carbon-design-system / carbon-components-svelte

Svelte implementation of the Carbon Design System
https://svelte.carbondesignsystem.com
Apache License 2.0
2.71k stars 261 forks source link

Considerations for progressive enhancement #1622

Open theetrain opened 1 year ago

theetrain commented 1 year ago

🚧 Status: Draft 🚧

The following items are needed in order to enable progressive enhancement capabilities for prerendered or server-rendered components:

General: documentation

Add a special section for progressive enhancement, and provide badges for every component that contains explicit support for it. We may also want a checklist system for all components; that way it's clear which components does or does not support certain functionality.

General: Form actions and href

See #1599

UIShell

WIP

Accordion

WIP

Breakpoint

<Button>

Modal

WIP

DataTable

WIP

Combobox

WIP

Dropdown

WIP

Tabs

WIP

Toggle

WIP

Tooltip, Tooltip Icon, Tooltip Definition

WIP

Theme

WIP

UIShell

### Related Tasks
- [ ] #310 
- [ ] https://github.com/carbon-design-system/carbon-components-svelte/issues/1006
- [ ] https://github.com/carbon-design-system/carbon-components-svelte/issues/1006
gohde commented 1 year ago

In terms of using sveltekit's form actions, would it be possible to add an option to the modal to have the primary button be of type submit? or have the buttons as a slot in order to pass in custom buttons. That way we can wrap the modal in a native form and have the whole thing work as intended by sveltekit?

theetrain commented 1 year ago

@gohde absolutely. Though the actual implementation is yet-decided, we'll try to find a way to make the modal's buttons submit as a form. The tricky thing with some modals is they don't open easily without JS, so part of the exploration is to find a pattern that would allow the page to fully refresh without JS and display an opened modal that has a submittable form.

gohde commented 1 year ago

I had a similar issue with Tabs and ended up solving it using route params. As you tabbed around it would update the url. It worked fine and I don't see why that couldn't work with this also. [[modal]] or with nested or several modals using [...modals]?

theetrain commented 1 year ago

I'm sure it's achievable, I guess I was needlessly concerned with a potential refactor for Modal, but we'll cross that bridge in time.

Aspirations include: