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(types): support custom values from app.config.ts #863

Merged
merged 3 commits into from
Nov 17, 2023

Conversation

benjamincanac
Copy link
Member

@benjamincanac benjamincanac commented Oct 25, 2023

πŸ”— Linked issue

Resolves #858

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR enables props autocomplete with custom values added in app.config.ts, only default values worked previously.

For example if we define an app.config.ts as such:

export default defineAppConfig({
  ui: {
    button: {
      color: {
        custom: {
          subtle: '...'
        }
      }
    }
  }
})

Autocomplete will for for the color and variant props of the Button:
CleanShot 2023-11-17 at 18.45.21@2x.png
CleanShot 2023-11-17 at 18.45.37@2x.png

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@vercel
Copy link

vercel bot commented Oct 25, 2023

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Updated (UTC)
ui βœ… Ready (Inspect) Visit Preview Nov 17, 2023 5:39pm

@benjamincanac
Copy link
Member Author

benjamincanac commented Oct 25, 2023

Reverted a commit to open this draft PR as it broke nuxt-component-meta, so the selects for size, color and variant didn't work anymore. Also, this doesn't work when the user's AppConfig is not filled.

@benjamincanac benjamincanac changed the title feat(types): handle user AppConfig in props feat(types): autocomplete custom values from app.config.ts Nov 17, 2023
@benjamincanac benjamincanac changed the title feat(types): autocomplete custom values from app.config.ts feat(types): support custom values from app.config.ts Nov 17, 2023
@benjamincanac benjamincanac marked this pull request as ready for review November 17, 2023 17:37
@benjamincanac benjamincanac merged commit 7339324 into dev Nov 17, 2023
2 checks passed
@benjamincanac benjamincanac deleted the fix/user-app-config-types branch November 17, 2023 17:48
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.

[TypeScript] Add custom variants, colors
1 participant