Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/select multi option #67

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

RATIU5
Copy link

@RATIU5 RATIU5 commented Feb 13, 2025

This PR will add multi-select functionality to the select component. It's currently in draft mode and it not ready to be merged yet.

  • Render badges via Astro
  • Select accepts multiple attribute and an array for defaultValue
  • Position badges wither within or under select button
  • Badge SVG de-selects the option and updates UI
  • Search select component with multi-select functionality
  • Keyboard interactions

Example

<Select
  label='Select Element'
  multiple // add this attribute to enable multi-select mode
  defaultValue={['opt-1-1', 'opt-2-1']}
  options={[
    { label: "Option 1", value: "opt-1-1" },
    { label: "Option 2", value: "opt-2-1" },
    { label: "Option 3", value: "opt-3-1" },
  ]}
/>

@RATIU5 RATIU5 requested review from louisescher and a team as code owners February 13, 2025 18:29
Copy link

changeset-bot bot commented Feb 13, 2025

🦋 Changeset detected

Latest commit: ea25433

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@studiocms/ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@withstudiocms-deployments
Copy link

withstudiocms-deployments bot commented Feb 13, 2025

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2025-02-20 21:14:30 CET

@RATIU5 RATIU5 marked this pull request as draft February 13, 2025 18:29
Copy link
Member

@studiocms-no-reply studiocms-no-reply left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @RATIU5, and thank you for opening your first pull request to StudioCMS! 🎉
Please make sure to review the project's Contributing Guide to ensure your pull request meets our quality standards.
We're excited to have you here and appreciate your contribution. If you have not already, please make sure to include the following information in your pull request: - A clear description of the changes - Steps to reproduce the issue (if applicable) - Any relevant screenshots or logs
Our team will review your pull request as soon as possible. If you have any questions or need help, feel free to ask. We're here to help you! 🚀
In the meantime, you will notice that a few checks will run on your pull request. These checks are automated and help us ensure that your changes meet our quality standards. If you see any errors or warnings, don't worry! Our team will help you address them. 😊

@louisescher louisescher self-requested a review February 16, 2025 00:01
Copy link

pkg-pr-new bot commented Feb 16, 2025

Open in Stackblitz

npm i https://pkg.pr.new/@studiocms/ui@67

commit: b6ce6bf

<span class="sui-badge" class:list={[color, size, variant, rounding]} {...props}>
{icon && <Icon name={icon} width={16} height={16} />}
<span class="sui-badge" class:list={[color, size, variant, rounding, className]} {...props}>
{icon && iconPosition === 'left' && <Icon name={icon} width={iconSize} height={iconSize} viewBox="0 0 24 24" />}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Icon component does automatically append the viewBox attribute, since there is different size icons included in the packs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants