@apptify-labs/ui 1.0.0

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.
Files changed (88) hide show
  1. package/.storybook/main.ts +27 -0
  2. package/.storybook/preview.tsx +15 -0
  3. package/.turbo/turbo-build.log +19 -0
  4. package/README.md +107 -0
  5. package/STORYBOOK.md +112 -0
  6. package/dist/index.d.mts +33 -0
  7. package/dist/index.d.ts +33 -0
  8. package/dist/index.js +182 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/index.mjs +136 -0
  11. package/dist/index.mjs.map +1 -0
  12. package/package.json +63 -0
  13. package/postcss.config.js +6 -0
  14. package/src/components/card/card.stories.tsx +38 -0
  15. package/src/components/card/card.tsx +75 -0
  16. package/src/components/card/index.ts +1 -0
  17. package/src/components/input/index.ts +1 -0
  18. package/src/components/input/input.stories.tsx +40 -0
  19. package/src/components/input/input.tsx +24 -0
  20. package/src/components/label/index.ts +1 -0
  21. package/src/components/label/label.stories.tsx +22 -0
  22. package/src/components/label/label.tsx +23 -0
  23. package/src/components/separator/index.ts +1 -0
  24. package/src/components/separator/separator.stories.tsx +36 -0
  25. package/src/components/separator/separator.tsx +28 -0
  26. package/src/index.ts +5 -0
  27. package/src/styles.css +69 -0
  28. package/src/utils/cn.ts +14 -0
  29. package/src/utils/index.ts +1 -0
  30. package/storybook-static/assets/Color-YHDXOIA2-kSxZo1Vy.js +1 -0
  31. package/storybook-static/assets/DocsRenderer-CFRXHY34-DsDoVbDP.js +575 -0
  32. package/storybook-static/assets/card.stories-1IXkTbkW.js +20 -0
  33. package/storybook-static/assets/chunk-XP5HYGXS-rhzvizV_.js +1 -0
  34. package/storybook-static/assets/client-CN6oaCdP.js +33 -0
  35. package/storybook-static/assets/entry-preview-Ct7_9bu-.js +2 -0
  36. package/storybook-static/assets/entry-preview-docs-pv-Qwe_M.js +46 -0
  37. package/storybook-static/assets/iframe-CbRAOl5a.js +211 -0
  38. package/storybook-static/assets/index-B3ijS-tw.js +11 -0
  39. package/storybook-static/assets/index-DH-M5T-F.js +240 -0
  40. package/storybook-static/assets/index-DHO77v_d.js +1 -0
  41. package/storybook-static/assets/index-DrFu-skq.js +6 -0
  42. package/storybook-static/assets/index-DzGJhHoF.js +9 -0
  43. package/storybook-static/assets/jsx-runtime-D_zvdyIk.js +9 -0
  44. package/storybook-static/assets/preview-B8lJiyuQ.js +34 -0
  45. package/storybook-static/assets/preview-BBWR9nbA.js +1 -0
  46. package/storybook-static/assets/preview-BIuR4HGU.js +240 -0
  47. package/storybook-static/assets/preview-BWzBA1C2.js +396 -0
  48. package/storybook-static/assets/preview-B_o1KE33.css +1 -0
  49. package/storybook-static/assets/preview-CM32KvaH.js +1 -0
  50. package/storybook-static/assets/preview-CvbIS5ZJ.js +1 -0
  51. package/storybook-static/assets/preview-Cy3uZJAu.js +2 -0
  52. package/storybook-static/assets/preview-DD_OYowb.js +1 -0
  53. package/storybook-static/assets/preview-DGUiP6tS.js +7 -0
  54. package/storybook-static/assets/preview-DHQbi4pV.js +1 -0
  55. package/storybook-static/assets/react-18-BeIp0fAf.js +1 -0
  56. package/storybook-static/assets/test-utils-BxnH6twK.js +9 -0
  57. package/storybook-static/favicon.svg +1 -0
  58. package/storybook-static/iframe.html +666 -0
  59. package/storybook-static/index.html +177 -0
  60. package/storybook-static/index.json +1 -0
  61. package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
  62. package/storybook-static/nunito-sans-bold.woff2 +0 -0
  63. package/storybook-static/nunito-sans-italic.woff2 +0 -0
  64. package/storybook-static/nunito-sans-regular.woff2 +0 -0
  65. package/storybook-static/project.json +1 -0
  66. package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +3 -0
  67. package/storybook-static/sb-addons/essentials-backgrounds-5/manager-bundle.js +12 -0
  68. package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +405 -0
  69. package/storybook-static/sb-addons/essentials-docs-4/manager-bundle.js +245 -0
  70. package/storybook-static/sb-addons/essentials-measure-8/manager-bundle.js +3 -0
  71. package/storybook-static/sb-addons/essentials-outline-9/manager-bundle.js +3 -0
  72. package/storybook-static/sb-addons/essentials-toolbars-7/manager-bundle.js +3 -0
  73. package/storybook-static/sb-addons/essentials-viewport-6/manager-bundle.js +3 -0
  74. package/storybook-static/sb-addons/interactions-10/manager-bundle.js +222 -0
  75. package/storybook-static/sb-addons/links-1/manager-bundle.js +3 -0
  76. package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
  77. package/storybook-static/sb-common-assets/favicon.svg +1 -0
  78. package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  79. package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  80. package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  81. package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  82. package/storybook-static/sb-manager/globals-module-info.js +1052 -0
  83. package/storybook-static/sb-manager/globals-runtime.js +41775 -0
  84. package/storybook-static/sb-manager/globals.js +48 -0
  85. package/storybook-static/sb-manager/runtime.js +12048 -0
  86. package/tailwind.config.js +103 -0
  87. package/tsconfig.json +21 -0
  88. package/tsup.config.ts +12 -0
