@zonos/amino 6.1.0 → 6.1.1
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.
|
@@ -13,7 +13,9 @@ export type SwitchProps = BaseProps & {
|
|
|
13
13
|
labelIcon?: ReactNode;
|
|
14
14
|
onChange: (checked: boolean) => void;
|
|
15
15
|
subtitle?: ReactNode;
|
|
16
|
+
/** Icon rendered at the left end of the track. */
|
|
16
17
|
switchIconLeft?: ReactNode;
|
|
18
|
+
/** Icon rendered at the right end of the track. */
|
|
17
19
|
switchIconRight?: ReactNode;
|
|
18
20
|
};
|
|
19
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react"),a=require("../text/Text.js"),s=require("../../utils/cn.js"),l=require("react/jsx-runtime");require("../../_rollupPluginBabelHelpers-4522587c.js"),require("../../tslib.es6-cdc5f922.js"),require("../../styles/constants/theme.js"),require("clsx"),require("tailwind-merge");exports.Switch=function(t){var
|
|
1
|
+
"use strict";var e=require("react"),a=require("../text/Text.js"),s=require("../../utils/cn.js"),l=require("react/jsx-runtime");require("../../_rollupPluginBabelHelpers-4522587c.js"),require("../../tslib.es6-cdc5f922.js"),require("../../styles/constants/theme.js"),require("clsx"),require("tailwind-merge");exports.Switch=function(t){var r=t["aria-label"],i=t.checked,n=t.className,c=t.disabled,o=t.label,x=t.labelDescription,p=t.labelIcon,d=t.onChange,u=t.style,h=t.subtitle,b=t.switchIconLeft,g=t.switchIconRight,m=e.useId(),_=Boolean(b||g),y=Boolean(o||p||x||h);return l.jsxs("label",{className:s.cn("flex cursor-pointer flex-row","focus-within:outline-none\n [&:has(input:focus-visible)]:shadow-[var(--amino-glow-blue)]",c&&"cursor-not-allowed",n),htmlFor:m,style:u,children:[l.jsx("input",{"aria-label":!y&&r?r:void 0,checked:i,id:m,onChange:function(){return!c&&d(!i)},onKeyDown:function(e){return"Enter"===e.key&&!c&&d(!i)},style:{width:"0px"},tabIndex:0,type:"checkbox"}),_?l.jsxs("div",{className:s.cn("relative block h-8 w-[62px] min-w-6 rounded-[20px] leading-4\n select-none","bg-gray-50",i&&"bg-primary",c&&"opacity-40"),children:[l.jsx("div",{className:s.cn("bg-gray-200 dark:bg-gray-200","shadow-[0px_-1px_1px_0px_rgba(0,0,0,0.2)_inset,0px_1px_3px_0px_rgba(0,0,0,0.4)]","absolute top-[2px] left-[2px] h-7 w-7 rounded-full\n transition-all",i&&"left-[calc(100%-30px)]",c&&"opacity-95")}),l.jsx("div",{className:"absolute top-1 right-auto left-1",children:b}),l.jsx("div",{className:"absolute top-1 right-1 left-auto",children:g})]}):l.jsx("div",{className:s.cn("relative block h-4 min-h-4 w-8 min-w-8 rounded-[20px] leading-4\n select-none","bg-gray-100 shadow-[var(--amino-v3-shadow-inset)]",i&&"bg-primary",c&&"opacity-40"),children:l.jsx("div",{className:s.cn("bg-gray-0 dark:bg-gray-1000","shadow-[0px_-1px_1px_0px_rgba(0,0,0,0.08)_inset,0px_1px_3px_0px_rgba(0,0,0,0.2)]","absolute top-[1px] left-[1px] h-[14px] w-[14px] rounded-full\n transition-all",i&&["left-[calc(100%-15px)]","shadow-[0px_-1px_1px_0px_rgba(68,94,238,0.08)_inset,0px_1px_3px_0px_rgba(0,0,0,0.2)]"],c&&"opacity-95")})}),y&&l.jsxs("div",{className:"ml-4",children:[l.jsxs("div",{className:"flex items-center leading-4",children:[p&&l.jsx("div",{className:s.cn("mr-1",c&&"opacity-40"),children:p}),l.jsxs(a.Text,{className:s.cn("mb-0",c&&"text-gray-600"),type:"input-label",children:[o,x&&l.jsx("span",{className:"ml-1 text-gray-600",children:x})]})]}),h&&l.jsx(a.Text,{className:s.cn(c&&"text-gray-400"),type:"subtitle",children:h})]})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../tslib.es6-cdc5f922.js"),r=require("react"),s=require("../__amino__/TranslateAminoText.js"),t=require("../card/Card.js"),
|
|
1
|
+
"use strict";var e=require("../../tslib.es6-cdc5f922.js"),r=require("react"),s=require("../__amino__/TranslateAminoText.js"),t=require("../card/Card.js"),n=require("../select/Select.js"),i=require("../stack/HStack.js"),a=require("../switch/Switch.js"),o=require("../text/Text.js"),c=require("../../icons/custom/theme/ThemeDarkIcon.js"),u=require("../../icons/custom/theme/ThemeLightIcon.js"),l=require("../../icons/NightIcon.js"),h=require("../../icons/SunnyIcon.js"),d=require("../../styles/constants/theme.js"),m=require("../../utils/cn.js"),j=require("../../utils/hooks/useAminoTheme.js"),x=require("react/jsx-runtime");require("../../_rollupPluginBabelHelpers-4522587c.js"),require("../translations/Translate.js"),require("../../utils/translations/_handleTranslateComponentText.js"),require("../../utils/translations/AminoTranslationStore.js"),require("zod"),require("zustand"),require("../../utils/storage.js"),require("dayjs"),require("../../utils/translations/supportedLanguages.js"),require("../select/_StyledReactSelect.js"),require("react-intersection-observer"),require("react-select"),require("../checkbox/Checkbox.js"),require("framer-motion"),require("../help-text/HelpText.js"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../utils/getNodeText.js"),require("../../utils/getTestId.js"),require("../../icons/DoubleChevronIcon.js"),require("../../icons/RemoveCircleIcon.js"),require("../../icons/RemoveIcon.js"),require("../stack/Stack.js"),require("clsx"),require("tailwind-merge"),require("../../icons/icon-base/_ThemeIconBase.js"),require("../../utils/hooks/useStorage.js");var g=[{label:"Light",value:"day"},{label:"Dark",value:"night"}];exports.ThemeSelect=function(q){var b=q.className,v=q.disabled,T=void 0!==v&&v,p=q.type,y=void 0===p?"select":p,f=j.useAminoTheme(),k=f.aminoTheme,I=f.setAminoTheme,_=e.__read(r.useState(!1),2),S=_[0],C=_[1];return r.useEffect(function(){C("night"===k)},[k]),x.jsxs(x.Fragment,{children:["cards"===y&&x.jsxs(i.HStack,{className:b,children:[x.jsx("button",{className:m.cn("rounded-amino-8 text-text-color border-2 border-solid\n border-transparent focus:outline-none active:outline-none","day"===k&&"text-primary border-blue-400"),"data-theme":"day",onClick:function(){return I("day")},type:"button",children:x.jsxs(t.Card,{className:"bg-gray-0 [&_svg]:mb-amino-16 [&_svg]:shadow-v3-large flex flex-col items-center [&_svg]:h-16 [&_svg]:w-[110px]",spacing:d.theme.space16,children:[x.jsx(u.ThemeLightIcon,{}),x.jsx(o.Text,{type:"bold-label",children:x.jsx(s.TranslateAminoText,{text:"Light"})})]})}),x.jsx("button",{className:m.cn("rounded-amino-8 text-text-color border-2 border-solid\n border-transparent focus:outline-none active:outline-none","night"===k&&"text-primary border-blue-400"),"data-theme":"night",onClick:function(){return I("night")},type:"button",children:x.jsxs(t.Card,{className:"bg-gray-0 [&_svg]:mb-amino-16 [&_svg]:shadow-v3-large flex flex-col items-center [&_svg]:h-16 [&_svg]:w-[110px]",spacing:d.theme.space16,children:[x.jsx(c.ThemeDarkIcon,{}),x.jsx(o.Text,{type:"bold-label",children:x.jsx(s.TranslateAminoText,{text:"Dark"})})]})})]}),"select"===y&&x.jsx(n.Select,{className:b,icon:function(){switch(k){case"day":default:return x.jsx(h.SunnyIcon,{});case"night":return x.jsx(l.NightIcon,{})}}(),isClearable:!1,isDisabled:T,onChange:function(e){return I((null==e?void 0:e.value)||"day")},options:g,value:g.filter(function(e){return e.value===k})}),"toggle"===y&&x.jsx(a.Switch,{"aria-label":"Dark mode",checked:S,className:b,disabled:T,onChange:function(){return!T&&I("night"===k?"day":"night")},switchIconLeft:x.jsx(h.SunnyIcon,{}),switchIconRight:x.jsx(l.NightIcon,{})})]})};
|