ymy-components 0.0.34 → 0.0.35
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.
|
@@ -39,4 +39,9 @@ export type BannerButtonProps = {
|
|
|
39
39
|
* Defaults to 'simplified' if not specified.
|
|
40
40
|
*/
|
|
41
41
|
characterPreference?: CharacterPreference;
|
|
42
|
+
/**
|
|
43
|
+
* Whether to animate the text translation.
|
|
44
|
+
* Defaults to true if not specified.
|
|
45
|
+
*/
|
|
46
|
+
animate?: boolean;
|
|
42
47
|
};
|
package/dist/index.cjs.js
CHANGED
|
@@ -131,7 +131,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[ir]+=1);const Xu=Qu`
|
|
|
131
131
|
@media (min-width: 640px) {
|
|
132
132
|
margin-right: 0.25rem;
|
|
133
133
|
}
|
|
134
|
-
`;var Cs={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},io=N.createContext&&N.createContext(Cs),tl=["attr","size","title"];function rl(e,t){if(e==null)return{};var r=nl(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nl(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _r(){return _r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_r.apply(this,arguments)}function oo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Er(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oo(Object(r),!0).forEach(function(n){il(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function il(e,t,r){return t=ol(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ol(e){var t=sl(e,"string");return typeof t=="symbol"?t:t+""}function sl(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ns(e){return e&&e.map((t,r)=>N.createElement(t.tag,Er({key:r},t.attr),Ns(t.child)))}function Me(e){return t=>N.createElement(al,_r({attr:Er({},e.attr)},t),Ns(e.child))}function al(e){var t=r=>{var{attr:n,size:i,title:o}=e,s=rl(e,tl),a=i||r.size||"1em",u;return r.className&&(u=r.className),e.className&&(u=(u?u+" ":"")+e.className),N.createElement("svg",_r({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:u,style:Er(Er({color:e.color||r.color},r.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&N.createElement("title",null,o),e.children)};return io!==void 0?N.createElement(io.Consumer,null,r=>t(r)):t(Cs)}function cl(e){return Me({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function ul(e){return Me({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"22",y1:"2",x2:"11",y2:"13"},child:[]},{tag:"polygon",attr:{points:"22 2 15 22 11 13 2 9 22 2"},child:[]}]})(e)}const ll=({iconComponent:e,buttonText:t,buttonType:r="primary",onClick:n,characterPreference:i})=>{let
|
|
134
|
+
`;var Cs={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},io=N.createContext&&N.createContext(Cs),tl=["attr","size","title"];function rl(e,t){if(e==null)return{};var r=nl(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nl(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _r(){return _r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_r.apply(this,arguments)}function oo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Er(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oo(Object(r),!0).forEach(function(n){il(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function il(e,t,r){return t=ol(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ol(e){var t=sl(e,"string");return typeof t=="symbol"?t:t+""}function sl(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ns(e){return e&&e.map((t,r)=>N.createElement(t.tag,Er({key:r},t.attr),Ns(t.child)))}function Me(e){return t=>N.createElement(al,_r({attr:Er({},e.attr)},t),Ns(e.child))}function al(e){var t=r=>{var{attr:n,size:i,title:o}=e,s=rl(e,tl),a=i||r.size||"1em",u;return r.className&&(u=r.className),e.className&&(u=(u?u+" ":"")+e.className),N.createElement("svg",_r({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:u,style:Er(Er({color:e.color||r.color},r.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&N.createElement("title",null,o),e.children)};return io!==void 0?N.createElement(io.Consumer,null,r=>t(r)):t(Cs)}function cl(e){return Me({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function ul(e){return Me({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"22",y1:"2",x2:"11",y2:"13"},child:[]},{tag:"polygon",attr:{points:"22 2 15 22 11 13 2 9 22 2"},child:[]}]})(e)}const ll=({iconComponent:e,buttonText:t,buttonType:r="primary",onClick:n,characterPreference:i,animate:o=!0})=>{let s;e==="plus"?s=M.jsx(cl,{}):e==="send"&&(s=M.jsx(ul,{}));const a=()=>{n&&n()};return M.jsx(Ju,{onClick:a,children:M.jsxs(Zu,{className:r,children:[M.jsx(el,{children:s}),M.jsx(ts,{textStyles:{lineHeight:"0.8rem",minWidth:"3rem"},content:t,animate:o,characterPreference:i})]})})},fl=H(es.div)`
|
|
135
135
|
width: 2.5rem;
|
|
136
136
|
height: 2.5rem;
|
|
137
137
|
border-radius: 50%;
|
package/dist/index.es.js
CHANGED
|
@@ -4176,21 +4176,22 @@ const jf = ({
|
|
|
4176
4176
|
buttonText: t,
|
|
4177
4177
|
buttonType: r = "primary",
|
|
4178
4178
|
onClick: n,
|
|
4179
|
-
characterPreference: i
|
|
4179
|
+
characterPreference: i,
|
|
4180
|
+
animate: o = !0
|
|
4180
4181
|
}) => {
|
|
4181
|
-
let
|
|
4182
|
-
e === "plus" ?
|
|
4183
|
-
const
|
|
4182
|
+
let s;
|
|
4183
|
+
e === "plus" ? s = /* @__PURE__ */ $.jsx(yl, {}) : e === "send" && (s = /* @__PURE__ */ $.jsx(gl, {}));
|
|
4184
|
+
const a = () => {
|
|
4184
4185
|
n && n();
|
|
4185
4186
|
};
|
|
4186
|
-
return /* @__PURE__ */ $.jsx(sl, { onClick:
|
|
4187
|
-
/* @__PURE__ */ $.jsx(cl, { children:
|
|
4187
|
+
return /* @__PURE__ */ $.jsx(sl, { onClick: a, children: /* @__PURE__ */ $.jsxs(al, { className: r, children: [
|
|
4188
|
+
/* @__PURE__ */ $.jsx(cl, { children: s }),
|
|
4188
4189
|
/* @__PURE__ */ $.jsx(
|
|
4189
4190
|
Jc,
|
|
4190
4191
|
{
|
|
4191
4192
|
textStyles: { lineHeight: "0.8rem", minWidth: "3rem" },
|
|
4192
4193
|
content: t,
|
|
4193
|
-
animate:
|
|
4194
|
+
animate: o,
|
|
4194
4195
|
characterPreference: i
|
|
4195
4196
|
}
|
|
4196
4197
|
)
|