@@ -0,0 +1 @@
1
+ import{R as e}from"./index-DzGJhHoF.js";const o={},c=e.createContext(o);function u(n){const t=e.useContext(c);return e.useMemo(function(){return typeof n=="function"?n(t):{...t,...n}},[t,n])}function m(n){let t;return n.disableParentContext?t=typeof n.components=="function"?n.components(o):n.components||o:t=u(n.components),e.createElement(c.Provider,{value:t},n.children)}export{m as MDXProvider,u as useMDXComponents};
@@ -0,0 +1,6 @@
1
+ function l(o){for(var f=[],i=1;i<arguments.length;i++)f[i-1]=arguments[i];var n=Array.from(typeof o=="string"?[o]:o);n[n.length-1]=n[n.length-1].replace(/\r?\n([\t ]*)$/,"");var s=n.reduce(function(t,g){var a=g.match(/\n([\t ]+|(?!\s).)/g);return a?t.concat(a.map(function(u){var r,e;return(e=(r=u.match(/[\t ]/g))===null||r===void 0?void 0:r.length)!==null&&e!==void 0?e:0})):t},[]);if(s.length){var d=new RegExp(`
2
+ [ ]{`+Math.min.apply(Math,s)+"}","g");n=n.map(function(t){return t.replace(d,`
3
+ `)})}n[0]=n[0].replace(/^\r?\n/,"");var c=n[0];return f.forEach(function(t,g){var a=c.match(/(?:^|\n)( *)$/),u=a?a[1]:"",r=t;typeof t=="string"&&t.includes(`
4
+ `)&&(r=String(t).split(`
5
+ `).map(function(e,h){return h===0?e:""+u+e}).join(`
6
+ `)),c+=r+n[g+1]}),c}export{l as d};
@@ -0,0 +1,9 @@
1
+ function V(p,T){for(var v=0;v<T.length;v++){const l=T[v];if(typeof l!="string"&&!Array.isArray(l)){for(const _ in l)if(_!=="default"&&!(_ in p)){const R=Object.getOwnPropertyDescriptor(l,_);R&&Object.defineProperty(p,_,R.get?R:{enumerable:!0,get:()=>l[_]})}}}return Object.freeze(Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}))}function F(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}var h={exports:{}},r={};/**
2
+ * @license React
3
+ * react.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var k;function tt(){if(k)return r;k=1;var p=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),U=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),z=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),j=Symbol.iterator;function K(t){return t===null||typeof t!="object"?null:(t=j&&t[j]||t["@@iterator"],typeof t=="function"?t:null)}var P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},H=Object.assign,$={};function y(t,e,u){this.props=t,this.context=e,this.refs=$,this.updater=u||P}y.prototype.isReactComponent={},y.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")},y.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function N(){}N.prototype=y.prototype;function C(t,e,u){this.props=t,this.context=e,this.refs=$,this.updater=u||P}var d=C.prototype=new N;d.constructor=C,H(d,y.prototype),d.isPureReactComponent=!0;var M=Array.isArray;function g(){}var f={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function A(t,e,u){var n=u.ref;return{$$typeof:p,type:t,key:e,ref:n!==void 0?n:null,props:u}}function B(t,e){return A(t.type,e,t.props)}function S(t){return typeof t=="object"&&t!==null&&t.$$typeof===p}function W(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(u){return e[u]})}var b=/\/+/g;function O(t,e){return typeof t=="object"&&t!==null&&t.key!=null?W(""+t.key):e.toString(36)}function Q(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(g,g):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function E(t,e,u,n,o){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var i=!1;if(t===null)i=!0;else switch(s){case"bigint":case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case p:case T:i=!0;break;case w:return i=t._init,E(i(t._payload),e,u,n,o)}}if(i)return o=o(t),i=n===""?"."+O(t,0):n,M(o)?(u="",i!=null&&(u=i.replace(b,"$&/")+"/"),E(o,e,u,"",function(J){return J})):o!=null&&(S(o)&&(o=B(o,u+(o.key==null||t&&t.key===o.key?"":(""+o.key).replace(b,"$&/")+"/")+i)),e.push(o)),1;i=0;var a=n===""?".":n+":";if(M(t))for(var c=0;c<t.length;c++)n=t[c],s=a+O(n,c),i+=E(n,e,u,s,o);else if(c=K(t),typeof c=="function")for(t=c.call(t),c=0;!(n=t.next()).done;)n=n.value,s=a+O(n,c++),i+=E(n,e,u,s,o);else if(s==="object"){if(typeof t.then=="function")return E(Q(t),e,u,n,o);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return i}function m(t,e,u){if(t==null)return t;var n=[],o=0;return E(t,n,"","",function(s){return e.call(u,s,o++)}),n}function X(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(u){(t._status===0||t._status===-1)&&(t._status=1,t._result=u)},function(u){(t._status===0||t._status===-1)&&(t._status=2,t._result=u)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var I=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Z={map:m,forEach:function(t,e,u){m(t,function(){e.apply(this,arguments)},u)},count:function(t){var e=0;return m(t,function(){e++}),e},toArray:function(t){return m(t,function(e){return e})||[]},only:function(t){if(!S(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};return r.Activity=G,r.Children=Z,r.Component=y,r.Fragment=v,r.Profiler=_,r.PureComponent=C,r.StrictMode=l,r.Suspense=q,r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=f,r.__COMPILER_RUNTIME={__proto__:null,c:function(t){return f.H.useMemoCache(t)}},r.cache=function(t){return function(){return t.apply(null,arguments)}},r.cacheSignal=function(){return null},r.cloneElement=function(t,e,u){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var n=H({},t.props),o=t.key;if(e!=null)for(s in e.key!==void 0&&(o=""+e.key),e)!Y.call(e,s)||s==="key"||s==="__self"||s==="__source"||s==="ref"&&e.ref===void 0||(n[s]=e[s]);var s=arguments.length-2;if(s===1)n.children=u;else if(1<s){for(var i=Array(s),a=0;a<s;a++)i[a]=arguments[a+2];n.children=i}return A(t.type,o,n)},r.createContext=function(t){return t={$$typeof:U,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:R,_context:t},t},r.createElement=function(t,e,u){var n,o={},s=null;if(e!=null)for(n in e.key!==void 0&&(s=""+e.key),e)Y.call(e,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(o[n]=e[n]);var i=arguments.length-2;if(i===1)o.children=u;else if(1<i){for(var a=Array(i),c=0;c<i;c++)a[c]=arguments[c+2];o.children=a}if(t&&t.defaultProps)for(n in i=t.defaultProps,i)o[n]===void 0&&(o[n]=i[n]);return A(t,s,o)},r.createRef=function(){return{current:null}},r.forwardRef=function(t){return{$$typeof:D,render:t}},r.isValidElement=S,r.lazy=function(t){return{$$typeof:w,_payload:{_status:-1,_result:t},_init:X}},r.memo=function(t,e){return{$$typeof:z,type:t,compare:e===void 0?null:e}},r.startTransition=function(t){var e=f.T,u={};f.T=u;try{var n=t(),o=f.S;o!==null&&o(u,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(g,I)}catch(s){I(s)}finally{e!==null&&u.types!==null&&(e.types=u.types),f.T=e}},r.unstable_useCacheRefresh=function(){return f.H.useCacheRefresh()},r.use=function(t){return f.H.use(t)},r.useActionState=function(t,e,u){return f.H.useActionState(t,e,u)},r.useCallback=function(t,e){return f.H.useCallback(t,e)},r.useContext=function(t){return f.H.useContext(t)},r.useDebugValue=function(){},r.useDeferredValue=function(t,e){return f.H.useDeferredValue(t,e)},r.useEffect=function(t,e){return f.H.useEffect(t,e)},r.useEffectEvent=function(t){return f.H.useEffectEvent(t)},r.useId=function(){return f.H.useId()},r.useImperativeHandle=function(t,e,u){return f.H.useImperativeHandle(t,e,u)},r.useInsertionEffect=function(t,e){return f.H.useInsertionEffect(t,e)},r.useLayoutEffect=function(t,e){return f.H.useLayoutEffect(t,e)},r.useMemo=function(t,e){return f.H.useMemo(t,e)},r.useOptimistic=function(t,e){return f.H.useOptimistic(t,e)},r.useReducer=function(t,e,u){return f.H.useReducer(t,e,u)},r.useRef=function(t){return f.H.useRef(t)},r.useState=function(t){return f.H.useState(t)},r.useSyncExternalStore=function(t,e,u){return f.H.useSyncExternalStore(t,e,u)},r.useTransition=function(){return f.H.useTransition()},r.version="19.2.6",r}var L;function et(){return L||(L=1,h.exports=tt()),h.exports}var x=et();const rt=F(x),nt=V({__proto__:null,default:rt},[x]);export{rt as R,et as a,F as g,nt as o,x as r};
@@ -0,0 +1,9 @@
1
+ var s={exports:{}},e={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var o;function d(){if(o)return e;o=1;var R=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(v,r,t){var u=null;if(t!==void 0&&(u=""+t),r.key!==void 0&&(u=""+r.key),"key"in r){t={};for(var n in r)n!=="key"&&(t[n]=r[n])}else t=r;return r=t.ref,{$$typeof:R,type:v,key:u,ref:r!==void 0?r:null,props:t}}return e.Fragment=a,e.jsx=i,e.jsxs=i,e}var x;function l(){return x||(x=1,s.exports=d()),s.exports}var p=l();export{p as j};
@@ -0,0 +1,34 @@
1
+ import{d as P}from"./index-DrFu-skq.js";const{useEffect:_,useMemo:h}=__STORYBOOK_MODULE_PREVIEW_API__,{global:j}=__STORYBOOK_MODULE_GLOBAL__,{logger:X}=__STORYBOOK_MODULE_CLIENT_LOGGER__;var p="backgrounds",U={light:{name:"light",value:"#F8F8F8"},dark:{name:"dark",value:"#333"}},{document:b,window:O}=j,D=()=>{var r;return!!((r=O==null?void 0:O.matchMedia("(prefers-reduced-motion: reduce)"))!=null&&r.matches)},A=r=>{(Array.isArray(r)?r:[r]).forEach(N)},N=r=>{var t;let e=b.getElementById(r);e&&((t=e.parentElement)==null||t.removeChild(e))},F=(r,e)=>{let t=b.getElementById(r);if(t)t.innerHTML!==e&&(t.innerHTML=e);else{let o=b.createElement("style");o.setAttribute("id",r),o.innerHTML=e,b.head.appendChild(o)}},Y=(r,e,t)=>{var a;let o=b.getElementById(r);if(o)o.innerHTML!==e&&(o.innerHTML=e);else{let d=b.createElement("style");d.setAttribute("id",r),d.innerHTML=e;let i=`addon-backgrounds-grid${t?`-docs-${t}`:""}`,n=b.getElementById(i);n?(a=n.parentElement)==null||a.insertBefore(d,n):b.head.appendChild(d)}},W={cellSize:100,cellAmount:10,opacity:.8},w="addon-backgrounds",R="addon-backgrounds-grid",q=D()?"":"transition: background-color 0.3s;",J=(r,e)=>{let{globals:t,parameters:o,viewMode:a,id:d}=e,{options:i=U,disable:n,grid:s=W}=o[p]||{},c=t[p]||{},u=c.value,l=u?i[u]:void 0,$=(l==null?void 0:l.value)||"transparent",f=c.grid||!1,y=!!l&&!n,m=a==="docs"?`#anchor--${d} .docs-story`:".sb-show-main",E=a==="docs"?`#anchor--${d} .docs-story`:".sb-show-main",H=o.layout===void 0||o.layout==="padded",L=a==="docs"?20:H?16:0,{cellAmount:k,cellSize:g,opacity:x,offsetX:v=L,offsetY:S=L}=s,B=a==="docs"?`${w}-docs-${d}`:`${w}-color`,G=a==="docs"?d:null;_(()=>{let M=`
2
+ ${m} {
3
+ background: ${$} !important;
4
+ ${q}
5
+ }`;if(!y){A(B);return}Y(B,M,G)},[m,B,G,y,$]);let T=a==="docs"?`${R}-docs-${d}`:`${R}`;return _(()=>{if(!f){A(T);return}let M=[`${g*k}px ${g*k}px`,`${g*k}px ${g*k}px`,`${g}px ${g}px`,`${g}px ${g}px`].join(", "),K=`
6
+ ${E} {
7
+ background-size: ${M} !important;
8
+ background-position: ${v}px ${S}px, ${v}px ${S}px, ${v}px ${S}px, ${v}px ${S}px !important;
9
+ background-blend-mode: difference !important;
10
+ background-image: linear-gradient(rgba(130, 130, 130, ${x}) 1px, transparent 1px),
11
+ linear-gradient(90deg, rgba(130, 130, 130, ${x}) 1px, transparent 1px),
12
+ linear-gradient(rgba(130, 130, 130, ${x/2}) 1px, transparent 1px),
13
+ linear-gradient(90deg, rgba(130, 130, 130, ${x/2}) 1px, transparent 1px) !important;
14
+ }
15
+ `;F(T,K)},[k,g,E,T,f,v,S,x]),r()},Q=(r,e=[],t)=>{if(r==="transparent")return"transparent";if(e.find(a=>a.value===r)||r)return r;let o=e.find(a=>a.name===t);if(o)return o.value;if(t){let a=e.map(d=>d.name).join(", ");X.warn(P`
16
+ Backgrounds Addon: could not find the default color "${t}".
17
+ These are the available colors for your story based on your configuration:
18
+ ${a}.
19
+ `)}return"transparent"},Z=(r,e)=>{var u;let{globals:t,parameters:o}=e,a=(u=t[p])==null?void 0:u.value,d=o[p],i=h(()=>d.disable?"transparent":Q(a,d.values,d.default),[d,a]),n=h(()=>i&&i!=="transparent",[i]),s=e.viewMode==="docs"?`#anchor--${e.id} .docs-story`:".sb-show-main",c=h(()=>`
20
+ ${s} {
21
+ background: ${i} !important;
22
+ ${D()?"":"transition: background-color 0.3s;"}
23
+ }
24
+ `,[i,s]);return _(()=>{let l=e.viewMode==="docs"?`addon-backgrounds-docs-${e.id}`:"addon-backgrounds-color";if(!n){A(l);return}Y(l,c,e.viewMode==="docs"?e.id:null)},[n,c,e]),r()},V=(r,e)=>{var y;let{globals:t,parameters:o}=e,a=o[p].grid,d=((y=t[p])==null?void 0:y.grid)===!0&&a.disable!==!0,{cellAmount:i,cellSize:n,opacity:s}=a,c=e.viewMode==="docs",u=o.layout===void 0||o.layout==="padded"?16:0,l=a.offsetX??(c?20:u),$=a.offsetY??(c?20:u),f=h(()=>{let m=e.viewMode==="docs"?`#anchor--${e.id} .docs-story`:".sb-show-main",E=[`${n*i}px ${n*i}px`,`${n*i}px ${n*i}px`,`${n}px ${n}px`,`${n}px ${n}px`].join(", ");return`
25
+ ${m} {
26
+ background-size: ${E} !important;
27
+ background-position: ${l}px ${$}px, ${l}px ${$}px, ${l}px ${$}px, ${l}px ${$}px !important;
28
+ background-blend-mode: difference !important;
29
+ background-image: linear-gradient(rgba(130, 130, 130, ${s}) 1px, transparent 1px),
30
+ linear-gradient(90deg, rgba(130, 130, 130, ${s}) 1px, transparent 1px),
31
+ linear-gradient(rgba(130, 130, 130, ${s/2}) 1px, transparent 1px),
32
+ linear-gradient(90deg, rgba(130, 130, 130, ${s/2}) 1px, transparent 1px) !important;
33
+ }
34
+ `},[n]);return _(()=>{let m=e.viewMode==="docs"?`addon-backgrounds-grid-docs-${e.id}`:"addon-backgrounds-grid";if(!d){A(m);return}F(m,f)},[d,f,e]),r()},C,ae=(C=globalThis.FEATURES)!=null&&C.backgroundsStoryGlobals?[J]:[V,Z],I,oe={[p]:{grid:{cellSize:20,opacity:.5,cellAmount:5},disable:!1,...!((I=globalThis.FEATURES)!=null&&I.backgroundsStoryGlobals)&&{values:Object.values(U)}}},ee={[p]:{value:void 0,grid:!1}},z,de=(z=globalThis.FEATURES)!=null&&z.backgroundsStoryGlobals?ee:{[p]:null};export{ae as decorators,de as initialGlobals,oe as parameters};
@@ -0,0 +1 @@
1
+ var j="Invariant failed";function S(e,t){if(!e)throw new Error(j)}const{useEffect:T}=__STORYBOOK_MODULE_PREVIEW_API__,{global:d}=__STORYBOOK_MODULE_GLOBAL__;var K="measureEnabled";function Y(){let e=d.document.documentElement,t=Math.max(e.scrollHeight,e.offsetHeight);return{width:Math.max(e.scrollWidth,e.offsetWidth),height:t}}function G(){let e=d.document.createElement("canvas");e.id="storybook-addon-measure";let t=e.getContext("2d");S(t!=null);let{width:o,height:l}=Y();return A(e,t,{width:o,height:l}),e.style.position="absolute",e.style.left="0",e.style.top="0",e.style.zIndex="2147483647",e.style.pointerEvents="none",d.document.body.appendChild(e),{canvas:e,context:t,width:o,height:l}}function A(e,t,{width:o,height:l}){e.style.width=`${o}px`,e.style.height=`${l}px`;let i=d.window.devicePixelRatio;e.width=Math.floor(o*i),e.height=Math.floor(l*i),t.scale(i,i)}var h={};function U(){h.canvas||(h=G())}function H(){h.context&&h.context.clearRect(0,0,h.width??0,h.height??0)}function V(e){H(),e(h.context)}function Z(){S(h.canvas),S(h.context),A(h.canvas,h.context,{width:0,height:0});let{width:e,height:t}=Y();A(h.canvas,h.context,{width:e,height:t}),h.width=e,h.height=t}function J(){var e;h.canvas&&(H(),(e=h.canvas.parentNode)==null||e.removeChild(h.canvas),h={})}var w={margin:"#f6b26b",border:"#ffe599",padding:"#93c47d",content:"#6fa8dc",text:"#232020"},c=6;function W(e,{x:t,y:o,w:l,h:i,r:n}){t=t-l/2,o=o-i/2,l<2*n&&(n=l/2),i<2*n&&(n=i/2),e.beginPath(),e.moveTo(t+n,o),e.arcTo(t+l,o,t+l,o+i,n),e.arcTo(t+l,o+i,t,o+i,n),e.arcTo(t,o+i,t,o,n),e.arcTo(t,o,t+l,o,n),e.closePath()}function Q(e,{padding:t,border:o,width:l,height:i,top:n,left:r}){let f=l-o.left-o.right-t.left-t.right,a=i-t.top-t.bottom-o.top-o.bottom,s=r+o.left+t.left,u=n+o.top+t.top;return e==="top"?s+=f/2:e==="right"?(s+=f,u+=a/2):e==="bottom"?(s+=f/2,u+=a):e==="left"?u+=a/2:e==="center"&&(s+=f/2,u+=a/2),{x:s,y:u}}function x(e,t,{margin:o,border:l,padding:i},n,r){let f=m=>0,a=0,s=0,u=r?1:.5,g=r?n*2:0;return e==="padding"?f=m=>i[m]*u+g:e==="border"?f=m=>i[m]+l[m]*u+g:e==="margin"&&(f=m=>i[m]+l[m]+o[m]*u+g),t==="top"?s=-f("top"):t==="right"?a=f("right"):t==="bottom"?s=f("bottom"):t==="left"&&(a=-f("left")),{offsetX:a,offsetY:s}}function tt(e,t){return Math.abs(e.x-t.x)<Math.abs(e.w+t.w)/2&&Math.abs(e.y-t.y)<Math.abs(e.h+t.h)/2}function et(e,t,o){return e==="top"?t.y=o.y-o.h-c:e==="right"?t.x=o.x+o.w/2+c+t.w/2:e==="bottom"?t.y=o.y+o.h+c:e==="left"&&(t.x=o.x-o.w/2-c-t.w/2),{x:t.x,y:t.y}}function X(e,t,{x:o,y:l,w:i,h:n},r){return W(e,{x:o,y:l,w:i,h:n,r:3}),e.fillStyle=`${w[t]}dd`,e.fill(),e.strokeStyle=w[t],e.stroke(),e.fillStyle=w.text,e.fillText(r,o,l),W(e,{x:o,y:l,w:i,h:n,r:3}),e.fillStyle=`${w[t]}dd`,e.fill(),e.strokeStyle=w[t],e.stroke(),e.fillStyle=w.text,e.fillText(r,o,l),{x:o,y:l,w:i,h:n}}function C(e,t){e.font="600 12px monospace",e.textBaseline="middle",e.textAlign="center";let o=e.measureText(t),l=o.actualBoundingBoxAscent+o.actualBoundingBoxDescent,i=o.width+c*2,n=l+c*2;return{w:i,h:n}}function ot(e,t,{type:o,position:l="center",text:i},n,r=!1){let{x:f,y:a}=Q(l,t),{offsetX:s,offsetY:u}=x(o,l,t,c+1,r);f+=s,a+=u;let{w:g,h:m}=C(e,i);if(n&&tt({x:f,y:a,w:g,h:m},n)){let v=et(l,{x:f,y:a,w:g},n);f=v.x,a=v.y}return X(e,o,{x:f,y:a,w:g,h:m},i)}function it(e,{w:t,h:o}){let l=t*.5+c,i=o*.5+c;return{offsetX:(e.x==="left"?-1:1)*l,offsetY:(e.y==="top"?-1:1)*i}}function lt(e,t,{type:o,text:l}){let{floatingAlignment:i,extremities:n}=t,r=n[i.x],f=n[i.y],{w:a,h:s}=C(e,l),{offsetX:u,offsetY:g}=it(i,{w:a,h:s});return r+=u,f+=g,X(e,o,{x:r,y:f,w:a,h:s},l)}function E(e,t,o,l){let i=[];o.forEach((n,r)=>{let f=l&&n.position==="center"?lt(e,t,n):ot(e,t,n,i[r-1],l);i[r]=f})}function nt(e,t,o,l){let i=o.reduce((n,r)=>{var f;return Object.prototype.hasOwnProperty.call(n,r.position)||(n[r.position]=[]),(f=n[r.position])==null||f.push(r),n},{});i.top&&E(e,t,i.top,l),i.right&&E(e,t,i.right,l),i.bottom&&E(e,t,i.bottom,l),i.left&&E(e,t,i.left,l),i.center&&E(e,t,i.center,l)}var L={margin:"#f6b26ba8",border:"#ffe599a8",padding:"#93c47d8c",content:"#6fa8dca8"},B=30;function p(e){return parseInt(e.replace("px",""),10)}function b(e){return Number.isInteger(e)?e:e.toFixed(2)}function P(e){return e.filter(t=>t.text!==0&&t.text!=="0")}function ft(e){let t={top:d.window.scrollY,bottom:d.window.scrollY+d.window.innerHeight,left:d.window.scrollX,right:d.window.scrollX+d.window.innerWidth},o={top:Math.abs(t.top-e.top),bottom:Math.abs(t.bottom-e.bottom),left:Math.abs(t.left-e.left),right:Math.abs(t.right-e.right)};return{x:o.left>o.right?"left":"right",y:o.top>o.bottom?"top":"bottom"}}function rt(e){let t=d.getComputedStyle(e),{top:o,left:l,right:i,bottom:n,width:r,height:f}=e.getBoundingClientRect(),{marginTop:a,marginBottom:s,marginLeft:u,marginRight:g,paddingTop:m,paddingBottom:v,paddingLeft:k,paddingRight:F,borderBottomWidth:I,borderTopWidth:D,borderLeftWidth:$,borderRightWidth:N}=t;o=o+d.window.scrollY,l=l+d.window.scrollX,n=n+d.window.scrollY,i=i+d.window.scrollX;let y={top:p(a),bottom:p(s),left:p(u),right:p(g)},q={top:p(m),bottom:p(v),left:p(k),right:p(F)},z={top:p(D),bottom:p(I),left:p($),right:p(N)},_={top:o-y.top,bottom:n+y.bottom,left:l-y.left,right:i+y.right};return{margin:y,padding:q,border:z,top:o,left:l,bottom:n,right:i,width:r,height:f,extremities:_,floatingAlignment:ft(_)}}function at(e,{margin:t,width:o,height:l,top:i,left:n,bottom:r,right:f}){let a=l+t.bottom+t.top;e.fillStyle=L.margin,e.fillRect(n,i-t.top,o,t.top),e.fillRect(f,i-t.top,t.right,a),e.fillRect(n,r,o,t.bottom),e.fillRect(n-t.left,i-t.top,t.left,a);let s=[{type:"margin",text:b(t.top),position:"top"},{type:"margin",text:b(t.right),position:"right"},{type:"margin",text:b(t.bottom),position:"bottom"},{type:"margin",text:b(t.left),position:"left"}];return P(s)}function st(e,{padding:t,border:o,width:l,height:i,top:n,left:r,bottom:f,right:a}){let s=l-o.left-o.right,u=i-t.top-t.bottom-o.top-o.bottom;e.fillStyle=L.padding,e.fillRect(r+o.left,n+o.top,s,t.top),e.fillRect(a-t.right-o.right,n+t.top+o.top,t.right,u),e.fillRect(r+o.left,f-t.bottom-o.bottom,s,t.bottom),e.fillRect(r+o.left,n+t.top+o.top,t.left,u);let g=[{type:"padding",text:t.top,position:"top"},{type:"padding",text:t.right,position:"right"},{type:"padding",text:t.bottom,position:"bottom"},{type:"padding",text:t.left,position:"left"}];return P(g)}function ht(e,{border:t,width:o,height:l,top:i,left:n,bottom:r,right:f}){let a=l-t.top-t.bottom;e.fillStyle=L.border,e.fillRect(n,i,o,t.top),e.fillRect(n,r-t.bottom,o,t.bottom),e.fillRect(n,i+t.top,t.left,a),e.fillRect(f-t.right,i+t.top,t.right,a);let s=[{type:"border",text:t.top,position:"top"},{type:"border",text:t.right,position:"right"},{type:"border",text:t.bottom,position:"bottom"},{type:"border",text:t.left,position:"left"}];return P(s)}function ut(e,{padding:t,border:o,width:l,height:i,top:n,left:r}){let f=l-o.left-o.right-t.left-t.right,a=i-t.top-t.bottom-o.top-o.bottom;return e.fillStyle=L.content,e.fillRect(r+o.left+t.left,n+o.top+t.top,f,a),[{type:"content",position:"center",text:`${b(f)} x ${b(a)}`}]}function dt(e){return t=>{if(e&&t){let o=rt(e),l=at(t,o),i=st(t,o),n=ht(t,o),r=ut(t,o),f=o.width<=B*3||o.height<=B;nt(t,o,[...r,...i,...n,...l],f)}}}function mt(e){V(dt(e))}var gt=(e,t)=>{let o=d.document.elementFromPoint(e,t),l=i=>{if(i&&i.shadowRoot){let n=i.shadowRoot.elementFromPoint(e,t);return i.isEqualNode(n)?i:n.shadowRoot?l(n):n}return i};return l(o)||o},O,M={x:0,y:0};function R(e,t){O=gt(e,t),mt(O)}var pt=(e,t)=>{let{measureEnabled:o}=t.globals;return T(()=>{let l=i=>{window.requestAnimationFrame(()=>{i.stopPropagation(),M.x=i.clientX,M.y=i.clientY})};return document.addEventListener("pointermove",l),()=>{document.removeEventListener("pointermove",l)}},[]),T(()=>{let l=n=>{window.requestAnimationFrame(()=>{n.stopPropagation(),R(n.clientX,n.clientY)})},i=()=>{window.requestAnimationFrame(()=>{Z()})};return t.viewMode==="story"&&o&&(document.addEventListener("pointerover",l),U(),window.addEventListener("resize",i),R(M.x,M.y)),()=>{window.removeEventListener("resize",i),J()}},[o,t.viewMode]),e()},ct=[pt],wt={[K]:!1};export{ct as decorators,wt as initialGlobals};