@hhgtech/hhg-components 1.18.51 → 1.18.52
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/build/care.js +1 -1
- package/build/components.js +1 -1
- package/build/{useTranslations-5afc8996.js → cookieHelper-dda8dbe1.js} +2 -2
- package/build/cookieHelper-dda8dbe1.js.map +1 -0
- package/build/core.d.ts +6 -0
- package/build/core.js +2 -0
- package/build/core.js.map +1 -0
- package/build/esm/care.js +1 -1
- package/build/esm/components.js +1 -1
- package/build/esm/cookieHelper-6f220950.js +2 -0
- package/build/esm/cookieHelper-6f220950.js.map +1 -0
- package/build/esm/core.d.ts +6 -0
- package/build/esm/core.js +2 -0
- package/build/esm/core.js.map +1 -0
- package/build/esm/index-5141dacb.js +2 -0
- package/build/esm/{index-5d764c22.js.map → index-5141dacb.js.map} +1 -1
- package/build/esm/{index-bf224a7a.js → index-7132f4f6.js} +2 -2
- package/build/esm/{index-bf224a7a.js.map → index-7132f4f6.js.map} +1 -1
- package/build/esm/index-9d55875e.js +2 -0
- package/build/esm/{index-78ed862d.js.map → index-9d55875e.js.map} +1 -1
- package/build/esm/index-e958af70.js +2 -0
- package/build/esm/index-e958af70.js.map +1 -0
- package/build/esm/index.js +1 -1
- package/build/esm/index.styled-e54aba6d.js +2 -0
- package/build/esm/{index.styled-623a73c4.js.map → index.styled-e54aba6d.js.map} +1 -1
- package/build/esm/navigation.js +1 -1
- package/build/esm/together.js +1 -1
- package/build/esm/types-4906ea0d.js +2 -0
- package/build/esm/{types-370ad93a.js.map → types-4906ea0d.js.map} +1 -1
- package/build/esm/types-4a772485.js +2 -0
- package/build/esm/types-4a772485.js.map +1 -0
- package/build/esm/types-b3ae1911.js +2 -0
- package/build/esm/{types-533a03f3.js.map → types-b3ae1911.js.map} +1 -1
- package/build/esm/useScrollbarSize-99db33e1.js +2 -0
- package/build/esm/useScrollbarSize-99db33e1.js.map +1 -0
- package/build/esm/useTranslations-824bc4ba.js +2 -0
- package/build/esm/useTranslations-824bc4ba.js.map +1 -0
- package/build/index-464cb2a2.js +2 -0
- package/build/index-464cb2a2.js.map +1 -0
- package/build/index-4fd66577.js +2 -0
- package/build/{index-378e9415.js.map → index-4fd66577.js.map} +1 -1
- package/build/{index-3d3c5ade.js → index-5fd48792.js} +2 -2
- package/build/{index-3d3c5ade.js.map → index-5fd48792.js.map} +1 -1
- package/build/index-fd4a7699.js +2 -0
- package/build/{index-fa839075.js.map → index-fd4a7699.js.map} +1 -1
- package/build/index.js +1 -1
- package/build/index.styled-81c03994.js +2 -0
- package/build/{index.styled-90a49a4d.js.map → index.styled-81c03994.js.map} +1 -1
- package/build/navigation.js +1 -1
- package/build/together.js +1 -1
- package/build/types-01c9c692.js +2 -0
- package/build/{types-2502acac.js.map → types-01c9c692.js.map} +1 -1
- package/build/types-340fb704.js +2 -0
- package/build/{types-4dc34eec.js.map → types-340fb704.js.map} +1 -1
- package/build/types-521f641a.js +2 -0
- package/build/types-521f641a.js.map +1 -0
- package/build/useScrollbarSize-586f6706.js +2 -0
- package/build/useScrollbarSize-586f6706.js.map +1 -0
- package/build/useTranslations-0aa60f65.js +2 -0
- package/build/useTranslations-0aa60f65.js.map +1 -0
- package/package.json +60 -1
- package/build/esm/index-5d764c22.js +0 -2
- package/build/esm/index-78ed862d.js +0 -2
- package/build/esm/index-dda84841.js +0 -2
- package/build/esm/index-dda84841.js.map +0 -1
- package/build/esm/index.styled-623a73c4.js +0 -2
- package/build/esm/types-370ad93a.js +0 -2
- package/build/esm/types-533a03f3.js +0 -2
- package/build/esm/useTranslations-07b12611.js +0 -2
- package/build/esm/useTranslations-07b12611.js.map +0 -1
- package/build/index-378e9415.js +0 -2
- package/build/index-b80f3e08.js +0 -2
- package/build/index-b80f3e08.js.map +0 -1
- package/build/index-fa839075.js +0 -2
- package/build/index.styled-90a49a4d.js +0 -2
- package/build/types-2502acac.js +0 -2
- package/build/types-4dc34eec.js +0 -2
- package/build/useTranslations-5afc8996.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-521f641a.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("lodash/debounce"));exports.MEASURE_ELEMENT_CLASS="measure-scrollbar-size",exports.useScrollbarSize=function(t){void 0===t&&(t=!0);var n=e.useState({height:0,width:0}),i=n[0],u=n[1],o=e.useRef(null);return e.useEffect((function(){if(t&&"undefined"!=typeof window){var e=function(){return o.current||(o.current=document.createElement("div"),o.current.classList.add("measure-scrollbar-size"),o.current.style.width="99px",o.current.style.height="99px",o.current.style.overflow="scroll",o.current.style.position="absolute",o.current.style.top="-9999px",o.current.setAttribute("aria-hidden","true"),o.current.setAttribute("role","presentation")),o.current},n=function(){var t=e(),r=t.offsetHeight,n=t.clientHeight,i=t.offsetWidth,o=t.clientWidth,c=r-n,s=i-o;u((function(e){var t=e.height,r=e.width;return t!==c||r!==s?{height:c,width:s}:e}))},i=r.default(n,100);window.addEventListener("resize",i),document.body.appendChild(e()),n();var c=e();return function(){i.cancel(),window.removeEventListener("resize",i),document.body.removeChild(c)}}}),[t]),i};
|
|
2
|
+
//# sourceMappingURL=useScrollbarSize-586f6706.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScrollbarSize-586f6706.js","sources":["../src/hooks/useScrollbarSize.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react'\n\nimport debounce from 'lodash/debounce'\n\nexport interface ScrollbarMeasurements {\n /** Current height of the scrollbar */\n height: number\n /** Current width of the scrollbar */\n width: number\n}\nexport const MEASURE_ELEMENT_CLASS = 'measure-scrollbar-size'\nconst useScrollbarSize = (trigger = true): ScrollbarMeasurements => {\n const [dimensions, setDimensions] = useState({ height: 0, width: 0 })\n const element = useRef<HTMLDivElement | null>(null)\n\n // initialize resize event handler and state when mounted\n useEffect(() => {\n if (!trigger || typeof window === 'undefined') {\n return\n }\n const getElement = () => {\n if (!element.current) {\n // element was not created yet -- initialize\n element.current = document.createElement('div')\n element.current.classList.add(MEASURE_ELEMENT_CLASS)\n element.current.style.width = '99px'\n element.current.style.height = '99px'\n element.current.style.overflow = 'scroll'\n element.current.style.position = 'absolute'\n element.current.style.top = '-9999px'\n element.current.setAttribute('aria-hidden', 'true')\n element.current.setAttribute('role', 'presentation')\n }\n return element.current\n }\n\n const updateState = () => {\n const {\n offsetHeight,\n clientHeight,\n offsetWidth,\n clientWidth,\n } = getElement()\n const scrollbarHeight = offsetHeight - clientHeight\n const scrollbarWidth = offsetWidth - clientWidth\n\n setDimensions((currentDimensions) => {\n const { height, width } = currentDimensions\n return height !== scrollbarHeight || width !== scrollbarWidth\n ? { height: scrollbarHeight, width: scrollbarWidth }\n : currentDimensions\n })\n }\n\n const handleResize = debounce(updateState, 100)\n\n // initialize\n window.addEventListener('resize', handleResize)\n document.body.appendChild(getElement())\n updateState()\n\n const elementToRemove = getElement()\n // cleanup\n return () => {\n handleResize.cancel()\n window.removeEventListener('resize', handleResize)\n document.body.removeChild(elementToRemove)\n }\n }, [trigger])\n\n return dimensions\n}\n\nexport { useScrollbarSize }\n"],"names":["trigger","_a","useState","height","width","dimensions","setDimensions","element","useRef","useEffect","window","getElement","current","document","createElement","classList","add","style","overflow","position","top","setAttribute","updateState","offsetHeight","clientHeight","offsetWidth","clientWidth","scrollbarHeight","scrollbarWidth","currentDimensions","handleResize","debounce","addEventListener","body","appendChild","elementToRemove","cancel","removeEventListener","removeChild"],"mappings":"8KAUqC,kDACZ,SAACA,QAAA,IAAAA,IAAAA,GAAc,GAChC,IAAAC,EAA8BC,EAAAA,SAAS,CAAEC,OAAQ,EAAGC,MAAO,IAA1DC,OAAYC,OACbC,EAAUC,SAA8B,MAyD9C,OAtDAC,EAAAA,WAAU,WACR,GAAKT,GAA6B,oBAAXU,OAAvB,CAGA,IAAMC,EAAa,WAajB,OAZKJ,EAAQK,UAEXL,EAAQK,QAAUC,SAASC,cAAc,OACzCP,EAAQK,QAAQG,UAAUC,IAdG,0BAe7BT,EAAQK,QAAQK,MAAMb,MAAQ,OAC9BG,EAAQK,QAAQK,MAAMd,OAAS,OAC/BI,EAAQK,QAAQK,MAAMC,SAAW,SACjCX,EAAQK,QAAQK,MAAME,SAAW,WACjCZ,EAAQK,QAAQK,MAAMG,IAAM,UAC5Bb,EAAQK,QAAQS,aAAa,cAAe,QAC5Cd,EAAQK,QAAQS,aAAa,OAAQ,iBAEhCd,EAAQK,SAGXU,EAAc,WACZ,IAAArB,EAKFU,IAJFY,EAAYtB,EAAAsB,aACZC,EAAYvB,EAAAuB,aACZC,EAAWxB,EAAAwB,YACXC,gBAEIC,EAAkBJ,EAAeC,EACjCI,EAAiBH,EAAcC,EAErCpB,GAAc,SAACuB,GACL,IAAA1B,EAAkB0B,EAAiB1B,OAA3BC,EAAUyB,EAAiBzB,MAC3C,OAAOD,IAAWwB,GAAmBvB,IAAUwB,EAC3C,CAAEzB,OAAQwB,EAAiBvB,MAAOwB,GAClCC,MAIFC,EAAeC,EAAAA,QAAST,EAAa,KAG3CZ,OAAOsB,iBAAiB,SAAUF,GAClCjB,SAASoB,KAAKC,YAAYvB,KAC1BW,IAEA,IAAMa,EAAkBxB,IAExB,OAAO,WACLmB,EAAaM,SACb1B,OAAO2B,oBAAoB,SAAUP,GACrCjB,SAASoB,KAAKK,YAAYH,OAE3B,CAACnC,IAEGK"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var n,t,e,r,o=require("./tslib.es6-f7929e76.js"),a=require("styled-components"),i=require("react"),c=require("./translationsContext-63e3e5ec.js"),s=function(n){var t=Object.keys(n);return t.length?"?"+t.map((function(t){return"".concat(t,"=").concat(n[t])})).join("&"):""},u={BREAK_POINT_MOBILE:768,BREAK_POINT_TABLET:1024,BREAK_POINT_PC:1200},l={mbDown:"@media (max-width: ".concat(u.BREAK_POINT_MOBILE-1,"px)"),mbUp:"@media (min-width: ".concat(u.BREAK_POINT_MOBILE,"px)"),tdDown:"@media (max-width: ".concat(u.BREAK_POINT_TABLET-1,"px)"),tdOnly:"@media (min-width: ".concat(u.BREAK_POINT_MOBILE,"px) and (max-width: ").concat(u.BREAK_POINT_TABLET-1,"px)"),tdUp:"@media (min-width: ".concat(u.BREAK_POINT_TABLET,"px)"),pcUp:"@media (min-width: ".concat(u.BREAK_POINT_PC,"px)"),pcOnly:"@media (min-width: ".concat(u.BREAK_POINT_TABLET,"px) and (max-width: ").concat(u.BREAK_POINT_PC-1,"px)"),pcDown:"@media (max-width: ".concat(u.BREAK_POINT_PC-1,"px)")},p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(n){var t={exports:{}};return n(t,t.exports),t.exports}var m=d((function(n){(function(t){function e(n){var t=new Error(n);return t.name="ValueError",t}function r(n){return function(t){var r=Array.prototype.slice.call(arguments,1),o=0,a="UNDEFINED";return t.replace(/([{}])\1|[{](.*?)(?:!(.+?))?[}]/g,(function(t,i,c,s){if(null!=i)return i;var u=c;if(u.length>0){if("IMPLICIT"===a)throw e("cannot switch from implicit to explicit numbering");a="EXPLICIT"}else{if("EXPLICIT"===a)throw e("cannot switch from explicit to implicit numbering");a="IMPLICIT",u=String(o),o+=1}var l=u.split("."),p=(/^\d+$/.test(l[0])?l:["0"].concat(l)).reduce((function(n,t){return n.reduce((function(n,e){return null!=e&&t in Object(e)?["function"==typeof e[t]?e[t]():e[t]]:[]}),[])}),[r]).reduce((function(n,t){return t}),"");if(null==s)return p;if(Object.prototype.hasOwnProperty.call(n,s))return n[s](p);throw e('no transformer named "'+s+'"')}))}}var o=r({});o.create=r,o.extend=function(n,e){var o=r(e);n.format=function(){var n=Array.prototype.slice.call(arguments);return n.unshift(this),o.apply(t,n)}},n.exports=o}).call(p,p)}));exports.Breakpoints=u,exports.MediaQueries=l,exports.commonjsGlobal=p,exports.createCommonjsModule=d,exports.formatUrlWithPageParam=function(n,t,e){void 0===t&&(t=1),void 0===e&&(e="page");var r=n.split("?"),o=r[0],a=r[1],i=new URLSearchParams(a||""),c={};return i.forEach((function(n,t){n&&(c[t]=n)})),Number(t)>1?c[e]=String(t):delete c[e],o+s(c)},exports.getBoundariesFromMediaQueryKey=function(n){switch(n){case"mbDown":return[0,u.BREAK_POINT_MOBILE-1];case"mbUp":return[u.BREAK_POINT_MOBILE,0];case"tdDown":return[0,u.BREAK_POINT_TABLET-1];case"tdOnly":return[u.BREAK_POINT_MOBILE,u.BREAK_POINT_TABLET-1];case"tdUp":return[u.BREAK_POINT_TABLET,0];case"pcUp":return[u.BREAK_POINT_PC,0];case"pcOnly":return[u.BREAK_POINT_TABLET,u.BREAK_POINT_PC-1];case"pcDown":return[0,u.BREAK_POINT_PC-1]}},exports.makeParams=s,exports.mbLayout=function(){return function(n){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return a.css(t||(t=o.__makeTemplateObject(["\n @media (max-width: ","px) {\n ",";\n }\n "],["\n @media (max-width: ","px) {\n ",";\n }\n "])),1023,a.css.apply(void 0,o.__spreadArray([n],e,!1)))}},exports.pcLayout=function(n){return function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return a.css(r||(r=o.__makeTemplateObject(["\n @media (min-width: ","px) {\n ",";\n }\n "],["\n @media (min-width: ","px) {\n ",";\n }\n "])),n?768:1024,a.css.apply(void 0,o.__spreadArray([t],e,!1)))}},exports.spLayout=function(){return function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return a.css(n||(n=o.__makeTemplateObject(["\n @media (max-width: ","px) {\n ",";\n }\n "],["\n @media (max-width: ","px) {\n ",";\n }\n "])),767,a.css.apply(void 0,o.__spreadArray([t],e,!1)))}},exports.stringFormat=m,exports.tdLayout=function(){return function(n){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return a.css(e||(e=o.__makeTemplateObject(["\n @media (min-width: ","px) and (max-width: ","px) {\n ",";\n }\n "],["\n @media (min-width: ","px) and (max-width: ","px) {\n ",";\n }\n "])),768,1023,a.css.apply(void 0,o.__spreadArray([n],t,!1)))}},exports.toggleNoScroll=function(n){"undefined"!=typeof window&&(document.documentElement.classList.toggle("noscroll",n),document.body.classList.toggle("noscroll",n))},exports.useTranslations=function(){var n=i.useContext(c.TranslationsContext)||{locale:"en-PH"},t=n.values,e=n.locale;return i.useMemo((function(){return{t:function(n,r){return t?t[n]?r?m(t[n]||n,r):t[n]||n:(console.warn("[useTranslations] Missing translation for key ".concat(n," and locale ").concat(e)),r?m(c.defaultTranslations[n]||n,r):c.defaultTranslations[n]||n):(console.error("[useTranslations] t method called before translation values are loaded"),n)},locale:e}}),[t,e])};
|
|
2
|
+
//# sourceMappingURL=useTranslations-0aa60f65.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTranslations-0aa60f65.js","sources":["../src/misc/utils.ts","../node_modules/string-format/index.js","../src/hooks/useTranslations.tsx"],"sourcesContent":["import { css } from 'styled-components'\nconst BREAK_POINT = 768\nconst BREAK_POINT_TABLET = 1024\n\n/**\n * The breakpoint for smartphone devices less than 768.\n * @example\n * ${(props: ThemeProps) => spLayout()`\n * color: ${props.theme.colors.neutral100};\n * `}\n * @example\n * ${spLayout()`\n * color: ${(props) => props.theme.colors.neutral100};\n * `}\n */\n\nexport const spLayout = () => {\n return (style: TemplateStringsArray, ...exps) => css`\n @media (max-width: ${BREAK_POINT - 1}px) {\n ${css(style, ...exps)};\n }\n `\n}\n\n/**\n * The breakpoint for mobile and tablet devices less than 1024\n * @example\n * ${(props: ThemeProps) => mbLayout()`\n * color: ${props.theme.colors.neutral100};\n * `}\n * @example\n * ${mbLayout()`\n * color: ${(props) => props.theme.colors.neutral100};\n * `}\n */\nexport const mbLayout = () => {\n return (style: TemplateStringsArray, ...exps) => css`\n @media (max-width: ${BREAK_POINT_TABLET - 1}px) {\n ${css(style, ...exps)};\n }\n `\n}\n\n/**\n * The breakpoint for tablet devices only between 768 and 1024\n * @example\n * ${(props: ThemeProps) => tdLayout()`\n * color: ${props.theme.colors.neutral100};\n * `}\n * @example\n * ${tdLayout()`\n * color: ${(props) => props.theme.colors.neutral100};\n * `}\n */\nexport const tdLayout = () => {\n return (style: TemplateStringsArray, ...exps) => css`\n @media (min-width: ${BREAK_POINT}px) and (max-width: ${BREAK_POINT_TABLET - 1}px) {\n ${css(style, ...exps)};\n }\n `\n}\n\n/**\n * The breakpoint for pc/laptop devices greater than or equal 1024.\n * @example\n * ${(props: ThemeProps) => pcLayout()`\n * color: ${props.theme.colors.neutral100};\n * `}\n * @example\n * ${pcLayout()`\n * color: ${(props) => props.theme.colors.neutral100};\n * `}\n */\nexport const pcLayout = (useBreakpointMobile?: boolean) => {\n return (style: TemplateStringsArray, ...exps) => css`\n @media (min-width: ${useBreakpointMobile ? BREAK_POINT : BREAK_POINT_TABLET}px) {\n ${css(style, ...exps)};\n }\n `\n}\n\nexport const makeParams = (params: Record<string, string>): string => {\n const paramKeys = Object.keys(params)\n if (!paramKeys.length) {\n return ''\n }\n return '?' + paramKeys.map((k: string) => `${k}=${params[k]}`).join('&')\n}\n\nexport const formatUrlWithPageParam = (\n path: string,\n page = 1,\n queryPageName = 'page',\n) => {\n const [urlPart, queryPart] = path.split('?')\n const urlObj = new URLSearchParams(queryPart || '')\n const params: Record<string, string> = {}\n\n urlObj.forEach((val, key) => {\n if (val) {\n params[key] = val\n }\n })\n\n if (Number(page) > 1) {\n params[queryPageName] = String(page) // Default is params.page\n } else {\n // Do not display \"page=1\" on the URL\n delete params[queryPageName] // Default is params.page\n }\n\n return urlPart + makeParams(params)\n}\n\nexport const toggleNoScroll = (isNoScroll?: boolean) => {\n if (typeof window !== 'undefined') {\n document.documentElement.classList.toggle('noscroll', isNoScroll)\n document.body.classList.toggle('noscroll', isNoScroll)\n }\n}\n\nexport const Breakpoints = {\n BREAK_POINT_MOBILE: 768,\n BREAK_POINT_TABLET: 1024,\n BREAK_POINT_PC: 1200,\n}\n\n/**\n * List of mediaQueries to use in StyledComponents\n * New naming convention base around breakpoints\n *\n * Note: mb = mobile, td = tablet device, pc = pc/laptop device\n *\n * mbDown: REPLACE spLayout. BREAK_POINT_MOBILE go down.\n * mbUp: REPLACE pcLayout(true). BREAK_POINT_MOBILE go up\n * tdDown: REPLACE mbLayout. BREAK_POINT_TABLET go down\n * tdOnly: REPLACE tdLayout. from BREAK_POINT_MOBILE to BREAK_POINT_TABLET\n * tdUp: REPLACE pcLayout(). BREAK_POINT_TABLET go up\n * pcDown: BREAK_POINT_PC go down\n * pcOnly: from BREAK_POINT_TABLET to BREAK_POINT_PC\n * pcUp: BREAK_POINT_PC go up\n *\n * @example\n * ${MediaQueries.mbDown} {\n * color: ${(props) => props.theme.colors.neutral100 }};\n * }\n */\nexport const MediaQueries = {\n mbDown: `@media (max-width: ${Breakpoints.BREAK_POINT_MOBILE - 1}px)`,\n mbUp: `@media (min-width: ${Breakpoints.BREAK_POINT_MOBILE}px)`,\n \n tdDown: `@media (max-width: ${Breakpoints.BREAK_POINT_TABLET - 1}px)`,\n tdOnly: `@media (min-width: ${Breakpoints.BREAK_POINT_MOBILE\n }px) and (max-width: ${Breakpoints.BREAK_POINT_TABLET - 1}px)`,\n tdUp: `@media (min-width: ${Breakpoints.BREAK_POINT_TABLET}px)`,\n \n pcUp: `@media (min-width: ${Breakpoints.BREAK_POINT_PC}px)`,\n pcOnly: `@media (min-width: ${Breakpoints.BREAK_POINT_TABLET}px) and (max-width: ${Breakpoints.BREAK_POINT_PC - 1}px)`,\n pcDown: `@media (max-width: ${Breakpoints.BREAK_POINT_PC - 1}px)`,\n}\n\nexport const getBoundariesFromMediaQueryKey = (key?: keyof typeof MediaQueries) => {\n // zero mean not set\n switch(key) {\n case 'mbDown': return [0, Breakpoints.BREAK_POINT_MOBILE - 1]\n case 'mbUp': return [Breakpoints.BREAK_POINT_MOBILE, 0]\n\n case 'tdDown': return [0, Breakpoints.BREAK_POINT_TABLET - 1]\n case 'tdOnly': return [Breakpoints.BREAK_POINT_MOBILE, Breakpoints.BREAK_POINT_TABLET - 1]\n case 'tdUp': return [Breakpoints.BREAK_POINT_TABLET, 0]\n\n case 'pcUp': return [Breakpoints.BREAK_POINT_PC, 0]\n case 'pcOnly': return [Breakpoints.BREAK_POINT_TABLET, Breakpoints.BREAK_POINT_PC - 1]\n case 'pcDown': return [0, Breakpoints.BREAK_POINT_PC - 1]\n }\n}","void function(global) {\n\n 'use strict';\n\n // ValueError :: String -> Error\n function ValueError(message) {\n var err = new Error(message);\n err.name = 'ValueError';\n return err;\n }\n\n // create :: Object -> String,*... -> String\n function create(transformers) {\n return function(template) {\n var args = Array.prototype.slice.call(arguments, 1);\n var idx = 0;\n var state = 'UNDEFINED';\n\n return template.replace(\n /([{}])\\1|[{](.*?)(?:!(.+?))?[}]/g,\n function(match, literal, _key, xf) {\n if (literal != null) {\n return literal;\n }\n var key = _key;\n if (key.length > 0) {\n if (state === 'IMPLICIT') {\n throw ValueError('cannot switch from ' +\n 'implicit to explicit numbering');\n }\n state = 'EXPLICIT';\n } else {\n if (state === 'EXPLICIT') {\n throw ValueError('cannot switch from ' +\n 'explicit to implicit numbering');\n }\n state = 'IMPLICIT';\n key = String(idx);\n idx += 1;\n }\n\n // 1. Split the key into a lookup path.\n // 2. If the first path component is not an index, prepend '0'.\n // 3. Reduce the lookup path to a single result. If the lookup\n // succeeds the result is a singleton array containing the\n // value at the lookup path; otherwise the result is [].\n // 4. Unwrap the result by reducing with '' as the default value.\n var path = key.split('.');\n var value = (/^\\d+$/.test(path[0]) ? path : ['0'].concat(path))\n .reduce(function(maybe, key) {\n return maybe.reduce(function(_, x) {\n return x != null && key in Object(x) ?\n [typeof x[key] === 'function' ? x[key]() : x[key]] :\n [];\n }, []);\n }, [args])\n .reduce(function(_, x) { return x; }, '');\n\n if (xf == null) {\n return value;\n } else if (Object.prototype.hasOwnProperty.call(transformers, xf)) {\n return transformers[xf](value);\n } else {\n throw ValueError('no transformer named \"' + xf + '\"');\n }\n }\n );\n };\n }\n\n // format :: String,*... -> String\n var format = create({});\n\n // format.create :: Object -> String,*... -> String\n format.create = create;\n\n // format.extend :: Object,Object -> ()\n format.extend = function(prototype, transformers) {\n var $format = create(transformers);\n prototype.format = function() {\n var args = Array.prototype.slice.call(arguments);\n args.unshift(this);\n return $format.apply(global, args);\n };\n };\n\n /* istanbul ignore else */\n if (typeof module !== 'undefined') {\n module.exports = format;\n } else if (typeof define === 'function' && define.amd) {\n define(function() { return format; });\n } else {\n global.format = format;\n }\n\n}.call(this, this);\n","import { useContext, useMemo } from 'react'\n\nimport { defaultTranslations, TranslationsKey } from 'i18n/translations'\nimport { TranslationsContext } from 'i18n/translationsContext'\nimport { LocaleType } from 'interfaces/types'\nimport formatString from 'string-format'\n\ntype UseTranslationsReturn<L> = {\n locale: L\n t: (k: TranslationsKey, option?: { [key: string]: any }) => string\n}\n\nexport function useTranslations<L = LocaleType>(): UseTranslationsReturn<L> {\n const { values, locale } = useContext(TranslationsContext) || {\n locale: 'en-PH',\n }\n return useMemo(\n () => ({\n t(k, option?) {\n if (!values) {\n console.error(\n '[useTranslations] t method called before translation values are loaded',\n )\n return k\n }\n if (values[k]) {\n return option ? formatString(values[k] || k, option) : values[k] || k\n }\n console.warn(\n `[useTranslations] Missing translation for key ${k} and locale ${locale}`,\n )\n return option\n ? formatString(defaultTranslations[k] || k, option)\n : defaultTranslations[k] || k\n },\n // @ts-ignore\n locale,\n }),\n [values, locale],\n )\n}\n"],"names":["makeParams","params","paramKeys","Object","keys","length","map","k","concat","join","Breakpoints","BREAK_POINT_MOBILE","BREAK_POINT_TABLET","BREAK_POINT_PC","MediaQueries","mbDown","mbUp","tdDown","tdOnly","tdUp","pcUp","pcOnly","pcDown","global","ValueError","message","err","Error","name","create","transformers","template","args","Array","prototype","slice","call","arguments","idx","state","replace","match","literal","_key","xf","key","String","path","split","value","test","reduce","maybe","_","x","hasOwnProperty","format","extend","$format","unshift","this","apply","module","exports","page","queryPageName","_a","urlPart","queryPart","urlObj","URLSearchParams","forEach","val","Number","style","exps","_i","css","templateObject_2","__makeTemplateObject","__spreadArray","useBreakpointMobile","templateObject_1","BREAK_POINT","isNoScroll","window","document","documentElement","classList","toggle","body","useContext","TranslationsContext","locale","values","useMemo","t","option","formatString","console","warn","defaultTranslations","error"],"mappings":"+JAiFaA,EAAa,SAACC,GACzB,IAAMC,EAAYC,OAAOC,KAAKH,GAC9B,OAAKC,EAAUG,OAGR,IAAMH,EAAUI,KAAI,SAACC,GAAc,MAAA,GAAAC,OAAGD,EAAC,KAAAC,OAAIP,EAAOM,OAAME,KAAK,KAF3D,IAqCEC,EAAc,CACzBC,mBAAoB,IACpBC,mBAAoB,KACpBC,eAAgB,MAuBLC,EAAe,CAC1BC,OAAQ,sBAAsBP,OAAAE,EAAYC,mBAAqB,EAAM,OACrEK,KAAM,sBAAAR,OAAsBE,EAAYC,mBAAuB,OAE/DM,OAAQ,sBAAsBT,OAAAE,EAAYE,mBAAqB,EAAM,OACrEM,OAAQ,sBAAsBV,OAAAE,EAAYC,mBACjB,wBAAAH,OAAAE,EAAYE,mBAAqB,EAAM,OAChEO,KAAM,sBAAAX,OAAsBE,EAAYE,mBAAuB,OAE/DQ,KAAM,sBAAAZ,OAAsBE,EAAYG,eAAmB,OAC3DQ,OAAQ,sBAAsBb,OAAAE,EAAYE,mBAAyC,wBAAAJ,OAAAE,EAAYG,eAAiB,EAAM,OACtHS,OAAQ,sBAAsBd,OAAAE,EAAYG,eAAiB,EAAM,gPC9J9D,SAASU,GAKZ,SAASC,EAAWC,GAClB,IAAIC,EAAM,IAAIC,MAAMF,GAEpB,OADAC,EAAIE,KAAO,aACJF,EAIT,SAASG,EAAOC,GACd,OAAO,SAASC,GACd,IAAIC,EAAOC,MAAMC,UAAUC,MAAMC,KAAKC,UAAW,GAC7CC,EAAM,EACNC,EAAQ,YAEZ,OAAOR,EAASS,QACd,oCACA,SAASC,EAAOC,EAASC,EAAMC,GAC7B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|
5
5
|
"module": "build/esm/index.js",
|
|
6
6
|
"files": [
|
|
@@ -153,5 +153,64 @@
|
|
|
153
153
|
"slugify": "^1.6.5",
|
|
154
154
|
"string-format": "^2.0.0",
|
|
155
155
|
"vanilla-lazyload": "^17.6.1"
|
|
156
|
+
},
|
|
157
|
+
"typesVersions": {
|
|
158
|
+
"*": {
|
|
159
|
+
"care": [
|
|
160
|
+
"build/care/index.d.ts"
|
|
161
|
+
],
|
|
162
|
+
"components": [
|
|
163
|
+
"build/components/index.d.ts"
|
|
164
|
+
],
|
|
165
|
+
"core": [
|
|
166
|
+
"build/core.d.ts"
|
|
167
|
+
],
|
|
168
|
+
"ecom": [
|
|
169
|
+
"build/ecom/index.d.ts"
|
|
170
|
+
],
|
|
171
|
+
"i18n": [
|
|
172
|
+
"build/i18n/index.d.ts"
|
|
173
|
+
],
|
|
174
|
+
"navigation": [
|
|
175
|
+
"build/components/organisms/navigationV2/index.d.ts"
|
|
176
|
+
],
|
|
177
|
+
"together": [
|
|
178
|
+
"build/together/index.d.ts"
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"exports": {
|
|
183
|
+
".": {
|
|
184
|
+
"import": "./build/esm/index.js",
|
|
185
|
+
"require": "./build/index.js"
|
|
186
|
+
},
|
|
187
|
+
"./care": {
|
|
188
|
+
"import": "./build/esm/care.js",
|
|
189
|
+
"require": "./build/care.js"
|
|
190
|
+
},
|
|
191
|
+
"./components": {
|
|
192
|
+
"import": "./build/esm/components.js",
|
|
193
|
+
"require": "./build/components.js"
|
|
194
|
+
},
|
|
195
|
+
"./core": {
|
|
196
|
+
"import": "./build/esm/core.js",
|
|
197
|
+
"require": "./build/core.js"
|
|
198
|
+
},
|
|
199
|
+
"./ecom": {
|
|
200
|
+
"import": "./build/esm/ecom.js",
|
|
201
|
+
"require": "./build/ecom.js"
|
|
202
|
+
},
|
|
203
|
+
"./i18n": {
|
|
204
|
+
"import": "./build/esm/i18n.js",
|
|
205
|
+
"require": "./build/i18n.js"
|
|
206
|
+
},
|
|
207
|
+
"./navigation": {
|
|
208
|
+
"import": "./build/esm/navigation.js",
|
|
209
|
+
"require": "./build/navigation.js"
|
|
210
|
+
},
|
|
211
|
+
"./together": {
|
|
212
|
+
"import": "./build/esm/together.js",
|
|
213
|
+
"require": "./build/together.js"
|
|
214
|
+
}
|
|
156
215
|
}
|
|
157
216
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import e from"react";import{aq as a}from"./useTranslations-07b12611.js";import{_ as t}from"./tslib.es6-fd0a5c98.js";import{p as l,q as n,r as i,s,t as d,v as o}from"./index.styled-623a73c4.js";var r=function(t){var l=t.type,n=void 0===l?"solid":l,i=t.className,s=t.style;return e.createElement(a,{style:s,className:i,"data-diver-type":n,dividerType:n})},c=function(a){var r=a.className,c=a.value,u=a.options,v=a.onChange,m=void 0===v?function(){}:v,p=a.id,b=a.placeholderIcon,f=a.placeholder,y=a.style,E=a.size,g=void 0===E?"lg":E,h=a.groupedWithLabel,k=a.disabled,N=a.dropdownLabelTrackingAttributes,C=void 0===N?{}:N,j=a.isNativeSelect,w=void 0!==j&&j,x=e.useState(!1),T=x[0],q=x[1],z=function(){return!k&&q(!T)};return w?e.createElement(l,{as:"select","data-is-native":"true",value:(null==c?void 0:c.value)||void 0,disabled:k,onChange:function(e){if("string"==typeof e.target.value){var a=u.find((function(a){return a.value===e.target.value}));a&&m(a)}}},f&&e.createElement("option",{value:f,disabled:!0,selected:!0},f),u.map((function(a){return e.createElement("option",{key:"".concat(p,"-").concat(a.value),value:a.value,disabled:!!a.disabled&&a.disabled},a.label)}))):e.createElement(l,{className:r,"data-dropdown-open":T||void 0,"data-size":g,id:p,"data-has-icons":!!b,style:y,onBlur:function(){return q(!1)},tabIndex:0,"data-disabled":k},!!h&&e.createElement(n,null,h),e.createElement(i,t({onClick:z,className:h&&"with-label"},C),b," ",e.createElement("span",null,c&&c.value?c.label:f)),T&&e.createElement(s,{onClick:z,"data-has-icons":!!b},u.map((function(a){return e.createElement(d,{key:"".concat(p,"-").concat(a.value),"data-selected":c&&c.value===a.value||void 0,onClick:function(){return!a.disabled&&!k&&(null==m?void 0:m(a))},"data-disabled":!!a.disabled&&a.disabled},a.icon&&e.createElement(o,null,a.icon),a.label)}))))};export{r as D,c as a};
|
|
2
|
-
//# sourceMappingURL=index-5d764c22.js.map
|