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

fix(select): fixes SelectTrigger text alignment when content overflow #3840

Open
wants to merge 41 commits into
base: main
Choose a base branch
from

Conversation

tangtai
Copy link

@tangtai tangtai commented May 28, 2024

SelectTrigger for when selected value is too long and truncated, the text alignment is inconsistent for different lengths

before after

fixes #3808

Copy link

vercel bot commented May 28, 2024

@tangtai is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@iamyahia iamyahia left a comment

Choose a reason for hiding this comment

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

Look good 👏

@whollacsek
Copy link

Running into this issue here hopefully it'll be merged soon

kevinmitch14 and others added 26 commits August 28, 2024 23:45
* feat: bump `cmdk` + use data attributes for styling

* refactor: bump again

* Merge remote-tracking branch 'upstream/main' into cmdk-bump-and-styles

* Revert "Merge remote-tracking branch 'upstream/main' into cmdk-bump-and-styles"

This reverts commit d74be6b.

* chore: sync `pnpm-lock`
* feat: add chart colors to base colors

* fix: format
)

Fix shadcn-ui#4214: Update ChartTooltipContent to handle "0" item value
## description

fix type import in toggle-group.tsx
# Fix Command Component issues and update documentation

## Changes
- Resolve Command Component issues by wrapping `<CommandGroup />` inside `<CommandList>`
- Update deprecated docs in `combobox.mdx` to reflect latest `<Command />` component usage

### Code Changes
From:
```tsx
<Command>
  ...
  <CommandGroup>
    ...
  </CommandGroup>
</Command>
```
To:
```tsx
<Command>
  ...
  <CommandList>
    <CommandGroup>
      ...
    </CommandGroup>
  </CommandList>
</Command>
```

## Visual Comparison
Before & After comparison: 

https://github.com/shadcn-ui/ui/assets/77154365/156b7180-54e6-45aa-8934-b4fb99e6160e

## Summary
By wrapping `<CommandGroup />` inside `<CommandList>{children}</CommandList>`, all issues related to the Command Component have been resolved.
# Description

This PR adds support for customizing graphics themes in the `ThemeCustomizer` component. Users can now select and copy chart colors (`chart-1`, `chart-2`, `chart-3`, `chart-4`, `chart-5`) along with other themes.

## Changes Implemented

1. **Themes Update**: Added chart themes (`chart-1`, `chart-2`, `chart-3`, `chart-4`, `chart-5`) to the chart file. themes configuration (`themes.ts`).
2. **Modification of the `ThemeCustomizer` Component**: The new graphics themes were integrated into the component so that they can be selected and copied.
3. **CSS Tweak**: Updated the functions that generate CSS code to include the new graphics themes.

## How to Test

1. Run the project locally.
2. Navigate to the `ThemeCustomizer` component.
3. Verify that the new graphics themes are available for selection.
4. Test the functionality of copying the CSS code and making sure it includes the graphics colors.

## References

- Added support for graphics themes based on defaults provided by Shadcn.
# Current Issue
when running `next lint`, the typescript compiler fails on the chart component (closes shadcn-ui#4229 )
`Type error: Type 'string[]' is not assignable to type 'string | TrustedHTML'.`

# Resolution

We can coerce the `string[]` into a valid type by `join`ing.
IDE uses the config mentioned in the `tsconfig.app.json` file whereas shadcn uses the config mentioned in the `tsconfig.json` file for path resolution 

Before adding the path to `tsconfig.app.json`

![image](https://github.com/user-attachments/assets/749c99f9-8d96-44f4-922b-c0a08623d104)


After adding the path to `tsconfig.app.json`

![image](https://github.com/user-attachments/assets/f5bef190-94e6-4c3e-8a7b-82f3ae3f9396)

This commit mentions the same in the installation with `vite` docs
* chore(www): switch to contentlayer2

* chore: rebuild registry

* fix: build
Typo fix to get proper value when pressing copy code in theme customizer section.

Link for Issue: shadcn-ui#4314
* feat(www): more chart examples

* feat: add themes support on blocks page

* chore: build registry

* fix: colors on charts

* fix: styles

* fix: downgrade rehype-pretty-code

* chore: fix

* fix: frame

* fix: code
* feat(www): more chart examples

* feat(www): add tooltip examples

* feat: add themes support on blocks page

* chore: build registry

* fix: colors on charts

* fix: styles

* fix: downgrade rehype-pretty-code

* chore: fix

* fix: frame

* fix: code

* feat: update charts nav

* fix: use client

* feat: update all charts
shadcn and others added 12 commits August 28, 2024 23:45
* fix: missing close tag for command

* docs(www): fix formatting

---------

Co-authored-by: shadcn <[email protected]>
Co-authored-by: Jai Prakash Kaushik <[email protected]>
Co-authored-by: shadcn <[email protected]>
remove redundant script closing tag
* fix: fix breaking changes for Command component that comes with cmdk 1.0.0

* chore: build registry

* chore: moving paths for some examples

* chore: moving paths for some examples

* chore: use data instead of aria

* fix: update command and pin cmdk

* fix: model selector

* fix: command for new york

---------

Co-authored-by: shadcn <[email protected]>
* bug-fix: added command-list component to eliminate error

Wrap CommandEmpty and CommandGroup inside CommandList
Eliminated Error: TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))

* fix(www): command examples

---------

Co-authored-by: shadcn <[email protected]>
Issue: 
The ModelItem component's onPeek handler was sometimes logging incorrect data, causing the model selector to appear inconsistent.

Changes Made:
Verified that the aria-selected attribute is true before calling onPeek(model), ensuring the function is only called when the element is actually selected.

Fixed Model Selector Inconsistency in Playground Example

fixes shadcn-ui#4506
* feat: edit in v0

* feat: update edit sources

* fix: edit button

* feat: rename to open in v0
@tangtai
Copy link
Author

tangtai commented Aug 29, 2024

updated branch, @shadcn can you approve the pull request?

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.

[bug]: Wrong gap in select filed when value overflows