@nimbus-ds/menubutton 2.1.0-rc.1 → 2.1.0

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 CHANGED
@@ -2,6 +2,16 @@
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
+ ## 2026-11-25 `2.1.0`
6
+
7
+ #### 🎉 New features
8
+
9
+ - Added the Norte UI appearance under the `next-norteui` theme: rest text and icon use `neutral-textLow`, hover and pressed use `neutral-surfaceHighlight`, the selected entry uses `neutral-background` with `primary-interactive`, and the Accordion container is transparent unless `active`. Under `next-norteui` and `next-norteui-dark`, Accordion items have no gap, both under the header and in the collapsed popover. Other themes render as before. ([#228](https://github.com/TiendaNube/nimbus-patterns/pull/228) by [@FedeTrevi-se](https://github.com/FedeTrevi-se))
10
+
11
+ #### 💡 Others
12
+
13
+ - Added `@nimbus-ds/styles` as a peer dependency to read the theme in effect. ([#228](https://github.com/TiendaNube/nimbus-patterns/pull/228) by [@FedeTrevi-se](https://github.com/FedeTrevi-se))
14
+
5
15
  ## 2026-03-04 `2.0.3`
6
16
 
7
17
  #### 🐛 Bug fixes
@@ -0,0 +1,182 @@
1
+ # Changelog
2
+
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
+
5
+ ## 2026-11-25 `2.1.0`
6
+
7
+ #### 🎉 New features
8
+
9
+ - Added the Norte UI appearance under the `next-norteui` theme: rest text and icon use `neutral-textLow`, hover and pressed use `neutral-surfaceHighlight`, the selected entry uses `neutral-background` with `primary-interactive`, and the Accordion container is transparent unless `active`. Under `next-norteui` and `next-norteui-dark`, Accordion items have no gap, both under the header and in the collapsed popover. Other themes render as before. ([#228](https://github.com/TiendaNube/nimbus-patterns/pull/228) by [@FedeTrevi-se](https://github.com/FedeTrevi-se))
10
+
11
+ #### 💡 Others
12
+
13
+ - Added `@nimbus-ds/styles` as a peer dependency to read the theme in effect. ([#228](https://github.com/TiendaNube/nimbus-patterns/pull/228) by [@FedeTrevi-se](https://github.com/FedeTrevi-se))
14
+
15
+ ## 2026-03-04 `2.0.3`
16
+
17
+ #### 🐛 Bug fixes
18
+
19
+ - Fixed `className` prop not being passed through to the underlying element. ([#156](https://github.com/TiendaNube/nimbus-patterns/pull/156) by [@joacotornello](https://github.com/joacotornello))
20
+
21
+ ## 2026-01-15 `2.0.2`
22
+
23
+ #### 📚 3rd party library updates
24
+
25
+ - Extends support to React 19. ([#138](https://github.com/TiendaNube/nimbus-patterns/pull/138) by [@joacotornello](https://github.com/joacotornello))
26
+
27
+ ## 2025-11-14 `2.0.1`
28
+
29
+ #### 🐛 Bug fixes
30
+
31
+ - Don't render start icon in popover content when menu is collapsed. ([#134](https://github.com/TiendaNube/nimbus-patterns/pull/134) by [@joacotornello](https://github.com/joacotornello))
32
+
33
+ ## 2025-11-04 `2.0.0`
34
+
35
+ #### 🛠 Breaking changes
36
+
37
+ - Renamed `showTooltipsWhenCollapsed` prop to `showPopoversWhenCollapsed` in `MenuButton` and `MenuButton.Accordion` components. ([#131](https://github.com/TiendaNube/nimbus-patterns/pull/131) by [@joacotornello](https://github.com/joacotornello))
38
+
39
+ #### 🎉 New features
40
+
41
+ - Adds support for popovers inside `MenuButton.Accordion` component. ([#131](https://github.com/TiendaNube/nimbus-patterns/pull/131) by [@joacotornello](https://github.com/joacotornello))
42
+
43
+ ## 2025-10-09 `1.9.0`
44
+
45
+ #### 🎉 New features
46
+
47
+ - Added `tooltipText` prop to `MenuButton` component to display custom tooltip text when menu is collapsed. ([#129](https://github.com/TiendaNube/nimbus-patterns/pull/129) by [@joacotornello](https://github.com/joacotornello))
48
+ - Added `tooltipText` prop to `MenuButton.Accordion` component to display custom tooltip text when menu is collapsed. ([#129](https://github.com/TiendaNube/nimbus-patterns/pull/129) by [@joacotornello](https://github.com/joacotornello))
49
+ - Added automatic tooltip support that displays button label when menu is collapsed and tooltips are enabled. ([#129](https://github.com/TiendaNube/nimbus-patterns/pull/129) by [@joacotornello](https://github.com/joacotornello))
50
+
51
+ ## 2025-08-08 `1.8.0`
52
+
53
+ #### 🎉 New features
54
+
55
+ - Added `expanded` prop support for MenuButton and MenuButtonAccordion components. ([#117](https://github.com/TiendaNube/nimbus-patterns/pull/117) by [@joacotornello](https://github.com/joacotornello))
56
+
57
+ ## 2025-08-05 `1.7.0`
58
+
59
+ #### 🎉 New features
60
+
61
+ - Updated MenuButton icon size from 14px to 16px for better visual consistency. ([#115](https://github.com/TiendaNube/nimbus-patterns/pull/115) by [@noecondoleo](https://github.com/noecondoleo) [@FedeTrevi-se](https://github.com/FedeTrevi-se))
62
+
63
+ ## 2025-03-18 `1.6.0`
64
+
65
+ #### 🎉 New features
66
+
67
+ - Adds `use-client` directive to the build output in order to support NextJS applications. ([#104](https://github.com/TiendaNube/nimbus-patterns/pull/104) by [@joacotornello](https://github.com/joacotornello))
68
+
69
+ ### 💡 Others
70
+
71
+ - Rebuild after build process changes to add support for modular imports and Server Components. ([#104](https://github.com/TiendaNube/nimbus-patterns/pull/104) by [@joacotornello](https://github.com/joacotornello))
72
+
73
+ ## 2024-02-07 `1.5.5`
74
+
75
+ ### 🎉 New features
76
+
77
+ - Add `wordBreak="break-all"` property to allow overflowing text to be trimmed at any position. ([#94](https://github.com/TiendaNube/nimbus-patterns/pull/94) by [@juanchigallego](https://github.com/juanchigallego))
78
+
79
+ ## 2024-01-09 `1.5.4`
80
+
81
+ #### 🐛 Bug fixes
82
+
83
+ - Remove visual focus box-shadow from `MenuButton` component because it visually hints the element is on focus even after an action has been performed. ([#93](https://github.com/TiendaNube/nimbus-patterns/pull/93) by [@juanchigallego](https://github.com/juanchigallego))
84
+
85
+ ## 2023-12-18 `1.5.3`
86
+
87
+ ### 🎉 New features
88
+
89
+ - Adjust component padding and size of the icon child. ([#90](https://github.com/TiendaNube/nimbus-patterns/pull/90) by [@juanchigallego](https://github.com/juanchigallego))
90
+ - Adjust padding on `MenuButtonAccordion` subcomponent. ([#90](https://github.com/TiendaNube/nimbus-patterns/pull/90) by [@juanchigallego](https://github.com/juanchigallego))
91
+
92
+ ## 2023-06-15 `1.5.2`
93
+
94
+ #### 💡 Others
95
+
96
+ - Removed module key from `package.json`. ([#62](https://github.com/TiendaNube/nimbus-patterns/pull/62) by [@juniorconquista](https://github.com/juniorconquista))
97
+
98
+ ## 2023-05-23 `1.5.0`
99
+
100
+ #### 📚 3rd party library updates
101
+
102
+ - Updated `@nimbus-ds/components@4.x` to `@nimbus-ds/components@5.x`. ([#56](https://github.com/TiendaNube/nimbus-patterns/pull/56) by [@juniorconquista](https://github.com/juniorconquista))
103
+
104
+ ## 2023-05-08 `1.4.0`
105
+
106
+ ### 🎉 New features
107
+
108
+ - Added `as` property to the `MenuButton.Accordion` component API. ([#50](https://github.com/TiendaNube/nimbus-patterns/pull/50) by [@juniorconquista](https://github.com/juniorconquista))
109
+
110
+ ## 2023-04-24 `1.3.1`
111
+
112
+ #### 🐛 Bug fixes
113
+
114
+ - Renamed `controlled` property to `open` in `MenuButton.Accordion` component API. ([#48](https://github.com/TiendaNube/nimbus-patterns/pull/48) by [@juniorconquista](https://github.com/juniorconquista))
115
+ - Changed the background color of the `MenuButton.Accordion` component when it is open. ([#48](https://github.com/TiendaNube/nimbus-patterns/pull/48) by [@juniorconquista](https://github.com/juniorconquista))
116
+
117
+ ## 2023-04-12 `1.3.0`
118
+
119
+ #### 🎉 New features
120
+
121
+ - Added `MenuButton.Accordion` subcomponent. ([#44](https://github.com/TiendaNube/nimbus-patterns/pull/44) by [@juniorconquista](https://github.com/juniorconquista))
122
+
123
+ ## 2023-04-04 `1.2.0`
124
+
125
+ #### 🎉 New features
126
+
127
+ - Added `as` property to the `MenuButton` component API. ([#32](https://github.com/TiendaNube/nimbus-patterns/pull/32) by [@juniorconquista](https://github.com/juniorconquista))
128
+
129
+ #### 📚 3rd party library updates
130
+
131
+ - Added `@nimbus-ds/typings@1.1.0`. ([#32](https://github.com/TiendaNube/nimbus-patterns/pull/32) by [@juniorconquista](https://github.com/juniorconquista))
132
+ - Updated `@nimbus-ds/components@4.x`. ([#32](https://github.com/TiendaNube/nimbus-patterns/pull/32) by [@juniorconquista](https://github.com/juniorconquista))
133
+ - Updated `@nimbus-ds/components@4.x`. ([#32](https://github.com/TiendaNube/nimbus-patterns/pull/32) by [@juniorconquista](https://github.com/juniorconquista))
134
+ - Removed `@nimbus-ds/styles@7.0.0`. ([#32](https://github.com/TiendaNube/nimbus-patterns/pull/32) by [@juniorconquista](https://github.com/juniorconquista))
135
+
136
+ ## 2023-03-20 `1.1.2`
137
+
138
+ ### 📚 3rd party library updates
139
+
140
+ - Updated `@nimbus-ds/styles@7.0.0`. ([#27](https://github.com/TiendaNube/nimbus-patterns/pull/27) by [@juanchigallego](https://github.com/juanchigallego))
141
+
142
+ ### 💡 Others
143
+
144
+ - Updated props to match current versions of `components` and `styles`. ([#27](https://github.com/TiendaNube/nimbus-patterns/pull/27) by [@juanchigallego](https://github.com/juanchigallego))
145
+
146
+ ## 2023-03-13 `1.1.1`
147
+
148
+ ### 📚 Documentation
149
+
150
+ - Add props documentation. ([#26](https://github.com/TiendaNube/nimbus-patterns/pull/26) by [@juanchigallego](https://github.com/juanchigallego))
151
+
152
+ ## 2023-02-17 `1.1.0`
153
+
154
+ ### 🎉 New features
155
+
156
+ - 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))
157
+
158
+ ### 📚 3rd party library updates
159
+
160
+ - Added `@nimbus-ds/components@2.8.0`. ([#20](https://github.com/TiendaNube/nimbus-patterns/pull/20) by [@juniorconquista](https://github.com/juniorconquista))
161
+ - Added `@nimbus-ds/styles@6.11.0`. ([#20](https://github.com/TiendaNube/nimbus-patterns/pull/20) by [@juniorconquista](https://github.com/juniorconquista))
162
+ - Added `@nimbus-ds/icons@1.0.0`. ([#20](https://github.com/TiendaNube/nimbus-patterns/pull/20) by [@juniorconquista](https://github.com/juniorconquista))
163
+ - Removed `@nimbus-ds/icon@2.0.0`. ([#20](https://github.com/TiendaNube/nimbus-patterns/pull/20) by [@juniorconquista](https://github.com/juniorconquista))
164
+ - Removed `@nimbus-ds/text@5.0.0`. ([#20](https://github.com/TiendaNube/nimbus-patterns/pull/20) by [@juniorconquista](https://github.com/juniorconquista))
165
+ - Removed `@nimbus-ds/box@2.4.0`. ([#20](https://github.com/TiendaNube/nimbus-patterns/pull/20) by [@juniorconquista](https://github.com/juniorconquista))
166
+ - Removed `@tiendanube/icons@0.3.1`. ([#20](https://github.com/TiendaNube/nimbus-patterns/pull/20) by [@juniorconquista](https://github.com/juniorconquista))
167
+
168
+ ## 2023-02-10 `1.0.0`
169
+
170
+ ### 📚 3rd party library updates
171
+
172
+ - Added `@nimbus-ds/icon@2.0.0`. ([#14](https://github.com/TiendaNube/nimbus-patterns/pull/14) by [@juanchigallego](https://github.com/juanchigallego))
173
+ - Added `@nimbus-ds/box@2.4.0`. ([#14](https://github.com/TiendaNube/nimbus-patterns/pull/14) by [@juanchigallego](https://github.com/juanchigallego))
174
+ - Added `@nimbus-ds/text@5.0.0`. ([#14](https://github.com/TiendaNube/nimbus-patterns/pull/14) by [@juanchigallego](https://github.com/juanchigallego))
175
+ - Added `@nimbus-ds/tokens@6.0.1`. ([#14](https://github.com/TiendaNube/nimbus-patterns/pull/14) by [@juanchigallego](https://github.com/juanchigallego))
176
+ - Added `@tiendanube/icons@0.3.2`. ([#14](https://github.com/TiendaNube/nimbus-patterns/pull/14) by [@juanchigallego](https://github.com/juanchigallego))
177
+
178
+ ### 🎉 New features
179
+
180
+ - Added `MenuButton` component. ([#14](https://github.com/TiendaNube/nimbus-patterns/pull/14) by [@juanchigallego](https://github.com/juanchigallego))
181
+ - Added `label`, `onClick`, `startIcon`, `active` and `children` properties to the `MenuButton` component API. ([#14](https://github.com/TiendaNube/nimbus-patterns/pull/14) by [@juanchigallego](https://github.com/juanchigallego))
182
+ - Added story documentation in Storybook. ([#14](https://github.com/TiendaNube/nimbus-patterns/pull/14) by [@juanchigallego](https://github.com/juanchigallego))
package/dist/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # `@nimbus-ds/menubutton`
2
+
3
+ [![@nimbus-ds/menubutton](https://img.shields.io/npm/v/@nimbus-ds/menubutton?label=%40nimbus-ds%2Fmenubutton)](https://www.npmjs.com/package/@nimbus-ds/menubutton)
4
+
5
+ MenuButton component is meant to be used inside Menus and navigation, and allows the user to navigate between different sections of an application.
6
+
7
+ ## Installation
8
+
9
+ ```sh
10
+ $ yarn add @nimbus-ds/menubutton
11
+ # or
12
+ $ npm install @nimbus-ds/menubutton
13
+ ```
@@ -0,0 +1,88 @@
1
+ // Generated by dts-bundle-generator v8.1.2
2
+
3
+ import { IconProps } from '@nimbus-ds/icons';
4
+ import { PolymorphicForwardRefComponent } from '@nimbus-ds/typings';
5
+ import { ButtonHTMLAttributes, ComponentPropsWithRef, FC, HTMLAttributes, ReactNode } from 'react';
6
+
7
+ export interface MenuButtonAccordionProperties {
8
+ /**
9
+ * Content of the menu.
10
+ * @TJS-type React.ReactNode
11
+ */
12
+ children: ReactNode;
13
+ /**
14
+ * It will be the accordion anchor and can contain all the props available in the MenuButton component's API.
15
+ * @TJS-type React.ReactNode
16
+ */
17
+ menuButton: MenuButtonProperties;
18
+ /**
19
+ * Required ID used to maintain correct component accessibility, it will be passed on to MenuButtonAccordion's children.
20
+ */
21
+ contentid: string;
22
+ /**
23
+ * Changes the component usage so that control of open and close is controlled from outside the component.
24
+ */
25
+ open?: boolean;
26
+ /**
27
+ * Sets the state of the button as active/inactive.
28
+ */
29
+ active?: boolean;
30
+ /**
31
+ * Whether the MenuButtonAccordion is expanded.
32
+ * If `undefined`, it follows `MenuExpandContext`.
33
+ * If provided, it overrides the context.
34
+ */
35
+ expanded?: boolean;
36
+ }
37
+ export type MenuButtonAccordionBaseProps = MenuButtonAccordionProperties & {
38
+ menuButton: Omit<MenuButtonProps, "expanded" | "tooltipText">;
39
+ } & Omit<HTMLAttributes<HTMLElement>, "color">;
40
+ declare const MenuButtonAccordion: PolymorphicForwardRefComponent<"button" | "a", MenuButtonAccordionBaseProps>;
41
+ export interface MenuButtonComponents {
42
+ Accordion: typeof MenuButtonAccordion;
43
+ }
44
+ export interface MenuButtonProperties {
45
+ /**
46
+ * Text label for the button.
47
+ */
48
+ label?: string;
49
+ /**
50
+ * Function executed when clicking the button.
51
+ * @TJS-type () => void;
52
+ */
53
+ onClick?: () => void;
54
+ /**
55
+ * Sets an icon element on the left of the button.
56
+ * @TJS-type React.FC<IconProps>
57
+ */
58
+ startIcon?: FC<IconProps>;
59
+ /**
60
+ * Sets the state of the button as active/inactive.
61
+ */
62
+ active?: boolean;
63
+ /**
64
+ * Inner components displayed on the right of the button component.
65
+ * @TJS-type React.ReactNode
66
+ */
67
+ children?: ReactNode;
68
+ /**
69
+ * Controlled override for menu expansion state. This prop does not manage internal state
70
+ * and is not forwarded to the DOM as an attribute. It is used only for layout and visual
71
+ * state determination.
72
+ * If not provided, the expanded state will be determined by the context.
73
+ */
74
+ expanded?: boolean;
75
+ /**
76
+ * Whether to show popovers when the button is collapsed. Defaults to true.
77
+ */
78
+ showPopoversWhenCollapsed?: boolean;
79
+ }
80
+ export type MenuButtonBaseProps = MenuButtonProperties & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "color">;
81
+ export declare const MenuButton: PolymorphicForwardRefComponent<"button" | "a", MenuButtonBaseProps> & MenuButtonComponents;
82
+ export type MenuButtonProps = ComponentPropsWithRef<typeof MenuButton>;
83
+
84
+ export {
85
+ MenuButton as default,
86
+ };
87
+
88
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@nimbus-ds/components"),require("@nimbus-ds/styles")):"function"==typeof define&&define.amd?define(["react","@nimbus-ds/components","@nimbus-ds/styles"],t):"object"==typeof exports?exports["@nimbus-ds/menubutton"]=t(require("react"),require("@nimbus-ds/components"),require("@nimbus-ds/styles")):e["@nimbus-ds/menubutton"]=t(e.react,e["@nimbus-ds/components"],e["@nimbus-ds/styles"])}(global,((e,t,n)=>(()=>{"use strict";var r={390:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.initialMenuContext=void 0;const r=n(476);t.initialMenuContext={expanded:!0,showPopoversWhenCollapsed:!0,popoverPosition:"right",activeAccordionPopover:null,setActiveAccordionPopover:r.noop}},81:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useMenuExpandContext=t.MenuExpandContext=void 0;const r=n(156),o=n(390),i=(0,r.createContext)(void 0);t.MenuExpandContext=i;t.useMenuExpandContext=(e=!0)=>{const t=(0,r.useContext)(i);if(void 0===t){if(!e)return o.initialMenuContext;throw new Error("Menu subcomponents must be used within MenuExpandContext.Provider")}return t}},843:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useMenuExpandContext=t.MenuExpandContext=void 0;var r=n(81);Object.defineProperty(t,"MenuExpandContext",{enumerable:!0,get:function(){return r.MenuExpandContext}}),Object.defineProperty(t,"useMenuExpandContext",{enumerable:!0,get:function(){return r.useMenuExpandContext}})},997:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useNorteUiTheme=t.useRandomId=void 0;var r=n(494);Object.defineProperty(t,"useRandomId",{enumerable:!0,get:function(){return r.useRandomId}});var o=n(77);Object.defineProperty(t,"useNorteUiTheme",{enumerable:!0,get:function(){return o.useNorteUiTheme}})},77:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useNorteUiTheme=void 0;var r=n(685);Object.defineProperty(t,"useNorteUiTheme",{enumerable:!0,get:function(){return r.useNorteUiTheme}})},685:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useNorteUiTheme=void 0;const r=n(990);t.useNorteUiTheme=()=>{const{currentTheme:e}=(0,r.useTheme)(),t="next-norteui"===e;return{isNorteUi:t||"next-norteui-dark"===e,isNorteUiLight:t}}},494:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useRandomId=void 0;var r=n(499);Object.defineProperty(t,"useRandomId",{enumerable:!0,get:function(){return r.useRandomId}})},499:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useRandomId=void 0;const r=n(156);t.useRandomId=function(){const e=(0,r.useRef)(null);return e.current??=Math.random().toString(36).substring(2,9),e.current}},385:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.noop=void 0;t.noop=()=>{}},476:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.noop=void 0;var r=n(385);Object.defineProperty(t,"noop",{enumerable:!0,get:function(){return r.noop}})},492:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MenuButton=void 0;const r=n(15).__importStar(n(156)),o=n(280),i=n(843),a=n(997),u=n(612),c=(0,r.forwardRef)((({style:e,label:t,onClick:n,startIcon:c,children:l,active:s=!1,as:d="button",expanded:f,showPopoversWhenCollapsed:p,...y},v)=>{const b=(0,r.useId)(),{isNorteUiLight:m}=(0,a.useNorteUiTheme)(),{expanded:h,showPopoversWhenCollapsed:_,popoverPosition:x,activeAccordionPopover:g,setActiveAccordionPopover:w}=(0,i.useMenuExpandContext)(!1),P=f??h,O=p??_??!0,j=(0,r.useMemo)((()=>!P&&!!g&&g===b),[P,g,b]),M=s?"primary-interactive":m?"neutral-textLow":"neutral-textHigh",C=y.disabled?"neutral-textDisabled":M,E=r.default.createElement(u.MenuButtonContent,{ref:v,expanded:P,disabledColor:C,label:t,startIcon:c,active:s,as:d,onClick:n,...y},l);return!P&&O?r.default.createElement(o.Popover,{content:r.default.createElement(u.MenuButtonContent,{expanded:!0,disabledColor:C,label:t,active:s,as:d,onClick:n,...y},l),arrow:!0,position:x??"right",padding:"small",onVisibility:e=>{w((t=>e?b:t===b?null:t))},enabledHover:!0,enabledClick:!1,visible:j},E):E}));t.MenuButton=c,c.Accordion=u.MenuButtonAccordion,c.displayName="MenuButton"},112:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MenuButtonAccordion=void 0;const r=n(15).__importStar(n(156)),o=n(280),i=n(843),a=n(997),u=n(492),c=(0,r.forwardRef)((({style:e,open:t,active:n,menuButton:c,children:l,as:s,expanded:d,...f},p)=>{const y=(0,r.useId)(),{isNorteUi:v,isNorteUiLight:b}=(0,a.useNorteUiTheme)(),m=v?"none":"0-5",{expanded:h,popoverPosition:_,showPopoversWhenCollapsed:x,activeAccordionPopover:g,setActiveAccordionPopover:w}=(0,i.useMenuExpandContext)(!1),P=d??h,[O,j]=(0,r.useState)(!1),M=(0,r.useMemo)((()=>!P&&!!g&&g===y),[P,g,y]),C=(0,r.useMemo)((()=>t??O),[t,O]),E=(0,r.useMemo)((()=>({expanded:!0,popoverPosition:_,activeAccordionPopover:null,setActiveAccordionPopover:()=>{}})),[_]),S=r.default.createElement(o.Box,{...f,ref:p,as:s,backgroundColor:b?n?"neutral-background":"transparent":n?"primary-surface":C?"neutral-surface":"transparent",borderRadius:"2",zIndex:C?"100":void 0,textDecoration:"none"},r.default.createElement(u.MenuButton,{...c,onClick:void 0!==t?c.onClick:()=>j((e=>!e)),active:n,"aria-expanded":C&&P,showPopoversWhenCollapsed:!1,expanded:P}),C&&P&&r.default.createElement(o.Box,{id:"content-1","aria-hidden":!C,height:C?"auto":"0",overflow:"hidden",display:"flex",flexDirection:"column",gap:m,pl:"6",pb:"1",pr:"1"},l));return!P&&x?r.default.createElement(o.Popover,{content:r.default.createElement(i.MenuExpandContext.Provider,{value:E},r.default.createElement(o.Box,{minWidth:"200px",display:"flex",flexDirection:"column",gap:m},l)),arrow:!0,position:_??"right",padding:"small",enabledClick:!1,onVisibility:e=>{w((t=>e?y:t===y?null:t))},enabledHover:!0,visible:M},S):S}));t.MenuButtonAccordion=c},414:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MenuButtonAccordion=void 0;const r=n(112);var o=n(112);Object.defineProperty(t,"MenuButtonAccordion",{enumerable:!0,get:function(){return o.MenuButtonAccordion}}),t.default=r.MenuButtonAccordion},951:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MenuButtonContent=void 0;const r=n(15).__importStar(n(156)),o=n(280),i=n(997),a=(e,t)=>t?{xs:e?"neutral-background":"transparent",hover:"neutral-surfaceHighlight",active:"neutral-surfaceHighlight",disabled:"neutral-surfaceDisabled"}:{xs:e?"primary-surface":"transparent",hover:"primary-surface",active:"primary-surfaceHighlight",disabled:"neutral-surfaceDisabled"},u=(0,r.forwardRef)((({expanded:e,disabledColor:t,label:n,startIcon:u,children:c,active:l,as:s="button",onClick:d,...f},p)=>{const{isNorteUiLight:y}=(0,i.useNorteUiTheme)(),v=e?{}:{justifyContent:"center",paddingX:"none"};return r.default.createElement(o.Box,{...f,ref:p,as:s,type:"button",onClick:d,alignItems:"center",textDecoration:"none",backgroundColor:a(l,y),borderRadius:"2",borderWidth:"none",cursor:{xs:"pointer",disabled:"not-allowed"},display:"flex",gap:"2",px:"2",py:{xs:"2",md:"1"},width:"100%",transitionProperty:"all",transitionDuration:"base",transitionTimingFunction:"ease-in-out",maxHeight:{xs:"34px",md:"26px"},...v},u&&r.default.createElement(o.Icon,{color:t,source:r.default.createElement(u,{size:16})}),e&&r.default.createElement(o.Box,{display:"inline-flex",flex:"1"},r.default.createElement(o.Text,{fontSize:"base",color:t,lineClamp:1,wordBreak:"break-all"},n)),e&&c)}));t.MenuButtonContent=u,u.displayName="MenuButtonContent"},864:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MenuButtonContent=void 0;var r=n(951);Object.defineProperty(t,"MenuButtonContent",{enumerable:!0,get:function(){return r.MenuButtonContent}})},612:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=n(15);r.__exportStar(n(414),t),r.__exportStar(n(864),t)},15:(e,t,n)=>{n.r(t),n.d(t,{__assign:()=>i,__asyncDelegator:()=>j,__asyncGenerator:()=>O,__asyncValues:()=>M,__await:()=>P,__awaiter:()=>y,__classPrivateFieldGet:()=>B,__classPrivateFieldIn:()=>A,__classPrivateFieldSet:()=>I,__createBinding:()=>b,__decorate:()=>u,__esDecorate:()=>l,__exportStar:()=>m,__extends:()=>o,__generator:()=>v,__importDefault:()=>T,__importStar:()=>S,__makeTemplateObject:()=>C,__metadata:()=>p,__param:()=>c,__propKey:()=>d,__read:()=>_,__rest:()=>a,__runInitializers:()=>s,__setFunctionName:()=>f,__spread:()=>x,__spreadArray:()=>w,__spreadArrays:()=>g,__values:()=>h});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function u(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function c(e,t){return function(n,r){t(n,r,e)}}function l(e,t,n,r,o,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var u,c=r.kind,l="getter"===c?"get":"setter"===c?"set":"value",s=!t&&e?r.static?e:e.prototype:null,d=t||(s?Object.getOwnPropertyDescriptor(s,r.name):{}),f=!1,p=n.length-1;p>=0;p--){var y={};for(var v in r)y[v]="access"===v?{}:r[v];for(var v in r.access)y.access[v]=r.access[v];y.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var b=(0,n[p])("accessor"===c?{get:d.get,set:d.set}:d[l],y);if("accessor"===c){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(u=a(b.get))&&(d.get=u),(u=a(b.set))&&(d.set=u),(u=a(b.init))&&o.push(u)}else(u=a(b))&&("field"===c?o.push(u):d[l]=u)}s&&Object.defineProperty(s,r.name,d),f=!0}function s(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function f(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function p(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function y(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}))}function v(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(c){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}var b=Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function m(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||b(t,e,n)}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function _(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function x(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(_(arguments[t]));return e}function g(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}function w(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function P(e){return this instanceof P?(this.v=e,this):new P(e)}function O(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||u(e,t)}))})}function u(e,t){try{(n=o[e](t)).value instanceof P?Promise.resolve(n.value.v).then(c,l):s(i[0][2],n)}catch(e){s(i[0][3],e)}var n}function c(e){u("next",e)}function l(e){u("throw",e)}function s(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}function j(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:P(e[r](t)),done:!1}:o?o(t):t}:o}}function M(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=h(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function C(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var E=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function S(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&b(t,e,n);return E(t,e),t}function T(e){return e&&e.__esModule?e:{default:e}}function B(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function I(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}function A(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}},280:e=>{e.exports=t},990:e=>{e.exports=n},156:t=>{t.exports=e}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return r[e](n,n.exports,i),n.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{var e=a;Object.defineProperty(e,"__esModule",{value:!0}),e.MenuButton=void 0;const t=i(492);var n=i(492);Object.defineProperty(e,"MenuButton",{enumerable:!0,get:function(){return n.MenuButton}}),e.default=t.MenuButton})(),a})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nimbus-ds/menubutton",
3
- "version": "2.1.0-rc.1",
3
+ "version": "2.1.0",
4
4
  "license": "MIT",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -17,6 +17,7 @@
17
17
  },
18
18
  "peerDependencies": {
19
19
  "@nimbus-ds/components": "^5",
20
+ "@nimbus-ds/styles": "^9.7.0",
20
21
  "react": "^16.8 || ^17.0 || ^18.0 || ^19.0",
21
22
  "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0"
22
23
  },