reactoms
Version:
A React Components Library made with TypeScript, Sass, Vite & Atomic Design : Card, Collapse, Icon, Image, Link, List for Atoms & Button, Footer, Gallery, Navbar, Slider, Title for Molecules
35 lines (32 loc) • 17.7 kB
JavaScript
(function(m,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],T):(m=typeof globalThis<"u"?globalThis:m||self,T(m["react-beautiful-timeline"]={},m.React))})(this,function(m,T){"use strict";var z={exports:{}},L={};/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var le;function Ne(){if(le)return L;le=1;var l=T,o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,v=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,y={key:!0,ref:!0,__self:!0,__source:!0};function k(x,b,O){var E,g={},P=null,B=null;O!==void 0&&(P=""+O),b.key!==void 0&&(P=""+b.key),b.ref!==void 0&&(B=b.ref);for(E in b)d.call(b,E)&&!y.hasOwnProperty(E)&&(g[E]=b[E]);if(x&&x.defaultProps)for(E in b=x.defaultProps,b)g[E]===void 0&&(g[E]=b[E]);return{$$typeof:o,type:x,key:P,ref:B,props:g,_owner:v.current}}return L.Fragment=i,L.jsx=k,L.jsxs=k,L}var W={};/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ce;function Le(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&function(){var l=T,o=Symbol.for("react.element"),i=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),x=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),B=Symbol.for("react.offscreen"),fe=Symbol.iterator,Ue="@@iterator";function Be(e){if(e===null||typeof e!="object")return null;var r=fe&&e[fe]||e[Ue];return typeof r=="function"?r:null}var D=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function R(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];He("error",e,t)}}function He(e,r,t){{var a=D.ReactDebugCurrentFrame,c=a.getStackAddendum();c!==""&&(r+="%s",t=t.concat([c]));var f=t.map(function(u){return String(u)});f.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,f)}}var Ke=!1,Ge=!1,Je=!1,ze=!1,Xe=!1,de;de=Symbol.for("react.module.reference");function qe(e){return!!(typeof e=="string"||typeof e=="function"||e===d||e===y||Xe||e===v||e===O||e===E||ze||e===B||Ke||Ge||Je||typeof e=="object"&&e!==null&&(e.$$typeof===P||e.$$typeof===g||e.$$typeof===k||e.$$typeof===x||e.$$typeof===b||e.$$typeof===de||e.getModuleId!==void 0))}function Ze(e,r,t){var a=e.displayName;if(a)return a;var c=r.displayName||r.name||"";return c!==""?t+"("+c+")":t}function ve(e){return e.displayName||"Context"}function w(e){if(e==null)return null;if(typeof e.tag=="number"&&R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case d:return"Fragment";case i:return"Portal";case y:return"Profiler";case v:return"StrictMode";case O:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case x:var r=e;return ve(r)+".Consumer";case k:var t=e;return ve(t._context)+".Provider";case b:return Ze(e,e.render,"ForwardRef");case g:var a=e.displayName||null;return a!==null?a:w(e.type)||"Memo";case P:{var c=e,f=c._payload,u=c._init;try{return w(u(f))}catch{return null}}}return null}var A=Object.assign,V=0,pe,ge,he,ye,me,be,Ee;function Re(){}Re.__reactDisabledLog=!0;function Qe(){{if(V===0){pe=console.log,ge=console.info,he=console.warn,ye=console.error,me=console.group,be=console.groupCollapsed,Ee=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Re,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}V++}}function er(){{if(V--,V===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},e,{value:pe}),info:A({},e,{value:ge}),warn:A({},e,{value:he}),error:A({},e,{value:ye}),group:A({},e,{value:me}),groupCollapsed:A({},e,{value:be}),groupEnd:A({},e,{value:Ee})})}V<0&&R("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ee=D.ReactCurrentDispatcher,re;function H(e,r,t){{if(re===void 0)try{throw Error()}catch(c){var a=c.stack.trim().match(/\n( *(at )?)/);re=a&&a[1]||""}return`
`+re+e}}var te=!1,K;{var rr=typeof WeakMap=="function"?WeakMap:Map;K=new rr}function _e(e,r){if(!e||te)return"";{var t=K.get(e);if(t!==void 0)return t}var a;te=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var f;f=ee.current,ee.current=null,Qe();try{if(r){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(j){a=j}Reflect.construct(e,[],u)}else{try{u.call()}catch(j){a=j}e.call(u.prototype)}}else{try{throw Error()}catch(j){a=j}e()}}catch(j){if(j&&a&&typeof j.stack=="string"){for(var s=j.stack.split(`
`),_=a.stack.split(`
`),p=s.length-1,h=_.length-1;p>=1&&h>=0&&s[p]!==_[h];)h--;for(;p>=1&&h>=0;p--,h--)if(s[p]!==_[h]){if(p!==1||h!==1)do if(p--,h--,h<0||s[p]!==_[h]){var S=`
`+s[p].replace(" at new "," at ");return e.displayName&&S.includes("<anonymous>")&&(S=S.replace("<anonymous>",e.displayName)),typeof e=="function"&&K.set(e,S),S}while(p>=1&&h>=0);break}}}finally{te=!1,ee.current=f,er(),Error.prepareStackTrace=c}var N=e?e.displayName||e.name:"",F=N?H(N):"";return typeof e=="function"&&K.set(e,F),F}function tr(e,r,t){return _e(e,!1)}function nr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function G(e,r,t){if(e==null)return"";if(typeof e=="function")return _e(e,nr(e));if(typeof e=="string")return H(e);switch(e){case O:return H("Suspense");case E:return H("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case b:return tr(e.render);case g:return G(e.type,r,t);case P:{var a=e,c=a._payload,f=a._init;try{return G(f(c),r,t)}catch{}}}return""}var $=Object.prototype.hasOwnProperty,je={},xe=D.ReactDebugCurrentFrame;function J(e){if(e){var r=e._owner,t=G(e.type,e._source,r?r.type:null);xe.setExtraStackFrame(t)}else xe.setExtraStackFrame(null)}function ar(e,r,t,a,c){{var f=Function.call.bind($);for(var u in e)if(f(e,u)){var s=void 0;try{if(typeof e[u]!="function"){var _=Error((a||"React class")+": "+t+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw _.name="Invariant Violation",_}s=e[u](r,u,a,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(p){s=p}s&&!(s instanceof Error)&&(J(c),R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",a||"React class",t,u,typeof s),J(null)),s instanceof Error&&!(s.message in je)&&(je[s.message]=!0,J(c),R("Failed %s type: %s",t,s.message),J(null))}}}var ir=Array.isArray;function ne(e){return ir(e)}function or(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function sr(e){try{return Te(e),!1}catch{return!0}}function Te(e){return""+e}function Se(e){if(sr(e))return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",or(e)),Te(e)}var U=D.ReactCurrentOwner,ur={key:!0,ref:!0,__self:!0,__source:!0},ke,we,ae;ae={};function lr(e){if($.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function cr(e){if($.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function fr(e,r){if(typeof e.ref=="string"&&U.current&&r&&U.current.stateNode!==r){var t=w(U.current.type);ae[t]||(R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',w(U.current.type),e.ref),ae[t]=!0)}}function dr(e,r){{var t=function(){ke||(ke=!0,R("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function vr(e,r){{var t=function(){we||(we=!0,R("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var pr=function(e,r,t,a,c,f,u){var s={$$typeof:o,type:e,key:r,ref:t,props:u,_owner:f};return s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:c}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function gr(e,r,t,a,c){{var f,u={},s=null,_=null;t!==void 0&&(Se(t),s=""+t),cr(r)&&(Se(r.key),s=""+r.key),lr(r)&&(_=r.ref,fr(r,c));for(f in r)$.call(r,f)&&!ur.hasOwnProperty(f)&&(u[f]=r[f]);if(e&&e.defaultProps){var p=e.defaultProps;for(f in p)u[f]===void 0&&(u[f]=p[f])}if(s||_){var h=typeof e=="function"?e.displayName||e.name||"Unknown":e;s&&dr(u,h),_&&vr(u,h)}return pr(e,s,_,c,a,U.current,u)}}var ie=D.ReactCurrentOwner,Oe=D.ReactDebugCurrentFrame;function I(e){if(e){var r=e._owner,t=G(e.type,e._source,r?r.type:null);Oe.setExtraStackFrame(t)}else Oe.setExtraStackFrame(null)}var oe;oe=!1;function se(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function Ce(){{if(ie.current){var e=w(ie.current.type);if(e)return`
Check the render method of \``+e+"`."}return""}}function hr(e){return""}var Pe={};function yr(e){{var r=Ce();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
Check the top-level render call using <`+t+">.")}return r}}function Ae(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=yr(r);if(Pe[t])return;Pe[t]=!0;var a="";e&&e._owner&&e._owner!==ie.current&&(a=" It was passed a child from "+w(e._owner.type)+"."),I(e),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),I(null)}}function Fe(e,r){{if(typeof e!="object")return;if(ne(e))for(var t=0;t<e.length;t++){var a=e[t];se(a)&&Ae(a,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var c=Be(e);if(typeof c=="function"&&c!==e.entries)for(var f=c.call(e),u;!(u=f.next()).done;)se(u.value)&&Ae(u.value,r)}}}function mr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===b||r.$$typeof===g))t=r.propTypes;else return;if(t){var a=w(r);ar(t,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!oe){oe=!0;var c=w(r);R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",c||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function br(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var a=r[t];if(a!=="children"&&a!=="key"){I(e),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),I(null);break}}e.ref!==null&&(I(e),R("Invalid attribute `ref` supplied to `React.Fragment`."),I(null))}}var De={};function Ie(e,r,t,a,c,f){{var u=qe(e);if(!u){var s="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(s+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var _=hr();_?s+=_:s+=Ce();var p;e===null?p="null":ne(e)?p="array":e!==void 0&&e.$$typeof===o?(p="<"+(w(e.type)||"Unknown")+" />",s=" Did you accidentally export a JSX literal instead of a component?"):p=typeof e,R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",p,s)}var h=gr(e,r,t,c,f);if(h==null)return h;if(u){var S=r.children;if(S!==void 0)if(a)if(ne(S)){for(var N=0;N<S.length;N++)Fe(S[N],e);Object.freeze&&Object.freeze(S)}else R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Fe(S,e)}if($.call(r,"key")){var F=w(e),j=Object.keys(r).filter(function(Tr){return Tr!=="key"}),ue=j.length>0?"{key: someKey, "+j.join(": ..., ")+": ...}":"{key: someKey}";if(!De[F+ue]){var xr=j.length>0?"{"+j.join(": ..., ")+": ...}":"{}";R(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,ue,F,xr,F),De[F+ue]=!0}}return e===d?br(h):mr(h),h}}function Er(e,r,t){return Ie(e,r,t,!0)}function Rr(e,r,t){return Ie(e,r,t,!1)}var _r=Rr,jr=Er;W.Fragment=d,W.jsx=_r,W.jsxs=jr}()),W}process.env.NODE_ENV==="production"?z.exports=Ne():z.exports=Le();var n=z.exports;const X=({content:l,caption:o=""})=>n.jsxs("figure",{className:"card",children:[l,o&&n.jsx("figcaption",{children:o})]}),We=({title:l,content:o})=>n.jsxs("details",{className:"collapse",children:[n.jsx("summary",{children:l}),n.jsx("figure",{children:o})]}),C=({name:l,cat:o="brands",option:i="2x",isHidden:d=!0,event:v=void 0})=>n.jsx("i",{...v?{className:`fa-${o} fa-${l} fa-${i}`}:{className:`fa-${o} fa-${l} fa-${i} fa-fw`},"aria-hidden":d,...v?{onClick:y=>v(y)}:{},...v?{onKeyDown:y=>v(y)}:{},...v?{tabIndex:0}:{}}),q=({url:l,alt:o,design:i="image"})=>n.jsx("img",{src:l,alt:o,className:i,loading:"lazy"}),Z=({content:l,url:o,design:i="link",label:d="",title:v=""})=>{const y=o.startsWith("https");return n.jsx("a",{href:o,className:`${i}`,...d?{"aria-label":d}:{},...v?{title:v}:{},...y?{rel:"noopener noreferrer"}:{},...y?{target:"_blank"}:{},children:l})},Y=({array:l})=>n.jsx("ul",{className:"list",children:l.map((o,i)=>n.jsx("li",{children:n.jsx(n.Fragment,{children:o})},i))}),M=({link:l,ico:o,txt:i=""})=>{const{url:d,label:v}=l,{name:y,cat:k,option:x}=o;return n.jsx(Z,{url:d,label:v,design:"link button",content:n.jsxs(n.Fragment,{children:[n.jsx(C,{name:y,cat:k,option:x,isHidden:!1,event:void 0}),i&&n.jsx("b",{children:i})]})})},Ye=({id:l,links:o})=>n.jsx("footer",{id:l,className:"footer",children:n.jsx(Y,{array:o.map(i=>n.jsx(M,{link:i.link,ico:i.ico}))})}),Q=({txt:l,lvl:o=4,sub:i="",ico:d=void 0})=>{o=Number(o),(o<1||o>3)&&(o=4);const v=`h${o}`;return n.jsxs("hgroup",{className:"title",children:[d&&n.jsx("p",{children:T.createElement(C,d)}),T.createElement(v,{},l),i&&n.jsx("p",{children:i})]})},Me=({array:l})=>{const o=(i,d)=>{const v={url:i.url,title:i.detail,design:"link",content:n.jsx(X,{caption:n.jsx(Q,{txt:i.caption.title}),content:n.jsx(q,{url:i.image.url,alt:i.image.alt})})};return i.caption.technos&&(v.content=n.jsx(X,{caption:n.jsxs(n.Fragment,{children:[n.jsx(Q,{txt:i.caption.title}),n.jsx(Y,{array:i.caption.technos.map(y=>n.jsx(C,{name:y,option:"lg",isHidden:!1}))})]}),content:n.jsx(q,{url:i.image.url??"",alt:i.image.alt??""})})),n.jsx(Z,{...v},d)};return n.jsx(Y,{array:l.map(o)})},Ve=({brand:l,links:o,contact:i})=>n.jsxs("nav",{className:"navbar",children:[n.jsx(M,{link:l.link,ico:l.ico}),n.jsx(Y,{array:o.map(d=>n.jsx(M,{link:d.link,ico:d.ico,txt:d.txt}))}),n.jsx(M,{link:i.link,ico:i.ico})]}),$e=({array:l,timer:o=5e3})=>{const i=l.length,[d,v]=T.useState(0),y=()=>v(g=>(g+1)%i),k=()=>v(g=>(g-1+i)%i);//! ********** AUTOPLAY **********
let[x,b]=T.useState(o!==0);const O=()=>b(g=>!g);T.useEffect(()=>{let g;return x&&(g=setInterval(()=>y(),o)),()=>clearInterval(g)},[x,i]);//! ********** KEYBOARD EVENTS **********
const E=g=>{switch(g.key){case"ArrowLeft":k();break;case"ArrowRight":y();break;case"a":case"A":case"p":case"P":O();break}};T.useEffect(()=>(document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E)}),[]);//! ********** RENDER **********
return n.jsxs("figure",{className:"slider",role:"region","aria-label":"slider",children:[l[d],i>1&&n.jsxs("nav",{children:[n.jsx(C,{name:"chevron-left",cat:"solid",isHidden:!1,event:k}),n.jsx(C,{name:"chevron-right",cat:"solid",isHidden:!1,event:y}),n.jsx(C,{name:x?"pause":"play",cat:"solid",isHidden:!1,event:O})]}),n.jsx("progress",{value:(d+1)/i})]})};m.Button=M,m.Card=X,m.Collapse=We,m.Footer=Ye,m.Gallery=Me,m.Icon=C,m.Image=q,m.Link=Z,m.List=Y,m.Navbar=Ve,m.Slider=$e,m.Title=Q,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
//# sourceMappingURL=index.umd.js.map