@zonos/amino 4.4.2 → 4.4.4

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
@@ -2,6 +2,7 @@ import './animations/DropdownAnimation';
2
2
  import './components/alert-dialog/AlertContext';
3
3
  import './components/alert-dialog/AlertDialog';
4
4
  import './components/alert-dialog/useAlert';
5
+ import './components/announcement-dialog/AnnouncementDialog';
5
6
  import './components/avatar/AvatarBase';
6
7
  import './components/avatar/ImageAvatar';
7
8
  import './components/avatar/UserAvatar';
@@ -80,7 +81,6 @@ import './components/select/CountryPhoneSelect';
80
81
  import './components/select/CountrySelect';
81
82
  import './components/select/MultiSelect';
82
83
  import './components/select/Select';
83
- import './components/select/ThemeSelect';
84
84
  import './components/skeleton/Skeleton';
85
85
  import './components/slide-over/SlideOver';
86
86
  import './components/slider/Slider';
@@ -110,6 +110,7 @@ import './components/text-avatar/TextAvatar';
110
110
  import './components/text/LegacyText';
111
111
  import './components/text/Text';
112
112
  import './components/textarea/Textarea';
113
+ import './components/theme-select/ThemeSelect';
113
114
  import './components/thumbnail/Thumbnail';
114
115
  import './components/toast/Toast';
115
116
  import './components/toast/ToastContext';
@@ -268,6 +269,8 @@ import './icons/custom/products/LandedCostIcon';
268
269
  import './icons/custom/products/RateIcon';
269
270
  import './icons/custom/products/RestrictIcon';
270
271
  import './icons/custom/products/ScreenIcon';
272
+ import './icons/custom/theme/ThemeDarkIcon';
273
+ import './icons/custom/theme/ThemeLightIcon';
271
274
  import './icons/custom/ZonosIcon';
272
275
  import './icons/custom/ZonosLogoIcon';
273
276
  import './icons/DashboardDuotoneIcon';
