@hhgtech/hhg-components 1.21.76 → 1.21.77

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.
@@ -1 +1 @@
1
- import{b as t,_ as o}from"./tslib.es6-dcf36680.js";import r,{useMemo as n,useState as a,useEffect as i}from"react";import{Autocomplete as s,Image as l,Select as m,Badge as h,Spoiler as p,LoadingOverlay as v,MantineProvider as w}from"@mantine/core";import{CommonGAssets as x}from"./gAssets.js";import{D as E,S,a as k,u as j,g as y}from"./theme-3e149f81.js";export{A as Accordion,c as Avatar,C as Carousel,d as Checkbox,b as DatePicker,I as Input,M as MAPPED_LOCALE,R as Radio,e as Switch,f as emotionCache,g as getMantineThemeOverride,u as useMantineLocale}from"./theme-3e149f81.js";import"date-fns";import"./screenSizeContext-1852eabc.js";import"styled-components";import{t as H}from"./theme-a50a1aa5.js";import"./index-9dd60ba6.js";import"./isProduction-6fc0946c.js";import"./Locale-69030fff.js";import{T as L}from"./index-1e715f4d.js";import"react-range";import{u as P}from"./useTranslations-b3eb31ef.js";import"lodash/debounce";import{useDebouncedValue as z}from"@mantine/hooks";import{B}from"./index-073d2467.js";import"./translationsContext-e7808c8f.js";import"string-format";import"@mantine/dates";import"@mantine/carousel";import"vanilla-lazyload";import"lodash";var D=function(e){var n=e.keepSearch,a=void 0!==n&&n,i=t(e,["keepSearch"]);return a?r.createElement(s,o({rightSection:r.createElement(l,{src:x.getAssetPath("chevron-down.svg"),fit:"none"}),size:"md",maxDropdownHeight:300},i)):r.createElement(m,o({rightSection:r.createElement(l,{src:x.getAssetPath("chevron-down.svg"),fit:"none"}),size:"md",maxDropdownHeight:300},i))},O=function(e){var n=e.color,a=void 0===n?H.colors.primaryBase:n,i=t(e,["color"]);return r.createElement(h,o({variant:"filled",color:a,styles:{root:{borderRadius:"2px",background:a,textTransform:"unset"}}},i))},T=function(e){var a=e.children,i=e.line,s=e.lineHeight,l=e.maxHeight,c=t(e,["children","line","lineHeight","maxHeight"]),m=P().t,h=n((function(){return l||(i&&s?i*s:(console.error("[HHG-Comp]:[Spoiler] Please provide maxHeight, or line with lineHeight"),0))}),[]);return a||console.error("[HHG-Comp]:[Spoiler] Please provide children"),r.createElement(p,o({showLabel:r.createElement(L,{size:"p3",color:H.colors.primaryBase},m("articlePage.readMore")),hideLabel:r.createElement(L,{size:"p3",color:H.colors.primaryBase},m("articlePage.showLess"))},c,{maxHeight:h}),a)},G=function(e){return r.createElement(v,o({loaderProps:{color:H.colors.primaryBase}},e))},W=function(e){var n=e.color,s=void 0===n?H.colors.primaryBase:n,l=e.withControl,c=e.onChange,m=e.value,h=e.min,d=e.max,p=e.isStatic,u=t(e,["color","withControl","onChange","value","min","max","isStatic"]),f=a(m||h||0),g=f[0],v=f[1],w=z(g,E)[0];return i((function(){null==c||c(w)}),[w]),r.createElement(S,null,l&&r.createElement(B,{type:"button",size:"sm",color:"ghost",onClick:function(){v((function(e){return h&&e===h?e:e-1}))}},r.createElement("svg",{width:"10",height:"10",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 3"},r.createElement("path",{d:"M1 1.004h8",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))),r.createElement(k,o({thumbSize:21,labelAlwaysOn:!0,radius:"xl",color:s,value:g,onChange:p?function(){return null}:v,min:h,max:d},u)),l&&r.createElement(B,{type:"button",size:"sm",color:"ghost",onClick:function(){v((function(e){return d&&e===d?e:e+1}))}},r.createElement("svg",{width:"16",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},r.createElement("path",{d:"M8 4v8M4 8h8",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))))},_=function(e){var n=e.children,a=e.locale,i=t(e,["children","locale"]);return j(a),r.createElement(w,o({theme:y(a),withGlobalStyles:!0,withNormalizeCSS:!0},i),n)};export{O as Badge,G as LoadingOverlay,_ as MantineProvider,D as Select,W as Slider,T as Spoiler};
1
+ import{b as t,_ as o}from"./tslib.es6-dcf36680.js";import r,{useMemo as n,useState as a,useEffect as i}from"react";import{Autocomplete as s,Image as l,Select as m,Badge as h,Spoiler as p,LoadingOverlay as v,MantineProvider as x}from"@mantine/core";import{CommonGAssets as w}from"./gAssets.js";import{D as E,S as k,a as j,u as S,g as H}from"./theme-3e149f81.js";export{A as Accordion,c as Avatar,C as Carousel,d as Checkbox,b as DatePicker,I as Input,M as MAPPED_LOCALE,R as Radio,e as Switch,f as emotionCache,g as getMantineThemeOverride,u as useMantineLocale}from"./theme-3e149f81.js";import"date-fns";import"./screenSizeContext-1852eabc.js";import"styled-components";import{t as y}from"./theme-a50a1aa5.js";import"./index-9dd60ba6.js";import"./isProduction-6fc0946c.js";import"./Locale-69030fff.js";import{T as L}from"./index-1e715f4d.js";import"react-range";import{u as P}from"./useTranslations-b3eb31ef.js";import"lodash/debounce";import{useDebouncedValue as z}from"@mantine/hooks";import{B}from"./index-073d2467.js";import"./translationsContext-e7808c8f.js";import"string-format";import"@mantine/dates";import"@mantine/carousel";import"vanilla-lazyload";import"lodash";var D=function(e){var n=e.keepSearch,a=void 0!==n&&n,i=t(e,["keepSearch"]);return a?r.createElement(s,o({rightSection:r.createElement(l,{src:w.getAssetPath("chevron-down.svg"),fit:"none"}),size:"md",maxDropdownHeight:300},i)):r.createElement(m,o({rightSection:r.createElement(l,{src:w.getAssetPath("chevron-down.svg"),fit:"none"}),size:"md",maxDropdownHeight:300},i))},O=function(e){var n=e.color,a=void 0===n?y.colors.primaryBase:n,i=t(e,["color"]);return r.createElement(h,o({variant:"filled",color:a,styles:{root:{borderRadius:"2px",background:a,textTransform:"unset"}}},i))},T=function(e){var a=e.children,i=e.line,s=e.lineHeight,l=e.maxHeight,c=t(e,["children","line","lineHeight","maxHeight"]),m=P().t,h=n((function(){return l||(i&&s?i*s:(console.error("[HHG-Comp]:[Spoiler] Please provide maxHeight, or line with lineHeight"),0))}),[]);return a||console.error("[HHG-Comp]:[Spoiler] Please provide children"),r.createElement(p,o({showLabel:r.createElement(L,{size:"p3",color:y.colors.primaryBase},m("articlePage.readMore")),hideLabel:r.createElement(L,{size:"p3",color:y.colors.primaryBase},m("articlePage.showLess"))},c,{maxHeight:h}),a)},G=function(e){return r.createElement(v,o({loaderProps:{color:y.colors.primaryBase}},e))},W=function(e){var n=e.color,s=void 0===n?y.colors.primaryBase:n,l=e.withControl,c=e.onChange,m=e.value,h=e.min,d=e.max,p=e.isStatic,u=t(e,["color","withControl","onChange","value","min","max","isStatic"]),f=a(m||h||0),g=f[0],v=f[1],x=z(g,E)[0];return i((function(){null==c||c(x)}),[x]),r.createElement(k,null,l&&r.createElement(B,{type:"button",size:"sm",color:"ghost",onClick:function(){v((function(e){return h&&e===h?e:e-1}))}},r.createElement("svg",{width:"10",height:"10",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 3"},r.createElement("path",{d:"M1 1.004h8",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))),r.createElement(j,o({thumbSize:21,labelAlwaysOn:!0,radius:"xl",color:s,value:g,onChange:p?function(){return null}:v,min:h,max:d},u)),l&&r.createElement(B,{type:"button",size:"sm",color:"ghost",onClick:function(){v((function(e){return d&&e===d?e:e+1}))}},r.createElement("svg",{width:"16",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},r.createElement("path",{d:"M8 4v8M4 8h8",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))))},_=function(e){var n=e.children,a=e.locale,i=t(e,["children","locale"]);return S(a),r.createElement(x,o({theme:H(a)},i),n)};export{O as Badge,G as LoadingOverlay,_ as MantineProvider,D as Select,W as Slider,T as Spoiler};
package/build/mantine.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./tslib.es6-e6f346c4.js"),t=require("react"),r=require("@mantine/core"),o=require("./gAssets.js"),n=require("./theme-cd1690f9.js");require("date-fns"),require("./screenSizeContext-8f86eb30.js"),require("styled-components");var a=require("./theme-696d81a9.js");require("./index-d28c27ca.js"),require("./isProduction-32e6a55a.js"),require("./Locale-11b51016.js");var i=require("./index-ac032299.js");require("react-range");var s=require("./useTranslations-00120db0.js");require("lodash/debounce");var l=require("@mantine/hooks"),c=require("./index-c0826785.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("./translationsContext-9e231a88.js"),require("string-format"),require("@mantine/dates"),require("@mantine/carousel"),require("vanilla-lazyload"),require("lodash");var d=u(t);exports.Accordion=n.Accordion,exports.Avatar=n.Avatar,exports.Carousel=n.Carousel,exports.Checkbox=n.Checkbox,exports.DatePicker=n.DatePicker,exports.Input=n.Input,exports.MAPPED_LOCALE=n.MAPPED_LOCALE,exports.Radio=n.Radio,exports.Switch=n.Switch,exports.emotionCache=n.emotionCache,exports.getMantineThemeOverride=n.getMantineThemeOverride,exports.useMantineLocale=n.useMantineLocale,exports.Badge=function(t){var o=t.color,n=void 0===o?a.theme.colors.primaryBase:o,i=e.__rest(t,["color"]);return d.default.createElement(r.Badge,e.__assign({variant:"filled",color:n,styles:{root:{borderRadius:"2px",background:n,textTransform:"unset"}}},i))},exports.LoadingOverlay=function(t){return d.default.createElement(r.LoadingOverlay,e.__assign({loaderProps:{color:a.theme.colors.primaryBase}},t))},exports.MantineProvider=function(t){var o=t.children,a=t.locale,i=e.__rest(t,["children","locale"]);return n.useMantineLocale(a),d.default.createElement(r.MantineProvider,e.__assign({theme:n.getMantineThemeOverride(a),withGlobalStyles:!0,withNormalizeCSS:!0},i),o)},exports.Select=function(t){var n=t.keepSearch,a=void 0!==n&&n,i=e.__rest(t,["keepSearch"]);return a?d.default.createElement(r.Autocomplete,e.__assign({rightSection:d.default.createElement(r.Image,{src:o.CommonGAssets.getAssetPath("chevron-down.svg"),fit:"none"}),size:"md",maxDropdownHeight:300},i)):d.default.createElement(r.Select,e.__assign({rightSection:d.default.createElement(r.Image,{src:o.CommonGAssets.getAssetPath("chevron-down.svg"),fit:"none"}),size:"md",maxDropdownHeight:300},i))},exports.Slider=function(r){var o=r.color,i=void 0===o?a.theme.colors.primaryBase:o,s=r.withControl,u=r.onChange,m=r.value,h=r.min,p=r.max,g=r.isStatic,f=e.__rest(r,["color","withControl","onChange","value","min","max","isStatic"]),x=t.useState(m||h||0),v=x[0],_=x[1],w=l.useDebouncedValue(v,n.DEBOUNCED_TIME)[0];return t.useEffect((function(){null==u||u(w)}),[w]),d.default.createElement(n.StyledSliderWrapper,null,s&&d.default.createElement(c.Button,{type:"button",size:"sm",color:"ghost",onClick:function(){_((function(e){return h&&e===h?e:e-1}))}},d.default.createElement("svg",{width:"10",height:"10",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 3"},d.default.createElement("path",{d:"M1 1.004h8",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))),d.default.createElement(n.StyledSlider,e.__assign({thumbSize:21,labelAlwaysOn:!0,radius:"xl",color:i,value:v,onChange:g?function(){return null}:_,min:h,max:p},f)),s&&d.default.createElement(c.Button,{type:"button",size:"sm",color:"ghost",onClick:function(){_((function(e){return p&&e===p?e:e+1}))}},d.default.createElement("svg",{width:"16",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},d.default.createElement("path",{d:"M8 4v8M4 8h8",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))))},exports.Spoiler=function(o){var n=o.children,l=o.line,c=o.lineHeight,u=o.maxHeight,m=e.__rest(o,["children","line","lineHeight","maxHeight"]),h=s.useTranslations().t,p=t.useMemo((function(){return u||(l&&c?l*c:(console.error("[HHG-Comp]:[Spoiler] Please provide maxHeight, or line with lineHeight"),0))}),[]);return n||console.error("[HHG-Comp]:[Spoiler] Please provide children"),d.default.createElement(r.Spoiler,e.__assign({showLabel:d.default.createElement(i.Text,{size:"p3",color:a.theme.colors.primaryBase},h("articlePage.readMore")),hideLabel:d.default.createElement(i.Text,{size:"p3",color:a.theme.colors.primaryBase},h("articlePage.showLess"))},m,{maxHeight:p}),n)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./tslib.es6-e6f346c4.js"),t=require("react"),r=require("@mantine/core"),o=require("./gAssets.js"),n=require("./theme-cd1690f9.js");require("date-fns"),require("./screenSizeContext-8f86eb30.js"),require("styled-components");var a=require("./theme-696d81a9.js");require("./index-d28c27ca.js"),require("./isProduction-32e6a55a.js"),require("./Locale-11b51016.js");var i=require("./index-ac032299.js");require("react-range");var s=require("./useTranslations-00120db0.js");require("lodash/debounce");var l=require("@mantine/hooks"),c=require("./index-c0826785.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("./translationsContext-9e231a88.js"),require("string-format"),require("@mantine/dates"),require("@mantine/carousel"),require("vanilla-lazyload"),require("lodash");var d=u(t);exports.Accordion=n.Accordion,exports.Avatar=n.Avatar,exports.Carousel=n.Carousel,exports.Checkbox=n.Checkbox,exports.DatePicker=n.DatePicker,exports.Input=n.Input,exports.MAPPED_LOCALE=n.MAPPED_LOCALE,exports.Radio=n.Radio,exports.Switch=n.Switch,exports.emotionCache=n.emotionCache,exports.getMantineThemeOverride=n.getMantineThemeOverride,exports.useMantineLocale=n.useMantineLocale,exports.Badge=function(t){var o=t.color,n=void 0===o?a.theme.colors.primaryBase:o,i=e.__rest(t,["color"]);return d.default.createElement(r.Badge,e.__assign({variant:"filled",color:n,styles:{root:{borderRadius:"2px",background:n,textTransform:"unset"}}},i))},exports.LoadingOverlay=function(t){return d.default.createElement(r.LoadingOverlay,e.__assign({loaderProps:{color:a.theme.colors.primaryBase}},t))},exports.MantineProvider=function(t){var o=t.children,a=t.locale,i=e.__rest(t,["children","locale"]);return n.useMantineLocale(a),d.default.createElement(r.MantineProvider,e.__assign({theme:n.getMantineThemeOverride(a)},i),o)},exports.Select=function(t){var n=t.keepSearch,a=void 0!==n&&n,i=e.__rest(t,["keepSearch"]);return a?d.default.createElement(r.Autocomplete,e.__assign({rightSection:d.default.createElement(r.Image,{src:o.CommonGAssets.getAssetPath("chevron-down.svg"),fit:"none"}),size:"md",maxDropdownHeight:300},i)):d.default.createElement(r.Select,e.__assign({rightSection:d.default.createElement(r.Image,{src:o.CommonGAssets.getAssetPath("chevron-down.svg"),fit:"none"}),size:"md",maxDropdownHeight:300},i))},exports.Slider=function(r){var o=r.color,i=void 0===o?a.theme.colors.primaryBase:o,s=r.withControl,u=r.onChange,m=r.value,h=r.min,p=r.max,g=r.isStatic,f=e.__rest(r,["color","withControl","onChange","value","min","max","isStatic"]),x=t.useState(m||h||0),v=x[0],_=x[1],E=l.useDebouncedValue(v,n.DEBOUNCED_TIME)[0];return t.useEffect((function(){null==u||u(E)}),[E]),d.default.createElement(n.StyledSliderWrapper,null,s&&d.default.createElement(c.Button,{type:"button",size:"sm",color:"ghost",onClick:function(){_((function(e){return h&&e===h?e:e-1}))}},d.default.createElement("svg",{width:"10",height:"10",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 3"},d.default.createElement("path",{d:"M1 1.004h8",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))),d.default.createElement(n.StyledSlider,e.__assign({thumbSize:21,labelAlwaysOn:!0,radius:"xl",color:i,value:v,onChange:g?function(){return null}:_,min:h,max:p},f)),s&&d.default.createElement(c.Button,{type:"button",size:"sm",color:"ghost",onClick:function(){_((function(e){return p&&e===p?e:e+1}))}},d.default.createElement("svg",{width:"16",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},d.default.createElement("path",{d:"M8 4v8M4 8h8",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))))},exports.Spoiler=function(o){var n=o.children,l=o.line,c=o.lineHeight,u=o.maxHeight,m=e.__rest(o,["children","line","lineHeight","maxHeight"]),h=s.useTranslations().t,p=t.useMemo((function(){return u||(l&&c?l*c:(console.error("[HHG-Comp]:[Spoiler] Please provide maxHeight, or line with lineHeight"),0))}),[]);return n||console.error("[HHG-Comp]:[Spoiler] Please provide children"),d.default.createElement(r.Spoiler,e.__assign({showLabel:d.default.createElement(i.Text,{size:"p3",color:a.theme.colors.primaryBase},h("articlePage.readMore")),hideLabel:d.default.createElement(i.Text,{size:"p3",color:a.theme.colors.primaryBase},h("articlePage.showLess"))},m,{maxHeight:p}),n)};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hhgtech/hhg-components",
3
- "version": "1.21.76",
3
+ "version": "1.21.77",
4
4
  "main": "build/index.js",
5
5
  "module": "build/esm/index.js",
6
6
  "files": [