@nimbus-ds/menubutton 1.0.0 → 1.1.1-rc.3
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 +20 -0
- package/dist/index.d.ts +8 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -9
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +1 -5
- package/dist/index.module.js.map +1 -1
- package/package.json +5 -10
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
MenuButton component is meant to be used inside Menus and navigation, and allows the user to navigate between different sections of an application.
|
|
4
4
|
|
|
5
|
+
## 2023-03-13 `1.1.1`
|
|
6
|
+
|
|
7
|
+
- Add props documentation. ([#26](https://github.com/TiendaNube/nimbus-patterns/pull/26) by [@juanchigallego](https://github.com/juanchigallego))
|
|
8
|
+
|
|
9
|
+
## 2023-02-17 `1.1.0`
|
|
10
|
+
|
|
11
|
+
### 🎉 New features
|
|
12
|
+
|
|
13
|
+
- Removed external dependency from `@tiendanube/icons` package to now use internal `@nimbus-ds/icons` package. ([#15](https://github.com/TiendaNube/nimbus-design-system/pull/#15) by [@juniorconquista](https://github.com/juniorconquista))
|
|
14
|
+
|
|
15
|
+
### 📚 3rd party library updates
|
|
16
|
+
|
|
17
|
+
- Added `@nimbus-ds/components@2.8.0`. ([#20](https://github.com/TiendaNube/nimbus-patterns/pull/20) by [@juniorconquista](https://github.com/juniorconquista))
|
|
18
|
+
- Added `@nimbus-ds/styles@6.11.0`. ([#20](https://github.com/TiendaNube/nimbus-patterns/pull/20) by [@juniorconquista](https://github.com/juniorconquista))
|
|
19
|
+
- Added `@nimbus-ds/icons@1.0.0`. ([#20](https://github.com/TiendaNube/nimbus-patterns/pull/20) by [@juniorconquista](https://github.com/juniorconquista))
|
|
20
|
+
- Removed `@nimbus-ds/icon@2.0.0`. ([#20](https://github.com/TiendaNube/nimbus-patterns/pull/20) by [@juniorconquista](https://github.com/juniorconquista))
|
|
21
|
+
- Removed `@nimbus-ds/text@5.0.0`. ([#20](https://github.com/TiendaNube/nimbus-patterns/pull/20) by [@juniorconquista](https://github.com/juniorconquista))
|
|
22
|
+
- Removed `@nimbus-ds/box@2.4.0`. ([#20](https://github.com/TiendaNube/nimbus-patterns/pull/20) by [@juniorconquista](https://github.com/juniorconquista))
|
|
23
|
+
- Removed `@tiendanube/icons@0.3.1`. ([#20](https://github.com/TiendaNube/nimbus-patterns/pull/20) by [@juniorconquista](https://github.com/juniorconquista))
|
|
24
|
+
|
|
5
25
|
## 2023-02-10 `1.0.0`
|
|
6
26
|
|
|
7
27
|
### 📚 3rd party library updates
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import React, { ButtonHTMLAttributes, ReactNode } from "react";
|
|
2
|
-
import {
|
|
1
|
+
import React, { ButtonHTMLAttributes, ReactNode, FC } from "react";
|
|
2
|
+
import { IconProps } from "@nimbus-ds/icons";
|
|
3
3
|
export interface MenuButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
/** Text label for the button */
|
|
4
5
|
label: string;
|
|
6
|
+
/** Function executed when clicking the button */
|
|
5
7
|
onClick?: () => void;
|
|
6
|
-
|
|
8
|
+
/** Sets an icon element on the left of the button */
|
|
9
|
+
startIcon?: FC<IconProps>;
|
|
10
|
+
/** Sets the state of the button as active/inactive */
|
|
7
11
|
active?: boolean;
|
|
12
|
+
/** Inner components displayed on the right of the button component */
|
|
8
13
|
children?: ReactNode;
|
|
9
14
|
}
|
|
10
15
|
export const MenuButton: React.FC<MenuButtonProps>;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;
|
|
1
|
+
{"mappings":";;AAGA,gCACE,SAAQ,qBAAqB,iBAAiB,CAAC;IAC/C,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,qDAAqD;IACrD,SAAS,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC;IAC1B,sDAAsD;IACtD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;ACTD,OAAA,MAAM,YAAY,MAAM,EAAE,CAAC,eAAe,CAoDzC,CAAC;ACtDF,eAAe,UAAU,CAAC","sources":["packages/react/MenuButton/src/packages/react/MenuButton/src/menuButton.types.ts","packages/react/MenuButton/src/packages/react/MenuButton/src/MenuButton.tsx","packages/react/MenuButton/src/packages/react/MenuButton/src/index.ts","packages/react/MenuButton/src/index.ts"],"sourcesContent":[null,null,null,"import { MenuButton } from \"./MenuButton\";\n\nexport { MenuButton } from \"./MenuButton\";\nexport type { MenuButtonProps } from \"./menuButton.types\";\nexport default MenuButton;\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
var $kFxFh$react = require("react");
|
|
2
|
-
var $kFxFh$
|
|
3
|
-
var $kFxFh$nimbusdsicon = require("@nimbus-ds/icon");
|
|
4
|
-
var $kFxFh$nimbusdsbox = require("@nimbus-ds/box");
|
|
2
|
+
var $kFxFh$nimbusdscomponents = require("@nimbus-ds/components");
|
|
5
3
|
|
|
6
4
|
function $parcel$defineInteropFlag(a) {
|
|
7
5
|
Object.defineProperty(a, '__esModule', {value: true, configurable: true});
|
|
@@ -19,12 +17,10 @@ $parcel$export(module.exports, "default", () => $c1118e38a3916ade$export$2e2bcd8
|
|
|
19
17
|
$parcel$export(module.exports, "MenuButton", () => $7f667c33a97c600f$export$266a769812832828);
|
|
20
18
|
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
20
|
const $7f667c33a97c600f$export$266a769812832828 = ({ className: _className , style: _style , label: label , onClick: onClick , startIcon: IconSrc , children: children , active: active = false , ...rest })=>{
|
|
25
21
|
const activeColor = active ? "primary.interactive" : "primary.textHigh";
|
|
26
22
|
const disabledColor = rest.disabled ? "neutral.textDisabled" : activeColor;
|
|
27
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($kFxFh$react))).createElement((0, $kFxFh$
|
|
23
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($kFxFh$react))).createElement((0, $kFxFh$nimbusdscomponents.Box), {
|
|
28
24
|
...rest,
|
|
29
25
|
as: "button",
|
|
30
26
|
type: "button",
|
|
@@ -52,13 +48,13 @@ const $7f667c33a97c600f$export$266a769812832828 = ({ className: _className , sty
|
|
|
52
48
|
transitionProperty: "all",
|
|
53
49
|
transitionDuration: "base",
|
|
54
50
|
transitionTimingFunction: "ease-in-out"
|
|
55
|
-
}, IconSrc && /*#__PURE__*/ (0, ($parcel$interopDefault($kFxFh$react))).createElement((0, $kFxFh$
|
|
51
|
+
}, IconSrc && /*#__PURE__*/ (0, ($parcel$interopDefault($kFxFh$react))).createElement((0, $kFxFh$nimbusdscomponents.Icon), {
|
|
56
52
|
color: disabledColor,
|
|
57
53
|
source: /*#__PURE__*/ (0, ($parcel$interopDefault($kFxFh$react))).createElement(IconSrc, null)
|
|
58
|
-
}), /*#__PURE__*/ (0, ($parcel$interopDefault($kFxFh$react))).createElement((0, $kFxFh$
|
|
54
|
+
}), /*#__PURE__*/ (0, ($parcel$interopDefault($kFxFh$react))).createElement((0, $kFxFh$nimbusdscomponents.Box), {
|
|
59
55
|
display: "inline-flex",
|
|
60
56
|
flex: "1"
|
|
61
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($kFxFh$react))).createElement((0, $kFxFh$
|
|
57
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($kFxFh$react))).createElement((0, $kFxFh$nimbusdscomponents.Text), {
|
|
62
58
|
fontSize: "base",
|
|
63
59
|
color: disabledColor
|
|
64
60
|
}, label)), children);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
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ent":["import { MenuButton } from \"./MenuButton\";\n\nexport { MenuButton } from \"./MenuButton\";\nexport type { MenuButtonProps } from \"./menuButton.types\";\nexport default MenuButton;\n","import React from \"react\";\n\nimport { Text, Icon, Box } from \"@nimbus-ds/components\";\n\nimport { MenuButtonProps } from \"./menuButton.types\";\n\nconst MenuButton: React.FC<MenuButtonProps> = ({\n className: _className,\n style: _style,\n label,\n onClick,\n startIcon: IconSrc,\n children,\n active = false,\n ...rest\n}: MenuButtonProps) => {\n const activeColor = active ? \"primary.interactive\" : \"primary.textHigh\";\n const disabledColor = rest.disabled ? \"neutral.textDisabled\" : activeColor;\n\n return (\n <Box\n {...rest}\n as=\"button\"\n type=\"button\"\n onClick={onClick}\n alignItems=\"center\"\n backgroundColor={{\n xs: active ? \"primary.surface\" : \"transparent\",\n hover: \"primary.surface\",\n active: \"primary.surfaceHighlight\",\n disabled: \"neutral.surfaceDisabled\",\n }}\n boxShadow={{\n focus: \"focusRing\",\n }}\n borderRadius=\".5rem\"\n borderWidth=\"0\"\n cursor={{\n xs: \"pointer\",\n disabled: \"not-allowed\",\n }}\n display=\"flex\"\n gap=\"2\"\n padding=\"2\"\n width=\"100%\"\n transitionProperty=\"all\"\n transitionDuration=\"base\"\n transitionTimingFunction=\"ease-in-out\"\n >\n {IconSrc && <Icon color={disabledColor} source={<IconSrc />} />}\n <Box display=\"inline-flex\" flex=\"1\">\n <Text fontSize=\"base\" color={disabledColor}>\n {label}\n </Text>\n </Box>\n {children}\n </Box>\n );\n};\n\nMenuButton.displayName = \"MenuButton\";\n\nexport { MenuButton };\n"],"names":[],"version":3,"file":"index.js.map"}
|
package/dist/index.module.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import $hq6vK$react from "react";
|
|
2
|
-
import {Text as $hq6vK$Text} from "@nimbus-ds/
|
|
3
|
-
import {Icon as $hq6vK$Icon} from "@nimbus-ds/icon";
|
|
4
|
-
import {Box as $hq6vK$Box} from "@nimbus-ds/box";
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import {Box as $hq6vK$Box, Icon as $hq6vK$Icon, Text as $hq6vK$Text} from "@nimbus-ds/components";
|
|
7
3
|
|
|
8
4
|
|
|
9
5
|
|
package/dist/index.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;ACAA;;AAMA,MAAM,4CAAwC,CAAC,EAC7C,WAAW,WAAU,EACrB,OAAO,OAAM,SACb,MAAK,WACL,QAAO,EACP,WAAW,QAAO,YAClB,SAAQ,UACR,SAAS,KAAK,GACd,GAAG,MACa,GATlB;IAUE,MAAM,cAAc,SAAS,wBAAwB,kBAAkB;IACvE,MAAM,gBAAgB,KAAK,QAAQ,GAAG,yBAAyB,WAAW;IAE1E,qBACE,CAAA,GAAA,YAAA,EAAA,aAAA,CAAC,CAAA,GAAA,UAAG,AAAH,GAAG;QAAA,GACE,IAAI;QACR,IAAG;QACH,MAAK;QACL,SAAS;QACT,YAAW;QACX,iBAAiB;YACf,IAAI,SAAS,oBAAoB,aAAa;YAC9C,OAAO;YACP,QAAQ;YACR,UAAU;QACX;QACD,WAAW;YACT,OAAO;QACR;QACD,cAAa;QACb,aAAY;QACZ,QAAQ;YACN,IAAI;YACJ,UAAU;QACX;QACD,SAAQ;QACR,KAAI;QACJ,SAAQ;QACR,OAAM;QACN,oBAAmB;QACnB,oBAAmB;QACnB,0BAAyB;IAPxB,GASA,yBAAW,CAAA,GAAA,YAAA,AAAA,EAAA,aAAA,CAAC,CAAA,GAAA,WAAA,GAAI;QAAC,OAAO;QAAe,sBAAQ,CAAA,GAAA,YAAA,EAAA,aAAA,CAAC,SAAO,IAAA;IAAG,kBAC3D,CAAA,GAAA,YAAA,EAAA,aAAA,CAAC,CAAA,GAAA,UAAG,AAAH,GAAG;QAAC,SAAQ;QAAc,MAAK;IAAhC,iBACE,CAAA,GAAA,YAAA,EAAA,aAAA,CAAC,CAAA,GAAA,WAAI,AAAJ,GAAI;QAAC,UAAS;QAAO,OAAO;IAAa,GACvC,SAGJ;AAGP;AAEA,0CAAW,WAAW,GAAG;;AD5DzB;;IAIA,2CAAe,CAAA,GAAA,yCAAA","sources":["packages/react/MenuButton/src/index.ts","packages/react/MenuButton/src/MenuButton.tsx"],"sourcesContent":["import { MenuButton } from \"./MenuButton\";\n\nexport { MenuButton } from \"./MenuButton\";\nexport type { MenuButtonProps } from \"./menuButton.types\";\nexport default MenuButton;\n","import React from \"react\";\n\nimport { Text, Icon, Box } from \"@nimbus-ds/components\";\n\nimport { MenuButtonProps } from \"./menuButton.types\";\n\nconst MenuButton: React.FC<MenuButtonProps> = ({\n className: _className,\n style: _style,\n label,\n onClick,\n startIcon: IconSrc,\n children,\n active = false,\n ...rest\n}: MenuButtonProps) => {\n const activeColor = active ? \"primary.interactive\" : \"primary.textHigh\";\n const disabledColor = rest.disabled ? \"neutral.textDisabled\" : activeColor;\n\n return (\n <Box\n {...rest}\n as=\"button\"\n type=\"button\"\n onClick={onClick}\n alignItems=\"center\"\n backgroundColor={{\n xs: active ? \"primary.surface\" : \"transparent\",\n hover: \"primary.surface\",\n active: \"primary.surfaceHighlight\",\n disabled: \"neutral.surfaceDisabled\",\n }}\n boxShadow={{\n focus: \"focusRing\",\n }}\n borderRadius=\".5rem\"\n borderWidth=\"0\"\n cursor={{\n xs: \"pointer\",\n disabled: \"not-allowed\",\n }}\n display=\"flex\"\n gap=\"2\"\n padding=\"2\"\n width=\"100%\"\n transitionProperty=\"all\"\n transitionDuration=\"base\"\n transitionTimingFunction=\"ease-in-out\"\n >\n {IconSrc && <Icon color={disabledColor} source={<IconSrc />} />}\n <Box display=\"inline-flex\" flex=\"1\">\n <Text fontSize=\"base\" color={disabledColor}>\n {label}\n </Text>\n </Box>\n {children}\n </Box>\n );\n};\n\nMenuButton.displayName = \"MenuButton\";\n\nexport { MenuButton };\n"],"names":[],"version":3,"file":"index.module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nimbus-ds/menubutton",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1-rc.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,14 +28,9 @@
|
|
|
28
28
|
"url": "https://github.com/TiendaNube/nimbus-patterns/issues"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@nimbus-ds/
|
|
32
|
-
"@nimbus-ds/
|
|
33
|
-
"@nimbus-ds/
|
|
34
|
-
"@nimbus-ds/tokens": "^6.0.1",
|
|
35
|
-
"@tiendanube/icons": "^0.3.2"
|
|
31
|
+
"@nimbus-ds/components": "^2.8.0",
|
|
32
|
+
"@nimbus-ds/icons": "^1.0.0",
|
|
33
|
+
"@nimbus-ds/styles": "^6.11.0"
|
|
36
34
|
},
|
|
37
|
-
"
|
|
38
|
-
"@nimbus-ds/badge": "^3.0.0",
|
|
39
|
-
"@nimbus-ds/tag": "^2.0.0"
|
|
40
|
-
}
|
|
35
|
+
"stableVersion": "1.1.0"
|
|
41
36
|
}
|