@@ -0,0 +1,27 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { Theme } from "../../types/Theme";
3
+ type AnnouncementType = 'feature-update' | 'announcement';
4
+ export type AnnouncementDialogProps = {
5
+ announcementId: string;
6
+ children: ReactNode;
7
+ className?: string;
8
+ image?: ReactNode;
9
+ imageWidth?: number;
10
+ label?: ReactNode;
11
+ onClose: () => void;
12
+ open: boolean;
13
+ themeOverride?: Theme;
14
+ type: AnnouncementType;
15
+ width?: number;
16
+ /** Close when clicking outside dialog (on the backdrop)
17
+ * @default true
18
+ */
19
+ closeOnBlur?: boolean;
20
+ /** Close on pressing 'escape' key
21
+ * @default true
22
+ */
23
+ closeOnEsc?: boolean;
24
+ noBorder?: boolean;
25
+ };
26
+ export declare const AnnouncementDialog: import("react").ForwardRefExoticComponent<AnnouncementDialogProps & import("react").RefAttributes<HTMLDivElement>>;
27
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";var e=require("../../_tslib-fe391a2e.js"),n=require("react/jsx-runtime"),t=require("react"),r=require("../text/Text.js"),a=require("../../styles/constants/theme.js"),s=require("../../utils/hooks/useStorage.js"),i=require("styled-components"),o=require("../dialog/_BaseDialog.js"),u=require("../stack/VStack.js");function c(e){return e&&e.__esModule?e:{default:e}}require("../../utils/storage.js"),require("swr"),require("../../utils/hooks/useSwr.js"),require("framer-motion"),require("../backdrop/Backdrop.js"),require("../stack/Stack.js");var l,d,g=c(i),m=g.default(u.VStack)(l||(l=e.__makeTemplateObject(["\n padding: "," ",";\n overflow-y: auto;\n flex-grow: 1;\n"],["\n padding: "," ",";\n overflow-y: auto;\n flex-grow: 1;\n"])),a.theme.space16,a.theme.space24),h=g.default.div(d||(d=e.__makeTemplateObject(["\n width: ",";\n height: auto;\n margin: ",";\n margin-bottom: ",";\n"],["\n width: ",";\n height: auto;\n margin: ",";\n margin-bottom: ",";\n"])),(function(e){return"".concat(e.imageWidth,"px")||"100%"}),(function(e){return e.imageWidth?"0 auto":"unset"}),a.theme.space16),_=t.forwardRef((function(t,a){var i=t.announcementId,u=t.children,c=t.className,l=t.image,d=t.imageWidth,g=t.label,_=t.onClose,p=t.open,j=t.themeOverride,f=t.type,x=t.width,q=t.closeOnBlur,k=t.closeOnEsc,w=t.noBorder,y=e.__read(s.useStorage({key:"announcement:".concat(i),defaultValue:"",type:"local"}),2),b=y[0],v=y[1];return n.jsxs(o.BaseDialog,e.__assign({className:c,"data-theme":j,open:p||!b,width:x,onClose:function(){_(),v("seen")},closeOnBlur:q,closeOnEsc:k,noBorder:w},{children:[n.jsx(h,e.__assign({imageWidth:d},{children:l})),n.jsxs(m,e.__assign({spacing:8},{children:[n.jsx(r.Text,e.__assign({type:"label",color:"blue600"},{children:"feature-update"===f?"Feature update":"Announcement"})),n.jsx(r.Text,e.__assign({type:"title"},{children:g})),n.jsx("div",e.__assign({ref:a},{children:n.jsx(r.Text,e.__assign({color:"gray800"},{children:u}))}))]}))]}))}));exports.AnnouncementDialog=_;
@@ -1 +1 @@
1
- "use strict";var e=require("../../../_tslib-fe391a2e.js"),r=require("react/jsx-runtime"),t=require("../../checkbox/Checkbox.js"),n=require("../../text/Text.js"),s=require("../../../styles/constants/theme.js"),i=require("../../../utils/hooks/useStorage.js"),a=require("styled-components");function c(e){return e&&e.__esModule?e:{default:e}}require("react"),require("framer-motion"),require("../../../icons/CheckmarkIcon.js"),require("../../../icons/icon-base/_IconBase.js"),require("../../../utils/getTestId.js"),require("../../../utils/storage.js"),require("swr"),require("../../../utils/hooks/useSwr.js");var l,o,u,h=c(a),m=h.default(n.Text)(l||(l=e.__makeTemplateObject(["\n font-size: ",";\n"],["\n font-size: ",";\n"])),s.theme.space16),d=h.default.div(o||(o=e.__makeTemplateObject(["\n label {\n /* Align checkbox with list item */\n display: flex;\n align-items: center;\n }\n"],["\n label {\n /* Align checkbox with list item */\n display: flex;\n align-items: center;\n }\n"]))),x=h.default.div(u||(u=e.__makeTemplateObject(["\n margin-left: ",";\n margin-top: ",";\n"],["\n margin-left: ",";\n margin-top: ",";\n"])),s.theme.space24,s.theme.space24);exports.MdxProgressCheckbox=function(n){var s=n.pathname,a=n.checkboxKey,c=n.children,l=n.xlabel;a||console.warn("A unique progress checkbox key is required to track progress");var o="".concat(s,"-").concat(a),u=e.__read(i.useStorage({key:o,type:"local",defaultValue:""}),2),h=u[0],b=u[1];return r.jsxs(d,{children:[r.jsx(t.Checkbox,{checked:!!h,labelComponent:r.jsx(m,e.__assign({type:"bold-label"},{children:l})),label:l,onChange:function(){return b(h?"":"isChecked")}}),r.jsx(x,{children:c})]})};
1
+ "use strict";var e=require("../../../_tslib-fe391a2e.js"),r=require("react/jsx-runtime"),t=require("../../checkbox/Checkbox.js"),n=require("../../text/Text.js"),s=require("../../../styles/constants/theme.js"),i=require("../../../utils/hooks/useStorage.js"),a=require("styled-components");function c(e){return e&&e.__esModule?e:{default:e}}require("react"),require("framer-motion"),require("../../../icons/CheckmarkIcon.js"),require("../../../icons/icon-base/_IconBase.js"),require("../../../utils/getTestId.js"),require("../../../utils/storage.js"),require("swr"),require("../../../utils/hooks/useSwr.js");var l,o,u,h=c(a),m=h.default(n.Text)(l||(l=e.__makeTemplateObject(["\n font-size: ",";\n"],["\n font-size: ",";\n"])),s.theme.space16),d=h.default.div(o||(o=e.__makeTemplateObject(["\n label {\n /* Align checkbox with list item */\n display: flex;\n align-items: center;\n }\n"],["\n label {\n /* Align checkbox with list item */\n display: flex;\n align-items: center;\n }\n"]))),x=h.default.div(u||(u=e.__makeTemplateObject(["\n margin-left: ",";\n margin-top: ",";\n"],["\n margin-left: ",";\n margin-top: ",";\n"])),s.theme.space24,s.theme.space24);exports.MdxProgressCheckbox=function(n){var s=n.pathname,a=n.checkboxKey,c=n.children,l=n.xlabel;a||console.warn("A unique progress checkbox key is required to track progress");var o="".concat(s,"-").concat(a),u=e.__read(i.useStorage({defaultValue:"",key:o,type:"local"}),2),h=u[0],b=u[1];return r.jsxs(d,{children:[r.jsx(t.Checkbox,{checked:!!h,labelComponent:r.jsx(m,e.__assign({type:"bold-label"},{children:l})),label:l,onChange:function(){return b(h?"":"checked")}}),r.jsx(x,{children:c})]})};
@@ -1 +1 @@
1
- "use strict";var e=require("../../_tslib-fe391a2e.js"),t=require("react/jsx-runtime"),i=require("../../styles/constants/theme.js");function a(e){return e&&e.__esModule?e:{default:e}}var s,n,r,l=a(require("styled-components")),h=l.default.span(s||(s=e.__makeTemplateObject(["\n font-size: ",";\n line-height: 16px;\n color: ",";\n"],["\n font-size: ",";\n line-height: 16px;\n color: ",";\n"])),i.theme.fontSizeS,i.theme.gray900),o=l.default.span(n||(n=e.__makeTemplateObject(["\n color: ",";\n display: block;\n font-family: ",";\n font-size: 14px;\n font-weight: 400;\n line-height: 16px;\n margin-bottom: ",";\n"],["\n color: ",";\n display: block;\n font-family: ",";\n font-size: 14px;\n font-weight: 400;\n line-height: 16px;\n margin-bottom: ",";\n"])),i.theme.gray1200,i.theme.fontSans,i.theme.space8),p=[{label:"Page Header (3XL) · 34px (2.125rem)",size:"3xl",tag:"h2",type:"page-header",weight:900},{label:"Header (2XL) · 28px (1.75rem)",size:"2xl",type:"header",tag:"h3",weight:700},{label:"Description Header (2XL) · 28px (1.75rem)",size:"2xl",tag:"h3",type:"description-header",weight:700},{label:"Title (XL) • 22px (1.375rem)",size:"xl",tag:"h4",type:"title",weight:600},{label:"Bold Subheader (L) • 18px (1.125rem)",size:"l",tag:"h5",type:"bold-subheader",weight:700},{label:"Semi Bold Subheader (L / H4) • 18px (1.125rem)",size:"l",tag:"h5",type:"semi-bold-subheader",weight:600},{label:"Subheader (L) • 18px (1.125rem)",size:"l",tag:"h5",type:"subheader",weight:500},{label:"Bold Label (Base) • 14px (.875rem)",size:"base",tag:"span",type:"bold-label",weight:700},{label:"Label (Base) • 14px (.875rem)",size:"base",tag:"span",type:"label",weight:500},{label:"Body (Base) • 14px (.875rem)",size:"base",tag:"span",type:"body",weight:400},{label:"Small header (S) • 12px (.75rem)",size:"s",tag:"span",type:"small-header",weight:600},{label:"Caption (S) • 12px (.75rem)",size:"s",tag:"span",type:"caption",weight:400},{label:"Hint text (XS) • 10px (.625rem)",size:"xs",tag:"span",type:"hint-text",weight:400}],g=e.__read(p,13),c=g[0],u=g[1],z=g[2],f=g[3],b=g[4],m=g[5],d=g[6],x=g[7],w=g[8],y=g[9],U=g[10],W=g[11],_=g[12],S=l.default.h1(r||(r=e.__makeTemplateObject(["\n font-size: ",";\n font-weight: ",";\n line-height: ",";\n margin: 0;\n color: ",";\n text-transform: ",";\n"],["\n font-size: ",";\n font-weight: ",";\n line-height: ",";\n margin: 0;\n color: ",";\n text-transform: ",";\n"])),(function(e){return"var(--amino-font-size-".concat(e.fontSize||e.size,")")}),(function(e){return e.fontWeight}),(function(e){return"var(--amino-line-height-".concat(e.lineHeight||e.size,")")}),(function(e){return e.color&&i.theme[e.color]}),(function(e){return e.isUppercase&&"uppercase"}));exports.Text=function(i){var a=i.children,s=i.className,n=i.color,r=i.fontSize,l=i.fontWeight,p=i.isUppercase,g=i.lineHeight,j=i.tag,L=i.title,H=function(i){var l=i.as,h=i.fontWeight,o=i.size,p=i.isUppercase;return t.jsx(S,e.__assign({as:l,color:n,className:s,fontSize:r,fontWeight:h,lineHeight:g,size:o,isUppercase:!!p,title:L},{children:a}))};switch(i.type){case"page-header":return H({as:j||c.tag,fontWeight:l||c.weight,isUppercase:p,size:c.size});case"header":return H({as:j||u.tag,fontWeight:l||u.weight,isUppercase:p,size:u.size});case"description-header":return H({as:j||z.tag,fontWeight:l||z.weight,isUppercase:p,size:z.size});case"title":return H({as:j||f.tag,fontWeight:l||f.weight,isUppercase:p,size:f.size});case"bold-subheader":return H({as:j||b.tag,fontWeight:l||b.weight,isUppercase:p,size:b.size});case"semi-bold-subheader":return H({as:j||m.tag,fontWeight:l||m.weight,isUppercase:p,size:m.size});case"subheader":return H({as:j||d.tag,fontWeight:l||d.weight,isUppercase:p,size:d.size});case"bold-label":return H({as:j||x.tag,fontWeight:l||x.weight,isUppercase:p,size:x.size});case"label":return H({as:j||w.tag,fontWeight:l||w.weight,isUppercase:p,size:w.size});case"small-header":return H({as:j||U.tag,fontWeight:l||U.weight,isUppercase:"boolean"!=typeof p||p,size:U.size});case"caption":return H({as:j||W.tag,fontWeight:l||W.weight,isUppercase:p,size:W.size});case"hint-text":return H({as:j||_.tag,fontWeight:l||_.weight,isUppercase:p,size:_.size});case"subtitle":return t.jsx(h,e.__assign({className:s,title:L},{children:a}));case"input-label":return t.jsx(o,e.__assign({className:s,title:L},{children:a}));default:return H({as:j||y.tag,fontWeight:l||y.weight,isUppercase:p,size:y.size})}},exports.textOptions=p,exports.textOthers=["code","subtitle","small-header","input-label"];
1
+ "use strict";var e=require("../../_tslib-fe391a2e.js"),t=require("react/jsx-runtime"),i=require("../../styles/constants/theme.js");function a(e){return e&&e.__esModule?e:{default:e}}var s,n,r,l=a(require("styled-components")),h=l.default.span(s||(s=e.__makeTemplateObject(["\n font-size: ",";\n line-height: 16px;\n color: ",";\n"],["\n font-size: ",";\n line-height: 16px;\n color: ",";\n"])),i.theme.fontSizeS,i.theme.gray900),o=l.default.span(n||(n=e.__makeTemplateObject(["\n color: ",";\n display: block;\n font-family: ",";\n font-size: 14px;\n font-weight: 400;\n line-height: 16px;\n margin-bottom: ",";\n"],["\n color: ",";\n display: block;\n font-family: ",";\n font-size: 14px;\n font-weight: 400;\n line-height: 16px;\n margin-bottom: ",";\n"])),i.theme.gray1200,i.theme.fontSans,i.theme.space8),p=[{label:"Page Header (3XL) · 34px (2.125rem)",size:"3xl",tag:"h2",type:"page-header",weight:900},{label:"Header (2XL) · 28px (1.75rem)",size:"2xl",type:"header",tag:"h3",weight:700},{label:"Description Header (2XL) · 28px (1.75rem)",size:"2xl",tag:"h3",type:"description-header",weight:700},{label:"Title (XL) • 22px (1.375rem)",size:"xl",tag:"h4",type:"title",weight:600},{label:"Bold Subheader (L) • 18px (1.125rem)",size:"l",tag:"h5",type:"bold-subheader",weight:700},{label:"Semi Bold Subheader (L / H4) • 18px (1.125rem)",size:"l",tag:"h5",type:"semi-bold-subheader",weight:600},{label:"Subheader (L) • 18px (1.125rem)",size:"l",tag:"h5",type:"subheader",weight:500},{label:"Bold Label (Base) • 14px (.875rem)",size:"base",tag:"span",type:"bold-label",weight:700},{label:"Label (Base) • 14px (.875rem)",size:"base",tag:"span",type:"label",weight:500},{label:"Body (Base) • 14px (.875rem)",size:"base",tag:"span",type:"body",weight:400},{label:"Small header (S) • 12px (.75rem)",size:"s",tag:"span",type:"small-header",weight:600},{label:"Caption (S) • 12px (.75rem)",size:"s",tag:"span",type:"caption",weight:400},{label:"Hint text (XS) • 10px (.625rem)",size:"xs",tag:"span",type:"hint-text",weight:400}],g=e.__read(p,13),c=g[0],d=g[1],u=g[2],z=g[3],b=g[4],f=g[5],m=g[6],x=g[7],w=g[8],y=g[9],U=g[10],W=g[11],_=g[12],S=l.default.h1(r||(r=e.__makeTemplateObject(["\n font-size: ",";\n font-weight: ",";\n line-height: ",";\n margin: 0;\n color: ",";\n text-transform: ",";\n\n svg {\n display: inline-block;\n vertical-align: middle;\n }\n"],["\n font-size: ",";\n font-weight: ",";\n line-height: ",";\n margin: 0;\n color: ",";\n text-transform: ",";\n\n svg {\n display: inline-block;\n vertical-align: middle;\n }\n"])),(function(e){return"var(--amino-font-size-".concat(e.fontSize||e.size,")")}),(function(e){return e.fontWeight}),(function(e){return"var(--amino-line-height-".concat(e.lineHeight||e.size,")")}),(function(e){return e.color&&i.theme[e.color]}),(function(e){return e.isUppercase&&"uppercase"}));exports.Text=function(i){var a=i.children,s=i.className,n=i.color,r=i.fontSize,l=i.fontWeight,p=i.isUppercase,g=i.lineHeight,v=i.tag,j=i.title,L=function(i){var l=i.as,h=i.fontWeight,o=i.size,p=i.isUppercase;return t.jsx(S,e.__assign({as:l,color:n,className:s,fontSize:r,fontWeight:h,lineHeight:g,size:o,isUppercase:!!p,title:j},{children:a}))};switch(i.type){case"page-header":return L({as:v||c.tag,fontWeight:l||c.weight,isUppercase:p,size:c.size});case"header":return L({as:v||d.tag,fontWeight:l||d.weight,isUppercase:p,size:d.size});case"description-header":return L({as:v||u.tag,fontWeight:l||u.weight,isUppercase:p,size:u.size});case"title":return L({as:v||z.tag,fontWeight:l||z.weight,isUppercase:p,size:z.size});case"bold-subheader":return L({as:v||b.tag,fontWeight:l||b.weight,isUppercase:p,size:b.size});case"semi-bold-subheader":return L({as:v||f.tag,fontWeight:l||f.weight,isUppercase:p,size:f.size});case"subheader":return L({as:v||m.tag,fontWeight:l||m.weight,isUppercase:p,size:m.size});case"bold-label":return L({as:v||x.tag,fontWeight:l||x.weight,isUppercase:p,size:x.size});case"label":return L({as:v||w.tag,fontWeight:l||w.weight,isUppercase:p,size:w.size});case"small-header":return L({as:v||U.tag,fontWeight:l||U.weight,isUppercase:"boolean"!=typeof p||p,size:U.size});case"caption":return L({as:v||W.tag,fontWeight:l||W.weight,isUppercase:p,size:W.size});case"hint-text":return L({as:v||_.tag,fontWeight:l||_.weight,isUppercase:p,size:_.size});case"subtitle":return t.jsx(h,e.__assign({className:s,title:j},{children:a}));case"input-label":return t.jsx(o,e.__assign({className:s,title:j},{children:a}));default:return L({as:v||y.tag,fontWeight:l||y.weight,isUppercase:p,size:y.size})}},exports.textOptions=p,exports.textOthers=["code","subtitle","small-header","input-label"];
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export type Props = {
3
+ disabled?: boolean;
4
+ type?: 'cards' | 'select' | 'toggle';
5
+ };
6
+ export declare const ThemeSelect: ({ disabled, type }: Props) => JSX.Element;
@@ -0,0 +1 @@
1
+ "use strict";var e=require("../../_tslib-fe391a2e.js"),n=require("react/jsx-runtime"),t=require("../../icons/custom/theme/ThemeDarkIcon.js"),i=require("../../icons/custom/theme/ThemeLightIcon.js"),r=require("../../icons/NightIcon.js"),o=require("../../icons/SunnyIcon.js"),s=require("../../styles/constants/theme.js"),a=require("../../utils/hooks/useAminoTheme.js"),c=require("styled-components"),u=require("../card/Card.js"),l=require("../select/Select.js"),d=require("../stack/HStack.js"),h=require("../text/Text.js");function m(e){return e&&e.__esModule?e:{default:e}}require("react"),require("../../icons/flag-icon/useStableUniqueId.js"),require("uuid"),require("../../icons/icon-base/_ThemeIconBase.js"),require("../../icons/icon-base/_IconBase.js"),require("../../utils/hooks/useStorage.js"),require("../../utils/storage.js"),require("swr"),require("../../utils/hooks/useSwr.js"),require("../stack/Stack.js"),require("../help-text/HelpText.js"),require("../select/_StyledReactSelect.js"),require("react-select"),require("../checkbox/Checkbox.js"),require("framer-motion"),require("../../icons/CheckmarkIcon.js"),require("../../utils/getTestId.js"),require("../../icons/CheckCircleIcon.js"),require("../../icons/DoubleChevronIcon.js"),require("../../icons/RemoveCircleIcon.js"),require("../../icons/RemoveIcon.js");var p,x,g,b,j,k,f,y=m(c),q=y.default.button(p||(p=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?s.theme.blue400:"transparent")}),(function(e){return e.isActive?s.theme.primary:s.theme.textColor}),s.theme.radius8),v=y.default(u.Card)(x||(x=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"])),s.theme.gray0,s.theme.space16,s.theme.v3ShadowLarge,s.theme.space16),_=y.default.div(g||(g=e.__makeTemplateObject(["\n background: ",";\n height: 28px;\n width: 28px;\n border-radius: 50%;\n transition: ",";\n position: absolute;\n top: 2px;\n left: ",";\n"],["\n background: ",";\n height: 28px;\n width: 28px;\n border-radius: 50%;\n transition: ",";\n position: absolute;\n top: 2px;\n left: ",";\n"])),s.theme.primary,s.theme.transition,(function(e){return e.checked?"calc(100% - 30px)":"2px"})),w=y.default(o.SunnyIcon)(b||(b=e.__makeTemplateObject(["\n position: absolute;\n top: 6px;\n right: 5.8px;\n color: ",";\n"],["\n position: absolute;\n top: 6px;\n right: 5.8px;\n color: ",";\n"])),(function(e){return e.isActive?s.theme.gray0:s.theme.gray1200})),T=y.default(r.NightIcon)(j||(j=e.__makeTemplateObject(["\n position: absolute;\n top: 6px;\n left: 6px;\n color: ",";\n"],["\n position: absolute;\n top: 6px;\n left: 6px;\n color: ",";\n"])),(function(e){return e.isActive?s.theme.gray0:s.theme.gray1200})),I=y.default.div(k||(k=e.__makeTemplateObject(["\n margin-right: ",";\n width: 62px;\n height: 32px;\n min-width: 24px;\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 margin-right: ",";\n position: relative;\n"],["\n margin-right: ",";\n width: 62px;\n height: 32px;\n min-width: 24px;\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 margin-right: ",";\n position: relative;\n"])),s.theme.space16,(function(e){return e.checked?s.theme.gray50:s.theme.gray400}),s.theme.v3ShadowInset,s.theme.space16),S=y.default.label(f||(f=e.__makeTemplateObject(["\n display: flex;\n flex-direction: row;\n cursor: pointer;\n\n &.disabled {\n "," {\n background: ",";\n }\n cursor: not-allowed;\n }\n"],["\n display: flex;\n flex-direction: row;\n cursor: pointer;\n\n &.disabled {\n "," {\n background: ",";\n }\n cursor: not-allowed;\n }\n"])),I,(function(e){return e.checked?s.theme.gray300:""})),C=[{label:"Light",value:"day"},{label:"Dark",value:"night"}];exports.ThemeSelect=function(s){var c=s.disabled,u=void 0!==c&&c,m=s.type,p=void 0===m?"select":m,x=a.useAminoTheme(),g=x.aminoTheme,b=x.setAminoTheme,j="day"===g;return n.jsxs(n.Fragment,{children:["cards"===p&&n.jsxs(d.HStack,{children:[n.jsx(q,e.__assign({onClick:function(){return b("day")},type:"button","data-theme":"day",isActive:"day"===g},{children:n.jsxs(v,{children:[n.jsx(i.ThemeLightIcon,{}),n.jsx(h.Text,e.__assign({type:"bold-label"},{children:"Light"}))]})})),n.jsx(q,e.__assign({onClick:function(){return b("night")},type:"button","data-theme":"night",isActive:"night"===g},{children:n.jsxs(v,{children:[n.jsx(t.ThemeDarkIcon,{}),n.jsx(h.Text,e.__assign({type:"bold-label"},{children:"Dark"}))]})}))]}),"select"===p&&n.jsx(l.Select,{value:C.filter((function(e){return e.value===g})),options:C,icon:function(){switch(g){case"day":default:return n.jsx(o.SunnyIcon,{});case"night":return n.jsx(r.NightIcon,{})}}(),onChange:function(e){return b((null==e?void 0:e.value)||"day")},isDisabled:u,isClearable:!1}),"toggle"===p&&n.jsx(S,e.__assign({className:u?"disabled":"",checked:j,onClick:function(){return!u&&b("day"===g?"night":"day")}},{children:n.jsxs(I,e.__assign({checked:j},{children:[n.jsx(_,{checked:j,id:"amino-theme-switch"}),n.jsx(w,{size:20,isActive:"day"===g}),n.jsx(T,{size:20,isActive:"night"===g})]}))}))]})};
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const ThemeDarkIcon: import("react").ForwardRefExoticComponent<{
3
+ className?: string | undefined;
4
+ } & import("react").RefAttributes<SVGSVGElement>>;
@@ -0,0 +1 @@
1
+ "use strict";var c=require("../../../_tslib-fe391a2e.js"),l=require("react/jsx-runtime"),h=require("react"),i=require("../../flag-icon/useStableUniqueId.js"),e=require("../../icon-base/_ThemeIconBase.js");require("uuid");var a=h.forwardRef((function(h,a){var r=h.className,t=i.useStableUniqueId(1);return l.jsxs(e.ThemeIconBase,c.__assign({ref:a,className:r},{children:[l.jsxs("g",c.__assign({clipPath:"url(#".concat(t[0],")")},{children:[l.jsx("rect",{width:"110",height:"64",fill:"#101116",rx:"4"}),l.jsx("rect",{width:"40",height:"8",x:"7.999",y:"33",fill:"#2E3038",rx:"2"}),l.jsx("rect",{width:"80",height:"8",x:"65",y:"17",fill:"#2E3038",rx:"2"}),l.jsx("rect",{width:"35",height:"6",x:"65",y:"53",fill:"#2E3038",rx:"2"}),l.jsx("rect",{width:"6.148",height:"4",x:"65",y:"41",fill:"#2E3038",rx:"2"}),l.jsx("rect",{width:"18.444",height:"4",x:"77.296",y:"41",fill:"#2E3038",rx:"2"}),l.jsx("rect",{width:"4",height:"4",x:"101.889",y:"41",fill:"#2E3038",rx:"2"}),l.jsx("rect",{width:"6.148",height:"4",x:"65",y:"33",fill:"#2E3038",rx:"2"}),l.jsx("rect",{width:"18.444",height:"4",x:"77.296",y:"33",fill:"#2E3038",rx:"2"}),l.jsx("rect",{width:"4",height:"4",x:"101.889",y:"33",fill:"#2E3038",rx:"2"}),l.jsx("rect",{width:"40",height:"6",x:"8",y:"45",fill:"#2E3038",rx:"2"}),l.jsx("rect",{width:"32",height:"6",x:"8",y:"59",fill:"#2E3038",rx:"2"}),l.jsx("path",{fill:"#2E3038",d:"M56 11h1v61h-1z"}),l.jsx("path",{fill:"#fff",d:"M18.418 22.163a.045.045 0 0 1-.045-.046v-.078a.04.04 0 0 1 .009-.026l1.409-2.046h-1.294a.045.045 0 0 1-.045-.046v-.168c0-.026.02-.046.045-.046h1.662c.024 0 .044.02.044.046v.064c0 .01-.003.019-.008.026l-1.428 2.049h1.392c.024 0 .044.02.044.046v.179c0 .025-.02.046-.044.046h-1.741Zm9.525 0a.044.044 0 0 1-.035-.017l-1.468-1.853v1.824c0 .025-.02.046-.045.046h-.177a.045.045 0 0 1-.044-.046v-2.364c0-.026.02-.046.044-.046h.076c.013 0 .026.006.034.017l1.466 1.855v-1.826c0-.026.02-.046.044-.046h.174c.024 0 .044.02.044.046v2.364c0 .025-.02.046-.044.046h-.07Zm7.064 0c-.347 0-.786-.138-.98-.523a.044.044 0 0 1 .02-.06l.156-.079a.044.044 0 0 1 .06.02c.13.257.473.392.744.392.206 0 .687-.043.687-.44.003-.31-.364-.38-.718-.449-.415-.08-.886-.173-.886-.634a.566.566 0 0 1 .162-.423c.158-.16.44-.257.755-.257.361 0 .648.07.876.41a.044.044 0 0 1-.014.063l-.144.085a.044.044 0 0 1-.06-.015c-.156-.25-.409-.287-.659-.29-.066 0-.65.011-.65.42 0 .248.264.315.666.39l.024.005c.428.082.914.175.914.698-.004.637-.73.687-.953.687ZM23.19 19.959c-.274 0-.506.088-.671.254-.175.176-.27.432-.268.722.003.47.298.978.939.978.648 0 .943-.507.943-.978 0-.486-.292-.976-.943-.976Zm0 2.207c-.826 0-1.202-.64-1.202-1.235 0-.61.372-1.224 1.202-1.224.348 0 .645.113.859.328.223.224.345.545.343.904-.003.59-.38 1.227-1.202 1.227Zm7.848-2.207c-.274 0-.506.088-.671.254-.175.175-.27.432-.268.722.003.47.298.978.939.978.647 0 .942-.507.942-.978 0-.486-.291-.976-.942-.976Zm0 2.207c-.826 0-1.202-.64-1.202-1.235 0-.61.372-1.224 1.202-1.224.348 0 .645.113.859.328.223.224.345.545.343.904-.003.59-.38 1.227-1.202 1.227Z"}),l.jsx("path",{fill:"#fff",d:"M23.19 20c-.262 0-.485.083-.642.242-.167.168-.258.414-.256.693.003.452.285.938.899.938.62 0 .902-.486.902-.938 0-.465-.279-.935-.902-.935Zm0 1.953c-.668 0-.975-.528-.979-1.018-.001-.3.098-.567.28-.75.173-.174.415-.266.7-.266.679 0 .983.51.983 1.016 0 .49-.308 1.018-.983 1.018ZM31.04 20c-.263 0-.486.083-.643.241-.167.168-.258.415-.256.694.002.452.285.938.899.938.62 0 .902-.486.902-.938 0-.465-.28-.935-.902-.935Zm0 1.953c-.669 0-.977-.528-.98-1.018-.001-.3.098-.567.28-.75.173-.174.415-.266.7-.266.678 0 .982.51.982 1.016 0 .49-.307 1.018-.982 1.018Zm-12.543-2.206c-.002 0-.004.002-.004.006v.169c0 .003.002.005.004.005h1.371l-1.453 2.108v.082c0 .003.002.005.004.005h1.74c.003 0 .005-.002.005-.005v-.18c0-.002-.002-.005-.004-.005h-1.47l1.473-2.111v-.068c0-.004-.001-.006-.003-.006h-1.663Zm1.663 2.456h-1.741a.085.085 0 0 1-.085-.086v-.078c0-.017.005-.034.015-.049l1.366-1.982h-1.218a.085.085 0 0 1-.084-.086v-.17c0-.047.038-.085.084-.085h1.663c.046 0 .084.038.084.086v.064a.086.086 0 0 1-.015.05l-1.384 1.985h1.315c.046 0 .084.038.084.086v.179a.085.085 0 0 1-.084.086Zm6.24-2.025 1.543 1.944h.07c.002 0 .004-.002.004-.005v-2.364c0-.004-.002-.006-.004-.006h-.174c-.002 0-.005.002-.005.006v1.942l-1.536-1.946-.079-.002c-.002 0-.004.002-.004.006v2.364c0 .003.002.005.004.005h.177c.002 0 .005-.002.005-.005v-1.94Zm1.613 2.025h-.07a.084.084 0 0 1-.065-.032l-1.397-1.762v1.708a.085.085 0 0 1-.085.086h-.177a.085.085 0 0 1-.085-.086v-2.364c0-.048.038-.086.085-.086h.076c.025 0 .05.011.066.032l1.393 1.765v-1.711c0-.048.038-.086.085-.086h.174c.046 0 .084.038.084.086v2.364a.085.085 0 0 1-.084.086Zm6.215-.663-.163.076c.184.375.608.507.943.507.213 0 .909-.047.912-.648 0-.489-.447-.575-.88-.658l-.025-.005c-.343-.063-.698-.13-.698-.428 0-.448.62-.461.69-.461.262.003.527.043.693.31l.15-.085c-.217-.331-.494-.398-.842-.398-.304 0-.576.092-.727.246a.527.527 0 0 0-.15.394c0 .428.434.513.853.595.354.068.754.144.75.488 0 .433-.508.48-.726.48-.284 0-.642-.142-.78-.413Zm.78.663c-.359 0-.814-.143-1.017-.545a.084.084 0 0 1 .038-.114l.157-.078a.086.086 0 0 1 .114.037c.123.243.449.37.708.37.194 0 .646-.04.646-.4.003-.277-.331-.341-.685-.409-.41-.08-.918-.18-.918-.674a.604.604 0 0 1 .173-.45c.165-.17.458-.27.784-.27.374 0 .672.072.91.427.012.02.017.044.012.066a.086.086 0 0 1-.04.055l-.144.085a.087.087 0 0 1-.115-.028c-.145-.234-.386-.269-.625-.272-.061 0-.609.011-.609.38 0 .2.195.27.633.35l.025.005c.421.081.946.182.946.738-.005.675-.761.727-.993.727ZM23.19 19.747c-.803 0-1.162.595-1.162 1.185 0 .575.364 1.194 1.162 1.194.794 0 1.158-.616 1.162-1.187.001-.348-.116-.659-.332-.875-.206-.207-.493-.317-.83-.317Zm0 2.46c-.853 0-1.242-.661-1.242-1.275 0-.63.384-1.265 1.242-1.265.359 0 .666.117.887.34.23.232.357.563.355.932-.003.61-.394 1.267-1.242 1.267Zm7.848-2.46c-.803 0-1.162.595-1.162 1.185 0 .575.364 1.194 1.162 1.194.794 0 1.158-.616 1.161-1.187.002-.348-.116-.659-.33-.875-.207-.207-.494-.317-.831-.317Zm0 2.46c-.854 0-1.242-.661-1.242-1.275 0-.63.384-1.265 1.242-1.265.359 0 .666.117.887.34.23.232.357.563.355.932-.003.61-.393 1.267-1.242 1.267Z"}),l.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M12 17.902a3.348 3.348 0 0 0-3.222 4.263.03.03 0 0 0 .038.02l.453-.15a.074.074 0 0 1 .093.046l.028.08a2.764 2.764 0 1 0 4.576-2.852.03.03 0 0 0-.043.001l-.314.356a.074.074 0 0 1-.104.006l-.064-.056a2.179 2.179 0 1 0-2.632 3.459.03.03 0 0 0 .042-.01l.224-.418a.074.074 0 0 1 .1-.03l.075.04a1.594 1.594 0 1 0 .942-2.99.03.03 0 0 0-.033.03v.208a.03.03 0 0 0 .026.03 1.329 1.329 0 1 1-.37 0 .03.03 0 0 0 .025-.03v-.494c0-.04.033-.074.074-.074H12a1.913 1.913 0 1 1-.732 3.681.03.03 0 0 0-.038.014l-.232.431a.074.074 0 0 1-.1.03l-.075-.04a2.497 2.497 0 1 1 2.684-4.195.03.03 0 0 0 .04-.004l.323-.366a.074.074 0 0 1 .104-.006l.064.056a3.08 3.08 0 0 1-.375 4.907.03.03 0 0 0-.01.039l.095.184a.03.03 0 0 0 .042.011A3.348 3.348 0 0 0 12 17.902Zm1.336 6.126a.03.03 0 0 1 .04.013l.222.43c.02.036.065.05.102.03l.076-.043a3.667 3.667 0 1 0-5.243-2.01l.028.08a.074.074 0 0 0 .093.046l.464-.153a.03.03 0 0 1 .037.017 3.083 3.083 0 0 0 4.18 1.59ZM12 20.24a1.01 1.01 0 1 0 0 2.02 1.01 1.01 0 0 0 0-2.02Z",clipRule:"evenodd"}),l.jsx("path",{stroke:"#2E3038",d:"M0 11h111"}),l.jsx("circle",{cx:"5.5",cy:"5.5",r:"1.5",fill:"#F95C67"}),l.jsx("circle",{cx:"10.5",cy:"5.5",r:"1.5",fill:"#F9CD48"}),l.jsx("circle",{cx:"15.5",cy:"5.5",r:"1.5",fill:"#56C76F"}),l.jsx("rect",{width:"6.148",height:"4",x:"65",y:"63",fill:"#2E3038",rx:"2"}),l.jsx("rect",{width:"18.444",height:"4",x:"77.296",y:"63",fill:"#2E3038",rx:"2"}),l.jsx("rect",{width:"4",height:"4",x:"101.889",y:"63",fill:"#2E3038",rx:"2"})]})),l.jsx("defs",{children:l.jsx("clipPath",c.__assign({id:t[0]},{children:l.jsx("rect",{width:"110",height:"64",fill:"#fff",rx:"4"})}))})]}))}));exports.ThemeDarkIcon=a;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const ThemeLightIcon: import("react").ForwardRefExoticComponent<{
3
+ className?: string | undefined;
4
+ } & import("react").RefAttributes<SVGSVGElement>>;
@@ -0,0 +1 @@
1
+ "use strict";var c=require("../../../_tslib-fe391a2e.js"),l=require("react/jsx-runtime"),h=require("react"),i=require("../../flag-icon/useStableUniqueId.js"),e=require("../../icon-base/_ThemeIconBase.js");require("uuid");var a=h.forwardRef((function(h,a){var r=h.className,t=i.useStableUniqueId(1);return l.jsxs(e.ThemeIconBase,c.__assign({ref:a,className:r},{children:[l.jsxs("g",c.__assign({clipPath:"url(#".concat(t[0],")")},{children:[l.jsx("rect",{width:"110",height:"64",fill:"#fff",rx:"4"}),l.jsx("rect",{width:"40",height:"8",x:"7.999",y:"33",fill:"#EAEBED",rx:"2"}),l.jsx("rect",{width:"80",height:"8",x:"65",y:"17",fill:"#EAEBED",rx:"2"}),l.jsx("rect",{width:"35",height:"6",x:"65",y:"53",fill:"#EAEBED",rx:"2"}),l.jsx("rect",{width:"6.148",height:"4",x:"65",y:"41",fill:"#EAEBED",rx:"2"}),l.jsx("rect",{width:"18.444",height:"4",x:"77.296",y:"41",fill:"#EAEBED",rx:"2"}),l.jsx("rect",{width:"4",height:"4",x:"101.889",y:"41",fill:"#EAEBED",rx:"2"}),l.jsx("rect",{width:"6.148",height:"4",x:"65",y:"33",fill:"#EAEBED",rx:"2"}),l.jsx("rect",{width:"18.444",height:"4",x:"77.296",y:"33",fill:"#EAEBED",rx:"2"}),l.jsx("rect",{width:"4",height:"4",x:"101.889",y:"33",fill:"#EAEBED",rx:"2"}),l.jsx("rect",{width:"40",height:"6",x:"8",y:"45",fill:"#EAEBED",rx:"2"}),l.jsx("rect",{width:"32",height:"6",x:"8",y:"59",fill:"#EAEBED",rx:"2"}),l.jsx("path",{fill:"#EAEBED",d:"M56 11h1v61h-1z"}),l.jsx("path",{fill:"#101116",d:"M18.418 22.163a.045.045 0 0 1-.045-.046v-.078a.04.04 0 0 1 .009-.026l1.409-2.046h-1.294a.045.045 0 0 1-.045-.046v-.168c0-.026.02-.046.045-.046h1.662c.024 0 .044.02.044.046v.064c0 .01-.003.019-.008.026l-1.428 2.049h1.392c.024 0 .044.02.044.046v.179c0 .025-.02.046-.044.046h-1.741Zm9.525 0a.044.044 0 0 1-.035-.017l-1.468-1.853v1.824c0 .025-.02.046-.045.046h-.177a.045.045 0 0 1-.044-.046v-2.364c0-.026.02-.046.044-.046h.076c.013 0 .026.006.034.017l1.466 1.855v-1.826c0-.026.02-.046.044-.046h.174c.024 0 .044.02.044.046v2.364c0 .025-.02.046-.044.046h-.07Zm7.064 0c-.347 0-.786-.138-.98-.523a.044.044 0 0 1 .02-.06l.156-.079a.044.044 0 0 1 .06.02c.13.257.473.392.744.392.206 0 .687-.043.687-.44.003-.31-.364-.38-.718-.449-.415-.08-.886-.173-.886-.634a.566.566 0 0 1 .162-.423c.158-.16.44-.257.755-.257.361 0 .648.07.876.41a.044.044 0 0 1-.014.063l-.144.085a.044.044 0 0 1-.06-.015c-.156-.25-.409-.287-.659-.29-.066 0-.65.011-.65.42 0 .248.264.315.666.39l.024.005c.428.082.914.175.914.698-.004.637-.73.687-.953.687ZM23.19 19.959c-.274 0-.506.088-.671.254-.175.176-.27.432-.268.722.003.47.298.978.939.978.648 0 .943-.507.943-.978 0-.486-.292-.976-.943-.976Zm0 2.207c-.826 0-1.202-.64-1.202-1.235 0-.61.372-1.224 1.202-1.224.348 0 .645.113.859.328.223.224.345.545.343.904-.003.59-.38 1.227-1.202 1.227Zm7.848-2.207c-.274 0-.506.088-.671.254-.175.175-.27.432-.268.722.003.47.298.978.939.978.647 0 .942-.507.942-.978 0-.486-.291-.976-.942-.976Zm0 2.207c-.826 0-1.202-.64-1.202-1.235 0-.61.372-1.224 1.202-1.224.348 0 .645.113.859.328.223.224.345.545.343.904-.003.59-.38 1.227-1.202 1.227Z"}),l.jsx("path",{fill:"#101116",d:"M23.19 20c-.262 0-.485.083-.642.242-.167.168-.258.414-.256.693.003.452.285.938.899.938.62 0 .902-.486.902-.938 0-.465-.279-.935-.902-.935Zm0 1.953c-.668 0-.975-.528-.979-1.018-.001-.3.098-.567.28-.75.173-.174.415-.266.7-.266.679 0 .983.51.983 1.016 0 .49-.308 1.018-.983 1.018ZM31.04 20c-.263 0-.486.083-.643.241-.167.168-.258.415-.256.694.002.452.285.938.899.938.62 0 .902-.486.902-.938 0-.465-.28-.935-.902-.935Zm0 1.953c-.669 0-.977-.528-.98-1.018-.001-.3.098-.567.28-.75.173-.174.415-.266.7-.266.678 0 .982.51.982 1.016 0 .49-.307 1.018-.982 1.018Zm-12.543-2.206c-.002 0-.004.002-.004.006v.169c0 .003.002.005.004.005h1.371l-1.453 2.108v.082c0 .003.002.005.004.005h1.74c.003 0 .005-.002.005-.005v-.18c0-.002-.002-.005-.004-.005h-1.47l1.473-2.111v-.068c0-.004-.001-.006-.003-.006h-1.663Zm1.663 2.456h-1.741a.085.085 0 0 1-.085-.086v-.078c0-.017.005-.034.015-.049l1.366-1.982h-1.218a.085.085 0 0 1-.084-.086v-.17c0-.047.038-.085.084-.085h1.663c.046 0 .084.038.084.086v.064a.086.086 0 0 1-.015.05l-1.384 1.985h1.315c.046 0 .084.038.084.086v.179a.085.085 0 0 1-.084.086Zm6.24-2.025 1.543 1.944h.07c.002 0 .004-.002.004-.005v-2.364c0-.004-.002-.006-.004-.006h-.174c-.002 0-.005.002-.005.006v1.942l-1.536-1.946-.079-.002c-.002 0-.004.002-.004.006v2.364c0 .003.002.005.004.005h.177c.002 0 .005-.002.005-.005v-1.94Zm1.613 2.025h-.07a.084.084 0 0 1-.065-.032l-1.397-1.762v1.708a.085.085 0 0 1-.085.086h-.177a.085.085 0 0 1-.085-.086v-2.364c0-.048.038-.086.085-.086h.076c.025 0 .05.011.066.032l1.393 1.765v-1.711c0-.048.038-.086.085-.086h.174c.046 0 .084.038.084.086v2.364a.085.085 0 0 1-.084.086Zm6.215-.663-.163.076c.184.375.608.507.943.507.213 0 .909-.047.912-.648 0-.489-.447-.575-.88-.658l-.025-.005c-.343-.063-.698-.13-.698-.428 0-.448.62-.461.69-.461.262.003.527.043.693.31l.15-.085c-.217-.331-.494-.398-.842-.398-.304 0-.576.092-.727.246a.527.527 0 0 0-.15.394c0 .428.434.513.853.595.354.068.754.144.75.488 0 .433-.508.48-.726.48-.284 0-.642-.142-.78-.413Zm.78.663c-.359 0-.814-.143-1.017-.545a.084.084 0 0 1 .038-.114l.157-.078a.086.086 0 0 1 .114.037c.123.243.449.37.708.37.194 0 .646-.04.646-.4.003-.277-.331-.341-.685-.409-.41-.08-.918-.18-.918-.674a.604.604 0 0 1 .173-.45c.165-.17.458-.27.784-.27.374 0 .672.072.91.427.012.02.017.044.012.066a.086.086 0 0 1-.04.055l-.144.085a.087.087 0 0 1-.115-.028c-.145-.234-.386-.269-.625-.272-.061 0-.609.011-.609.38 0 .2.195.27.633.35l.025.005c.421.081.946.182.946.738-.005.675-.761.727-.993.727ZM23.19 19.747c-.803 0-1.162.595-1.162 1.185 0 .575.364 1.194 1.162 1.194.794 0 1.158-.616 1.162-1.187.001-.348-.116-.659-.332-.875-.206-.207-.493-.317-.83-.317Zm0 2.46c-.853 0-1.242-.661-1.242-1.275 0-.63.384-1.265 1.242-1.265.359 0 .666.117.887.34.23.232.357.563.355.932-.003.61-.394 1.267-1.242 1.267Zm7.848-2.46c-.803 0-1.162.595-1.162 1.185 0 .575.364 1.194 1.162 1.194.794 0 1.158-.616 1.161-1.187.002-.348-.116-.659-.33-.875-.207-.207-.494-.317-.831-.317Zm0 2.46c-.854 0-1.242-.661-1.242-1.275 0-.63.384-1.265 1.242-1.265.359 0 .666.117.887.34.23.232.357.563.355.932-.003.61-.393 1.267-1.242 1.267Z"}),l.jsx("path",{fill:"#101116",fillRule:"evenodd",d:"M12 17.902a3.348 3.348 0 0 0-3.222 4.263.03.03 0 0 0 .038.02l.453-.15a.074.074 0 0 1 .093.046l.028.08a2.764 2.764 0 1 0 4.576-2.852.03.03 0 0 0-.043.001l-.314.356a.074.074 0 0 1-.104.006l-.064-.056a2.179 2.179 0 1 0-2.632 3.459.03.03 0 0 0 .042-.01l.224-.418a.074.074 0 0 1 .1-.03l.075.04a1.594 1.594 0 1 0 .942-2.99.03.03 0 0 0-.033.03v.208a.03.03 0 0 0 .026.03 1.329 1.329 0 1 1-.37 0 .03.03 0 0 0 .025-.03v-.494c0-.04.033-.074.074-.074H12a1.913 1.913 0 1 1-.732 3.681.03.03 0 0 0-.038.014l-.232.431a.074.074 0 0 1-.1.03l-.075-.04a2.497 2.497 0 1 1 2.684-4.195.03.03 0 0 0 .04-.004l.323-.366a.074.074 0 0 1 .104-.006l.064.056a3.08 3.08 0 0 1-.375 4.907.03.03 0 0 0-.01.039l.095.184a.03.03 0 0 0 .042.011A3.348 3.348 0 0 0 12 17.902Zm1.336 6.126a.03.03 0 0 1 .04.013l.222.43c.02.036.065.05.102.03l.076-.043a3.667 3.667 0 1 0-5.243-2.01l.028.08a.074.074 0 0 0 .093.046l.464-.153a.03.03 0 0 1 .037.017 3.083 3.083 0 0 0 4.18 1.59ZM12 20.24a1.01 1.01 0 1 0 0 2.02 1.01 1.01 0 0 0 0-2.02Z",clipRule:"evenodd"}),l.jsx("path",{stroke:"#EAEBED",d:"M0 11h111"}),l.jsx("circle",{cx:"5.5",cy:"5.5",r:"1.5",fill:"#D92141"}),l.jsx("circle",{cx:"10.5",cy:"5.5",r:"1.5",fill:"#FABC00"}),l.jsx("circle",{cx:"15.5",cy:"5.5",r:"1.5",fill:"#2B9C4D"}),l.jsx("rect",{width:"6.148",height:"4",x:"65",y:"63",fill:"#EAEBED",rx:"2"}),l.jsx("rect",{width:"18.444",height:"4",x:"77.296",y:"63",fill:"#EAEBED",rx:"2"}),l.jsx("rect",{width:"4",height:"4",x:"101.889",y:"63",fill:"#EAEBED",rx:"2"})]})),l.jsx("defs",{children:l.jsx("clipPath",c.__assign({id:t[0]},{children:l.jsx("rect",{width:"110",height:"64",fill:"#fff",rx:"4"})}))})]}))}));exports.ThemeLightIcon=a;
@@ -0,0 +1,8 @@
1
+ import { type ReactNode } from 'react';
2
+ type Props = {
3
+ children: ReactNode;
4
+ viewBox?: string;
5
+ className?: string;
6
+ };
7
+ export declare const ThemeIconBase: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<SVGSVGElement>>;
8
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";var e=require("../../_tslib-fe391a2e.js"),r=require("react/jsx-runtime"),s=require("react").forwardRef((function(s,i){var a=s.viewBox,n=s.children,t=s.className;return r.jsx("svg",e.__assign({ref:i,fill:"none",className:t,xmlns:"http://www.w3.org/2000/svg",viewBox:a||"0 0 110 64"},{children:n}))}));exports.ThemeIconBase=s;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zonos/amino",
3
- "version": "4.4.2",
3
+ "version": "4.4.4",
4
4
  "description": "Core UI components for Amino",
5
5
  "repository": "git@github.com:Zonos/amino.git",
6
6
  "license": "MIT",
@@ -12,7 +12,6 @@
12
12
  "not op_mini all"
13
13
  ],
14
14
  "scripts": {},
15
- "devDependencies": {},
16
15
  "dependencies": {
17
16
  "@dnd-kit/core": "^5.0.3",
18
17
  "@dnd-kit/modifiers": "^5.0.0",
@@ -33,8 +32,10 @@
33
32
  "react-simple-maps": "^3.0.0",
34
33
  "react-split-it": "^2.0.0",
35
34
  "topojson-client": "^3.1.0",
36
- "uuid": "^8.3.2"
35
+ "uuid": "^8.3.2",
36
+ "zod": "^3.21.4"
37
37
  },
38
+ "devDependencies": {},
38
39
  "peerDependencies": {
39
40
  "@emotion/react": "^11.x",
40
41
  "@emotion/styled": "^11.x",
@@ -1 +1 @@
1
- "use strict";var e=require("./useStorage.js");require("../storage.js"),require("swr"),require("./useSwr.js");exports.useCurrentSchema=function(r){return e.useStorage({type:"session",key:"amino:current-schema",defaultValue:r})};
1
+ "use strict";var e=require("./useStorage.js");require("../storage.js"),require("swr"),require("./useSwr.js");exports.useCurrentSchema=function(r){return e.useStorage({defaultValue:r,key:"amino:current-schema",type:"session"})};
@@ -1,17 +1,10 @@
1
- import { type StorageType } from '../storage';
1
+ import { type StorageProps } from '../storage';
2
2
  type AminoLocalStorageKey = 'current-schema';
3
3
  /** Storage key that's being used in Amino */
4
4
  export type AminoStorageKey = `amino:${AminoLocalStorageKey}` | (string & Record<never, never>);
5
- type Props<TValue extends unknown, TKey extends AminoStorageKey> = {
6
- type: StorageType;
7
- key: TKey;
8
- /**
9
- * @param json - If true, the value will be set/parsed as JSON
10
- * @default false
11
- */
12
- json?: boolean;
5
+ type Props<TValue extends unknown, TKey extends AminoStorageKey> = StorageProps<TValue, TKey> & {
13
6
  defaultValue: TValue;
14
7
  };
15
8
  type Return<T> = [value: T, setValue: (value: T) => void];
16
- export declare const useStorage: <TValue extends unknown, TKey extends AminoStorageKey = AminoStorageKey>({ defaultValue, key, type, json, }: Props<TValue, TKey>) => Return<TValue>;
9
+ export declare const useStorage: <TValue extends unknown, TKey extends AminoStorageKey = AminoStorageKey>({ defaultValue, json, key, type, }: Props<TValue, TKey>) => Return<TValue>;
17
10
  export {};
@@ -1 +1 @@
1
- "use strict";var e=require("../storage.js"),r=require("./useSwr.js");require("swr");exports.useStorage=function(t){var u=t.defaultValue,n=t.key,s=t.type,a=t.json,o=r.useSwr(n,(function(){return e.getStorageItem({type:s,key:n,json:a})||null})).data;return[null!=o?o:u,function(r){return e.setStorageItem({type:s,key:n,value:r,json:a})}]};
1
+ "use strict";var e=require("../storage.js"),r=require("./useSwr.js");require("swr");exports.useStorage=function(t){var u=t.defaultValue,n=t.json,s=t.key,a=t.type,o=r.useSwr(s,(function(){return e.getStorageItem({type:a,key:s,json:n})||null})).data;return[null!=o?o:u,function(r){return e.setStorageItem({type:a,key:s,value:r,json:n})}]};
@@ -1,16 +1,20 @@
1
+ import type { Schema } from 'zod';
1
2
  export type StorageType = 'session' | 'local';
2
- export type StorageProps = {
3
+ export type StorageProps<Value, Key extends string = string> = {
3
4
  type: StorageType;
4
- key: string;
5
+ key: Key;
5
6
  /**
6
7
  * @param json - If true, the value will be set/parsed as JSON
7
- * @default false
8
+ * Set the schema for runtime validation of values.
9
+ * @default undefined
8
10
  */
9
- json?: boolean;
11
+ json?: {
12
+ schema: Schema<Value>;
13
+ };
10
14
  };
11
- type SetProps<Value> = StorageProps & {
15
+ type SetProps<Value> = StorageProps<Value> & {
12
16
  value: Value;
13
17
  };
14
- export declare const getStorageItem: <Value extends unknown>({ type, key, json, }: StorageProps) => Value | null;
18
+ export declare const getStorageItem: <Value extends unknown>({ type, key, json, }: StorageProps<Value, string>) => Value | null;
15
19
  export declare const setStorageItem: <Value extends unknown>({ type, key, json, value, }: SetProps<Value>) => void;
16
20
  export {};
package/utils/storage.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e=require("swr");exports.getStorageItem=function(e){var t=e.type,r=e.key,s=e.json,n=("session"===t?sessionStorage:localStorage).getItem(r);if(!n)return null;if(s)try{return JSON.parse(n)}catch(e){return null}return n},exports.setStorageItem=function(t){var r=t.type,s=t.key,n=t.json,o=t.value,a="session"===r?sessionStorage:localStorage,i=n?JSON.stringify(o):String(o);a.setItem(s,i),e.mutate(s,o)};
1
+ "use strict";var e=require("swr");exports.getStorageItem=function(e){var t=e.type,r=e.key,s=e.json,a=("session"===t?sessionStorage:localStorage).getItem(r);if(!a)return null;if(s)try{var n=JSON.parse(a),o=s.schema.safeParse(n);return o.success?o.data:null}catch(e){return null}return a},exports.setStorageItem=function(t){var r=t.type,s=t.key,a=t.json,n=t.value,o="session"===r?sessionStorage:localStorage,u=a?JSON.stringify(n):String(n);o.setItem(s,u),e.mutate(s,n)};
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const ThemeSelect: () => JSX.Element;
@@ -1 +0,0 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("../../icons/NightIcon.js"),s=require("../../icons/SunnyIcon.js"),i=require("../../utils/hooks/useAminoTheme.js"),t=require("./Select.js");require("../../_tslib-fe391a2e.js"),require("react"),require("../../icons/icon-base/_IconBase.js"),require("../../styles/constants/theme.js"),require("../../utils/hooks/useStorage.js"),require("../../utils/storage.js"),require("swr"),require("../../utils/hooks/useSwr.js"),require("../help-text/HelpText.js"),require("../text/Text.js"),require("styled-components"),require("./_StyledReactSelect.js"),require("react-select"),require("../checkbox/Checkbox.js"),require("framer-motion"),require("../../icons/CheckmarkIcon.js"),require("../../utils/getTestId.js"),require("../../icons/CheckCircleIcon.js"),require("../../icons/DoubleChevronIcon.js"),require("../../icons/RemoveCircleIcon.js"),require("../../icons/RemoveIcon.js");var n=[{label:"Light",value:"day"},{label:"Dark",value:"night"}];exports.ThemeSelect=function(){var u=i.useAminoTheme(),o=u.aminoTheme,c=u.setAminoTheme;return e.jsxs(e.Fragment,{children:[e.jsx(t.Select,{value:n.filter((function(e){return e.value===o})),options:n,icon:function(){switch(o){case"day":default:return e.jsx(s.SunnyIcon,{});case"night":return e.jsx(r.NightIcon,{})}}(),onChange:function(e){return c((null==e?void 0:e.value)||"day")}}),e.jsxs("p",{children:["Local storage value: ",o]})]})};
@@ -1 +0,0 @@
1
- "use strict";var e=require("../../_tslib-fe391a2e.js"),r=require("react/jsx-runtime"),s=require("react").forwardRef((function(s,i){var t=s.size,a=s.viewBox,n=s.children,c=s.className,l=t||24;return r.jsx("svg",e.__assign({ref:i,fill:"none",className:c,xmlns:"http://www.w3.org/2000/svg",width:l,height:l,viewBox:a||"0 0 24 24"},{children:n}))}));exports.IconBase=s;