@hhgtech/hhg-components 1.21.61 → 1.21.62

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 u,MantineProvider as v}from"@mantine/core";import{CommonGAssets as w}from"./gAssets.js";import{D as x,S as E,a as k,u as j,g as S}from"./theme-508eb8b9.js";export{A as Accordion,c as Avatar,C as Carousel,d as Checkbox,b as DatePicker,I as Input,R as Radio,e as Switch,f as emotionCache,g as getMantineThemeOverride}from"./theme-508eb8b9.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 H}from"./index.styled-520ccc61.js";import"react-range";import{u as z}from"./useTranslations-ddaec288.js";import"lodash/debounce";import{useDebouncedValue as P}from"@mantine/hooks";import{B}from"./index-588deadc.js";import"./translationsContext-8575bd07.js";import"string-format";import"@mantine/dates";import"@mantine/carousel";import"vanilla-lazyload";import"lodash";var L=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))},M=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},i,{styles:{root:{borderRadius:"2px",background:a,textTransform:"unset"}}}))},D=function(e){var a=e.children,i=e.line,s=e.lineHeight,l=e.maxHeight,c=t(e,["children","line","lineHeight","maxHeight"]),m=z().t,d=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(H,{size:"p2",color:y.colors.primaryBase},m("articlePage.readMore")),hideLabel:r.createElement(H,{size:"p2",color:y.colors.primaryBase},m("articlePage.showLess"))},c,{maxHeight:d}),a)},T=function(e){return r.createElement(u,o({loaderProps:{color:y.colors.primaryBase}},e))},G=function(e){var n=e.color,s=void 0===n?y.colors.primaryBase:n,l=e.withControl,c=e.onChange,m=e.value,d=e.min,h=e.max,p=t(e,["color","withControl","onChange","value","min","max"]),u=a(m||d||0),g=u[0],f=u[1],v=P(g,x)[0];return i((function(){null==c||c(v)}),[v]),r.createElement(E,null,l&&r.createElement(B,{type:"button",size:"sm",color:"ghost",onClick:function(){f((function(e){return d&&e===d?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:f,min:d,max:h},p)),l&&r.createElement(B,{type:"button",size:"sm",color:"ghost",onClick:function(){f((function(e){return h&&e===h?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"}))))},O=function(e){var n=e.children,a=e.locale,i=t(e,["children","locale"]);return j(a),r.createElement(v,o({theme:S(a),withGlobalStyles:!0,withNormalizeCSS:!0},i),n)};export{M as Badge,T as LoadingOverlay,O as MantineProvider,L as Select,G as Slider,D 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 u,MantineProvider as v}from"@mantine/core";import{CommonGAssets as w}from"./gAssets.js";import{D as x,S as E,a as k,u as j,g as S}from"./theme-508eb8b9.js";export{A as Accordion,c as Avatar,C as Carousel,d as Checkbox,b as DatePicker,I as Input,R as Radio,e as Switch,f as emotionCache,g as getMantineThemeOverride}from"./theme-508eb8b9.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 H}from"./index.styled-520ccc61.js";import"react-range";import{u as z}from"./useTranslations-ddaec288.js";import"lodash/debounce";import{useDebouncedValue as P}from"@mantine/hooks";import{B}from"./index-588deadc.js";import"./translationsContext-8575bd07.js";import"string-format";import"@mantine/dates";import"@mantine/carousel";import"vanilla-lazyload";import"lodash";var L=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))},M=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))},D=function(e){var a=e.children,i=e.line,s=e.lineHeight,l=e.maxHeight,c=t(e,["children","line","lineHeight","maxHeight"]),m=z().t,d=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(H,{size:"p2",color:y.colors.primaryBase},m("articlePage.readMore")),hideLabel:r.createElement(H,{size:"p2",color:y.colors.primaryBase},m("articlePage.showLess"))},c,{maxHeight:d}),a)},T=function(e){return r.createElement(u,o({loaderProps:{color:y.colors.primaryBase}},e))},G=function(e){var n=e.color,s=void 0===n?y.colors.primaryBase:n,l=e.withControl,c=e.onChange,m=e.value,d=e.min,h=e.max,p=t(e,["color","withControl","onChange","value","min","max"]),u=a(m||d||0),g=u[0],f=u[1],v=P(g,x)[0];return i((function(){null==c||c(v)}),[v]),r.createElement(E,null,l&&r.createElement(B,{type:"button",size:"sm",color:"ghost",onClick:function(){f((function(e){return d&&e===d?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:f,min:d,max:h},p)),l&&r.createElement(B,{type:"button",size:"sm",color:"ghost",onClick:function(){f((function(e){return h&&e===h?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"}))))},O=function(e){var n=e.children,a=e.locale,i=t(e,["children","locale"]);return j(a),r.createElement(v,o({theme:S(a),withGlobalStyles:!0,withNormalizeCSS:!0},i),n)};export{M as Badge,T as LoadingOverlay,O as MantineProvider,L as Select,G as Slider,D 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"),r=require("react"),t=require("@mantine/core"),o=require("./gAssets.js"),n=require("./theme-6fd790c0.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.styled-27ff3b4a.js");require("react-range");var s=require("./useTranslations-fe351941.js");require("lodash/debounce");var l=require("@mantine/hooks"),c=require("./index-8b1987d5.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("./translationsContext-f799a864.js"),require("string-format"),require("@mantine/dates"),require("@mantine/carousel"),require("vanilla-lazyload"),require("lodash");var d=u(r);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.Radio=n.Radio,exports.Switch=n.Switch,exports.emotionCache=n.emotionCache,exports.getMantineThemeOverride=n.getMantineThemeOverride,exports.Badge=function(r){var o=r.color,n=void 0===o?a.theme.colors.primaryBase:o,i=e.__rest(r,["color"]);return d.default.createElement(t.Badge,e.__assign({variant:"filled",color:n},i,{styles:{root:{borderRadius:"2px",background:n,textTransform:"unset"}}}))},exports.LoadingOverlay=function(r){return d.default.createElement(t.LoadingOverlay,e.__assign({loaderProps:{color:a.theme.colors.primaryBase}},r))},exports.MantineProvider=function(r){var o=r.children,a=r.locale,i=e.__rest(r,["children","locale"]);return n.useMantineLocale(a),d.default.createElement(t.MantineProvider,e.__assign({theme:n.getMantineThemeOverride(a),withGlobalStyles:!0,withNormalizeCSS:!0},i),o)},exports.Select=function(r){var n=r.keepSearch,a=void 0!==n&&n,i=e.__rest(r,["keepSearch"]);return a?d.default.createElement(t.Autocomplete,e.__assign({rightSection:d.default.createElement(t.Image,{src:o.CommonGAssets.getAssetPath("chevron-down.svg"),fit:"none"}),size:"md",maxDropdownHeight:300},i)):d.default.createElement(t.Select,e.__assign({rightSection:d.default.createElement(t.Image,{src:o.CommonGAssets.getAssetPath("chevron-down.svg"),fit:"none"}),size:"md",maxDropdownHeight:300},i))},exports.Slider=function(t){var o=t.color,i=void 0===o?a.theme.colors.primaryBase:o,s=t.withControl,u=t.onChange,m=t.value,h=t.min,p=t.max,f=e.__rest(t,["color","withControl","onChange","value","min","max"]),g=r.useState(m||h||0),v=g[0],x=g[1],_=l.useDebouncedValue(v,n.DEBOUNCED_TIME)[0];return r.useEffect((function(){null==u||u(_)}),[_]),d.default.createElement(n.StyledSliderWrapper,null,s&&d.default.createElement(c.Button,{type:"button",size:"sm",color:"ghost",onClick:function(){x((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:x,min:h,max:p},f)),s&&d.default.createElement(c.Button,{type:"button",size:"sm",color:"ghost",onClick:function(){x((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=r.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(t.Spoiler,e.__assign({showLabel:d.default.createElement(i.Text,{size:"p2",color:a.theme.colors.primaryBase},h("articlePage.readMore")),hideLabel:d.default.createElement(i.Text,{size:"p2",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"),r=require("react"),t=require("@mantine/core"),o=require("./gAssets.js"),n=require("./theme-6fd790c0.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.styled-27ff3b4a.js");require("react-range");var s=require("./useTranslations-fe351941.js");require("lodash/debounce");var l=require("@mantine/hooks"),c=require("./index-8b1987d5.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("./translationsContext-f799a864.js"),require("string-format"),require("@mantine/dates"),require("@mantine/carousel"),require("vanilla-lazyload"),require("lodash");var d=u(r);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.Radio=n.Radio,exports.Switch=n.Switch,exports.emotionCache=n.emotionCache,exports.getMantineThemeOverride=n.getMantineThemeOverride,exports.Badge=function(r){var o=r.color,n=void 0===o?a.theme.colors.primaryBase:o,i=e.__rest(r,["color"]);return d.default.createElement(t.Badge,e.__assign({variant:"filled",color:n,styles:{root:{borderRadius:"2px",background:n,textTransform:"unset"}}},i))},exports.LoadingOverlay=function(r){return d.default.createElement(t.LoadingOverlay,e.__assign({loaderProps:{color:a.theme.colors.primaryBase}},r))},exports.MantineProvider=function(r){var o=r.children,a=r.locale,i=e.__rest(r,["children","locale"]);return n.useMantineLocale(a),d.default.createElement(t.MantineProvider,e.__assign({theme:n.getMantineThemeOverride(a),withGlobalStyles:!0,withNormalizeCSS:!0},i),o)},exports.Select=function(r){var n=r.keepSearch,a=void 0!==n&&n,i=e.__rest(r,["keepSearch"]);return a?d.default.createElement(t.Autocomplete,e.__assign({rightSection:d.default.createElement(t.Image,{src:o.CommonGAssets.getAssetPath("chevron-down.svg"),fit:"none"}),size:"md",maxDropdownHeight:300},i)):d.default.createElement(t.Select,e.__assign({rightSection:d.default.createElement(t.Image,{src:o.CommonGAssets.getAssetPath("chevron-down.svg"),fit:"none"}),size:"md",maxDropdownHeight:300},i))},exports.Slider=function(t){var o=t.color,i=void 0===o?a.theme.colors.primaryBase:o,s=t.withControl,u=t.onChange,m=t.value,h=t.min,p=t.max,f=e.__rest(t,["color","withControl","onChange","value","min","max"]),g=r.useState(m||h||0),v=g[0],x=g[1],_=l.useDebouncedValue(v,n.DEBOUNCED_TIME)[0];return r.useEffect((function(){null==u||u(_)}),[_]),d.default.createElement(n.StyledSliderWrapper,null,s&&d.default.createElement(c.Button,{type:"button",size:"sm",color:"ghost",onClick:function(){x((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:x,min:h,max:p},f)),s&&d.default.createElement(c.Button,{type:"button",size:"sm",color:"ghost",onClick:function(){x((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=r.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(t.Spoiler,e.__assign({showLabel:d.default.createElement(i.Text,{size:"p2",color:a.theme.colors.primaryBase},h("articlePage.readMore")),hideLabel:d.default.createElement(i.Text,{size:"p2",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.61",
3
+ "version": "1.21.62",
4
4
  "main": "build/index.js",
5
5
  "module": "build/esm/index.js",
6
6
  "files": [