You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
joshblack
changed the title
Ship initial version of popover based on design guidance @joshblack @dakahn
Ship initial version of popover based on design guidance
Oct 25, 2021
…ign-system#10080)
### Related Ticket(s)
Closescarbon-design-system#9940
### Description
This PR takes a new approach, and offers some advantages of carbon-design-system#9941.
While the other PR aims to separate class definitions from their registration in the browser, and should work well for teams or projects that wish to _extend_ C4IBM components, it does nothing to solve the problem for teams that are _double-consuming_ C4IBM components. For example, consider the widget team:
- They are building widgets using the react-wrapper version of the components
- When the react component imports the element, it brings along its `customElements.define()` method
- The widget is placed on a page that is already using the C4IBM CDN links, which _also_ bring along the `customElements.define()` method.
- Both the widget script and the CDN link are rolled up into separate scripts and whichever one runs second will encounter the unexpected error, not know how to handle that problem, and halt execution of the script, likely leaving large pieces of setup functionality unprocessed
This new approach offers a method for elements to _attempt_ to define themselves, but to gracefully handle the failure and to continue executing the remainder of the running script. The new decorator is a simple copy/paste from the LitElement `@customElement` decorator, with the `customElements.define` functions wrapped in a try/catch block.
As of right now, this only impacts one component and is simply a proof-of-concept.
### Changelog
**New**
- Adds a `@carbonElement()` decorator to the carbon-web-components package
**Changed**
- Edit the carbon-web-components package's accordion-item component to use @CarbonElement
This issue is for bringing Popover over the initial hurdle and stabilizing it for usage in other components.
Checklist
offset
border-radius
drop-shadow
caret-offset
inline
andblock
paddingaria-owns
for menusQuestions
The text was updated successfully, but these errors were encountered: