@lifesg/react-design-system 1.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +175 -0
- package/README.md +68 -0
- package/dist/README.md +68 -0
- package/dist/accordion/accordion-context.d.ts +2 -0
- package/dist/accordion/accordion-item.d.ts +3 -0
- package/dist/accordion/accordion-item.style.d.ts +13 -0
- package/dist/accordion/accordion.d.ts +5 -0
- package/dist/accordion/accordion.style.d.ts +6 -0
- package/dist/accordion/index.d.ts +2 -0
- package/dist/accordion/index.js +364 -0
- package/dist/accordion/index.js.map +1 -0
- package/dist/accordion/package.json +7 -0
- package/dist/accordion/types.d.ts +27 -0
- package/dist/alert/alert.d.ts +3 -0
- package/dist/alert/alert.style.d.ts +9 -0
- package/dist/alert/index.d.ts +2 -0
- package/dist/alert/index.js +175 -0
- package/dist/alert/index.js.map +1 -0
- package/dist/alert/package.json +7 -0
- package/dist/alert/types.d.ts +6 -0
- package/dist/animations/index.d.ts +2 -0
- package/dist/animations/index.js +7 -0
- package/dist/animations/index.js.map +1 -0
- package/dist/animations/loading-dots/loading-dots.d.ts +2 -0
- package/dist/animations/loading-dots/lottie-animation.d.ts +2 -0
- package/dist/animations/loading-spinner/loading-spinner.d.ts +2 -0
- package/dist/animations/loading-spinner/lottie-animation.d.ts +2 -0
- package/dist/animations/package.json +7 -0
- package/dist/box-container/box-container.d.ts +3 -0
- package/dist/box-container/box-container.styles.d.ts +22 -0
- package/dist/box-container/index.d.ts +2 -0
- package/dist/box-container/index.js +204 -0
- package/dist/box-container/index.js.map +1 -0
- package/dist/box-container/package.json +7 -0
- package/dist/box-container/types.d.ts +18 -0
- package/dist/breadcrumb/breadcrumb.d.ts +3 -0
- package/dist/breadcrumb/breadcrumb.style.d.ts +19 -0
- package/dist/breadcrumb/index.d.ts +2 -0
- package/dist/breadcrumb/index.js +184 -0
- package/dist/breadcrumb/index.js.map +1 -0
- package/dist/breadcrumb/package.json +7 -0
- package/dist/breadcrumb/types.d.ts +10 -0
- package/dist/button/button.d.ts +6 -0
- package/dist/button/button.style.d.ts +4 -0
- package/dist/button/index.d.ts +2 -0
- package/dist/button/index.js +268 -0
- package/dist/button/index.js.map +1 -0
- package/dist/button/package.json +7 -0
- package/dist/button/types.d.ts +17 -0
- package/dist/checkbox/checkbox.d.ts +3 -0
- package/dist/checkbox/checkbox.style.d.ts +11 -0
- package/dist/checkbox/index.d.ts +2 -0
- package/dist/checkbox/index.js +41 -0
- package/dist/checkbox/index.js.map +1 -0
- package/dist/checkbox/package.json +7 -0
- package/dist/checkbox/types.d.ts +6 -0
- package/dist/cjs/index.js +2162 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/color/color.d.ts +59 -0
- package/dist/color/index.d.ts +2 -0
- package/dist/color/index.js +2 -0
- package/dist/color/index.js.map +1 -0
- package/dist/color/package.json +7 -0
- package/dist/color/types.d.ts +52 -0
- package/dist/date-input/date-input.d.ts +3 -0
- package/dist/date-input/date-input.style.d.ts +22 -0
- package/dist/date-input/index.d.ts +2 -0
- package/dist/date-input/index.js +240 -0
- package/dist/date-input/index.js.map +1 -0
- package/dist/date-input/package.json +7 -0
- package/dist/date-input/types.d.ts +25 -0
- package/dist/form/form-date-input.d.ts +3 -0
- package/dist/form/form-input-group.d.ts +3 -0
- package/dist/form/form-input.d.ts +3 -0
- package/dist/form/form-label-addon.d.ts +15 -0
- package/dist/form/form-label-addon.style.d.ts +2 -0
- package/dist/form/form-label.d.ts +5 -0
- package/dist/form/form-label.style.d.ts +6 -0
- package/dist/form/form-multi-select.d.ts +3 -0
- package/dist/form/form-select.d.ts +3 -0
- package/dist/form/form-textarea.d.ts +3 -0
- package/dist/form/form-textarea.style.d.ts +3 -0
- package/dist/form/form-timepicker.d.ts +3 -0
- package/dist/form/form-wrapper.d.ts +8 -0
- package/dist/form/form-wrapper.style.d.ts +1 -0
- package/dist/form/index.d.ts +11 -0
- package/dist/form/index.js +1452 -0
- package/dist/form/index.js.map +1 -0
- package/dist/form/package.json +7 -0
- package/dist/form/types.d.ts +49 -0
- package/dist/icon/arrow-right-icon.d.ts +3 -0
- package/dist/icon/icon.d.ts +3 -0
- package/dist/icon/index.d.ts +2 -0
- package/dist/icon/index.js +12 -0
- package/dist/icon/index.js.map +1 -0
- package/dist/icon/info-icon.d.ts +3 -0
- package/dist/icon/package.json +7 -0
- package/dist/icon/play-alt-icon.d.ts +3 -0
- package/dist/icon/search-icon.d.ts +3 -0
- package/dist/icon/shared.style.d.ts +1 -0
- package/dist/icon/types.d.ts +9 -0
- package/dist/icon-button/icon-button.d.ts +3 -0
- package/dist/icon-button/icon-button.style.d.ts +1 -0
- package/dist/icon-button/index.d.ts +2 -0
- package/dist/icon-button/index.js +30 -0
- package/dist/icon-button/index.js.map +1 -0
- package/dist/icon-button/package.json +7 -0
- package/dist/icon-button/types.d.ts +6 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +2162 -0
- package/dist/index.js.map +1 -0
- package/dist/input/index.d.ts +2 -0
- package/dist/input/index.js +68 -0
- package/dist/input/index.js.map +1 -0
- package/dist/input/input.d.ts +3 -0
- package/dist/input/input.style.d.ts +6 -0
- package/dist/input/package.json +7 -0
- package/dist/input/types.d.ts +10 -0
- package/dist/input-group/index.d.ts +2 -0
- package/dist/input-group/index.js +768 -0
- package/dist/input-group/index.js.map +1 -0
- package/dist/input-group/input-group-list-addon.d.ts +3 -0
- package/dist/input-group/input-group-list-addon.style.d.ts +16 -0
- package/dist/input-group/input-group.d.ts +3 -0
- package/dist/input-group/input-group.style.d.ts +15 -0
- package/dist/input-group/package.json +7 -0
- package/dist/input-group/types.d.ts +39 -0
- package/dist/input-select/index.d.ts +3 -0
- package/dist/input-select/index.js +577 -0
- package/dist/input-select/index.js.map +1 -0
- package/dist/input-select/input-multi-select.d.ts +3 -0
- package/dist/input-select/input-select-wrapper.d.ts +3 -0
- package/dist/input-select/input-select.d.ts +3 -0
- package/dist/input-select/input-select.styles.d.ts +19 -0
- package/dist/input-select/package.json +7 -0
- package/dist/input-select/types.d.ts +49 -0
- package/dist/input-textarea/index.d.ts +2 -0
- package/dist/input-textarea/index.js +182 -0
- package/dist/input-textarea/index.js.map +1 -0
- package/dist/input-textarea/package.json +7 -0
- package/dist/input-textarea/textara-counter.style.d.ts +5 -0
- package/dist/input-textarea/textarea-counter.d.ts +8 -0
- package/dist/input-textarea/textarea.d.ts +4 -0
- package/dist/input-textarea/textarea.style.d.ts +6 -0
- package/dist/input-textarea/types.d.ts +8 -0
- package/dist/link-list/index.d.ts +2 -0
- package/dist/link-list/index.js +196 -0
- package/dist/link-list/index.js.map +1 -0
- package/dist/link-list/link-list.d.ts +3 -0
- package/dist/link-list/link-list.styles.d.ts +17 -0
- package/dist/link-list/package.json +7 -0
- package/dist/link-list/types.d.ts +20 -0
- package/dist/masonry/index.d.ts +1 -0
- package/dist/masonry/index.js +42 -0
- package/dist/masonry/index.js.map +1 -0
- package/dist/masonry/masonry.d.ts +6 -0
- package/dist/masonry/masonry.style.d.ts +6 -0
- package/dist/masonry/package.json +7 -0
- package/dist/masonry/types.d.ts +28 -0
- package/dist/media/index.d.ts +2 -0
- package/dist/media/index.js +2 -0
- package/dist/media/index.js.map +1 -0
- package/dist/media/media.d.ts +5 -0
- package/dist/media/package.json +7 -0
- package/dist/media/types.d.ts +18 -0
- package/dist/modal/index.d.ts +5 -0
- package/dist/modal/index.js +120 -0
- package/dist/modal/index.js.map +1 -0
- package/dist/modal/modal-box.d.ts +3 -0
- package/dist/modal/modal-box.styles.d.ts +4 -0
- package/dist/modal/modal.d.ts +3 -0
- package/dist/modal/modal.styles.d.ts +8 -0
- package/dist/modal/package.json +7 -0
- package/dist/modal/types.d.ts +18 -0
- package/dist/overlay/index.d.ts +2 -0
- package/dist/overlay/index.js +40 -0
- package/dist/overlay/index.js.map +1 -0
- package/dist/overlay/overlay.d.ts +3 -0
- package/dist/overlay/overlay.styles.d.ts +3 -0
- package/dist/overlay/package.json +7 -0
- package/dist/overlay/types.d.ts +26 -0
- package/dist/package.json +35 -0
- package/dist/popover/index.d.ts +3 -0
- package/dist/popover/index.js +372 -0
- package/dist/popover/index.js.map +1 -0
- package/dist/popover/package.json +7 -0
- package/dist/popover/popover-hoc.d.ts +3 -0
- package/dist/popover/popover.d.ts +3 -0
- package/dist/popover/popover.styles.d.ts +11 -0
- package/dist/popover/types.d.ts +19 -0
- package/dist/radio-button/index.d.ts +2 -0
- package/dist/radio-button/index.js +31 -0
- package/dist/radio-button/index.js.map +1 -0
- package/dist/radio-button/package.json +7 -0
- package/dist/radio-button/radio-button.d.ts +3 -0
- package/dist/radio-button/radio-button.styles.d.ts +9 -0
- package/dist/radio-button/types.d.ts +3 -0
- package/dist/shared/component-loading-spinner/component-loading-spinner.d.ts +12 -0
- package/dist/shared/component-loading-spinner/component-loading-spinner.style.d.ts +15 -0
- package/dist/shared/dropdown-list/dropdown-list.d.ts +7 -0
- package/dist/shared/dropdown-list/dropdown-list.styles.d.ts +31 -0
- package/dist/shared/dropdown-list/dropdown-search.d.ts +6 -0
- package/dist/shared/dropdown-list/dropdown-search.styles.d.ts +4 -0
- package/dist/shared/dropdown-list/types.d.ts +43 -0
- package/dist/spec/color-spec/base-color-set.d.ts +2 -0
- package/dist/spec/color-spec/bookingsg-color-set.d.ts +2 -0
- package/dist/spec/media-spec.d.ts +2 -0
- package/dist/spec/text-spec/base-text-style-set.d.ts +2 -0
- package/dist/spec/text-spec/font-spec.d.ts +9 -0
- package/dist/text/helper.d.ts +6 -0
- package/dist/text/index.d.ts +4 -0
- package/dist/text/index.js +130 -0
- package/dist/text/index.js.map +1 -0
- package/dist/text/package.json +7 -0
- package/dist/text/text-style.d.ts +100 -0
- package/dist/text/text.d.ts +22 -0
- package/dist/text/types.d.ts +33 -0
- package/dist/text-list/index.d.ts +6 -0
- package/dist/text-list/index.js +76 -0
- package/dist/text-list/index.js.map +1 -0
- package/dist/text-list/ordered-list.d.ts +3 -0
- package/dist/text-list/package.json +7 -0
- package/dist/text-list/text-list.styles.d.ts +3 -0
- package/dist/text-list/types.d.ts +23 -0
- package/dist/text-list/unordered-list.d.ts +3 -0
- package/dist/theme/color-theme-helper.d.ts +1 -0
- package/dist/theme/helper.d.ts +16 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/index.js +2 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/package.json +7 -0
- package/dist/theme/text-theme-helper.d.ts +1 -0
- package/dist/theme/types.d.ts +35 -0
- package/dist/timeline/index.d.ts +2 -0
- package/dist/timeline/index.js +199 -0
- package/dist/timeline/index.js.map +1 -0
- package/dist/timeline/package.json +7 -0
- package/dist/timeline/timeline.d.ts +3 -0
- package/dist/timeline/timeline.style.d.ts +19 -0
- package/dist/timeline/types.d.ts +19 -0
- package/dist/timepicker/helper.d.ts +15 -0
- package/dist/timepicker/index.d.ts +2 -0
- package/dist/timepicker/index.js +516 -0
- package/dist/timepicker/index.js.map +1 -0
- package/dist/timepicker/package.json +7 -0
- package/dist/timepicker/timepicker-dropdown.d.ts +12 -0
- package/dist/timepicker/timepicker-dropdown.styles.d.ts +13 -0
- package/dist/timepicker/timepicker.d.ts +3 -0
- package/dist/timepicker/timepicker.styles.d.ts +8 -0
- package/dist/timepicker/types.d.ts +19 -0
- package/dist/toggle-button/index.d.ts +2 -0
- package/dist/toggle-button/index.js +190 -0
- package/dist/toggle-button/index.js.map +1 -0
- package/dist/toggle-button/package.json +7 -0
- package/dist/toggle-button/toggle-button.d.ts +3 -0
- package/dist/toggle-button/toggle-button.styles.d.ts +10 -0
- package/dist/toggle-button/types.d.ts +7 -0
- package/dist/tooltip/index.d.ts +3 -0
- package/dist/tooltip/index.js +320 -0
- package/dist/tooltip/index.js.map +1 -0
- package/dist/tooltip/package.json +7 -0
- package/dist/tooltip/tooltip-hoc.d.ts +3 -0
- package/dist/tooltip/tooltip.d.ts +3 -0
- package/dist/tooltip/tooltip.styles.d.ts +9 -0
- package/dist/tooltip/types.d.ts +19 -0
- package/dist/transition/index.d.ts +4 -0
- package/dist/transition/index.js +2 -0
- package/dist/transition/index.js.map +1 -0
- package/dist/transition/package.json +7 -0
- package/dist/util/string-helper.d.ts +27 -0
- package/package.json +106 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import r,{useState as o,useRef as i,useEffect as a}from"react";import l from"react-dom";import c,{css as s}from"styled-components";var u,d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},f={exports:{}};u=e=>(()=>{var t={"./node_modules/css-mediaquery/index.js":
|
|
2
|
+
/*!**********************************************!*\
|
|
3
|
+
!*** ./node_modules/css-mediaquery/index.js ***!
|
|
4
|
+
\**********************************************/(e,t)=>{t.match=function(e,t){return l(e).some((function(e){var n=e.inverse,r="all"===e.type||t.type===e.type;if(r&&n||!r&&!n)return!1;var o=e.expressions.every((function(e){var n=e.feature,r=e.modifier,o=e.value,i=t[n];if(!i)return!1;switch(n){case"orientation":case"scan":return i.toLowerCase()===o.toLowerCase();case"width":case"height":case"device-width":case"device-height":o=u(o),i=u(i);break;case"resolution":o=s(o),i=s(i);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":o=c(o),i=c(i);break;case"grid":case"color":case"color-index":case"monochrome":o=parseInt(o,10)||1,i=parseInt(i,10)||0}switch(r){case"min":return i>=o;case"max":return i<=o;default:return i===o}}));return o&&!n||!o&&n}))},t.parse=l;var n=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,r=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,o=/^(?:(min|max)-)?(.+)/,i=/(em|rem|px|cm|mm|in|pt|pc)?$/,a=/(dpi|dpcm|dppx)?$/;function l(e){return e.split(",").map((function(e){var t=(e=e.trim()).match(n),i=t[1],a=t[2],l=t[3]||"",c={};return c.inverse=!!i&&"not"===i.toLowerCase(),c.type=a?a.toLowerCase():"all",l=l.match(/\([^\)]+\)/g)||[],c.expressions=l.map((function(e){var t=e.match(r),n=t[1].toLowerCase().match(o);return{modifier:n[1],feature:n[2],value:t[2]}})),c}))}function c(e){var t,n=Number(e);return n||(n=(t=e.match(/^(\d+)\s*\/\s*(\d+)$/))[1]/t[2]),n}function s(e){var t=parseFloat(e);switch(String(e).match(a)[1]){case"dpcm":return t/2.54;case"dppx":return 96*t;default:return t}}function u(e){var t=parseFloat(e);switch(String(e).match(i)[1]){case"em":case"rem":return 16*t;case"cm":return 96*t/2.54;case"mm":return 96*t/2.54/10;case"in":return 96*t;case"pt":return 72*t;case"pc":return 72*t/12;default:return t}}},"./node_modules/hyphenate-style-name/index.js":
|
|
5
|
+
/*!****************************************************!*\
|
|
6
|
+
!*** ./node_modules/hyphenate-style-name/index.js ***!
|
|
7
|
+
\****************************************************/(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=/[A-Z]/g,o=/^ms-/,i={};function a(e){return"-"+e.toLowerCase()}const l=function(e){if(i.hasOwnProperty(e))return i[e];var t=e.replace(r,a);return i[e]=o.test(t)?"-"+t:t}},"./node_modules/matchmediaquery/index.js":
|
|
8
|
+
/*!***********************************************!*\
|
|
9
|
+
!*** ./node_modules/matchmediaquery/index.js ***!
|
|
10
|
+
\***********************************************/(e,t,n)=>{var r=n(/*! css-mediaquery */"./node_modules/css-mediaquery/index.js").match,o="undefined"!=typeof window?window.matchMedia:null;function i(e,t,n){var i=this;if(o&&!n){var a=o.call(window,e);this.matches=a.matches,this.media=a.media,a.addListener(l)}else this.matches=r(e,t),this.media=e;function l(e){i.matches=e.matches,i.media=e.media}this.addListener=function(e){a&&a.addListener(e)},this.removeListener=function(e){a&&a.removeListener(e)},this.dispose=function(){a&&a.removeListener(l)}}e.exports=function(e,t,n){return new i(e,t,n)}},"./node_modules/object-assign/index.js":
|
|
11
|
+
/*!*********************************************!*\
|
|
12
|
+
!*** ./node_modules/object-assign/index.js ***!
|
|
13
|
+
\*********************************************/e=>{
|
|
14
|
+
/*
|
|
15
|
+
object-assign
|
|
16
|
+
(c) Sindre Sorhus
|
|
17
|
+
@license MIT
|
|
18
|
+
*/
|
|
19
|
+
var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,l,c=o(e),s=1;s<arguments.length;s++){for(var u in a=Object(arguments[s]))n.call(a,u)&&(c[u]=a[u]);if(t){l=t(a);for(var d=0;d<l.length;d++)r.call(a,l[d])&&(c[l[d]]=a[l[d]])}}return c}},"./node_modules/prop-types/checkPropTypes.js":
|
|
20
|
+
/*!***************************************************!*\
|
|
21
|
+
!*** ./node_modules/prop-types/checkPropTypes.js ***!
|
|
22
|
+
\***************************************************/(e,t,n)=>{var r,o=n(/*! ./lib/ReactPropTypesSecret */"./node_modules/prop-types/lib/ReactPropTypesSecret.js"),i={},a=n(/*! ./lib/has */"./node_modules/prop-types/lib/has.js");function l(e,t,n,l,c){for(var s in e)if(a(e,s)){var u;try{if("function"!=typeof e[s]){var d=Error((l||"React class")+": "+n+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}u=e[s](t,s,l,n,null,o)}catch(e){u=e}if(!u||u instanceof Error||r((l||"React class")+": type specification of "+n+" `"+s+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in i)){i[u.message]=!0;var f=c?c():"";r("Failed "+n+" type: "+u.message+(null!=f?f:""))}}}r=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}},l.resetWarningCache=function(){i={}},e.exports=l},"./node_modules/prop-types/factoryWithTypeCheckers.js":
|
|
23
|
+
/*!************************************************************!*\
|
|
24
|
+
!*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***!
|
|
25
|
+
\************************************************************/(e,t,n)=>{var r,o=n(/*! react-is */"./node_modules/react-is/index.js"),i=n(/*! object-assign */"./node_modules/object-assign/index.js"),a=n(/*! ./lib/ReactPropTypesSecret */"./node_modules/prop-types/lib/ReactPropTypesSecret.js"),l=n(/*! ./lib/has */"./node_modules/prop-types/lib/has.js"),c=n(/*! ./checkPropTypes */"./node_modules/prop-types/checkPropTypes.js");function s(){return null}r=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}},e.exports=function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,u="<<anonymous>>",d={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:h(s),arrayOf:function(e){return h((function(t,n,r,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var l=t[n];if(!Array.isArray(l))return new p("Invalid "+o+" `"+i+"` of type `"+v(l)+"` supplied to `"+r+"`, expected an array.");for(var c=0;c<l.length;c++){var s=e(l,c,r,o,i+"["+c+"]",a);if(s instanceof Error)return s}return null}))},element:h((function(t,n,r,o,i){var a=t[n];return e(a)?null:new p("Invalid "+o+" `"+i+"` of type `"+v(a)+"` supplied to `"+r+"`, expected a single ReactElement.")})),elementType:h((function(e,t,n,r,i){var a=e[t];return o.isValidElementType(a)?null:new p("Invalid "+r+" `"+i+"` of type `"+v(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(e){return h((function(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||u;return new p("Invalid "+o+" `"+i+"` of type `"+((l=t[n]).constructor&&l.constructor.name?l.constructor.name:u)+"` supplied to `"+r+"`, expected instance of `"+a+"`.")}var l;return null}))},node:h((function(e,t,n,r,o){return g(e[t])?null:new p("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return h((function(t,n,r,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var c=t[n],s=v(c);if("object"!==s)return new p("Invalid "+o+" `"+i+"` of type `"+s+"` supplied to `"+r+"`, expected an object.");for(var u in c)if(l(c,u)){var d=e(c,u,r,o,i+"."+u,a);if(d instanceof Error)return d}return null}))},oneOf:function(e){if(!Array.isArray(e))return r(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),s;function t(t,n,r,o,i){for(var a=t[n],l=0;l<e.length;l++)if(f(a,e[l]))return null;var c=JSON.stringify(e,(function(e,t){return"symbol"===b(t)?String(t):t}));return new p("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+r+"`, expected one of "+c+".")}return h(t)},oneOfType:function(e){if(!Array.isArray(e))return r("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return r("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+w(n)+" at index "+t+"."),s}return h((function(t,n,r,o,i){for(var c=[],s=0;s<e.length;s++){var u=(0,e[s])(t,n,r,o,i,a);if(null==u)return null;u.data&&l(u.data,"expectedType")&&c.push(u.data.expectedType)}return new p("Invalid "+o+" `"+i+"` supplied to `"+r+"`"+(c.length>0?", expected one of type ["+c.join(", ")+"]":"")+".")}))},shape:function(e){return h((function(t,n,r,o,i){var l=t[n],c=v(l);if("object"!==c)return new p("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");for(var s in e){var u=e[s];if("function"!=typeof u)return m(r,o,i,s,b(u));var d=u(l,s,r,o,i+"."+s,a);if(d)return d}return null}))},exact:function(e){return h((function(t,n,r,o,c){var s=t[n],u=v(s);if("object"!==u)return new p("Invalid "+o+" `"+c+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");var d=i({},t[n],e);for(var f in d){var h=e[f];if(l(e,f)&&"function"!=typeof h)return m(r,o,c,f,b(h));if(!h)return new p("Invalid "+o+" `"+c+"` key `"+f+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var y=h(s,f,r,o,c+"."+f,a);if(y)return y}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function h(e){var n={},o=0;function i(i,l,c,s,d,f,h){if(s=s||u,f=f||c,h!==a){if(t){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}if("undefined"!=typeof console){var m=s+":"+c;!n[m]&&o<3&&(r("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+s+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),n[m]=!0,o++)}}return null==l[c]?i?null===l[c]?new p("The "+d+" `"+f+"` is marked as required in `"+s+"`, but its value is `null`."):new p("The "+d+" `"+f+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:e(l,c,s,d,f)}var l=i.bind(null,!1);return l.isRequired=i.bind(null,!0),l}function y(e){return h((function(t,n,r,o,i,a){var l=t[n];return v(l)!==e?new p("Invalid "+o+" `"+i+"` of type `"+b(l)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function m(e,t,n,r,o){return new p((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function g(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(g);if(null===t||e(t))return!0;var r=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!r)return!1;var o,i=r.call(t);if(r!==t.entries){for(;!(o=i.next()).done;)if(!g(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!g(a[1]))return!1}return!0;default:return!1}}function v(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function b(e){if(null==e)return""+e;var t=v(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function w(e){var t=b(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return p.prototype=Error.prototype,d.checkPropTypes=c,d.resetWarningCache=c.resetWarningCache,d.PropTypes=d,d}},"./node_modules/prop-types/index.js":
|
|
26
|
+
/*!******************************************!*\
|
|
27
|
+
!*** ./node_modules/prop-types/index.js ***!
|
|
28
|
+
\******************************************/(e,t,n)=>{var r=n(/*! react-is */"./node_modules/react-is/index.js");e.exports=n(/*! ./factoryWithTypeCheckers */"./node_modules/prop-types/factoryWithTypeCheckers.js")(r.isElement,!0)},"./node_modules/prop-types/lib/ReactPropTypesSecret.js":
|
|
29
|
+
/*!*************************************************************!*\
|
|
30
|
+
!*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
|
|
31
|
+
\*************************************************************/e=>{e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},"./node_modules/prop-types/lib/has.js":
|
|
32
|
+
/*!********************************************!*\
|
|
33
|
+
!*** ./node_modules/prop-types/lib/has.js ***!
|
|
34
|
+
\********************************************/e=>{e.exports=Function.call.bind(Object.prototype.hasOwnProperty)},"./node_modules/react-is/cjs/react-is.development.js":
|
|
35
|
+
/*!***********************************************************!*\
|
|
36
|
+
!*** ./node_modules/react-is/cjs/react-is.development.js ***!
|
|
37
|
+
\***********************************************************/(e,t)=>{!function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var p=e.type;switch(p){case s:case u:case o:case a:case i:case f:return p;default:var m=p&&p.$$typeof;switch(m){case c:case d:case y:case h:case l:return m;default:return t}}case r:return t}}}var S=s,x=u,$=c,F=l,_=n,O=d,j=o,H=y,B=h,C=r,D=a,k=i,E=f,z=!1;function T(e){return w(e)===u}t.AsyncMode=S,t.ConcurrentMode=x,t.ContextConsumer=$,t.ContextProvider=F,t.Element=_,t.ForwardRef=O,t.Fragment=j,t.Lazy=H,t.Memo=B,t.Portal=C,t.Profiler=D,t.StrictMode=k,t.Suspense=E,t.isAsyncMode=function(e){return z||(z=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),T(e)||w(e)===s},t.isConcurrentMode=T,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return w(e)===d},t.isFragment=function(e){return w(e)===o},t.isLazy=function(e){return w(e)===y},t.isMemo=function(e){return w(e)===h},t.isPortal=function(e){return w(e)===r},t.isProfiler=function(e){return w(e)===a},t.isStrictMode=function(e){return w(e)===i},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===u||e===a||e===i||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===h||e.$$typeof===l||e.$$typeof===c||e.$$typeof===d||e.$$typeof===g||e.$$typeof===v||e.$$typeof===b||e.$$typeof===m)},t.typeOf=w}()},"./node_modules/react-is/index.js":
|
|
38
|
+
/*!****************************************!*\
|
|
39
|
+
!*** ./node_modules/react-is/index.js ***!
|
|
40
|
+
\****************************************/(e,t,n)=>{e.exports=n(/*! ./cjs/react-is.development.js */"./node_modules/react-is/cjs/react-is.development.js")},"./node_modules/shallow-equal/dist/index.esm.js":
|
|
41
|
+
/*!******************************************************!*\
|
|
42
|
+
!*** ./node_modules/shallow-equal/dist/index.esm.js ***!
|
|
43
|
+
\******************************************************/(e,t,n)=>{function r(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t),o=n.length;if(r.length!==o)return!1;for(var i=0;i<o;i++){var a=n[i];if(e[a]!==t[a]||!Object.prototype.hasOwnProperty.call(t,a))return!1}return!0}function o(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}n.r(t),n.d(t,{shallowEqualArrays:()=>o,shallowEqualObjects:()=>r})},"./src/Component.ts":
|
|
44
|
+
/*!**************************!*\
|
|
45
|
+
!*** ./src/Component.ts ***!
|
|
46
|
+
\**************************/function(e,t,n){var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(/*! ./useMediaQuery */"./src/useMediaQuery.ts"));t.default=function(e){var t=e.children,n=e.device,o=e.onChange,a=r(e,["children","device","onChange"]),l=(0,i.default)(a,n,o);return"function"==typeof t?t(l):l?t:null}},"./src/Context.ts":
|
|
47
|
+
/*!************************!*\
|
|
48
|
+
!*** ./src/Context.ts ***!
|
|
49
|
+
\************************/(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=(0,n(/*! react */"react").createContext)(void 0);t.default=r},"./src/index.ts":
|
|
50
|
+
/*!**********************!*\
|
|
51
|
+
!*** ./src/index.ts ***!
|
|
52
|
+
\**********************/function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Context=t.toQuery=t.useMediaQuery=t.default=void 0;var o=r(n(/*! ./useMediaQuery */"./src/useMediaQuery.ts"));t.useMediaQuery=o.default;var i=r(n(/*! ./Component */"./src/Component.ts"));t.default=i.default;var a=r(n(/*! ./toQuery */"./src/toQuery.ts"));t.toQuery=a.default;var l=r(n(/*! ./Context */"./src/Context.ts"));t.Context=l.default},"./src/mediaQuery.ts":
|
|
53
|
+
/*!***************************!*\
|
|
54
|
+
!*** ./src/mediaQuery.ts ***!
|
|
55
|
+
\***************************/function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=i(n(/*! prop-types */"./node_modules/prop-types/index.js")),l=a.default.oneOfType([a.default.string,a.default.number]),c={all:a.default.bool,grid:a.default.bool,aural:a.default.bool,braille:a.default.bool,handheld:a.default.bool,print:a.default.bool,projection:a.default.bool,screen:a.default.bool,tty:a.default.bool,tv:a.default.bool,embossed:a.default.bool},s={orientation:a.default.oneOf(["portrait","landscape"]),scan:a.default.oneOf(["progressive","interlace"]),aspectRatio:a.default.string,deviceAspectRatio:a.default.string,height:l,deviceHeight:l,width:l,deviceWidth:l,color:a.default.bool,colorIndex:a.default.bool,monochrome:a.default.bool,resolution:l,type:Object.keys(c)},u=o(s,["type"]),d=r({minAspectRatio:a.default.string,maxAspectRatio:a.default.string,minDeviceAspectRatio:a.default.string,maxDeviceAspectRatio:a.default.string,minHeight:l,maxHeight:l,minDeviceHeight:l,maxDeviceHeight:l,minWidth:l,maxWidth:l,minDeviceWidth:l,maxDeviceWidth:l,minColor:a.default.number,maxColor:a.default.number,minColorIndex:a.default.number,maxColorIndex:a.default.number,minMonochrome:a.default.number,maxMonochrome:a.default.number,minResolution:l,maxResolution:l},u),f=r(r({},c),d);t.default={all:f,types:c,matchers:s,features:d}},"./src/toQuery.ts":
|
|
56
|
+
/*!************************!*\
|
|
57
|
+
!*** ./src/toQuery.ts ***!
|
|
58
|
+
\************************/function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(/*! hyphenate-style-name */"./node_modules/hyphenate-style-name/index.js")),i=r(n(/*! ./mediaQuery */"./src/mediaQuery.ts"));t.default=function(e){var t=[];return Object.keys(i.default.all).forEach((function(n){var r=e[n];null!=r&&t.push(function(e,t){var n=(0,o.default)(e);return"number"==typeof t&&(t="".concat(t,"px")),!0===t?n:!1===t?"not ".concat(n):"(".concat(n,": ").concat(t,")")}(n,r))})),t.join(" and ")}},"./src/useMediaQuery.ts":
|
|
59
|
+
/*!******************************!*\
|
|
60
|
+
!*** ./src/useMediaQuery.ts ***!
|
|
61
|
+
\******************************/function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! react */"react"),i=r(n(/*! matchmediaquery */"./node_modules/matchmediaquery/index.js")),a=r(n(/*! hyphenate-style-name */"./node_modules/hyphenate-style-name/index.js")),l=n(/*! shallow-equal */"./node_modules/shallow-equal/dist/index.esm.js"),c=r(n(/*! ./toQuery */"./src/toQuery.ts")),s=r(n(/*! ./Context */"./src/Context.ts")),u=function(e){if(e)return Object.keys(e).reduce((function(t,n){return t[(0,a.default)(n)]=e[n],t}),{})},d=function(){var e=(0,o.useRef)(!1);return(0,o.useEffect)((function(){e.current=!0}),[]),e.current},f=function(e){var t=function(){return function(e){return e.query||(0,c.default)(e)}(e)},n=(0,o.useState)(t),r=n[0],i=n[1];return(0,o.useEffect)((function(){var e=t();r!==e&&i(e)}),[e]),r};t.default=function(e,t,n){var r=function(e){var t=(0,o.useContext)(s.default),n=function(){return u(e)||u(t)},r=(0,o.useState)(n),i=r[0],a=r[1];return(0,o.useEffect)((function(){var e=n();(0,l.shallowEqualObjects)(i,e)||a(e)}),[e,t]),i}(t),a=f(e);if(!a)throw new Error("Invalid or missing MediaQuery!");var c=function(e,t){var n=function(){return(0,i.default)(e,t||{},!!t)},r=(0,o.useState)(n),a=r[0],l=r[1],c=d();return(0,o.useEffect)((function(){if(c){var e=n();return l(e),function(){e&&e.dispose()}}}),[e,t]),a}(a,r),p=function(e){var t=(0,o.useState)(e.matches),n=t[0],r=t[1];return(0,o.useEffect)((function(){var t=function(e){r(e.matches)};return e.addListener(t),r(e.matches),function(){e.removeListener(t)}}),[e]),n}(c),h=d();return(0,o.useEffect)((function(){h&&n&&n(p)}),[p]),(0,o.useEffect)((function(){return function(){c&&c.dispose()}}),[]),p}},react:
|
|
62
|
+
/*!**************************************************************************************!*\
|
|
63
|
+
!*** external {"commonjs":"react","commonjs2":"react","amd":"react","root":"React"} ***!
|
|
64
|
+
\**************************************************************************************/t=>{t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e].call(i.exports,i,i.exports,r),i.exports}return r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r("./src/index.ts")})(),f.exports=u(r);const p={mobileS:320,mobileM:375,mobileL:480,tablet:1199,desktopM:1399,desktopL:1999,desktop4k:3840};var h=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},y="object"==typeof d&&d&&d.Object===Object&&d,m="object"==typeof self&&self&&self.Object===Object&&self,g=y||m||Function("return this")(),v=g,b=function(){return v.Date.now()},w=/\s/;var S=function(e){for(var t=e.length;t--&&w.test(e.charAt(t)););return t},x=/^\s+/;var $=function(e){return e?e.slice(0,S(e)+1).replace(x,""):e},F=g.Symbol,_=F,O=Object.prototype,j=O.hasOwnProperty,H=O.toString,B=_?_.toStringTag:void 0;var C=function(e){var t=j.call(e,B),n=e[B];try{e[B]=void 0;var r=!0}catch(e){}var o=H.call(e);return r&&(t?e[B]=n:delete e[B]),o},D=Object.prototype.toString;var k=C,E=function(e){return D.call(e)},z=F?F.toStringTag:void 0;var T=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":z&&z in Object(e)?k(e):E(e)};var P=T,A=function(e){return null!=e&&"object"==typeof e};var W=function(e){return"symbol"==typeof e||A(e)&&"[object Symbol]"==P(e)},I=$,L=h,R=W,M=/^[-+]0x[0-9a-f]+$/i,N=/^0b[01]+$/i,V=/^0o[0-7]+$/i,q=parseInt;var Q=h,X=b,G=function(e){if("number"==typeof e)return e;if(R(e))return NaN;if(L(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=L(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=I(e);var n=N.test(e);return n||V.test(e)?q(e.slice(2),n?2:8):M.test(e)?NaN:+e},U=Math.max,Y=Math.min;var J=function(e,t,n){var r,o,i,a,l,c,s=0,u=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=r,i=o;return r=o=void 0,s=t,a=e.apply(i,n)}function h(e){return s=e,l=setTimeout(m,t),u?p(e):a}function y(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-s>=i}function m(){var e=X();if(y(e))return g(e);l=setTimeout(m,function(e){var n=t-(e-c);return d?Y(n,i-(e-s)):n}(e))}function g(e){return l=void 0,f&&r?p(e):(r=o=void 0,a)}function v(){var e=X(),n=y(e);if(r=arguments,o=this,c=e,n){if(void 0===l)return h(c);if(d)return clearTimeout(l),l=setTimeout(m,t),p(c)}return void 0===l&&(l=setTimeout(m,t)),a}return t=G(t)||0,Q(n)&&(u=!!n.leading,i=(d="maxWait"in n)?U(G(n.maxWait)||0,t):i,f="trailing"in n?!!n.trailing:f),v.cancel=function(){void 0!==l&&clearTimeout(l),s=0,r=c=o=l=void 0},v.flush=function(){return void 0===l?a:g(X())},v};const Z=c.div`
|
|
65
|
+
position: fixed;
|
|
66
|
+
left: 0;
|
|
67
|
+
top: 0;
|
|
68
|
+
height: 0;
|
|
69
|
+
width: 0;
|
|
70
|
+
visibility: hidden;
|
|
71
|
+
z-index: ${e=>e.zIndex||(e.$stacked?99999:99998)};
|
|
72
|
+
|
|
73
|
+
${e=>{if(e.$show)return s`
|
|
74
|
+
height: 100%;
|
|
75
|
+
width: 100vw;
|
|
76
|
+
visibility: visible;
|
|
77
|
+
`}}
|
|
78
|
+
`,K=c.div`
|
|
79
|
+
position: absolute;
|
|
80
|
+
left: 0;
|
|
81
|
+
top: 0;
|
|
82
|
+
background-color: rgba(5, 1, 1, ${e=>e.$backgroundOpacity});
|
|
83
|
+
backdrop-filter: ${e=>(e=>{let t="";return e&&(t+="blur(10px)"),t.length>0?t:"none"})(e.$backgroundBlur)};
|
|
84
|
+
transition: opacity 200ms ease;
|
|
85
|
+
|
|
86
|
+
${e=>{let t="";return e.$show?t+=s`
|
|
87
|
+
visibility: visible;
|
|
88
|
+
opacity: 1;
|
|
89
|
+
pointer-events: auto;
|
|
90
|
+
height: 100%;
|
|
91
|
+
width: 100vw;
|
|
92
|
+
`:t+=s`
|
|
93
|
+
visibility: hidden;
|
|
94
|
+
opacity: 0;
|
|
95
|
+
transition-delay: ${e.$disableTransition?"0ms":"400ms"};
|
|
96
|
+
pointer-events: none;
|
|
97
|
+
height: 0;
|
|
98
|
+
width: 0;
|
|
99
|
+
`,e.$disableTransition&&(t+=s`
|
|
100
|
+
transition: none;
|
|
101
|
+
`),t}}
|
|
102
|
+
`,ee=({show:t=!1,rootId:n,onOverlayClick:c,children:s,backgroundOpacity:u,backgroundBlur:d=!0,disableTransition:f=!1,enableOverlayClick:p=!1,zIndex:h,id:y})=>{const[m,g]=o(null),[v,b]=o(),w=i(),S=i(null),x=s&&r.cloneElement(s,{ref:S}),$=y?`lifesg-ds-overlay-root-${y}`:"lifesg-ds-overlay-root";a((()=>{if(t){const e=O();if(F(e),!e){const e=setTimeout((()=>{H("add")}),200);return()=>clearTimeout(e)}}else if(!w.current){const e=setTimeout((()=>{H("add")}),200);return()=>clearTimeout(e)}}),[t]),a((()=>{g(_());const e=O();return F(e),e||j(),()=>{H("remove")}}),[]);const F=e=>{w.current=e,b(e)},_=()=>document&&n?document.getElementById(n):document?document.body:null,O=()=>document.body.classList.contains(ne),j=()=>{if(!document.getElementById(te)){const e=document.createElement("style");e.id=te;const t=document.documentElement.clientWidth,n=window.innerWidth-t;e.innerHTML=`\n\t\t\t\t.${ne} {\n\t\t\t\t\toverflow: hidden;\n\t\t\t\t\tpadding-right: ${n}px !important;\n\t\t\t\t\t-ms-overflow-style: none;\n\t\t\t\t\tscrollbar-width: none;\n\t\t\t\t}\n\n\t\t\t\t.${ne}::-webkit-scrollbar {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t`,document.body.appendChild(e)}},H=e=>{const t=document.body.classList.contains(ne);"add"!==e||t?"remove"===e&&t&&document.body.classList.remove(ne):document.body.classList.add(ne)},B=e=>{e.preventDefault();const t=S.current?.firstChild;t&&t.contains(e.target)||c&&p&&c()};return m?l.createPortal(e(Z,{id:$,"data-testid":$,$show:t,zIndex:h,$stacked:v,children:s&&e(K,{"data-testid":"overlay-wrapper",$show:t,$backgroundOpacity:u||(v?.5:.8),$backgroundBlur:d,$disableTransition:f,$enableOverlayClick:p,onClick:B,children:x})}),m):null},te="lifesg-ds-overlay-stylesheet",ne="lifesg-ds-overlay-open",re=e=>Object.keys(p).reduce(((t,n)=>{const r=p[n];return t[n]=`@media screen and (${e}: ${r}px)`,t}),{}),oe=re("max-width"),ie=(re("min-width"),c.div`
|
|
103
|
+
position: relative;
|
|
104
|
+
display: flex;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
align-items: center;
|
|
107
|
+
height: 100%;
|
|
108
|
+
width: 100%;
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
${e=>{return t=e.show,n=e.animationFrom||"bottom",t?`\n\t\t\t${n}: 0;\n\t\t\topacity: 1;\n\t\t\ttransition: all 300ms cubic-bezier(0.21, 0.79, 0.53, 1);\n\t\t\ttransition-delay: 200ms;\n\t\t`:`\n\t\t${n}: -3%;\n\t\topacity: 0;\n\t\ttransition: all 300ms cubic-bezier(0.4, 0.34, 0.38, 1);\n\t`;var t,n}}
|
|
111
|
+
|
|
112
|
+
${e=>e.verticalHeight?s`
|
|
113
|
+
${oe.mobileL} {
|
|
114
|
+
height: calc(${e.verticalHeight}px * 100);
|
|
115
|
+
}
|
|
116
|
+
`:s`
|
|
117
|
+
${oe.mobileL} {
|
|
118
|
+
height: calc(1vh * 100);
|
|
119
|
+
}
|
|
120
|
+
`}
|
|
121
|
+
`),ae=({id:t="modal",show:n,animationFrom:r="bottom",children:i,enableOverlayClick:l=!0,rootComponentId:c,zIndex:s,onOverlayClick:u,...d})=>{const[f,p]=o();a((()=>(p(.01*window.innerHeight),window.addEventListener("resize",h),()=>{window.removeEventListener("resize",h)})),[]);const h=()=>{const e=.01*window.innerHeight;p(e)};return e(ee,{"data-testid":`${t}-overlay`,show:n,enableOverlayClick:l,onOverlayClick:u,id:t,rootId:c,zIndex:s,children:e(ie,{show:n,animationFrom:r,"data-testid":t,verticalHeight:f,...d,children:i})})};var le=Array.isArray,ce=le,se=W,ue=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,de=/^\w*$/;var fe=function(e,t){if(ce(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!se(e))||(de.test(e)||!ue.test(e)||null!=t&&e in Object(t))},pe=T,he=h;var ye,me=function(e){if(!he(e))return!1;var t=pe(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ge=g["__core-js_shared__"],ve=(ye=/[^.]+$/.exec(ge&&ge.keys&&ge.keys.IE_PROTO||""))?"Symbol(src)_1."+ye:"";var be=function(e){return!!ve&&ve in e},we=Function.prototype.toString;var Se=me,xe=be,$e=h,Fe=function(e){if(null!=e){try{return we.call(e)}catch(e){}try{return e+""}catch(e){}}return""},_e=/^\[object .+?Constructor\]$/,Oe=Function.prototype,je=Object.prototype,He=Oe.toString,Be=je.hasOwnProperty,Ce=RegExp("^"+He.call(Be).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var De=function(e){return!(!$e(e)||xe(e))&&(Se(e)?Ce:_e).test(Fe(e))},ke=function(e,t){return null==e?void 0:e[t]};var Ee=function(e,t){var n=ke(e,t);return De(n)?n:void 0},ze=Ee(Object,"create"),Te=ze;var Pe=function(){this.__data__=Te?Te(null):{},this.size=0};var Ae=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},We=ze,Ie=Object.prototype.hasOwnProperty;var Le=function(e){var t=this.__data__;if(We){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Ie.call(t,e)?t[e]:void 0},Re=ze,Me=Object.prototype.hasOwnProperty;var Ne=ze;var Ve=Pe,qe=Ae,Qe=Le,Xe=function(e){var t=this.__data__;return Re?void 0!==t[e]:Me.call(t,e)},Ge=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ne&&void 0===t?"__lodash_hash_undefined__":t,this};function Ue(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ue.prototype.clear=Ve,Ue.prototype.delete=qe,Ue.prototype.get=Qe,Ue.prototype.has=Xe,Ue.prototype.set=Ge;var Ye=Ue;var Je=function(){this.__data__=[],this.size=0};var Ze=function(e,t){return e===t||e!=e&&t!=t};var Ke=function(e,t){for(var n=e.length;n--;)if(Ze(e[n][0],t))return n;return-1},et=Ke,tt=Array.prototype.splice;var nt=Ke;var rt=Ke;var ot=Ke;var it=Je,at=function(e){var t=this.__data__,n=et(t,e);return!(n<0)&&(n==t.length-1?t.pop():tt.call(t,n,1),--this.size,!0)},lt=function(e){var t=this.__data__,n=nt(t,e);return n<0?void 0:t[n][1]},ct=function(e){return rt(this.__data__,e)>-1},st=function(e,t){var n=this.__data__,r=ot(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function ut(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ut.prototype.clear=it,ut.prototype.delete=at,ut.prototype.get=lt,ut.prototype.has=ct,ut.prototype.set=st;var dt=ut,ft=Ee(g,"Map"),pt=Ye,ht=dt,yt=ft;var mt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var gt=function(e,t){var n=e.__data__;return mt(t)?n["string"==typeof t?"string":"hash"]:n.map},vt=gt;var bt=gt;var wt=gt;var St=gt;var xt=function(){this.size=0,this.__data__={hash:new pt,map:new(yt||ht),string:new pt}},$t=function(e){var t=vt(this,e).delete(e);return this.size-=t?1:0,t},Ft=function(e){return bt(this,e).get(e)},_t=function(e){return wt(this,e).has(e)},Ot=function(e,t){var n=St(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function jt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}jt.prototype.clear=xt,jt.prototype.delete=$t,jt.prototype.get=Ft,jt.prototype.has=_t,jt.prototype.set=Ot;var Ht=jt;function Bt(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Bt.Cache||Ht),n}Bt.Cache=Ht;var Ct=Bt;var Dt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kt=/\\(\\)?/g,Et=function(e){var t=Ct(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Dt,(function(e,n,r,o){t.push(r?o.replace(kt,"$1"):n||e)})),t}));var zt=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o},Tt=le,Pt=W,At=F?F.prototype:void 0,Wt=At?At.toString:void 0;var It=function e(t){if("string"==typeof t)return t;if(Tt(t))return zt(t,e)+"";if(Pt(t))return Wt?Wt.call(t):"";var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n},Lt=It;var Rt=le,Mt=fe,Nt=Et,Vt=function(e){return null==e?"":Lt(e)};var qt=W;var Qt=function(e,t){return Rt(e)?e:Mt(e,t)?[e]:Nt(Vt(e))},Xt=function(e){if("string"==typeof e||qt(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var Gt=function(e,t){for(var n=0,r=(t=Qt(t,e)).length;null!=e&&n<r;)e=e[Xt(t[n++])];return n&&n==r?e:void 0};var Ut=function(e,t,n){var r=null==e?void 0:Gt(e,t);return void 0===r?n:r};const Yt=(e,t,n)=>t?Ut(n,t)||Ut(e,t):n||e,Jt=(e,t)=>{const n=t||e.defaultValue;return Ut(e.collections,n)};var Zt;!function(e){e.colorScheme="colorScheme",e.layout="layout",e.textStyleScheme="textStyleScheme"}(Zt||(Zt={}));const Kt={collections:{base:{Brand:{1:"#EF413D",2:"#F26664",3:"#F58E8B",4:"#F9B5B2",5:"#FDDDD7",6:"#FFEEEA"},Primary:"#1C76D5",PrimaryDark:"#1869BF",Secondary:"#0056b3",Accent:{Dark:{1:"#465A88",2:"#556D99",3:"#8D8DBF"},Light:{1:"#57A9FF",2:"#81BFFF",3:"#BED7FF",4:"#E2ECFD",5:"#F6F8FF",6:"#FBFCFE"}},Neutral:{1:"#282828",2:"#424242",3:"#686868",4:"#A4A4A4",5:"#E0E4E5",6:"#ECEFEF",7:"#F8F8F8",8:"#FFFFFF"},Validation:{Green:{Text:"#097123",Icon:"#4FC029",Border:"#95D97F",Background:"#F9FDF8"},Orange:{Text:"#B34E00",Icon:"#FEAB10",Border:"#F9CB77",Background:"#FFFCF7",Badge:"#F57F17"},Red:{Text:"#C60000",Icon:"#C60000",Border:"#DD6666",Background:"#FDF7F7"}}},bookingsg:{Brand:{1:"#EF413D",2:"#F26664",3:"#F58E8B",4:"#F9B5B2",5:"#FDDDD7",6:"#FFEEEA"},Primary:"#6F4AB8",PrimaryDark:"#6443A6",Secondary:"#6443A6",Accent:{Dark:{1:"#355985",2:"#68819D",3:"#9AABBE"},Light:{1:"#9F82D9",2:"#B5A5D7",3:"#CEC3E4 ",4:"#E2DBEF",5:"#F2EFF8",6:"#F7F6FB"}},Neutral:{1:"#282828",2:"#424242",3:"#686868",4:"#A4A4A4",5:"#E0E4E5",6:"#ECEFEF",7:"#F8F8F8",8:"#FFFFFF"},Validation:{Green:{Text:"#097123",Icon:"#4FC029",Border:"#95D97F",Background:"#F9FDF8"},Orange:{Text:"#B34E00",Icon:"#FEAB10",Border:"#F9CB77",Background:"#FFFCF7",Badge:"#F57F17"},Red:{Text:"#C60000",Icon:"#C60000",Border:"#DD6666",Background:"#FDF7F7"}}}},defaultValue:"base"},en=e=>t=>{const n=t.theme,r=Jt(Kt,n[Zt.colorScheme]);return n.options&&n.options.color?Yt(r,e,n.options.color):Yt(r,e)},tn=(en("Brand.1"),en("Brand.2"),en("Brand.3"),en("Brand.4"),en("Brand.5"),en("Brand.6"),en("Primary")),nn=(en("PrimaryDark"),en("Secondary")),rn={Light:{1:en("Accent.Light.1"),2:en("Accent.Light.2"),3:en("Accent.Light.3"),4:en("Accent.Light.4"),5:en("Accent.Light.5"),6:en("Accent.Light.6")},Dark:{1:en("Accent.Dark.1"),2:en("Accent.Dark.2"),3:en("Accent.Dark.3")}},on={1:en("Neutral.1"),2:en("Neutral.2"),3:en("Neutral.3"),4:en("Neutral.4"),5:en("Neutral.5"),6:en("Neutral.6"),7:en("Neutral.7"),8:en("Neutral.8")},an=(en("Validation.Green.Text"),en("Validation.Green.Icon"),en("Validation.Green.Border"),en("Validation.Green.Background"),en("Validation.Orange.Text"),en("Validation.Orange.Icon"),en("Validation.Orange.Border"),en("Validation.Orange.Background"),en("Validation.Orange.Badge"),en("Validation.Red.Text"),en("Validation.Red.Icon"),en("Validation.Red.Border"),en("Validation.Red.Background"),c.svg`
|
|
122
|
+
height: 1rem;
|
|
123
|
+
width: 1rem;
|
|
124
|
+
vertical-align: text-top;
|
|
125
|
+
|
|
126
|
+
#path {
|
|
127
|
+
fill: ${on[8]};
|
|
128
|
+
}
|
|
129
|
+
`),ln=t=>e(an,{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 16 16",...t,children:e("g",{fill:"none",fillRule:"evenodd",children:e("g",{id:"path",fillRule:"nonzero",children:e("g",{children:e("g",{children:e("g",{children:e("path",{d:"M8.706 14.603l6.075-6.075c.294-.29.294-.765 0-1.06L8.706 1.398c-.29-.294-.765-.294-1.06 0l-.693.694c-.3.297-.294.78.013 1.072L10.73 6.75H1.75c-.416 0-.75.334-.75.75v1c0 .416.334.75.75.75h8.981l-3.765 3.587c-.304.291-.31.775-.013 1.072l.694.694c.29.294.765.294 1.06 0z",transform:"translate(-2384.000000, -760.000000) translate(2253.000000, 692.000000) translate(16.000000, 64.000000) translate(115.000000, 4.000000) translate(0.000000, 0.000000)"})})})})})})}),cn=t=>e(an,{width:"1rem",height:"1rem",viewBox:"0 0 40 40",xmlns:"http://www.w3.org/2000/svg",...t,children:e("path",{id:"path",d:"M20\n\t\t8.639c-.934\n\t\t0-1.742.342-2.43 1.03-.684.684-1.03 1.495-1.03 2.429 0 .931.346 1.742 1.03 2.426.688.688 1.496 1.03 2.43 1.03.931 0 1.742-.342 2.43-1.03.684-.684 1.026-1.495 1.026-2.426 0-.934-.342-1.745-1.026-2.43-.688-.687-1.499-1.03-2.43-1.03m4.61 20.91v-1.976a.959.959 0 0 0-.287-.7.959.959 0 0 0-.7-.286h-.99v-8.232a.954.954 0 0 0-.287-.7.945.945 0 0 0-.7-.29h-5.269a.95.95 0 0 0-.7.29.954.954 0 0 0-.286.7v1.976c0 .271.095.506.286.7a.959.959 0 0 0 .7.287h.99v5.269h-.99a.959.959 0 0 0-.7.286.959.959 0 0 0-.286.7v1.977c0 .274.095.505.286.7a.959.959 0 0 0 .7.286h7.246a.959.959 0 0 0 .7-.287.959.959 0 0 0 .286-.7M20 2.5c3.15 0 6.068.788 8.75 2.365a17.67 17.67 0 0 1 6.385 6.386C36.71 13.933 37.5 16.848 37.5 20c0 3.15-.79 6.068-2.365 8.751a17.71 17.71 0 0 1-6.385 6.385C26.068 36.712 23.15 37.5 20 37.5c-3.153 0-6.068-.788-8.75-2.363a17.71 17.71 0 0 1-6.385-6.385c-1.575-2.683-2.365-5.6-2.365-8.75 0-3.154.79-6.069 2.365-8.751a17.67 17.67 0 0 1 6.385-6.386C13.932 3.288 16.847 2.5 20 2.5",fillRule:"nonzero"})}),sn=t=>e(an,{xmlns:"http://www.w3.org/2000/svg",width:"2rem",height:"2rem",viewBox:"0 0 64 64",id:"play-icon",...t,children:e("path",{id:"path",d:"M52.762 37.237 20.474 53.38A5.856 5.856 0 0 1 12 48.143V15.856a5.856 5.856 0 0 1 8.474-5.238l32.288 16.144a5.856 5.856 0 0 1 0 10.475z",fillRule:"nonzero"})}),un=t=>e(an,{xmlns:"http://www.w3.org/2000/svg",width:"2rem",height:"2rem",viewBox:"0 0 32 32",fill:"none",...t,children:e("g",{id:"search",children:e("path",{id:"path",fillRule:"evenodd",clipRule:"evenodd",d:"M7.60986 7.60986C5.86994 9.34977 5 11.445 5 13.8956C5 16.3462 5.86994 18.4414 7.60986 20.1813C9.34977 21.9212 11.445 22.7911 13.8956 22.7911C15.6355 22.7911 17.2345 22.3133 18.6926 21.3576L24.2063 26.8713C24.3044 26.9571 24.4146 27 24.5372 27C24.6597 27 24.77 26.9571 24.868 26.8713L26.8713 24.868C26.9571 24.77 27 24.6597 27 24.5372C27 24.4146 26.9571 24.3044 26.8713 24.2063L21.3576 18.6926C22.3133 17.2345 22.7911 15.6355 22.7911 13.8956C22.7911 11.445 21.9212 9.34977 20.1813 7.60986C18.4414 5.86994 16.3462 5 13.8956 5C11.445 5 9.34977 5.86994 7.60986 7.60986ZM9.59484 18.178C8.4063 16.9894 7.81205 15.562 7.81205 13.8956C7.81205 12.2292 8.4063 10.8017 9.59484 9.61321C10.7834 8.42468 12.2169 7.83042 13.8956 7.83042C15.5742 7.83042 17.0047 8.42162 18.1872 9.60403C19.3696 10.7864 19.9608 12.2169 19.9608 13.8956C19.9608 15.5742 19.3696 17.0047 18.1872 18.1872C17.0047 19.3696 15.5742 19.9608 13.8956 19.9608C12.2169 19.9608 10.7834 19.3665 9.59484 18.178Z"})})}),dn=({type:t,...n})=>{switch(t){case"arrow-right":return e(ln,{...n});case"info":return e(cn,{...n});case"search":return e(un,{...n});case"play-alt":return e(sn,{...n});default:{const r=`sgds-icon sgds-icon-${t}`,o=n.className?`${r} ${n.className}`:r;return e(fn,{...n,className:o})}}},fn=c.span`
|
|
130
|
+
font-size: 1rem;
|
|
131
|
+
`,pn={Regular:"Open Sans",Semibold:"Open Sans Semibold",Bold:"Open Sans Bold",Light:"Open Sans Light"},hn={collections:{base:{D1:{fontFamily:pn.Bold,fontSize:3,fontWeight:700,lineHeight:4,letterSpacing:-.056},D2:{fontFamily:pn.Bold,fontSize:2.5,fontWeight:700,lineHeight:3.5,letterSpacing:-.032},D3:{fontFamily:pn.Bold,fontSize:1.625,fontWeight:700,lineHeight:2.25},D4:{fontFamily:pn.Bold,fontSize:1.375,fontWeight:700,lineHeight:1.75},DBody:{fontFamily:pn.Regular,fontSize:1.375,lineHeight:1.75},H1:{fontFamily:pn.Bold,fontSize:2,fontWeight:700,lineHeight:2.5},H2:{fontFamily:pn.Bold,fontSize:1.625,fontWeight:700,lineHeight:2.25},H3:{fontFamily:pn.Bold,fontSize:1.375,fontWeight:700,lineHeight:1.75},H4:{fontFamily:pn.Bold,fontSize:1.125,fontWeight:700,lineHeight:1.625},H5:{fontFamily:pn.Bold,fontSize:1,fontWeight:700,lineHeight:1.5,letterSpacing:.014},H6:{fontFamily:pn.Bold,fontSize:.875,fontWeight:700,lineHeight:1.6,letterSpacing:.012},Body:{fontFamily:pn.Regular,fontSize:1.125,lineHeight:1.625},BodySmall:{fontFamily:pn.Regular,fontSize:1,lineHeight:1.5,letterSpacing:.014},XSmall:{fontFamily:pn.Regular,fontSize:.75,lineHeight:1.2,letterSpacing:.012}}},defaultValue:"base"},yn=e=>t=>{const n=t.theme,r=Jt(hn,n[Zt.textStyleScheme]);return n.options&&n.options.textStyle?Yt(r,e,n.options.textStyle):Yt(r,e)},mn={D1:{fontFamily:yn("D1.fontFamily"),fontSize:yn("D1.fontSize"),fontWeight:yn("D1.fontWeight"),lineHeight:yn("D1.lineHeight"),letterSpacing:yn("D1.letterSpacing")},D2:{fontFamily:yn("D2.fontFamily"),fontSize:yn("D2.fontSize"),fontWeight:yn("D2.fontWeight"),lineHeight:yn("D2.lineHeight"),letterSpacing:yn("D2.letterSpacing")},D3:{fontFamily:yn("D3.fontFamily"),fontSize:yn("D3.fontSize"),fontWeight:yn("D3.fontWeight"),lineHeight:yn("D3.lineHeight"),letterSpacing:yn("D3.letterSpacing")},D4:{fontFamily:yn("D4.fontFamily"),fontSize:yn("D4.fontSize"),fontWeight:yn("D4.fontWeight"),lineHeight:yn("D4.lineHeight"),letterSpacing:yn("D4.letterSpacing")},DBody:{fontFamily:yn("DBody.fontFamily"),fontSize:yn("DBody.fontSize"),fontWeight:yn("DBody.fontWeight"),lineHeight:yn("DBody.lineHeight"),letterSpacing:yn("DBody.letterSpacing")},H1:{fontFamily:yn("H1.fontFamily"),fontSize:yn("H1.fontSize"),fontWeight:yn("H1.fontWeight"),lineHeight:yn("H1.lineHeight"),letterSpacing:yn("H1.letterSpacing")},H2:{fontFamily:yn("H2.fontFamily"),fontSize:yn("H2.fontSize"),fontWeight:yn("H2.fontWeight"),lineHeight:yn("H2.lineHeight"),letterSpacing:yn("H2.letterSpacing")},H3:{fontFamily:yn("H3.fontFamily"),fontSize:yn("H3.fontSize"),fontWeight:yn("H3.fontWeight"),lineHeight:yn("H3.lineHeight"),letterSpacing:yn("H3.letterSpacing")},H4:{fontFamily:yn("H4.fontFamily"),fontSize:yn("H4.fontSize"),fontWeight:yn("H4.fontWeight"),lineHeight:yn("H4.lineHeight"),letterSpacing:yn("H4.letterSpacing")},H5:{fontFamily:yn("H5.fontFamily"),fontSize:yn("H5.fontSize"),fontWeight:yn("H5.fontWeight"),lineHeight:yn("H5.lineHeight"),letterSpacing:yn("H5.letterSpacing")},H6:{fontFamily:yn("H6.fontFamily"),fontSize:yn("H6.fontSize"),fontWeight:yn("H6.fontWeight"),lineHeight:yn("H6.lineHeight"),letterSpacing:yn("H6.letterSpacing")},Body:{fontFamily:yn("Body.fontFamily"),fontSize:yn("Body.fontSize"),fontWeight:yn("Body.fontWeight"),lineHeight:yn("Body.lineHeight"),letterSpacing:yn("Body.letterSpacing")},BodySmall:{fontFamily:yn("BodySmall.fontFamily"),fontSize:yn("BodySmall.fontSize"),fontWeight:yn("BodySmall.fontWeight"),lineHeight:yn("BodySmall.lineHeight"),letterSpacing:yn("BodySmall.letterSpacing")},XSmall:{fontFamily:yn("XSmall.fontFamily"),fontSize:yn("XSmall.fontSize"),fontWeight:yn("XSmall.fontWeight"),lineHeight:yn("XSmall.lineHeight"),letterSpacing:yn("XSmall.letterSpacing")}},gn=e=>{switch(e){case 700:case"bold":return pn.Bold;case 600:case"semibold":return pn.Semibold;case 300:case"light":return pn.Light;case 400:case"regular":return pn.Regular;default:return""}},vn=(e,t)=>n=>{const r=mn[e].fontFamily(n),o=mn[e].fontWeight(n);return Object.values(pn).includes(r)?s`
|
|
132
|
+
font-family: ${gn(t)||gn(o)||r};
|
|
133
|
+
font-weight: normal !important;
|
|
134
|
+
`:s`
|
|
135
|
+
font-family: ${r};
|
|
136
|
+
font-weight: ${(bn(t)||o)??"normal"};
|
|
137
|
+
`},bn=e=>{switch(e){case 300:case"light":return 300;case 400:case"regular":return 400;case 600:case"semibold":return 600;case 700:case"bold":return 700;case 900:case"black":return 900;default:return""}},wn=(e,t,n=!1)=>r=>{const o=mn[e],i=o.fontSize(r);return s`
|
|
138
|
+
${vn(e,t)}
|
|
139
|
+
font-size: ${i}rem !important;
|
|
140
|
+
line-height: ${o.lineHeight}rem !important;
|
|
141
|
+
letter-spacing: ${o.letterSpacing(r)||0}rem !important;
|
|
142
|
+
${s`
|
|
143
|
+
margin-bottom: ${i*(n?1.05:0)}rem;
|
|
144
|
+
`}
|
|
145
|
+
`},Sn=(e=!1,t=!1)=>t?s`
|
|
146
|
+
display: block;
|
|
147
|
+
`:e?s`
|
|
148
|
+
display: inline;
|
|
149
|
+
`:s`
|
|
150
|
+
display: block;
|
|
151
|
+
`;var xn;!function(e){e.D1=c.h1`
|
|
152
|
+
${e=>s`
|
|
153
|
+
${wn("D1",e.weight,e.paragraph)}
|
|
154
|
+
color: ${on[1]};
|
|
155
|
+
${Sn(e.inline,e.paragraph)}
|
|
156
|
+
`}
|
|
157
|
+
`,e.D2=c.h1`
|
|
158
|
+
${e=>s`
|
|
159
|
+
${wn("D2",e.weight,e.paragraph)}
|
|
160
|
+
color: ${on[1]};
|
|
161
|
+
${Sn(e.inline,e.paragraph)}
|
|
162
|
+
`}
|
|
163
|
+
`,e.D3=c.h1`
|
|
164
|
+
${e=>s`
|
|
165
|
+
${wn("D3",e.weight,e.paragraph)}
|
|
166
|
+
color: ${on[1]};
|
|
167
|
+
${Sn(e.inline,e.paragraph)}
|
|
168
|
+
`}
|
|
169
|
+
`,e.D4=c.h1`
|
|
170
|
+
${e=>s`
|
|
171
|
+
${wn("D4",e.weight,e.paragraph)}
|
|
172
|
+
color: ${on[1]};
|
|
173
|
+
${Sn(e.inline,e.paragraph)}
|
|
174
|
+
`}
|
|
175
|
+
`,e.DBody=c.h1`
|
|
176
|
+
${e=>s`
|
|
177
|
+
${wn("DBody",e.weight,e.paragraph)}
|
|
178
|
+
color: ${on[1]};
|
|
179
|
+
${Sn(e.inline,e.paragraph)}
|
|
180
|
+
`}
|
|
181
|
+
`,e.H1=c.h1`
|
|
182
|
+
${e=>s`
|
|
183
|
+
${wn("H1",e.weight,e.paragraph)}
|
|
184
|
+
color: ${on[1]};
|
|
185
|
+
${Sn(e.inline,e.paragraph)}
|
|
186
|
+
`}
|
|
187
|
+
`,e.H2=c.h2`
|
|
188
|
+
${e=>s`
|
|
189
|
+
${wn("H2",e.weight,e.paragraph)}
|
|
190
|
+
color: ${on[1]};
|
|
191
|
+
${Sn(e.inline,e.paragraph)}
|
|
192
|
+
`}
|
|
193
|
+
`,e.H3=c.h3`
|
|
194
|
+
${e=>s`
|
|
195
|
+
${wn("H3",e.weight,e.paragraph)}
|
|
196
|
+
color: ${on[1]};
|
|
197
|
+
${Sn(e.inline,e.paragraph)}
|
|
198
|
+
`}
|
|
199
|
+
`,e.H4=c.h4`
|
|
200
|
+
${e=>s`
|
|
201
|
+
${wn("H4",e.weight,e.paragraph)}
|
|
202
|
+
color: ${on[1]};
|
|
203
|
+
${Sn(e.inline,e.paragraph)}
|
|
204
|
+
`}
|
|
205
|
+
`,e.H5=c.h5`
|
|
206
|
+
${e=>s`
|
|
207
|
+
${wn("H5",e.weight,e.paragraph)}
|
|
208
|
+
color: ${on[1]};
|
|
209
|
+
${Sn(e.inline,e.paragraph)}
|
|
210
|
+
`}
|
|
211
|
+
`,e.H6=c.h6`
|
|
212
|
+
${e=>s`
|
|
213
|
+
${wn("H6",e.weight,e.paragraph)}
|
|
214
|
+
color: ${on[1]};
|
|
215
|
+
${Sn(e.inline,e.paragraph)}
|
|
216
|
+
`}
|
|
217
|
+
`,e.Body=c.p`
|
|
218
|
+
${e=>s`
|
|
219
|
+
${wn("Body",e.weight,e.paragraph)}
|
|
220
|
+
color: ${on[1]};
|
|
221
|
+
${Sn(e.inline,e.paragraph)}
|
|
222
|
+
`}
|
|
223
|
+
`,e.BodySmall=c.p`
|
|
224
|
+
${e=>s`
|
|
225
|
+
${wn("BodySmall",e.weight,e.paragraph)}
|
|
226
|
+
color: ${on[1]};
|
|
227
|
+
${Sn(e.inline,e.paragraph)}
|
|
228
|
+
`}
|
|
229
|
+
`,e.XSmall=c.span`
|
|
230
|
+
${e=>s`
|
|
231
|
+
${wn("XSmall",e.weight,e.paragraph)}
|
|
232
|
+
color: ${on[1]};
|
|
233
|
+
${Sn(e.inline,e.paragraph)}
|
|
234
|
+
`}
|
|
235
|
+
`,e.Hyperlink={Default:e=>_n({...e,textStyle:"Body"}),Small:e=>_n({...e,textStyle:"BodySmall"})}}(xn||(xn={}));const $n=c.a`
|
|
236
|
+
${e=>s`
|
|
237
|
+
${wn(e.textStyle,e.weight)}
|
|
238
|
+
color: ${tn};
|
|
239
|
+
text-decoration: none;
|
|
240
|
+
|
|
241
|
+
:hover,
|
|
242
|
+
:active,
|
|
243
|
+
:focus {
|
|
244
|
+
color: ${nn};
|
|
245
|
+
}
|
|
246
|
+
`}
|
|
247
|
+
`,Fn=c(dn)`
|
|
248
|
+
margin-left: 0.4rem;
|
|
249
|
+
`,_n=({external:n=!1,children:r,...o})=>t($n,{...o,children:[r,n&&e(Fn,{type:"external"})]}),On=c.button`
|
|
250
|
+
display: flex;
|
|
251
|
+
justify-content: center;
|
|
252
|
+
align-items: center;
|
|
253
|
+
padding: 1.5rem;
|
|
254
|
+
background-color: ${on[8]};
|
|
255
|
+
border: none;
|
|
256
|
+
cursor: pointer;
|
|
257
|
+
|
|
258
|
+
img {
|
|
259
|
+
height: 1rem;
|
|
260
|
+
width: 1rem;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
&:focus {
|
|
264
|
+
outline: none;
|
|
265
|
+
background-color: ${on[7]};
|
|
266
|
+
}
|
|
267
|
+
`,jn=r.forwardRef((({children:t,iconType:n,...r},o)=>{let i;if(t)i=t;else{if(!n)return console.error("IconButton - Did not specify a valid children or iconType prop"),null;i=e(dn,{type:n})}return e(On,{ref:o,...r,children:i})})),Hn=c.div`
|
|
268
|
+
position: relative;
|
|
269
|
+
display: flex;
|
|
270
|
+
flex-direction: column;
|
|
271
|
+
width: 40rem;
|
|
272
|
+
max-height: 70%;
|
|
273
|
+
background: ${on[8]};
|
|
274
|
+
box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.45);
|
|
275
|
+
border-radius: 0.75rem;
|
|
276
|
+
overflow: hidden;
|
|
277
|
+
|
|
278
|
+
${oe.mobileL} {
|
|
279
|
+
width: 90%;
|
|
280
|
+
max-height: 70%;
|
|
281
|
+
}
|
|
282
|
+
`,Bn=c(jn)`
|
|
283
|
+
position: absolute;
|
|
284
|
+
top: 0;
|
|
285
|
+
right: 0;
|
|
286
|
+
padding: 1rem 0.75rem;
|
|
287
|
+
border-top-right-radius: 0.75rem;
|
|
288
|
+
background: transparent;
|
|
289
|
+
:focus-visible,
|
|
290
|
+
:focus,
|
|
291
|
+
:active {
|
|
292
|
+
background: transparent;
|
|
293
|
+
}
|
|
294
|
+
:focus-visible {
|
|
295
|
+
outline: 4px solid ${rn.Light[1]};
|
|
296
|
+
}
|
|
297
|
+
`,Cn=c(dn)`
|
|
298
|
+
font-size: 2rem;
|
|
299
|
+
color: ${on[4]};
|
|
300
|
+
`,Dn="all 300ms cubic-bezier(0.21, 0.79, 0.53, 1)",kn=c.div`
|
|
301
|
+
border-radius: 8px;
|
|
302
|
+
background: ${on[8]};
|
|
303
|
+
padding: 1rem 2rem;
|
|
304
|
+
box-shadow: 0 2px 8px 0 rgba(104, 104, 104, 0.24);
|
|
305
|
+
max-width: 30rem;
|
|
306
|
+
pointer-events: auto;
|
|
307
|
+
position: absolute;
|
|
308
|
+
|
|
309
|
+
${e=>e.$visible?s`
|
|
310
|
+
visibility: visible;
|
|
311
|
+
opacity: 1;
|
|
312
|
+
transition: ${Dn};
|
|
313
|
+
z-index: 2;
|
|
314
|
+
`:s`
|
|
315
|
+
visibility: hidden;
|
|
316
|
+
opacity: 0;
|
|
317
|
+
transition: ${Dn};
|
|
318
|
+
z-index: -1;
|
|
319
|
+
`}
|
|
320
|
+
${e=>(e=>{switch(e){case"top-center":return s`
|
|
321
|
+
top: calc(100% + 12px);
|
|
322
|
+
width: max-content;
|
|
323
|
+
margin: auto;
|
|
324
|
+
left: 50%;
|
|
325
|
+
-moz-transform: translateX(-50%);
|
|
326
|
+
-webkit-transform: translateX(-50%);
|
|
327
|
+
transform: translateX(-50%);
|
|
328
|
+
`;case"top-left":return s`
|
|
329
|
+
top: calc(100% + 12px);
|
|
330
|
+
width: max-content;
|
|
331
|
+
margin: auto;
|
|
332
|
+
left: 0;
|
|
333
|
+
`;case"top-right":return s`
|
|
334
|
+
top: calc(100% + 12px);
|
|
335
|
+
width: max-content;
|
|
336
|
+
margin: auto;
|
|
337
|
+
right: 0;
|
|
338
|
+
`;case"left":return s`
|
|
339
|
+
bottom: calc(100% + 12px);
|
|
340
|
+
width: max-content;
|
|
341
|
+
margin: auto;
|
|
342
|
+
left: 0;
|
|
343
|
+
`;case"right":return s`
|
|
344
|
+
bottom: calc(100% + 12px);
|
|
345
|
+
width: max-content;
|
|
346
|
+
margin: auto;
|
|
347
|
+
right: 0;
|
|
348
|
+
`;default:return s`
|
|
349
|
+
bottom: calc(100% + 12px);
|
|
350
|
+
width: max-content;
|
|
351
|
+
margin: auto;
|
|
352
|
+
left: 50%;
|
|
353
|
+
-moz-transform: translateX(-50%);
|
|
354
|
+
-webkit-transform: translateX(-50%);
|
|
355
|
+
transform: translateX(-50%);
|
|
356
|
+
`}})(e.$offset)}
|
|
357
|
+
|
|
358
|
+
${oe.mobileL} {
|
|
359
|
+
display: none;
|
|
360
|
+
}
|
|
361
|
+
`,En=c((({id:n="modal-box",children:r,onClose:o,showCloseButton:i=!0,...a})=>t(Hn,{"data-testid":n,...a,onClick:e=>{e.stopPropagation()},children:[i&&e(Bn,{type:"button",onClick:o,"data-testid":"close-button",children:e(Cn,{type:"cross"})}),r]})))`
|
|
362
|
+
padding: 3.5rem 1.25rem 2.5rem;
|
|
363
|
+
`,zn=c.div`
|
|
364
|
+
position: relative;
|
|
365
|
+
width: fit-content;
|
|
366
|
+
`,Tn=c.button`
|
|
367
|
+
cursor: pointer;
|
|
368
|
+
background: none;
|
|
369
|
+
border: none;
|
|
370
|
+
padding: 0;
|
|
371
|
+
`,Pn=({children:r,visible:l,onMobileClose:c,...s})=>{const u=s["data-testid"]||"popover",[d,h]=o("none"),y=i(null),m=f.exports.useMediaQuery({maxWidth:p.mobileL}),g=i(d);a((()=>(w(),window.addEventListener("resize",J(v,300)),()=>{window.removeEventListener("resize",J(v,300))})),[]);const v=()=>{w()},b=()=>{c&&c()},w=()=>{const e=S();var t;e&&(t=e,g.current=t,h(t))},S=()=>{if(y.current){const e=y.current.getBoundingClientRect(),t=24,n=e.y<t,r=window.innerWidth-t;return e.x<t?n?"top-left":"left":e.x+e.width>r?n?"top-right":"right":("top-left"===g.current||"left"===g.current)&&e.x-e.width/2>t||("top-right"===g.current||"right"===g.current)&&e.x+2*e.width<r?n?"top-center":"none":void 0}},x=()=>"string"==typeof r?e(xn.BodySmall,{children:r}):r;return t(n,{children:[e(kn,{ref:y,"data-testid":u,$visible:l,$offset:d,...s,children:x()}),m&&e(ae,{show:l,onOverlayClick:b,children:e(En,{onClose:b,children:x()})})]})},An=(n,r)=>l=>{const{onPopoverAppear:c,onPopoverDismiss:s,...u}=l,d=r.trigger||"click",h=u,[y,m]=o(!1),g=i(),v=f.exports.useMediaQuery({maxWidth:p.mobileL});a((()=>{if(!v)return document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b)}}),[y]);const b=e=>{g&&!g.current.contains(e.target)&&(y&&m(!1),s&&s())};return t(zn,{id:"popover-hoc-wrapper",ref:g,children:[e(Tn,{id:`popover-hoc-trigger${r["data-testid"]&&`-${r["data-testid"]}`}`,type:"button",onClick:e=>{e.preventDefault(),("click"===d||v)&&(m(!y),!y&&c&&c(),y&&s&&s())},onMouseEnter:()=>{"hover"!==d||v||m(!0)},onMouseLeave:()=>{"hover"===d&&y&&!v&&m(!1)},"aria-label":"popover-button",children:e(n,{...h})}),e(Pn,{visible:y,id:r.id,"data-testid":r["data-testid"],onMobileClose:()=>{m(!1)},children:r.content})]})};export{Pn as Popover,An as withPopover};
|
|
372
|
+
//# sourceMappingURL=index.js.map
|