@hhgtech/hhg-components 1.18.55 → 1.18.57
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/{cookieHelper-8f8e1c23.js → cookieHelper-ed78a7f1.js} +2 -2
- package/build/{cookieHelper-8f8e1c23.js.map → cookieHelper-ed78a7f1.js.map} +1 -1
- package/build/core.js +1 -1
- package/build/esm/care.js +1 -1
- package/build/esm/components.js +1 -1
- package/build/esm/{cookieHelper-ebb85a98.js → cookieHelper-00386d56.js} +2 -2
- package/build/esm/{cookieHelper-ebb85a98.js.map → cookieHelper-00386d56.js.map} +1 -1
- package/build/esm/core.js +1 -1
- package/build/esm/{index-3a83d01f.js → index-2017ad6a.js} +2 -2
- package/build/esm/{index-3a83d01f.js.map → index-2017ad6a.js.map} +1 -1
- package/build/esm/{index-071a48db.js → index-3e8dfdf1.js} +2 -2
- package/build/esm/{index-071a48db.js.map → index-3e8dfdf1.js.map} +1 -1
- package/build/esm/{index-e875bc07.js → index-6f3f75e7.js} +2 -2
- package/build/esm/{index-e875bc07.js.map → index-6f3f75e7.js.map} +1 -1
- package/build/esm/{index-52510d7b.js → index-9d13187e.js} +2 -2
- package/build/esm/{index-52510d7b.js.map → index-9d13187e.js.map} +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/{index.styled-1243f793.js → index.styled-6a37c4e2.js} +2 -2
- package/build/esm/{index.styled-1243f793.js.map → index.styled-6a37c4e2.js.map} +1 -1
- package/build/esm/navigation.js +1 -1
- package/build/esm/together.js +1 -1
- package/build/esm/{types-af8b0751.js → types-7b676b4a.js} +2 -2
- package/build/esm/{types-af8b0751.js.map → types-7b676b4a.js.map} +1 -1
- package/build/esm/{types-c6e69efa.js → types-f30bb23e.js} +2 -2
- package/build/esm/{types-c6e69efa.js.map → types-f30bb23e.js.map} +1 -1
- package/build/esm/useTranslations-5638eb68.js +2 -0
- package/build/esm/{useTranslations-3c1ac581.js.map → useTranslations-5638eb68.js.map} +1 -1
- package/build/{index-e1e94319.js → index-7d558dd3.js} +2 -2
- package/build/{index-e1e94319.js.map → index-7d558dd3.js.map} +1 -1
- package/build/{index-d6e5d160.js → index-8ced00dc.js} +2 -2
- package/build/{index-d6e5d160.js.map → index-8ced00dc.js.map} +1 -1
- package/build/{index-22beab5e.js → index-bc92ff85.js} +2 -2
- package/build/{index-22beab5e.js.map → index-bc92ff85.js.map} +1 -1
- package/build/{index-9ab35cbd.js → index-fdf894ed.js} +2 -2
- package/build/{index-9ab35cbd.js.map → index-fdf894ed.js.map} +1 -1
- package/build/index.js +1 -1
- package/build/{index.styled-b3f123fe.js → index.styled-22a0a8fe.js} +2 -2
- package/build/{index.styled-b3f123fe.js.map → index.styled-22a0a8fe.js.map} +1 -1
- package/build/navigation.js +1 -1
- package/build/together.js +1 -1
- package/build/{types-c01e247a.js → types-6d50fb9d.js} +2 -2
- package/build/{types-c01e247a.js.map → types-6d50fb9d.js.map} +1 -1
- package/build/{types-fc46d076.js → types-effeb886.js} +2 -2
- package/build/{types-fc46d076.js.map → types-effeb886.js.map} +1 -1
- package/build/useTranslations-00e7c0dc.js +2 -0
- package/build/{useTranslations-423301d0.js.map → useTranslations-00e7c0dc.js.map} +1 -1
- package/package.json +4 -1
- package/build/esm/useTranslations-3c1ac581.js +0 -2
- package/build/useTranslations-423301d0.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e,t,n,r,a=require("./tslib.es6-f7929e76.js"),o=require("styled-components"),i=require("react"),c=require("./translationsContext-63e3e5ec.js"),s={spLayout:!1,pcLayout:!1,tdLayout:!1,mbLayout:!1},u=function(e){var t=Object.keys(e);return t.length?"?"+t.map((function(t){return"".concat(t,"=").concat(e[t])})).join("&"):""},d={BREAK_POINT_SMALL_MOBILE:481,BREAK_POINT_MOBILE:768,BREAK_POINT_TABLET:1024,BREAK_POINT_PC:1200},p={smbDown:"@media (max-width: ".concat(d.BREAK_POINT_SMALL_MOBILE-1,"px)"),smbUp:"@media (min-width: ".concat(d.BREAK_POINT_SMALL_MOBILE,"px)"),mbDown:"@media (max-width: ".concat(d.BREAK_POINT_MOBILE-1,"px)"),mbOnly:"@media (min-width: ".concat(d.BREAK_POINT_SMALL_MOBILE,"px) and (max-width: ").concat(d.BREAK_POINT_MOBILE-1,"px)"),mbUp:"@media (min-width: ".concat(d.BREAK_POINT_MOBILE,"px)"),tdDown:"@media (max-width: ".concat(d.BREAK_POINT_TABLET-1,"px)"),tdOnly:"@media (min-width: ".concat(d.BREAK_POINT_MOBILE,"px) and (max-width: ").concat(d.BREAK_POINT_TABLET-1,"px)"),tdUp:"@media (min-width: ".concat(d.BREAK_POINT_TABLET,"px)"),pcUp:"@media (min-width: ".concat(d.BREAK_POINT_PC,"px)"),pcOnly:"@media (min-width: ".concat(d.BREAK_POINT_TABLET,"px) and (max-width: ").concat(d.BREAK_POINT_PC-1,"px)"),pcDown:"@media (max-width: ".concat(d.BREAK_POINT_PC-1,"px)")},l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function m(e){var t={exports:{}};return e(t,t.exports),t.exports}var _=m((function(e){(function(t){function n(e){var t=new Error(e);return t.name="ValueError",t}function r(e){return function(t){var r=Array.prototype.slice.call(arguments,1),a=0,o="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"===o)throw n("cannot switch from implicit to explicit numbering");o="EXPLICIT"}else{if("EXPLICIT"===o)throw n("cannot switch from explicit to implicit numbering");o="IMPLICIT",u=String(a),a+=1}var d=u.split("."),p=(/^\d+$/.test(d[0])?d:["0"].concat(d)).reduce((function(e,t){return e.reduce((function(e,n){return null!=n&&t in Object(n)?["function"==typeof n[t]?n[t]():n[t]]:[]}),[])}),[r]).reduce((function(e,t){return t}),"");if(null==s)return p;if(Object.prototype.hasOwnProperty.call(e,s))return e[s](p);throw n('no transformer named "'+s+'"')}))}}var a=r({});a.create=r,a.extend=function(e,n){var a=r(n);e.format=function(){var e=Array.prototype.slice.call(arguments);return e.unshift(this),a.apply(t,e)}},e.exports=a}).call(l,l)}));exports.Breakpoints=d,exports.MediaQueries=p,exports.commonjsGlobal=l,exports.createCommonjsModule=m,exports.formatUrlWithPageParam=function(e,t,n){void 0===t&&(t=1),void 0===n&&(n="page");var r=e.split("?"),a=r[0],o=r[1],i=new URLSearchParams(o||""),c={};return i.forEach((function(e,t){e&&(c[t]=e)})),Number(t)>1?c[n]=String(t):delete c[n],a+u(c)},exports.getBoundariesFromMediaQueryKey=function(e){switch(e){case"smbDown":return[0,d.BREAK_POINT_SMALL_MOBILE-1];case"smbUp":return[d.BREAK_POINT_SMALL_MOBILE,0];case"mbDown":return[0,d.BREAK_POINT_MOBILE-1];case"mbOnly":return[d.BREAK_POINT_SMALL_MOBILE,d.BREAK_POINT_MOBILE-1];case"mbUp":return[d.BREAK_POINT_MOBILE,0];case"tdDown":return[0,d.BREAK_POINT_TABLET-1];case"tdOnly":return[d.BREAK_POINT_MOBILE,d.BREAK_POINT_TABLET-1];case"tdUp":return[d.BREAK_POINT_TABLET,0];case"pcUp":return[d.BREAK_POINT_PC,0];case"pcOnly":return[d.BREAK_POINT_TABLET,d.BREAK_POINT_PC-1];case"pcDown":return[0,d.BREAK_POINT_PC-1]}},exports.makeParams=u,exports.mbLayout=function(){return s.mbLayout||(console.error("mbLayout is deprecated. Use `MediaQueries.tdDown` instead."),s.mbLayout=!0),function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return o.css(t||(t=a.__makeTemplateObject(["\n @media (max-width: ","px) {\n ",";\n }\n "],["\n @media (max-width: ","px) {\n ",";\n }\n "])),1023,o.css.apply(void 0,a.__spreadArray([e],n,!1)))}},exports.pcLayout=function(e){return s.pcLayout||(console.error("pcLayout is deprecated. if pcLayout(true) use `MediaQueries.mbUp`. If pcLayout() use `MediaQueries.tdUp`."),s.pcLayout=!0),function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return o.css(r||(r=a.__makeTemplateObject(["\n @media (min-width: ","px) {\n ",";\n }\n "],["\n @media (min-width: ","px) {\n ",";\n }\n "])),e?768:1024,o.css.apply(void 0,a.__spreadArray([t],n,!1)))}},exports.spLayout=function(){return s.spLayout||(console.error("spLayout is deprecated. Use `MediaQueries.mbDown` instead."),s.spLayout=!0),function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return o.css(e||(e=a.__makeTemplateObject(["\n @media (max-width: ","px) {\n ",";\n }\n "],["\n @media (max-width: ","px) {\n ",";\n }\n "])),767,o.css.apply(void 0,a.__spreadArray([t],n,!1)))}},exports.stringFormat=_,exports.tdLayout=function(){return s.tdLayout||(console.error("tdLayout is deprecated. Use `MediaQueries.tdOnly` instead."),s.tdLayout=!0),function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return o.css(n||(n=a.__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,o.css.apply(void 0,a.__spreadArray([e],t,!1)))}},exports.toggleNoScroll=function(e){"undefined"!=typeof window&&(document.documentElement.classList.toggle("noscroll",e),document.body.classList.toggle("noscroll",e))},exports.useTranslations=function(){var e=i.useContext(c.TranslationsContext)||{locale:"en-PH"},t=e.values,n=e.locale;return i.useMemo((function(){return{t:function(e,r){return t?t[e]?r?_(t[e]||e,r):t[e]||e:(console.warn("[useTranslations] Missing translation for key ".concat(e," and locale ").concat(n)),r?_(c.defaultTranslations[e]||e,r):c.defaultTranslations[e]||e):(console.error("[useTranslations] t method called before translation values are loaded"),e)},locale:n}}),[t,n])};
|
|
2
|
+
//# sourceMappingURL=useTranslations-00e7c0dc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTranslations-423301d0.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_SMALL_MOBILE: 481,\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: smb = small mobile; mb = mobile; td = tablet device; pc = pc/laptop device\n *\n * smbDown: BREAK_POINT_SMALL_MOBILE go down.\n * smbUp: BREAK_POINT_SMALL_MOBILE go up\n *\n * mbDown: REPLACE spLayout. BREAK_POINT_MOBILE go down.\n * mbOnly: from BREAK_POINT_SMALL_MOBILE to BREAK_POINT_MOBILE\n * mbUp: REPLACE pcLayout(true). BREAK_POINT_MOBILE go up\n *\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 *\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 smbDown: `@media (max-width: ${Breakpoints.BREAK_POINT_SMALL_MOBILE - 1}px)`,\n smbUp: `@media (min-width: ${Breakpoints.BREAK_POINT_SMALL_MOBILE}px)`,\n\n mbDown: `@media (max-width: ${Breakpoints.BREAK_POINT_MOBILE - 1}px)`,\n mbOnly: `@media (min-width: ${Breakpoints.BREAK_POINT_SMALL_MOBILE}px) and (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 'smbDown': return [0, Breakpoints.BREAK_POINT_SMALL_MOBILE - 1]\n case 'smbUp': return [Breakpoints.BREAK_POINT_SMALL_MOBILE, 0]\n\n case 'mbDown': return [0, Breakpoints.BREAK_POINT_MOBILE - 1]\n case 'mbOnly': return [Breakpoints.BREAK_POINT_SMALL_MOBILE, 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_SMALL_MOBILE","BREAK_POINT_MOBILE","BREAK_POINT_TABLET","BREAK_POINT_PC","MediaQueries","smbDown","smbUp","mbDown","mbOnly","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,yBAA0B,IAC1BC,mBAAoB,IACpBC,mBAAoB,KACpBC,eAAgB,MA6BLC,EAAe,CAC1BC,QAAS,sBAAsBR,OAAAE,EAAYC,yBAA2B,EAAM,OAC5EM,MAAO,sBAAAT,OAAsBE,EAAYC,yBAA6B,OAEtEO,OAAQ,sBAAsBV,OAAAE,EAAYE,mBAAqB,EAAM,OACrEO,OAAQ,sBAAsBX,OAAAE,EAAYC,yBAA+C,wBAAAH,OAAAE,EAAYE,mBAAqB,EAAM,OAChIQ,KAAM,sBAAAZ,OAAsBE,EAAYE,mBAAuB,OAE/DS,OAAQ,sBAAsBb,OAAAE,EAAYG,mBAAqB,EAAM,OACrES,OAAQ,sBAAsBd,OAAAE,EAAYE,mBACjB,wBAAAJ,OAAAE,EAAYG,mBAAqB,EAAM,OAChEU,KAAM,sBAAAf,OAAsBE,EAAYG,mBAAuB,OAE/DW,KAAM,sBAAAhB,OAAsBE,EAAYI,eAAmB,OAC3DW,OAAQ,sBAAsBjB,OAAAE,EAAYG,mBAAyC,wBAAAL,OAAAE,EAAYI,eAAiB,EAAM,OACtHY,OAAQ,sBAAsBlB,OAAAE,EAAYI,eAAiB,EAAM,gPCzK9D,SAASa,GAKZ,SAASC,EAA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A,EAAG8F,GAAUH,EAAO3F,IAAMA,GAEtEgG,QAAQC,KACN,iDAAAhG,OAAiDD,EAAgB,gBAAAC,OAAAyF,IAE5DI,EACHC,EAAaG,EAAAA,oBAAoBlG,IAAMA,EAAG8F,GAC1CI,sBAAoBlG,IAAMA,IAb5BgG,QAAQG,MACN,0EAEKnG,IAaX0F,OAAMA,KAER,CAACC,EAAQD"}
|
|
1
|
+
{"version":3,"file":"useTranslations-00e7c0dc.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\nconst logDeprecate = {\n spLayout: false,\n pcLayout: false,\n tdLayout: false,\n mbLayout: false,\n}\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 if (!logDeprecate.spLayout) {\n console.error('spLayout is deprecated. Use `MediaQueries.mbDown` instead.')\n logDeprecate.spLayout = true\n }\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 if (!logDeprecate.mbLayout) {\n console.error('mbLayout is deprecated. Use `MediaQueries.tdDown` instead.')\n logDeprecate.mbLayout = true\n }\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 if (!logDeprecate.tdLayout) {\n console.error('tdLayout is deprecated. Use `MediaQueries.tdOnly` instead.')\n logDeprecate.tdLayout = true\n }\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 if (!logDeprecate.pcLayout) {\n console.error('pcLayout is deprecated. if pcLayout(true) use `MediaQueries.mbUp`. If pcLayout() use `MediaQueries.tdUp`.')\n logDeprecate.pcLayout = true\n }\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_SMALL_MOBILE: 481,\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: smb = small mobile; mb = mobile; td = tablet device; pc = pc/laptop device\n *\n * smbDown: BREAK_POINT_SMALL_MOBILE go down.\n * smbUp: BREAK_POINT_SMALL_MOBILE go up\n *\n * mbDown: REPLACE spLayout. BREAK_POINT_MOBILE go down.\n * mbOnly: from BREAK_POINT_SMALL_MOBILE to BREAK_POINT_MOBILE\n * mbUp: REPLACE pcLayout(true). BREAK_POINT_MOBILE go up\n *\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 *\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 smbDown: `@media (max-width: ${Breakpoints.BREAK_POINT_SMALL_MOBILE - 1}px)`,\n smbUp: `@media (min-width: ${Breakpoints.BREAK_POINT_SMALL_MOBILE}px)`,\n\n mbDown: `@media (max-width: ${Breakpoints.BREAK_POINT_MOBILE - 1}px)`,\n mbOnly: `@media (min-width: ${Breakpoints.BREAK_POINT_SMALL_MOBILE}px) and (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 'smbDown': return [0, Breakpoints.BREAK_POINT_SMALL_MOBILE - 1]\n case 'smbUp': return [Breakpoints.BREAK_POINT_SMALL_MOBILE, 0]\n\n case 'mbDown': return [0, Breakpoints.BREAK_POINT_MOBILE - 1]\n case 'mbOnly': return [Breakpoints.BREAK_POINT_SMALL_MOBILE, 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":["logDeprecate","spLayout","pcLayout","tdLayout","mbLayout","makeParams","params","paramKeys","Object","keys","length","map","k","concat","join","Breakpoints","BREAK_POINT_SMALL_MOBILE","BREAK_POINT_MOBILE","BREAK_POINT_TABLET","BREAK_POINT_PC","MediaQueries","smbDown","smbUp","mbDown","mbOnly","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","console","error","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","warn","defaultTranslations"],"mappings":"+JAIMA,EAAe,CACnBC,UAAU,EACVC,UAAU,EACVC,UAAU,EACVC,UAAU,GAgGCC,EAAa,SAACC,GACzB,IAAMC,EAAYC,OAAOC,KAAKH,GAC9B,OAAKC,EAAUG,OAGR,IAAMH,EAAUI,KAAI,SAACC,GAAc,MAAA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MA,EAAGgG,GAC1CG,sBAAoBnG,IAAMA,IAb5BuE,QAAQC,MACN,0EAEKxE,IAaX4F,OAAMA,KAER,CAACC,EAAQD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hhgtech/hhg-components",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.57",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"module": "build/esm/index.js",
|
|
6
6
|
"files": [
|
|
@@ -159,6 +159,9 @@
|
|
|
159
159
|
"build/index.d.ts": [
|
|
160
160
|
"build/index.d.ts"
|
|
161
161
|
],
|
|
162
|
+
"navigation": [
|
|
163
|
+
"build/components/organisms/navigationV2/index.d.ts"
|
|
164
|
+
],
|
|
162
165
|
"build/*": [
|
|
163
166
|
"build/*",
|
|
164
167
|
"build/*/index.d.ts"
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as n,a as t}from"./tslib.es6-fd0a5c98.js";import{css as e}from"styled-components";import{useContext as a,useMemo as r}from"react";import{T as o,d as i}from"./translationsContext-977d7bc4.js";var c,d,u,s,l=function(){return function(a){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];return e(c||(c=n(["\n @media (max-width: ","px) {\n ",";\n }\n "],["\n @media (max-width: ","px) {\n ",";\n }\n "])),767,e.apply(void 0,t([a],r,!1)))}},m=function(){return function(a){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];return e(d||(d=n(["\n @media (max-width: ","px) {\n ",";\n }\n "],["\n @media (max-width: ","px) {\n ",";\n }\n "])),1023,e.apply(void 0,t([a],r,!1)))}},p=function(){return function(a){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];return e(u||(u=n(["\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,e.apply(void 0,t([a],r,!1)))}},_=function(a){return function(r){for(var o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];return e(s||(s=n(["\n @media (min-width: ","px) {\n ",";\n }\n "],["\n @media (min-width: ","px) {\n ",";\n }\n "])),a?768:1024,e.apply(void 0,t([r],o,!1)))}},f=function(n){var t=Object.keys(n);return t.length?"?"+t.map((function(t){return"".concat(t,"=").concat(n[t])})).join("&"):""},E=function(n,t,e){void 0===t&&(t=1),void 0===e&&(e="page");var a=n.split("?"),r=a[0],o=a[1],i=new URLSearchParams(o||""),c={};return i.forEach((function(n,t){n&&(c[t]=n)})),Number(t)>1?c[e]=String(t):delete c[e],r+f(c)},I=function(n){"undefined"!=typeof window&&(document.documentElement.classList.toggle("noscroll",n),document.body.classList.toggle("noscroll",n))},T={BREAK_POINT_SMALL_MOBILE:481,BREAK_POINT_MOBILE:768,BREAK_POINT_TABLET:1024,BREAK_POINT_PC:1200},B={smbDown:"@media (max-width: ".concat(T.BREAK_POINT_SMALL_MOBILE-1,"px)"),smbUp:"@media (min-width: ".concat(T.BREAK_POINT_SMALL_MOBILE,"px)"),mbDown:"@media (max-width: ".concat(T.BREAK_POINT_MOBILE-1,"px)"),mbOnly:"@media (min-width: ".concat(T.BREAK_POINT_SMALL_MOBILE,"px) and (max-width: ").concat(T.BREAK_POINT_MOBILE-1,"px)"),mbUp:"@media (min-width: ".concat(T.BREAK_POINT_MOBILE,"px)"),tdDown:"@media (max-width: ".concat(T.BREAK_POINT_TABLET-1,"px)"),tdOnly:"@media (min-width: ".concat(T.BREAK_POINT_MOBILE,"px) and (max-width: ").concat(T.BREAK_POINT_TABLET-1,"px)"),tdUp:"@media (min-width: ".concat(T.BREAK_POINT_TABLET,"px)"),pcUp:"@media (min-width: ".concat(T.BREAK_POINT_PC,"px)"),pcOnly:"@media (min-width: ".concat(T.BREAK_POINT_TABLET,"px) and (max-width: ").concat(T.BREAK_POINT_PC-1,"px)"),pcDown:"@media (max-width: ".concat(T.BREAK_POINT_PC-1,"px)")},O=function(n){switch(n){case"smbDown":return[0,T.BREAK_POINT_SMALL_MOBILE-1];case"smbUp":return[T.BREAK_POINT_SMALL_MOBILE,0];case"mbDown":return[0,T.BREAK_POINT_MOBILE-1];case"mbOnly":return[T.BREAK_POINT_SMALL_MOBILE,T.BREAK_POINT_MOBILE-1];case"mbUp":return[T.BREAK_POINT_MOBILE,0];case"tdDown":return[0,T.BREAK_POINT_TABLET-1];case"tdOnly":return[T.BREAK_POINT_MOBILE,T.BREAK_POINT_TABLET-1];case"tdUp":return[T.BREAK_POINT_TABLET,0];case"pcUp":return[T.BREAK_POINT_PC,0];case"pcOnly":return[T.BREAK_POINT_TABLET,T.BREAK_POINT_PC-1];case"pcDown":return[0,T.BREAK_POINT_PC-1]}},A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function w(n){var t={exports:{}};return n(t,t.exports),t.exports}var x=w((function(n){(function(t){function e(n){var t=new Error(n);return t.name="ValueError",t}function a(n){return function(t){var a=Array.prototype.slice.call(arguments,1),r=0,o="UNDEFINED";return t.replace(/([{}])\1|[{](.*?)(?:!(.+?))?[}]/g,(function(t,i,c,d){if(null!=i)return i;var u=c;if(u.length>0){if("IMPLICIT"===o)throw e("cannot switch from implicit to explicit numbering");o="EXPLICIT"}else{if("EXPLICIT"===o)throw e("cannot switch from explicit to implicit numbering");o="IMPLICIT",u=String(r),r+=1}var s=u.split("."),l=(/^\d+$/.test(s[0])?s:["0"].concat(s)).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]]:[]}),[])}),[a]).reduce((function(n,t){return t}),"");if(null==d)return l;if(Object.prototype.hasOwnProperty.call(n,d))return n[d](l);throw e('no transformer named "'+d+'"')}))}}var r=a({});r.create=a,r.extend=function(n,e){var r=a(e);n.format=function(){var n=Array.prototype.slice.call(arguments);return n.unshift(this),r.apply(t,n)}},n.exports=r}).call(A,A)}));function L(){var n=a(o)||{locale:"en-PH"},t=n.values,e=n.locale;return r((function(){return{t:function(n,a){return t?t[n]?a?x(t[n]||n,a):t[n]||n:(console.warn("[useTranslations] Missing translation for key ".concat(n," and locale ").concat(e)),a?x(i[n]||n,a):i[n]||n):(console.error("[useTranslations] t method called before translation values are loaded"),n)},locale:e}}),[t,e])}export{T as B,B as M,f as a,I as b,w as c,A as d,x as e,E as f,O as g,m,_ as p,l as s,p as t,L as u};
|
|
2
|
-
//# sourceMappingURL=useTranslations-3c1ac581.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var n,t,e,r,a=require("./tslib.es6-f7929e76.js"),o=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_SMALL_MOBILE:481,BREAK_POINT_MOBILE:768,BREAK_POINT_TABLET:1024,BREAK_POINT_PC:1200},d={smbDown:"@media (max-width: ".concat(u.BREAK_POINT_SMALL_MOBILE-1,"px)"),smbUp:"@media (min-width: ".concat(u.BREAK_POINT_SMALL_MOBILE,"px)"),mbDown:"@media (max-width: ".concat(u.BREAK_POINT_MOBILE-1,"px)"),mbOnly:"@media (min-width: ".concat(u.BREAK_POINT_SMALL_MOBILE,"px) and (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)")},l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function p(n){var t={exports:{}};return n(t,t.exports),t.exports}var m=p((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),a=0,o="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"===o)throw e("cannot switch from implicit to explicit numbering");o="EXPLICIT"}else{if("EXPLICIT"===o)throw e("cannot switch from explicit to implicit numbering");o="IMPLICIT",u=String(a),a+=1}var d=u.split("."),l=(/^\d+$/.test(d[0])?d:["0"].concat(d)).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 l;if(Object.prototype.hasOwnProperty.call(n,s))return n[s](l);throw e('no transformer named "'+s+'"')}))}}var a=r({});a.create=r,a.extend=function(n,e){var a=r(e);n.format=function(){var n=Array.prototype.slice.call(arguments);return n.unshift(this),a.apply(t,n)}},n.exports=a}).call(l,l)}));exports.Breakpoints=u,exports.MediaQueries=d,exports.commonjsGlobal=l,exports.createCommonjsModule=p,exports.formatUrlWithPageParam=function(n,t,e){void 0===t&&(t=1),void 0===e&&(e="page");var r=n.split("?"),a=r[0],o=r[1],i=new URLSearchParams(o||""),c={};return i.forEach((function(n,t){n&&(c[t]=n)})),Number(t)>1?c[e]=String(t):delete c[e],a+s(c)},exports.getBoundariesFromMediaQueryKey=function(n){switch(n){case"smbDown":return[0,u.BREAK_POINT_SMALL_MOBILE-1];case"smbUp":return[u.BREAK_POINT_SMALL_MOBILE,0];case"mbDown":return[0,u.BREAK_POINT_MOBILE-1];case"mbOnly":return[u.BREAK_POINT_SMALL_MOBILE,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 o.css(t||(t=a.__makeTemplateObject(["\n @media (max-width: ","px) {\n ",";\n }\n "],["\n @media (max-width: ","px) {\n ",";\n }\n "])),1023,o.css.apply(void 0,a.__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 o.css(r||(r=a.__makeTemplateObject(["\n @media (min-width: ","px) {\n ",";\n }\n "],["\n @media (min-width: ","px) {\n ",";\n }\n "])),n?768:1024,o.css.apply(void 0,a.__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 o.css(n||(n=a.__makeTemplateObject(["\n @media (max-width: ","px) {\n ",";\n }\n "],["\n @media (max-width: ","px) {\n ",";\n }\n "])),767,o.css.apply(void 0,a.__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 o.css(e||(e=a.__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,o.css.apply(void 0,a.__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-423301d0.js.map
|