@nimbus-ds/menubutton 1.1.2-rc.1 → 1.2.0-rc.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/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +5 -4
- package/dist/index.module.js.map +1 -1
- package/package.json +6 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode, FC, ComponentPropsWithRef } from "react";
|
|
2
2
|
import { IconProps } from "@nimbus-ds/icons";
|
|
3
|
-
|
|
3
|
+
import { PolymorphicForwardRefComponent } from "@nimbus-ds/typings";
|
|
4
|
+
interface MenuButtonBaseProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "color"> {
|
|
4
5
|
/** Text label for the button */
|
|
5
6
|
label: string;
|
|
6
7
|
/** Function executed when clicking the button */
|
|
@@ -12,7 +13,8 @@ export interface MenuButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonEle
|
|
|
12
13
|
/** Inner components displayed on the right of the button component */
|
|
13
14
|
children?: ReactNode;
|
|
14
15
|
}
|
|
15
|
-
export const MenuButton:
|
|
16
|
+
export const MenuButton: PolymorphicForwardRefComponent<"button" | "a", MenuButtonBaseProps>;
|
|
17
|
+
export type MenuButtonProps = ComponentPropsWithRef<typeof MenuButton>;
|
|
16
18
|
export default MenuButton;
|
|
17
19
|
|
|
18
20
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;AAGA,6BACE,SAAQ,IAAI,CAAC,qBAAqB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC9D,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;ACRD,OAAA,MAAM,+EAwDkE,CAAC;AAIzE,8BAA8B,sBAAsB,iBAAiB,CAAC,CAAC;AC/DvE,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\";\nexport default MenuButton;\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|
package/dist/index.js
CHANGED
|
@@ -17,15 +17,16 @@ $parcel$export(module.exports, "default", () => $c1118e38a3916ade$export$2e2bcd8
|
|
|
17
17
|
$parcel$export(module.exports, "MenuButton", () => $7f667c33a97c600f$export$266a769812832828);
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
const $7f667c33a97c600f$export$266a769812832828 = ({ className: _className , style: _style , label: label , onClick: onClick , startIcon: IconSrc , children: children , active: active = false , ...rest })=>{
|
|
20
|
+
const $7f667c33a97c600f$export$266a769812832828 = /*#__PURE__*/ (0, $kFxFh$react.forwardRef)(({ className: _className , style: _style , label: label , onClick: onClick , startIcon: IconSrc , children: children , active: active = false , as: as = "button" , ...rest })=>{
|
|
21
21
|
const activeColor = active ? "primary-interactive" : "primary-textHigh";
|
|
22
22
|
const disabledColor = rest.disabled ? "neutral-textDisabled" : activeColor;
|
|
23
23
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($kFxFh$react))).createElement((0, $kFxFh$nimbusdscomponents.Box), {
|
|
24
24
|
...rest,
|
|
25
|
-
as:
|
|
25
|
+
as: as,
|
|
26
26
|
type: "button",
|
|
27
27
|
onClick: onClick,
|
|
28
28
|
alignItems: "center",
|
|
29
|
+
textDecoration: "none",
|
|
29
30
|
backgroundColor: {
|
|
30
31
|
xs: active ? "primary-surface" : "transparent",
|
|
31
32
|
hover: "primary-surface",
|
|
@@ -58,7 +59,7 @@ const $7f667c33a97c600f$export$266a769812832828 = ({ className: _className , sty
|
|
|
58
59
|
fontSize: "base",
|
|
59
60
|
color: disabledColor
|
|
60
61
|
}, label)), children);
|
|
61
|
-
};
|
|
62
|
+
});
|
|
62
63
|
$7f667c33a97c600f$export$266a769812832828.displayName = "MenuButton";
|
|
63
64
|
|
|
64
65
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;ACAA;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;ACAA;;AAOA,MAAM,0DAAa,CAAA,GAAA,uBAAA,EACjB,CAAC,EACC,WAAW,WAAU,EACrB,OAAO,OAAM,SACb,MAAK,WACL,QAAO,EACP,WAAW,QAAO,YAClB,SAAQ,UACR,SAAS,KAAK,OACd,KAAK,WACL,GAAG,MAC+B,GAXtC;IAYI,MAAM,cAAc,SAAS,wBAAwB,kBAAkB;IACvE,MAAM,gBAAgB,KAAK,QAAQ,GAAG,yBAAyB,WAAW;IAE1E,qBACE,CAAA,GAAA,sCAAA,EAAA,aAAA,CAAC,CAAA,GAAA,6BAAG,AAAH,GAAG;QAAA,GACE,IAAI;QACR,IAAI;QACJ,MAAK;QACL,SAAS;QACT,YAAW;QACX,gBAAe;QACf,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,sCAAA,AAAA,EAAA,aAAA,CAAC,CAAA,GAAA,8BAAA,GAAI;QAAC,OAAO;QAAe,sBAAQ,CAAA,GAAA,sCAAA,EAAA,aAAA,CAAC,SAAO,IAAA;IAAG,kBAC3D,CAAA,GAAA,sCAAA,EAAA,aAAA,CAAC,CAAA,GAAA,6BAAG,AAAH,GAAG;QAAC,SAAQ;QAAc,MAAK;IAAhC,iBACE,CAAA,GAAA,sCAAA,EAAA,aAAA,CAAC,CAAA,GAAA,8BAAI,AAAJ,GAAI;QAAC,UAAS;QAAO,OAAO;IAAa,GACvC,SAGJ;AAGP;AAGF,0CAAW,WAAW,GAAG;;ADjEzB;;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\";\nexport default MenuButton;\n","import React, { ComponentPropsWithRef, forwardRef } from \"react\";\n\nimport { Text, Icon, Box } from \"@nimbus-ds/components\";\nimport { PolymorphicForwardRefComponent } from \"@nimbus-ds/typings\";\n\nimport { MenuButtonBaseProps } from \"./menuButton.types\";\n\nconst MenuButton = forwardRef(\n ({\n className: _className,\n style: _style,\n label,\n onClick,\n startIcon: IconSrc,\n children,\n active = false,\n as = \"button\",\n ...rest\n }: MenuButtonBaseProps & { as: any }) => {\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={as}\n type=\"button\"\n onClick={onClick}\n alignItems=\"center\"\n textDecoration=\"none\"\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) as PolymorphicForwardRefComponent<\"button\" | \"a\", MenuButtonBaseProps>;\n\nMenuButton.displayName = \"MenuButton\";\n\nexport type MenuButtonProps = ComponentPropsWithRef<typeof MenuButton>;\nexport { MenuButton };\n"],"names":[],"version":3,"file":"index.js.map"}
|
package/dist/index.module.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import $hq6vK$react from "react";
|
|
1
|
+
import $hq6vK$react, {forwardRef as $hq6vK$forwardRef} from "react";
|
|
2
2
|
import {Box as $hq6vK$Box, Icon as $hq6vK$Icon, Text as $hq6vK$Text} from "@nimbus-ds/components";
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
const $a1957ce755237e22$export$266a769812832828 = ({ className: _className , style: _style , label: label , onClick: onClick , startIcon: IconSrc , children: children , active: active = false , ...rest })=>{
|
|
6
|
+
const $a1957ce755237e22$export$266a769812832828 = /*#__PURE__*/ (0, $hq6vK$forwardRef)(({ className: _className , style: _style , label: label , onClick: onClick , startIcon: IconSrc , children: children , active: active = false , as: as = "button" , ...rest })=>{
|
|
7
7
|
const activeColor = active ? "primary-interactive" : "primary-textHigh";
|
|
8
8
|
const disabledColor = rest.disabled ? "neutral-textDisabled" : activeColor;
|
|
9
9
|
return /*#__PURE__*/ (0, $hq6vK$react).createElement((0, $hq6vK$Box), {
|
|
10
10
|
...rest,
|
|
11
|
-
as:
|
|
11
|
+
as: as,
|
|
12
12
|
type: "button",
|
|
13
13
|
onClick: onClick,
|
|
14
14
|
alignItems: "center",
|
|
15
|
+
textDecoration: "none",
|
|
15
16
|
backgroundColor: {
|
|
16
17
|
xs: active ? "primary-surface" : "transparent",
|
|
17
18
|
hover: "primary-surface",
|
|
@@ -44,7 +45,7 @@ const $a1957ce755237e22$export$266a769812832828 = ({ className: _className , sty
|
|
|
44
45
|
fontSize: "base",
|
|
45
46
|
color: disabledColor
|
|
46
47
|
}, label)), children);
|
|
47
|
-
};
|
|
48
|
+
});
|
|
48
49
|
$a1957ce755237e22$export$266a769812832828.displayName = "MenuButton";
|
|
49
50
|
|
|
50
51
|
|
package/dist/index.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;ACAA;;
|
|
1
|
+
{"mappings":";;;ACAA;;AAOA,MAAM,0DAAa,CAAA,GAAA,iBAAA,EACjB,CAAC,EACC,WAAW,WAAU,EACrB,OAAO,OAAM,SACb,MAAK,WACL,QAAO,EACP,WAAW,QAAO,YAClB,SAAQ,UACR,SAAS,KAAK,OACd,KAAK,WACL,GAAG,MAC+B,GAXtC;IAYI,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,IAAI;QACJ,MAAK;QACL,SAAS;QACT,YAAW;QACX,gBAAe;QACf,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;AAGF,0CAAW,WAAW,GAAG;;ADjEzB;;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\";\nexport default MenuButton;\n","import React, { ComponentPropsWithRef, forwardRef } from \"react\";\n\nimport { Text, Icon, Box } from \"@nimbus-ds/components\";\nimport { PolymorphicForwardRefComponent } from \"@nimbus-ds/typings\";\n\nimport { MenuButtonBaseProps } from \"./menuButton.types\";\n\nconst MenuButton = forwardRef(\n ({\n className: _className,\n style: _style,\n label,\n onClick,\n startIcon: IconSrc,\n children,\n active = false,\n as = \"button\",\n ...rest\n }: MenuButtonBaseProps & { as: any }) => {\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={as}\n type=\"button\"\n onClick={onClick}\n alignItems=\"center\"\n textDecoration=\"none\"\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) as PolymorphicForwardRefComponent<\"button\" | \"a\", MenuButtonBaseProps>;\n\nMenuButton.displayName = \"MenuButton\";\n\nexport type MenuButtonProps = ComponentPropsWithRef<typeof MenuButton>;\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.2.0-rc.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,9 +28,10 @@
|
|
|
28
28
|
"url": "https://github.com/TiendaNube/nimbus-patterns/issues"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@nimbus-ds/components": "^
|
|
32
|
-
"@nimbus-ds/icons": "^1.
|
|
33
|
-
"@nimbus-ds/styles": "^
|
|
31
|
+
"@nimbus-ds/components": "^4.0.0",
|
|
32
|
+
"@nimbus-ds/icons": "^1.1.0",
|
|
33
|
+
"@nimbus-ds/styles": "^8.0.0",
|
|
34
|
+
"@nimbus-ds/typings": "^1.1.0"
|
|
34
35
|
},
|
|
35
|
-
"stableVersion": "1.1.
|
|
36
|
+
"stableVersion": "1.1.2"
|
|
36
37
|
}
|