@frak-labs/components 0.0.26-beta.21f77a40 → 0.0.26-beta.34e9c815

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,56 +1,4 @@
1
- import{t as e}from"./jsxRuntime.module.D7jbXhdY.js";function t(t){return e(`svg`,{viewBox:`0 0 100 100`,fill:`none`,"aria-hidden":`true`,...t,children:[e(`circle`,{cx:`38`,cy:`28`,r:`23`,fill:`#FFF533`}),e(`path`,{d:`M50 38C30 10 12 30 50 38Z`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),e(`path`,{d:`M50 38C70 10 88 30 50 38Z`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),e(`rect`,{x:`10`,y:`38`,width:`80`,height:`16`,rx:`2`,stroke:`#222222`,"stroke-width":`4`}),e(`path`,{d:`M15 54V89C15 90.6 16.4 92 18 92H82C83.6 92 85 90.6 85 89V54`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),e(`line`,{x1:`50`,y1:`54`,x2:`50`,y2:`92`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`})]})}const n=`.reset_base__1831jhd0 {
2
- margin: 0;
3
- padding: 0;
4
- border: 0;
5
- box-sizing: border-box;
6
- font-size: 100%;
7
- font: inherit;
8
- vertical-align: baseline;
9
- -webkit-tap-highlight-color: transparent;
10
- }
11
- .reset_focusRing__1831jhd1 {
12
- outline: 2px solid transparent;
13
- outline-offset: 2px;
14
- }
15
- .reset_focusRing__1831jhd1:focus-visible {
16
- outline-color: currentColor;
17
- }
18
- .reset_fieldAppearance__1831jhd2 {
19
- appearance: none;
20
- background-color: transparent;
21
- }
22
- .reset_visuallyHidden__1831jhd3 {
23
- position: absolute;
24
- width: 1px;
25
- height: 1px;
26
- padding: 0;
27
- margin: -1px;
28
- overflow: hidden;
29
- clip: rect(0, 0, 0, 0);
30
- white-space: nowrap;
31
- border-width: 0;
32
- }
33
- .reset_element_ul__1831jhd4 {
34
- list-style: none;
35
- }
36
- .reset_element_ol__1831jhd5 {
37
- list-style: none;
38
- }
39
- .reset_element_button__1831jhd6 {
40
- cursor: pointer;
41
- }
42
- .reset_element_a__1831jhd7 {
43
- text-decoration: none;
44
- color: inherit;
45
- }
46
- .reset_element_table__1831jhdb {
47
- border-collapse: collapse;
48
- border-spacing: 0;
49
- }
50
- .reset_element_img__1831jhdc {
51
- display: block;
52
- max-width: 100%;
53
- }`,r=`:root {
1
+ import{l as e}from"./usePlacement.B7jMsQvP.js";const t=`:root {
54
2
  --text-primary__pbq4ak0: #000000;
55
3
  --text-secondary__pbq4ak1: #525252;
56
4
  --text-tertiary__pbq4ak2: #a3a3a3;
@@ -137,6 +85,58 @@ import{t as e}from"./jsxRuntime.module.D7jbXhdY.js";function t(t){return e(`svg`
137
85
  --icon-error__pbq4ak13: #e31c31;
138
86
  --icon-success__pbq4ak14: #09be67;
139
87
  --icon-warning__pbq4ak15: #ec7e00;
88
+ }`;function n(t){return e(`svg`,{viewBox:`0 0 100 100`,fill:`none`,"aria-hidden":`true`,...t,children:[e(`circle`,{cx:`38`,cy:`28`,r:`23`,fill:`#FFF533`}),e(`path`,{d:`M50 38C30 10 12 30 50 38Z`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),e(`path`,{d:`M50 38C70 10 88 30 50 38Z`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),e(`rect`,{x:`10`,y:`38`,width:`80`,height:`16`,rx:`2`,stroke:`#222222`,"stroke-width":`4`}),e(`path`,{d:`M15 54V89C15 90.6 16.4 92 18 92H82C83.6 92 85 90.6 85 89V54`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),e(`line`,{x1:`50`,y1:`54`,x2:`50`,y2:`92`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`})]})}const r=`.reset_base__1831jhd0 {
89
+ margin: 0;
90
+ padding: 0;
91
+ border: 0;
92
+ box-sizing: border-box;
93
+ font-size: 100%;
94
+ font: inherit;
95
+ vertical-align: baseline;
96
+ -webkit-tap-highlight-color: transparent;
97
+ }
98
+ .reset_focusRing__1831jhd1 {
99
+ outline: 2px solid transparent;
100
+ outline-offset: 2px;
101
+ }
102
+ .reset_focusRing__1831jhd1:focus-visible {
103
+ outline-color: currentColor;
104
+ }
105
+ .reset_fieldAppearance__1831jhd2 {
106
+ appearance: none;
107
+ background-color: transparent;
108
+ }
109
+ .reset_visuallyHidden__1831jhd3 {
110
+ position: absolute;
111
+ width: 1px;
112
+ height: 1px;
113
+ padding: 0;
114
+ margin: -1px;
115
+ overflow: hidden;
116
+ clip: rect(0, 0, 0, 0);
117
+ white-space: nowrap;
118
+ border-width: 0;
119
+ }
120
+ .reset_element_ul__1831jhd4 {
121
+ list-style: none;
122
+ }
123
+ .reset_element_ol__1831jhd5 {
124
+ list-style: none;
125
+ }
126
+ .reset_element_button__1831jhd6 {
127
+ cursor: pointer;
128
+ }
129
+ .reset_element_a__1831jhd7 {
130
+ text-decoration: none;
131
+ color: inherit;
132
+ }
133
+ .reset_element_table__1831jhdb {
134
+ border-collapse: collapse;
135
+ border-spacing: 0;
136
+ }
137
+ .reset_element_img__1831jhdc {
138
+ display: block;
139
+ max-width: 100%;
140
140
  }`,i=`.sprinkles_display_none_mobile__1iaw8zx0 {
141
141
  display: none;
142
142
  }
@@ -0,0 +1 @@
1
+ import{t as e}from"./loader.js";import{c as t,r as n}from"./usePlacement.B7jMsQvP.js";function r(r,i,a,o){t(()=>{e.injectBase(r,o??n)},[r]),t(()=>{!i||!a||e.injectPlacement(r,i,a)},[r,i,a])}export{r as t};
@@ -0,0 +1,58 @@
1
+ import{S as e,i as t,n,r}from"./loader.js";var i,a,o,s,c,l,u,d,f,p,m,h={},g=[],_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v=Array.isArray;function y(e,t){for(var n in t)e[n]=t[n];return e}function b(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function x(e,t,n){var r,a,o,s={};for(o in t)o==`key`?r=t[o]:o==`ref`?a=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?i.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(o in e.defaultProps)s[o]===void 0&&(s[o]=e.defaultProps[o]);return S(e,s,r,a,null)}function S(e,t,n,r,i){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++o,__i:-1,__u:0};return i==null&&a.vnode!=null&&a.vnode(s),s}function C(e){return e.children}function w(e,t){this.props=e,this.context=t}function T(e,t){if(t==null)return e.__?T(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?T(e):null}function E(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],o=y({},t);o.__v=t.__v+1,a.vnode&&a.vnode(o),P(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??T(t),!!(32&t.__u),i),o.__v=t.__v,o.__.__k[o.__i]=o,ie(r,o,i),t.__e=t.__=null,o.__e!=n&&D(o)}}function D(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),D(e)}function O(e){(!e.__d&&(e.__d=!0)&&s.push(e)&&!k.__r++||c!=a.debounceRendering)&&((c=a.debounceRendering)||l)(k)}function k(){try{for(var e,t=1;s.length;)s.length>t&&s.sort(u),e=s.shift(),t=s.length,E(e)}finally{s.length=k.__r=0}}function ee(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,_,v,y,b=r&&r.__k||g,x=t.length;for(c=A(n,t,b,c,x),d=0;d<x;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&b[p.__i]||h,p.__i=d,v=P(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&I(f.ref,null,p),u.push(p.ref,p.__c||m,p)),_==null&&m!=null&&(_=m),(y=!!(4&p.__u))||f.__k===p.__k?c=j(p,c,e,y):typeof p.type==`function`&&v!==void 0?c=v:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=_,c}function A(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=S(null,o,null,null,null):v(o)?o=e.__k[a]=S(C,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=S(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=te(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=T(s)),se(s,s));return r}function j(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=j(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=T(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function M(e,t){return t||=[],e==null||typeof e==`boolean`||(v(e)?e.some(function(e){M(e,t)}):t.push(e)),t}function te(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function ne(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||_.test(t)?n:n+`px`}function N(e,t,n,r,i){var a,o;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||ne(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||ne(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(d,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n.u=r.u:(n.u=f,e.addEventListener(t,a?m:p,a)):e.removeEventListener(t,a?m:p,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function re(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=f++;else if(t.t<n.u)return;return n(a.event?a.event(t):t)}}}function P(e,t,n,r,i,o,s,c,l,u){var d,f,p,m,h,_,x,S,T,E,D,O,k,A,j,M=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),o=[c=t.__e=n.__e]),(d=a.__b)&&d(t);n:if(typeof M==`function`)try{if(S=t.props,T=M.prototype&&M.prototype.render,E=(d=M.contextType)&&r[d.__c],D=d?E?E.props.value:d.__:r,n.__c?x=(f=t.__c=n.__c).__=f.__E:(T?t.__c=f=new M(S,D):(t.__c=f=new w(S,D),f.constructor=M,f.render=ce),E&&E.sub(f),f.state||={},f.__n=r,p=f.__d=!0,f.__h=[],f._sb=[]),T&&f.__s==null&&(f.__s=f.state),T&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=y({},f.__s)),y(f.__s,M.getDerivedStateFromProps(S,f.__s))),m=f.props,h=f.state,f.__v=t,p)T&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),T&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(T&&M.getDerivedStateFromProps==null&&S!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(S,D),t.__v==n.__v||!f.__e&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(S,f.__s,D)){t.__v!=n.__v&&(f.props=S,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),g.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&s.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(S,f.__s,D),T&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,_)})}if(f.context=D,f.props=S,f.__P=e,f.__e=!1,O=a.__r,k=0,T)f.state=f.__s,f.__d=!1,O&&O(t),d=f.render(f.props,f.state,f.context),g.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,O&&O(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++k<25);f.state=f.__s,f.getChildContext!=null&&(r=y(y({},r),f.getChildContext())),T&&!p&&f.getSnapshotBeforeUpdate!=null&&(_=f.getSnapshotBeforeUpdate(m,h)),A=d!=null&&d.type===C&&d.key==null?ae(d.props.children):d,c=ee(e,v(A)?A:[A],t,n,r,i,o,s,c,l,u),f.base=t.__e,t.__u&=-161,f.__h.length&&s.push(f),x&&(f.__E=f.__=null)}catch(e){if(t.__v=null,l||o!=null)if(e.then){for(t.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o[o.indexOf(c)]=null,t.__e=c}else{for(j=o.length;j--;)b(o[j]);F(t)}else t.__e=n.__e,t.__k=n.__k,e.then||F(t);a.__e(e,t,n)}else o==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):c=t.__e=oe(n.__e,t,n,r,i,o,s,l,u);return(d=a.diffed)&&d(t),128&t.__u?void 0:c}function F(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(F))}function ie(e,t,n){for(var r=0;r<n.length;r++)I(n[r],n[++r],n[++r]);a.__c&&a.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){a.__e(e,t.__v)}})}function ae(e){return typeof e!=`object`||!e||e.__b>0?e:v(e)?e.map(ae):y({},e)}function oe(e,t,n,r,o,s,c,l,u){var d,f,p,m,g,_,y,x=n.props||h,S=t.props,C=t.type;if(C==`svg`?o=`http://www.w3.org/2000/svg`:C==`math`?o=`http://www.w3.org/1998/Math/MathML`:o||=`http://www.w3.org/1999/xhtml`,s!=null){for(d=0;d<s.length;d++)if((g=s[d])&&`setAttribute`in g==!!C&&(C?g.localName==C:g.nodeType==3)){e=g,s[d]=null;break}}if(e==null){if(C==null)return document.createTextNode(S);e=document.createElementNS(o,C,S.is&&S),l&&=(a.__m&&a.__m(t,s),!1),s=null}if(C==null)x===S||l&&e.data==S||(e.data=S);else{if(s&&=i.call(e.childNodes),!l&&s!=null)for(x={},d=0;d<e.attributes.length;d++)x[(g=e.attributes[d]).name]=g.value;for(d in x)g=x[d],d==`dangerouslySetInnerHTML`?p=g:d==`children`||d in S||d==`value`&&`defaultValue`in S||d==`checked`&&`defaultChecked`in S||N(e,d,null,g,o);for(d in S)g=S[d],d==`children`?m=g:d==`dangerouslySetInnerHTML`?f=g:d==`value`?_=g:d==`checked`?y=g:l&&typeof g!=`function`||x[d]===g||N(e,d,g,x[d],o);if(f)l||p&&(f.__html==p.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(p&&(e.innerHTML=``),ee(t.type==`template`?e.content:e,v(m)?m:[m],t,n,r,C==`foreignObject`?`http://www.w3.org/1999/xhtml`:o,s,c,s?s[0]:n.__k&&T(n,0),l,u),s!=null)for(d=s.length;d--;)b(s[d]);l||(d=`value`,C==`progress`&&_==null?e.removeAttribute(`value`):_!=null&&(_!==e[d]||C==`progress`&&!_||C==`option`&&_!=x[d])&&N(e,d,_,x[d],o),d=`checked`,y!=null&&y!=e[d]&&N(e,d,y,x[d],o))}return e}function I(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){a.__e(e,n)}}function se(e,t,n){var r,i;if(a.unmount&&a.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||I(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){a.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&se(r[i],t,n||typeof e.type!=`function`);n||b(e.__e),e.__c=e.__=e.__e=void 0}function ce(e,t,n){return this.constructor(e,n)}function L(e,t,n){var r,o,s,c;t==document&&(t=document.documentElement),a.__&&a.__(e,t),o=(r=typeof n==`function`)?null:n&&n.__k||t.__k,s=[],c=[],P(t,e=(!r&&n||t).__k=x(C,null,[e]),o||h,h,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?i.call(t.childNodes):null,s,!r&&n?n:o?o.__e:t.firstChild,r,c),ie(s,e,c)}function le(e,t){L(e,t,le)}function ue(e,t,n){var r,a,o,s,c=y({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)o==`key`?r=t[o]:o==`ref`?a=t[o]:c[o]=t[o]===void 0&&s!=null?s[o]:t[o];return arguments.length>2&&(c.children=arguments.length>3?i.call(arguments,2):n),S(e.type,c,r||e.key,a||e.ref,null)}i=g.slice,a={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},o=0,w.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=y({},this.state);typeof e==`function`&&(e=e(y({},n),this.props)),e&&y(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),O(this))},w.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),O(this))},w.prototype.render=C,s=[],l=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,u=function(e,t){return e.__v.__b-t.__v.__b},k.__r=0,d=/(PointerCapture)$|Capture$/i,f=0,p=re(!1),m=re(!0);function R(){return R=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R.apply(this,arguments)}function de(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}var fe=[`context`,`children`],pe=[`useFragment`];function me(e,t,n,r){function i(){var t,n=Reflect.construct(HTMLElement,[],i);return n._vdomComponent=e,r&&r.shadow?(n._root=n.attachShadow({mode:r.mode||`open`,serializable:(t=r.serializable)!=null&&t}),r.adoptedStyleSheets&&(n._root.adoptedStyleSheets=r.adoptedStyleSheets)):n._root=n,n}return(i.prototype=Object.create(HTMLElement.prototype)).constructor=i,i.prototype.connectedCallback=function(){ge.call(this,r)},i.prototype.attributeChangedCallback=_e,i.prototype.disconnectedCallback=ve,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),i.observedAttributes=n,e.formAssociated&&(i.formAssociated=!0),n.forEach(function(e){Object.defineProperty(i.prototype,e,{get:function(){return this._vdom?this._vdom.props[e]:this._props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||={},this._props[e]=t);var n=typeof t;t!=null&&n!==`string`&&n!==`boolean`&&n!==`number`||this.setAttribute(e,t)}})}),customElements.define(t||e.tagName||e.displayName||e.name,i),i}function he(e){this.getChildContext=function(){return e.context};var t=e.children;return ue(t,de(e,fe))}function ge(e){var t=new CustomEvent(`_preact`,{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=x(he,R({},this._props,{context:t.detail.context}),ye(this,this._vdomComponent,e)),(this.hasAttribute(`hydrate`)?le:L)(this._vdom,this._root)}function z(e){return e.replace(/-(\w)/g,function(e,t){return t?t.toUpperCase():``})}function _e(e,t,n){if(this._vdom){var r={};r[e]=n??=void 0,r[z(e)]=n,this._vdom=ue(this._vdom,r),L(this._vdom,this._root)}}function ve(){L(this._vdom=null,this._root)}function B(e,t){var n=this,r=e.useFragment,i=de(e,pe);return x(r?C:`slot`,R({},i,{ref:function(e){e?(n.ref=e,n._listener||(n._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener(`_preact`,n._listener))):n.ref.removeEventListener(`_preact`,n._listener)}}))}function ye(e,t,n){if(e.nodeType===3)return e.data;if(e.nodeType!==1)return null;var r=[],i={},a=0,o=e.attributes,s=e.childNodes;for(a=o.length;a--;)o[a].name!==`slot`&&(i[o[a].name]=o[a].value,i[z(o[a].name)]=o[a].value);for(a=s.length;a--;){var c=ye(s[a],null,n),l=s[a].slot;l?i[l]=x(B,{name:l},c):r[a]=c}var u=!(!n||!n.shadow),d=t?x(B,{useFragment:!u},r):r;return!u&&t&&(e.innerHTML=``),x(t||e.nodeName.toLowerCase(),i,d)}function be(e,t,i=[],a={shadow:!0}){typeof window<`u`&&(n(r),customElements.get(t)||me(e,t,i,a))}var xe=0;Array.isArray;function Se(e,t,n,r,i,o){t||={};var s,c,l=t;if(`ref`in l)for(c in l={},t)c==`ref`?s=t[c]:l[c]=t[c];var u={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--xe,__i:-1,__u:0,__source:i,__self:o};if(typeof e==`function`&&(s=e.defaultProps))for(c in s)l[c]===void 0&&(l[c]=s[c]);return a.vnode&&a.vnode(u),u}var V,H,U,Ce,W=0,we=[],G=a,Te=G.__b,Ee=G.__r,De=G.diffed,Oe=G.__c,ke=G.unmount,Ae=G.__;function K(e,t){G.__h&&G.__h(H,e,W||t),W=0;var n=H.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function q(e){return W=1,je(Ie,e)}function je(e,t,n){var r=K(V++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ie(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=H,!H.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a&&a.call(this,e,t,n)||o};H.__f=!0;var a=H.shouldComponentUpdate,o=H.componentWillUpdate;H.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},H.shouldComponentUpdate=i}return r.__N||r.__}function J(e,t){var n=K(V++,3);!G.__s&&Q(n.__H,t)&&(n.__=e,n.u=t,H.__H.__h.push(n))}function Y(e,t){var n=K(V++,7);return Q(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Me(e,t){return W=8,Y(function(){return e},t)}function Ne(){for(var e;e=we.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(X),t.__h.some(Z),t.__h=[]}catch(n){t.__h=[],G.__e(n,e.__v)}}}G.__b=function(e){H=null,Te&&Te(e)},G.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ae&&Ae(e,t)},G.__r=function(e){Ee&&Ee(e),V=0;var t=(H=e.__c).__H;t&&(U===H?(t.__h=[],H.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(X),t.__h.some(Z),t.__h=[],V=0)),U=H},G.diffed=function(e){De&&De(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(we.push(t)!==1&&Ce===G.requestAnimationFrame||((Ce=G.requestAnimationFrame)||Fe)(Ne)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),U=H=null},G.__c=function(e,t){t.some(function(e){try{e.__h.some(X),e.__h=e.__h.filter(function(e){return!e.__||Z(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],G.__e(n,e.__v)}}),Oe&&Oe(e,t)},G.unmount=function(e){ke&&ke(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{X(e)}catch(e){t=e}}),n.__H=void 0,t&&G.__e(t,n.__v))};var Pe=typeof requestAnimationFrame==`function`;function Fe(e){var t,n=function(){clearTimeout(r),Pe&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Pe&&(t=requestAnimationFrame(n))}function X(e){var t=H,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),H=t}function Z(e){var t=H;e.__c=e.__(),H=t}function Q(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Ie(e,t){return typeof t==`function`?t(e):t}function Le(){let[n,r]=q(()=>window.FrakSetup?.config?.waitForBackendConfig===!1?!0:e.isResolved),[i,a]=q(()=>e.getConfig().hidden??!1),[o,s]=q(()=>!!window.FrakSetup?.client);return J(()=>{let n=e.getConfig();n.isResolved&&(r(!0),a(n.hidden??!1)),window.FrakSetup?.client&&s(!0);let i=e=>{let t=e.detail;t.isResolved&&r(!0),a(t.hidden??!1)};window.addEventListener(`frak:config`,i);let o=()=>s(!0);return t(`add`,o),()=>{window.removeEventListener(`frak:config`,i),t(`remove`,o)}},[]),{shouldRender:n,isHidden:i,isClientReady:o}}const $=`
2
+ :host {
3
+ display: contents;
4
+ }
5
+
6
+ :host([hidden]) {
7
+ display: none;
8
+ }
9
+
10
+ .button:disabled {
11
+ opacity: 0.7;
12
+ cursor: default;
13
+ }
14
+
15
+ .button__fadeIn {
16
+ animation: frak-fadeIn 300ms ease-in;
17
+ }
18
+
19
+ @keyframes frak-fadeIn {
20
+ from {
21
+ opacity: 0;
22
+ }
23
+
24
+ to {
25
+ opacity: 1;
26
+ }
27
+ }
28
+ `;function Re(e,t){return t?`${$}\n${e}\n${t}`:`${$}\n${e}`}const ze=`
29
+ :where(frak-button-share, frak-open-in-app) {
30
+ display: contents;
31
+ }
32
+
33
+ :where(frak-button-share .button, frak-open-in-app .button) {
34
+ display: flex;
35
+ align-items: center;
36
+ justify-content: center;
37
+ gap: 10px;
38
+ }
39
+
40
+ :where(frak-button-share .button:disabled, frak-open-in-app .button:disabled) {
41
+ opacity: 0.7;
42
+ cursor: default;
43
+ }
44
+
45
+ :where(frak-button-share .button__fadeIn, frak-open-in-app .button__fadeIn) {
46
+ animation: frak-fadeIn 300ms ease-in;
47
+ }
48
+
49
+ @keyframes frak-fadeIn {
50
+ from {
51
+ opacity: 0;
52
+ }
53
+
54
+ to {
55
+ opacity: 1;
56
+ }
57
+ }
58
+ `;function Be(t){return e.getConfig().placements?.[t]}function Ve(e){let[t,n]=q(0);return J(()=>{let e=e=>{n(e=>e+1)};return window.addEventListener(`frak:config`,e),n(e=>e+1),()=>window.removeEventListener(`frak:config`,e)},[]),Y(()=>e?Be(e):void 0,[e,t])}export{Y as a,J as c,M as d,x as f,w as h,Le as i,Se as l,a as m,Re as n,q as o,C as p,ze as r,Me as s,Ve as t,be as u};
@@ -0,0 +1 @@
1
+ import{f as e,v as t,x as n}from"./loader.js";import{c as r,o as i}from"./usePlacement.B7jMsQvP.js";import{n as a}from"./formatReward.DGzaZNpK.js";function o(e,t){switch(e.payoutType){case`fixed`:return e.amount[t];case`tiered`:return e.tiers.reduce((e,n)=>Math.max(e,n.amount[t]),0);case`percentage`:return 0}}function s({rewards:e},r,i){let s=(i?e.filter(e=>e.interactionTypeKey===i):e).map(e=>e.referrer).filter(e=>e!==void 0);if(s.length===0)return;let c=n(t(r)),l=s[0],u=o(l,c);for(let e=1;e<s.length;e++){let t=o(s[e],c);t>u&&(l=s[e],u=t)}if(u<=0){let e=s.find(e=>e.payoutType===`percentage`);if(!e)return;l=e}return a(l,r)}function c(t,n){let[a,o]=i(void 0);return r(()=>{if(!t)return;let r=window.FrakSetup?.client;r&&e(r).then(e=>{let t=r.config.metadata?.currency,i=s(e,t,n);i&&o(i)}).catch(()=>{})},[t,n]),{reward:a}}export{c as t};
@@ -0,0 +1 @@
1
+ import{C as e,T as t,s as n,w as r,y as i}from"./loader.js";import{o as a,s as o}from"./usePlacement.B7jMsQvP.js";function s(s,c,l){let[u,d]=a(void 0),[f,p]=a(!1);return{handleShare:o(async()=>{if(!window.FrakSetup?.client){console.error(`Frak client not found`),d(i.empty().formatDebugInfo(`Frak client not found`)),p(!0);return}let a=n(window.FrakSetup.client,{});try{await a.sharing(l?{link:l}:{}).display(e=>({...e,targetInteraction:s}),c)}catch(n){if(n instanceof t&&n.code===r.clientAborted){console.debug(`User aborted the modal`);return}let i=window.FrakSetup.client.debugInfo.formatDebugInfo(n);e(window.FrakSetup.client,`share_modal_error`,{error:n instanceof Object&&`message`in n?n.message:`Unknown error`,debugInfo:i}),d(i),p(!0),console.error(`Error while opening the modal`,n)}},[s,c,l]),isError:f,debugInfo:u}}export{s as t};
package/dist/banner.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { a as registerWebComponent, i as useClientReady, t as usePlacement } from "./usePlacement-LqYjZLX_.js";
2
2
  import { t as useLightDomStyles } from "./useLightDomStyles-Cjpf0MnX.js";
3
3
  import { t as useReward } from "./useReward-Cup3DU1-.js";
4
- import { i as cssSource$2, n as cssSource$4, r as cssSource$3, t as GiftIcon } from "./GiftIcon-BrNVWoWm.js";
4
+ import { i as cssSource$5, n as cssSource$6, r as cssSource$4, t as GiftIcon } from "./GiftIcon-BrNVWoWm.js";
5
5
  import { isInAppBrowser, redirectToExternalBrowser } from "@frak-labs/core-sdk";
6
6
  import { REFERRAL_SUCCESS_EVENT, getMergeToken } from "@frak-labs/core-sdk/actions";
7
7
  import { useCallback, useEffect, useMemo, useState } from "preact/hooks";
8
8
  import { jsx, jsxs } from "preact/jsx-runtime";
9
- //#region src/components/icons/CloseIcon.tsx
10
- function CloseIcon(props) {
9
+ //#region ../../packages/design-system/src/icons/CloseCircleIcon.tsx
10
+ function CloseCircleIcon(props) {
11
11
  return /* @__PURE__ */ jsx("svg", {
12
12
  width: "15",
13
13
  height: "15",
@@ -22,7 +22,7 @@ function CloseIcon(props) {
22
22
  });
23
23
  }
24
24
  //#endregion
25
- //#region src/components/icons/ExternalLinkIcon.tsx
25
+ //#region ../../packages/design-system/src/icons/ExternalLinkIcon.tsx
26
26
  function ExternalLinkIcon(props) {
27
27
  return /* @__PURE__ */ jsx("svg", {
28
28
  width: "12",
@@ -38,7 +38,7 @@ function ExternalLinkIcon(props) {
38
38
  });
39
39
  }
40
40
  //#endregion
41
- //#region src/components/icons/WarningIcon.tsx
41
+ //#region ../../packages/design-system/src/icons/WarningIcon.tsx
42
42
  function WarningIcon(props) {
43
43
  return /* @__PURE__ */ jsx("svg", {
44
44
  width: "16",
@@ -54,8 +54,8 @@ function WarningIcon(props) {
54
54
  });
55
55
  }
56
56
  //#endregion
57
- //#region \0ve-inline:src/components/Banner/Banner.css.ts.vanilla.js
58
- const cssSource$1 = `@keyframes Banner_fadeIn__1gnumzi0 {
57
+ //#region \0ve-inline:../../packages/design-system/src/styles/inAppBanner.css.ts.vanilla.js
58
+ const cssSource$3 = `@keyframes inAppBanner_fadeIn__1ibpiy70 {
59
59
  from {
60
60
  opacity: 0;
61
61
  transform: translateY(-4px);
@@ -65,61 +65,13 @@ const cssSource$1 = `@keyframes Banner_fadeIn__1gnumzi0 {
65
65
  transform: translateY(0);
66
66
  }
67
67
  }
68
- .Banner_rootBase__1gnumzi1 {
69
- position: relative;
68
+ .inAppBanner_container__1ibpiy71 {
69
+ position: fixed;
70
+ top: max(8px, env(safe-area-inset-top));
71
+ left: 16px;
72
+ right: 16px;
73
+ z-index: 1000;
70
74
  display: flex;
71
- animation: Banner_fadeIn__1gnumzi0 300ms ease-out;
72
- }
73
- .Banner_iconSvg__1gnumzi2 {
74
- width: 100%;
75
- height: 100%;
76
- }
77
- .Banner_referral__1gnumzi3 {
78
- flex-direction: row;
79
- align-items: center;
80
- gap: 16px;
81
- padding: 16px;
82
- background-color: #ffffff;
83
- color: var(--text-primary__pbq4ak0);
84
- }
85
- .Banner_referralIconWrapper__1gnumzi4 {
86
- flex-shrink: 0;
87
- align-self: flex-start;
88
- width: 40px;
89
- height: 40px;
90
- }
91
- .Banner_referralBody__1gnumzi5 {
92
- flex: 1;
93
- min-width: 0;
94
- }
95
- .Banner_referralTitle__1gnumzi6 {
96
- font-size: 16px;
97
- font-weight: 600;
98
- color: var(--text-primary__pbq4ak0);
99
- line-height: 22px;
100
- }
101
- .Banner_referralDescription__1gnumzi7 {
102
- margin-bottom: 8px;
103
- font-size: 14px;
104
- color: #979797;
105
- line-height: 22px;
106
- }
107
- .Banner_referralCta__1gnumzi8 {
108
- display: inline-block;
109
- padding: 8px 16px;
110
- border: 1px solid #000000;
111
- border-radius: 9999px;
112
- color: var(--text-primary__pbq4ak0);
113
- font-size: 10px;
114
- font-weight: 700;
115
- line-height: 12px;
116
- text-transform: uppercase;
117
- }
118
- .Banner_referralCta__1gnumzi8:focus-visible {
119
- outline: 2px solid #000000;
120
- outline-offset: 2px;
121
- }
122
- .Banner_inapp__1gnumzi9 {
123
75
  flex-direction: column;
124
76
  gap: 4px;
125
77
  padding: 12px 16px;
@@ -129,13 +81,14 @@ const cssSource$1 = `@keyframes Banner_fadeIn__1gnumzi0 {
129
81
  backdrop-filter: blur(12px);
130
82
  -webkit-backdrop-filter: blur(12px);
131
83
  color: #ffffff;
84
+ animation: inAppBanner_fadeIn__1ibpiy70 300ms ease-out;
132
85
  }
133
- .Banner_inappHeader__1gnumzia {
86
+ .inAppBanner_header__1ibpiy72 {
134
87
  display: flex;
135
88
  align-items: center;
136
89
  gap: 8px;
137
90
  }
138
- .Banner_inappIconWrapper__1gnumzib {
91
+ .inAppBanner_iconWrapper__1ibpiy73 {
139
92
  flex-shrink: 0;
140
93
  width: 20px;
141
94
  height: 20px;
@@ -144,19 +97,30 @@ const cssSource$1 = `@keyframes Banner_fadeIn__1gnumzi0 {
144
97
  justify-content: center;
145
98
  color: #ffffff;
146
99
  }
147
- .Banner_inappTitle__1gnumzic {
100
+ .inAppBanner_title__1ibpiy74 {
101
+ margin: 0;
102
+ padding: 0;
148
103
  font-size: 16px;
149
104
  font-weight: 500;
150
105
  line-height: 26px;
151
106
  color: var(--text-onAction__pbq4ak6);
152
107
  }
153
- .Banner_inappDescription__1gnumzid {
108
+ .inAppBanner_body__1ibpiy75 {
109
+ display: flex;
110
+ flex-wrap: wrap;
111
+ align-items: baseline;
112
+ gap: 0 4px;
113
+ }
114
+ .inAppBanner_description__1ibpiy76 {
115
+ margin: 0;
116
+ padding: 0;
154
117
  font-size: 14px;
155
118
  color: var(--text-onAction__pbq4ak6);
156
119
  line-height: 22px;
157
120
  opacity: 0.96;
158
121
  }
159
- .Banner_inappCta__1gnumzie {
122
+ .inAppBanner_cta__1ibpiy77 {
123
+ all: unset;
160
124
  display: inline-flex;
161
125
  align-items: center;
162
126
  gap: 4px;
@@ -165,13 +129,15 @@ const cssSource$1 = `@keyframes Banner_fadeIn__1gnumzi0 {
165
129
  font-weight: 600;
166
130
  text-decoration: underline;
167
131
  text-underline-offset: 2px;
132
+ cursor: pointer;
168
133
  }
169
- .Banner_inappCta__1gnumzie:focus-visible {
134
+ .inAppBanner_cta__1ibpiy77:focus-visible {
170
135
  outline: 2px solid #2BB2FF;
171
136
  outline-offset: 2px;
172
137
  border-radius: 4px;
173
138
  }
174
- .Banner_inappClose__1gnumzif {
139
+ .inAppBanner_closeButton__1ibpiy78 {
140
+ all: unset;
175
141
  position: absolute;
176
142
  top: 8px;
177
143
  right: 8px;
@@ -182,28 +148,147 @@ const cssSource$1 = `@keyframes Banner_fadeIn__1gnumzi0 {
182
148
  justify-content: center;
183
149
  border-radius: 9999px;
184
150
  color: rgba(255, 255, 255, 0.6);
151
+ cursor: pointer;
185
152
  }
186
- .Banner_inappClose__1gnumzif:focus-visible {
153
+ .inAppBanner_closeButton__1ibpiy78:focus-visible {
187
154
  outline: 2px solid #ffffff;
188
155
  outline-offset: 2px;
189
156
  }`;
190
157
  //#endregion
158
+ //#region ../../packages/design-system/src/styles/inAppBanner.css.ts
159
+ var body = "inAppBanner_body__1ibpiy75";
160
+ var closeButton = "inAppBanner_closeButton__1ibpiy78";
161
+ var container = "inAppBanner_container__1ibpiy71";
162
+ var cta = "inAppBanner_cta__1ibpiy77";
163
+ var description = "inAppBanner_description__1ibpiy76";
164
+ var header = "inAppBanner_header__1ibpiy72";
165
+ var iconWrapper = "inAppBanner_iconWrapper__1ibpiy73";
166
+ var title = "inAppBanner_title__1ibpiy74";
167
+ cssSource$4 + cssSource$3;
168
+ //#endregion
169
+ //#region ../../packages/design-system/src/components/InAppBanner/index.tsx
170
+ function InAppBanner({ title: title$1, description: description$1, cta: cta$1, dismissLabel, onAction, onDismiss, className, classNames }) {
171
+ return /* @__PURE__ */ jsxs("div", {
172
+ className: `${container}${className ? ` ${className}` : ""}`,
173
+ role: "alert",
174
+ children: [
175
+ /* @__PURE__ */ jsxs("div", {
176
+ className: header,
177
+ children: [/* @__PURE__ */ jsx("span", {
178
+ className: `${iconWrapper}${classNames?.icon ? ` ${classNames.icon}` : ""}`,
179
+ children: /* @__PURE__ */ jsx(WarningIcon, {
180
+ width: 20,
181
+ height: 20
182
+ })
183
+ }), /* @__PURE__ */ jsx("p", {
184
+ className: `${title}${classNames?.title ? ` ${classNames.title}` : ""}`,
185
+ children: title$1
186
+ })]
187
+ }),
188
+ /* @__PURE__ */ jsxs("div", {
189
+ className: body,
190
+ children: [/* @__PURE__ */ jsx("p", {
191
+ className: `${description}${classNames?.description ? ` ${classNames.description}` : ""}`,
192
+ children: description$1
193
+ }), /* @__PURE__ */ jsxs("button", {
194
+ type: "button",
195
+ className: `${cta}${classNames?.cta ? ` ${classNames.cta}` : ""}`,
196
+ onClick: onAction,
197
+ children: [cta$1, /* @__PURE__ */ jsx(ExternalLinkIcon, {
198
+ width: 14,
199
+ height: 14
200
+ })]
201
+ })]
202
+ }),
203
+ /* @__PURE__ */ jsx("button", {
204
+ type: "button",
205
+ className: `${closeButton}${classNames?.close ? ` ${classNames.close}` : ""}`,
206
+ onClick: onDismiss,
207
+ "aria-label": dismissLabel,
208
+ children: /* @__PURE__ */ jsx(CloseCircleIcon, {
209
+ width: 16,
210
+ height: 16
211
+ })
212
+ })
213
+ ]
214
+ });
215
+ }
216
+ //#endregion
217
+ //#region \0ve-inline:src/components/Banner/Banner.css.ts.vanilla.js
218
+ const cssSource$1 = `@keyframes Banner_fadeIn__1gnumzi0 {
219
+ from {
220
+ opacity: 0;
221
+ transform: translateY(-4px);
222
+ }
223
+ to {
224
+ opacity: 1;
225
+ transform: translateY(0);
226
+ }
227
+ }
228
+ .Banner_rootBase__1gnumzi1 {
229
+ position: relative;
230
+ display: flex;
231
+ animation: Banner_fadeIn__1gnumzi0 300ms ease-out;
232
+ }
233
+ .Banner_iconSvg__1gnumzi2 {
234
+ width: 100%;
235
+ height: 100%;
236
+ }
237
+ .Banner_referral__1gnumzi3 {
238
+ flex-direction: row;
239
+ align-items: center;
240
+ gap: 16px;
241
+ padding: 16px;
242
+ background-color: #ffffff;
243
+ color: var(--text-primary__pbq4ak0);
244
+ }
245
+ .Banner_referralIconWrapper__1gnumzi4 {
246
+ flex-shrink: 0;
247
+ align-self: flex-start;
248
+ width: 40px;
249
+ height: 40px;
250
+ }
251
+ .Banner_referralBody__1gnumzi5 {
252
+ flex: 1;
253
+ min-width: 0;
254
+ }
255
+ .Banner_referralTitle__1gnumzi6 {
256
+ font-size: 16px;
257
+ font-weight: 600;
258
+ color: var(--text-primary__pbq4ak0);
259
+ line-height: 22px;
260
+ }
261
+ .Banner_referralDescription__1gnumzi7 {
262
+ margin-bottom: 8px;
263
+ font-size: 14px;
264
+ color: #979797;
265
+ line-height: 22px;
266
+ }
267
+ .Banner_referralCta__1gnumzi8 {
268
+ display: inline-block;
269
+ padding: 8px 16px;
270
+ border: 1px solid #000000;
271
+ border-radius: 9999px;
272
+ color: var(--text-primary__pbq4ak0);
273
+ font-size: 10px;
274
+ font-weight: 700;
275
+ line-height: 12px;
276
+ text-transform: uppercase;
277
+ }
278
+ .Banner_referralCta__1gnumzi8:focus-visible {
279
+ outline: 2px solid #000000;
280
+ outline-offset: 2px;
281
+ }`;
282
+ //#endregion
191
283
  //#region src/components/Banner/Banner.css.ts
192
284
  var iconSvg = "Banner_iconSvg__1gnumzi2";
193
- var inapp = "Banner_inapp__1gnumzi9 reset_base__1831jhd0 Banner_rootBase__1gnumzi1";
194
- var inappClose = "Banner_inappClose__1gnumzif reset_element_button__1831jhd6 reset_fieldAppearance__1831jhd2 reset_focusRing__1831jhd1";
195
- var inappCta = "Banner_inappCta__1gnumzie reset_element_button__1831jhd6 reset_fieldAppearance__1831jhd2 reset_focusRing__1831jhd1";
196
- var inappDescription = "Banner_inappDescription__1gnumzid reset_base__1831jhd0";
197
- var inappHeader = "Banner_inappHeader__1gnumzia";
198
- var inappIconWrapper = "Banner_inappIconWrapper__1gnumzib";
199
- var inappTitle = "Banner_inappTitle__1gnumzic reset_base__1831jhd0";
200
285
  var referral = "Banner_referral__1gnumzi3 reset_base__1831jhd0 Banner_rootBase__1gnumzi1";
201
286
  var referralBody = "Banner_referralBody__1gnumzi5";
202
287
  var referralCta = "Banner_referralCta__1gnumzi8 reset_element_button__1831jhd6 reset_fieldAppearance__1831jhd2 reset_focusRing__1831jhd1";
203
288
  var referralDescription = "Banner_referralDescription__1gnumzi7 reset_base__1831jhd0";
204
289
  var referralIconWrapper = "Banner_referralIconWrapper__1gnumzi4";
205
290
  var referralTitle = "Banner_referralTitle__1gnumzi6 reset_base__1831jhd0";
206
- const cssSource = cssSource$2 + cssSource$3 + cssSource$4 + cssSource$1;
291
+ const cssSource = cssSource$5 + cssSource$4 + cssSource$6 + cssSource$1;
207
292
  //#endregion
208
293
  //#region src/components/Banner/Banner.tsx
209
294
  /**
@@ -321,43 +406,30 @@ function Banner({ placement: placementId, classname = "", interaction, referralT
321
406
  ]);
322
407
  if (!mode || !isPreview && (!shouldRender || isHidden || dismissed)) return null;
323
408
  const bannerClass = [
324
- mode === "inapp" ? inapp : referral,
409
+ referral,
325
410
  "frak-banner",
326
411
  `frak-banner--${mode}`,
327
412
  classname
328
413
  ].filter(Boolean).join(" ");
329
- if (mode === "inapp") return /* @__PURE__ */ jsxs("div", {
330
- class: bannerClass,
331
- role: "alert",
332
- children: [
333
- /* @__PURE__ */ jsxs("div", {
334
- class: inappHeader,
335
- children: [/* @__PURE__ */ jsx("span", {
336
- class: `${inappIconWrapper} frak-banner__icon`,
337
- children: /* @__PURE__ */ jsx(WarningIcon, {})
338
- }), /* @__PURE__ */ jsx("p", {
339
- class: `${inappTitle} frak-banner__title`,
340
- children: texts.title
341
- })]
342
- }),
343
- /* @__PURE__ */ jsx("p", {
344
- class: `${inappDescription} frak-banner__description`,
345
- children: texts.description
346
- }),
347
- /* @__PURE__ */ jsxs("button", {
348
- type: "button",
349
- class: `${inappCta} frak-banner__cta`,
350
- onClick: handleAction,
351
- children: [texts.cta, /* @__PURE__ */ jsx(ExternalLinkIcon, {})]
352
- }),
353
- /* @__PURE__ */ jsx("button", {
354
- type: "button",
355
- class: `${inappClose} frak-banner__close`,
356
- onClick: handleDismiss,
357
- "aria-label": "Dismiss",
358
- children: /* @__PURE__ */ jsx(CloseIcon, {})
359
- })
360
- ]
414
+ if (mode === "inapp") return /* @__PURE__ */ jsx(InAppBanner, {
415
+ title: texts.title,
416
+ description: texts.description,
417
+ cta: texts.cta,
418
+ dismissLabel: "Dismiss",
419
+ onAction: handleAction,
420
+ onDismiss: handleDismiss,
421
+ className: [
422
+ "frak-banner",
423
+ "frak-banner--inapp",
424
+ classname
425
+ ].filter(Boolean).join(" "),
426
+ classNames: {
427
+ icon: "frak-banner__icon",
428
+ title: "frak-banner__title",
429
+ description: "frak-banner__description",
430
+ cta: "frak-banner__cta",
431
+ close: "frak-banner__close"
432
+ }
361
433
  });
362
434
  return /* @__PURE__ */ jsxs("div", {
363
435
  class: bannerClass,
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "url": "https://twitter.com/QNivelais"
12
12
  }
13
13
  ],
14
- "version": "0.0.26-beta.21f77a40",
14
+ "version": "0.0.26-beta.34e9c815",
15
15
  "description": "Frak Wallet components, helping any person to interact with the Frak wallet.",
16
16
  "repository": {
17
17
  "url": "https://github.com/frak-id/wallet",
@@ -86,8 +86,8 @@
86
86
  "publish": "echo 'Publishing components...'"
87
87
  },
88
88
  "dependencies": {
89
- "@frak-labs/core-sdk": "0.2.1-beta.21f77a40",
90
- "@frak-labs/frame-connector": "0.2.0-beta.21f77a40",
89
+ "@frak-labs/core-sdk": "0.2.1-beta.34e9c815",
90
+ "@frak-labs/frame-connector": "0.2.0-beta.34e9c815",
91
91
  "preact": "^10.29.0",
92
92
  "preact-custom-element": "^4.6.0",
93
93
  "@frak-labs/design-system": "0.0.0"