db-ui / mono

DB UX Design System Monorepo - Provides Design Tokens and components for Web UIs
https://db-ui.github.io/mono/review/main/
Apache License 2.0
38 stars 6 forks source link

DBTag [removeable]: includes a lot of unused/not displayed DOM from DBCheckbox #2678

Open annsch opened 1 month ago

annsch commented 1 month ago

Which generators are impacted?

Reproduction case

Currently DB Tag with prop "removeable" also includes a lot of not displayed HTML Code generated by checkboxes' validation () – is this really necessary?

<div class="db-tag" data-semantic="successful" data-icon="plus">
     <div class="db-checkbox">
           <label for="checkbox">
                <input type="checkbox">
                Label-Text
           </label>
         <span id="checkbox-valid-message" class="db-infotext" data-semantic="successful" data-size="small">TODO: Add a validMessage</span>
         <span id="checkbox-invalid-message" class="db-infotext" data-semantic="critical" data-size="small">TODO: Add an invalidMessage</span>
    </div>
</div>

Expected Behaviour

When using DB Tag with removeable option, a lighter version of DBCheckbox should be rendered

Screenshots

No response

Browser version

None

Add any other context about the problem here.

No response

nmerget commented 1 month ago

You should be able to do something like this as well:

<DBTag>
   <label>
    <input type="checkbox" />
    Test
    </label>
</DBTag>

We need to fix this. DBTag should be just styling.

Maybe we could consider if we want to remove the additional span via JS. What do you think @mfranzke?

mfranzke commented 1 month ago

You should be able to do something like this as well:

<DBTag>
   <label>
  <input type="checkbox" />
    Test
    </label>
</DBTag>

We need to fix this. DBTag should be just styling.

Maybe we could consider if we want to remove the additional span via JS. What do you think @mfranzke?

this sounds a little fragile to me. Additionally we would manipulate what the users have inserted and probably intended differently in here. What about not using DBCheckbox in the firstplace, but only provide documentation for the construct that you suggested?

<label>
    <input type="checkbox" />
    Test
    </label>