From 349aa45d2b3f465fcf1a2dec1fefb067db3cc9a5 Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Wed, 6 Dec 2023 17:18:12 -0500 Subject: [PATCH] backport --- docs/pages/components/menu-item.md | 87 ++++++++++++------- docs/pages/resources/changelog.md | 1 + .../menu-item/menu-item.component.ts | 12 ++- src/components/menu-item/menu-item.styles.ts | 19 ++++ src/components/menu-item/menu-item.test.ts | 8 ++ 5 files changed, 96 insertions(+), 31 deletions(-) diff --git a/docs/pages/components/menu-item.md b/docs/pages/components/menu-item.md index 5bc1f23cf..c1e1f3f0b 100644 --- a/docs/pages/components/menu-item.md +++ b/docs/pages/components/menu-item.md @@ -60,35 +60,6 @@ const App = () => ( ## Examples -### Disabled - -Add the `disabled` attribute to disable the menu item so it cannot be selected. - -```html:preview - - Option 1 - Option 2 - Option 3 - -``` - -{% raw %} - -```jsx:react -import WaMenu from '@shoelace-style/shoelace/dist/react/menu'; -import WaMenuItem from '@shoelace-style/shoelace/dist/react/menu-item'; - -const App = () => ( - - Option 1 - Option 2 - Option 3 - -); -``` - -{% endraw %} - ### Prefix & Suffix Add content to the start and end of menu items using the `prefix` and `suffix` slots. @@ -151,6 +122,64 @@ const App = () => ( {% endraw %} +### Disabled + +Add the `disabled` attribute to disable the menu item so it cannot be selected. + +```html:preview + + Option 1 + Option 2 + Option 3 + +``` + +{% raw %} + +```jsx:react +import WaMenu from '@shoelace-style/shoelace/dist/react/menu'; +import WaMenuItem from '@shoelace-style/shoelace/dist/react/menu-item'; + +const App = () => ( + + Option 1 + Option 2 + Option 3 + +); +``` + +{% endraw %} + +### Loading + +Use the `loading` attribute to indicate that a menu item is busy. Like a disabled menu item, clicks will be suppressed until the loading state is removed. + +```html:preview + + Option 1 + Option 2 + Option 3 + +``` + +{% raw %} + +```jsx:react +import WaMenu from '@shoelace-style/shoelace/dist/react/menu'; +import WaMenuItem from '@shoelace-style/shoelace/dist/react/menu-item'; + +const App = () => ( + + Option 1 + Option 2 + Option 3 + +); +``` + +{% endraw %} + ### Checkbox Menu Items Set the `type` attribute to `checkbox` to create a menu item that will toggle on and off when selected. You can use the `checked` attribute to set the initial state. diff --git a/docs/pages/resources/changelog.md b/docs/pages/resources/changelog.md index a9fc72a0d..8a63eabf5 100644 --- a/docs/pages/resources/changelog.md +++ b/docs/pages/resources/changelog.md @@ -22,6 +22,7 @@ New versions of Web Awesome are released as-needed and generally occur when a cr ## Next +- Added the `loading` attribute and the `spinner` and `spinner__base` part to `` [#1700] - Added the `hover-bridge` feature to `` to support better tooltip accessibility [#1734] - Fixed a bug in `` and `` that made it work differently from `` and `