design-react-kit 5.5.0 → 5.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/Dropdown/DropdownMenu.cjs +1 -1
- package/dist/Dropdown/DropdownMenu.cjs.map +1 -1
- package/dist/Dropdown/DropdownMenu.js +3 -1
- package/dist/Dropdown/DropdownMenu.js.map +1 -1
- package/dist/Megamenu/MegamenuItem.cjs +1 -1
- package/dist/Megamenu/MegamenuItem.cjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/package.json +1 -1
- package/src/Dropdown/DropdownMenu.tsx +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [5.5.1](https://github.com/italia/design-react-kit/compare/v5.5.0...v5.5.1) (2025-01-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* remove dropdown menu offset in slim headers ([52a1149](https://github.com/italia/design-react-kit/commit/52a1149c48303d8e9389000441badf9394c0c674))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
1
10
|
# [5.5.0](https://github.com/italia/design-react-kit/compare/v5.4.1...v5.5.0) (2024-12-18)
|
|
2
11
|
|
|
3
12
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var x=Object.create;var s=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var o in e)s(t,o,{get:e[o],enumerable:!0})},a=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of y(e))!f.call(t,n)&&n!==o&&s(t,n,{get:()=>e[n],enumerable:!(r=M(e,n))||r.enumerable});return t};var N=(t,e,o)=>(o=t!=null?x(C(t)):{},a(e||!t||!t.__esModule?s(o,"default",{value:t,enumerable:!0}):o,t)),w=t=>a(s({},"__esModule",{value:!0}),t);var H={};l(H,{DropdownMenu:()=>D});module.exports=w(H);var d=N(require("react"),1),i=require("reactstrap");var p=require("react"),c="slim";var A=(0,p.createContext)({}),u=()=>{let{type:t}=(0,p.useContext)(A);return t};var D=({className:t,inNavbar:e,testId:o,children:r,...n})=>{let m=u();return d.default.createElement(i.DropdownMenu,{style:e&&m===c?{top:"unset !important"}:{},"data-testid":o,...n,className:t},r)};0&&(module.exports={DropdownMenu});
|
|
2
2
|
//# sourceMappingURL=DropdownMenu.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Dropdown/DropdownMenu.tsx"],"sourcesContent":["import React, { FC, HTMLAttributes } from 'react';\nimport { DropdownMenu as BSDRopdownMenu } from 'reactstrap';\
|
|
1
|
+
{"version":3,"sources":["../../src/Dropdown/DropdownMenu.tsx","../../src/Header/HeaderContext.tsx"],"sourcesContent":["import React, { FC, HTMLAttributes } from 'react';\nimport { DropdownMenu as BSDRopdownMenu } from 'reactstrap';\nimport { SLIM, useHeaderContext } from '../Header/HeaderContext';\n\nexport interface DropdownMenuProps extends HTMLAttributes<HTMLElement> {\n /** Classi aggiuntive da usare per il componente Button */\n inNavbar?: boolean;\n className?: string;\n testId?: string;\n}\n\nexport const DropdownMenu: FC<DropdownMenuProps> = ({ className, inNavbar, testId, children, ...attributes }) => {\n const type = useHeaderContext();\n const style = inNavbar && type === SLIM ? { top: 'unset !important' } : {};\n\n return (\n <BSDRopdownMenu style={style} data-testid={testId} {...attributes} className={className}>\n {children}\n </BSDRopdownMenu>\n );\n};\n","import { createContext, useContext } from 'react';\n\nexport const SLIM = 'slim';\nexport const CENTER = 'center';\nexport const NAVBAR = 'navbar';\n\nexport const HeaderContext = /* @__PURE__ */ createContext<{\n type?: typeof SLIM | typeof CENTER | typeof NAVBAR;\n}>({});\n\nexport const useHeaderContext = () => {\n const { type } = useContext(HeaderContext);\n return type;\n};\n"],"mappings":"0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA0C,sBAC1CC,EAA+C,sBCD/C,IAAAC,EAA0C,iBAE7BC,EAAO,OAIb,IAAMC,KAAgC,iBAE1C,CAAC,CAAC,EAEQC,EAAmB,IAAM,CACpC,GAAM,CAAE,KAAAC,CAAK,KAAI,cAAWF,CAAa,EACzC,OAAOE,CACT,EDFO,IAAMC,EAAsC,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,OAAAC,EAAQ,SAAAC,EAAU,GAAGC,CAAW,IAAM,CAC/G,IAAMC,EAAOC,EAAiB,EAG9B,OACE,EAAAC,QAAA,cAAC,EAAAC,aAAA,CAAe,MAHJP,GAAYI,IAASI,EAAO,CAAE,IAAK,kBAAmB,EAAI,CAAC,EAGzC,cAAaP,EAAS,GAAGE,EAAY,UAAWJ,GAC3EG,CACH,CAEJ","names":["DropdownMenu_exports","__export","DropdownMenu","__toCommonJS","import_react","import_reactstrap","import_react","SLIM","HeaderContext","useHeaderContext","type","DropdownMenu","className","inNavbar","testId","children","attributes","type","useHeaderContext","React","BSDRopdownMenu","SLIM"]}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DropdownMenu as BSDRopdownMenu } from 'reactstrap';
|
|
3
|
+
import { SLIM, useHeaderContext } from '../Header/HeaderContext';
|
|
3
4
|
export const DropdownMenu = ({ className, inNavbar, testId, children, ...attributes }) => {
|
|
4
|
-
const
|
|
5
|
+
const type = useHeaderContext();
|
|
6
|
+
const style = inNavbar && type === SLIM ? { top: 'unset !important' } : {};
|
|
5
7
|
return (React.createElement(BSDRopdownMenu, { style: style, "data-testid": testId, ...attributes, className: className }, children));
|
|
6
8
|
};
|
|
7
9
|
//# sourceMappingURL=DropdownMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.js","sourceRoot":"","sources":["../../src/Dropdown/DropdownMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,YAAY,IAAI,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"DropdownMenu.js","sourceRoot":"","sources":["../../src/Dropdown/DropdownMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,YAAY,IAAI,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AASjE,MAAM,CAAC,MAAM,YAAY,GAA0B,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,EAAE,EAAE;IAC9G,MAAM,IAAI,GAAG,gBAAgB,EAAE,CAAC;IAChC,MAAM,KAAK,GAAG,QAAQ,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAE3E,OAAO,CACL,oBAAC,cAAc,IAAC,KAAK,EAAE,KAAK,iBAAe,MAAM,KAAM,UAAU,EAAE,SAAS,EAAE,SAAS,IACpF,QAAQ,CACM,CAClB,CAAC;AACJ,CAAC,CAAC"}
|