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(VField/VInput): add new props icon-color and glow #21076

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

johnleider
Copy link
Member

@johnleider johnleider commented Mar 6, 2025

resolves #17763

TODO: docs

Description

Markup:

<template>
  <v-app>
    <v-container>
      <v-input
        :focused="isFocused"
        append-icon="$vuetify"
        color="primary"
        prepend-icon="$vuetify"
        icon-color
      >
        <v-field
          :active="isFocused"
          :focused="isFocused"
          append-inner-icon="$vuetify"
          color="primary"
          label="Custom implementation"
          prepend-inner-icon="$vuetify"
          glow
          icon-color
          v-click-outside="() => isFocused = false"
          @click="isFocused = true"
        >
          <template #default="{ props: fieldProps }">
            <div v-bind="fieldProps" />
          </template>
        </v-field>
      </v-input>

      <v-text-field
        :glow="glow"
        append-icon="$vuetify"
        append-inner-icon="$vuetify"
        color="primary"
        label="Textfield"
        prepend-icon="$vuetify"
        prepend-inner-icon="$vuetify"
      />

      <v-select
        :glow="glow"
        append-icon="$vuetify"
        append-inner-icon="$vuetify"
        color="primary"
        label="Select"
        prepend-icon="$vuetify"
        prepend-inner-icon="$vuetify"

        icon-color
      />
      <v-file-input
        :glow="glow"
        :icon-color="iconColor"
        append-icon="$vuetify"
        append-inner-icon="$vuetify"
        color="primary"
        label="File"
        prepend-icon="$vuetify"
        prepend-inner-icon="$vuetify"
      />
      <v-date-input
        :glow="glow"
        :icon-color="iconColor"
        append-icon="$vuetify"
        append-inner-icon="$vuetify"
        color="primary"
        label="Date"
        prepend-icon="$vuetify"
        prepend-inner-icon="$vuetify"
      />
      <v-textarea
        :glow="glow"
        :icon-color="iconColor"
        append-icon="$vuetify"
        append-inner-icon="$vuetify"
        color="primary"
        label="Textarea"
        prepend-icon="$vuetify"
        prepend-inner-icon="$vuetify"
      />

      <v-btn :text="`iconColor ${iconColor}`" @click="iconColor = !iconColor" />
      <v-btn :text="`glow ${glow}`" @click="glow = !glow" />
    </v-container>
  </v-app>
</template>

<script setup>
  import { ref } from 'vue'

  const glow = ref(false)
  const iconColor = ref(true)
  const isFocused = ref(false)
</script>

@johnleider johnleider added this to the v3.8.0 (Andromeda) milestone Mar 6, 2025
@johnleider johnleider requested a review from a team March 6, 2025 20:15
@johnleider johnleider self-assigned this Mar 6, 2025
@MatthewAry
Copy link
Contributor

When I think of the prop 'bloom' I think of glow. Why is this getting called bloom?

@johnleider johnleider changed the title feat(VField): add new prop bloom for coloring icons on focus feat(VField): add new prop glow for coloring icons on focus Mar 6, 2025
@johnleider
Copy link
Member Author

When I think of the prop 'bloom' I think of glow. Why is this getting called bloom?

Changed prop name to glow.

Copy link
Member

@KaelWD KaelWD left a comment

Choose a reason for hiding this comment

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

#17763 wanted outer icons too (VInput not just VField)

@MatthewAry
Copy link
Contributor

MatthewAry commented Mar 7, 2025

When I think of the prop 'bloom' I think of glow. Why is this getting called bloom?

⬇️

Changed prop name to glow.

Oh man, I didn't mean that the name needed to be changed. They're synonyms. I was just trying to understand the reasoning. The names 'bloom' or 'glow' suggest a visual effect which is not happening here.

This is just a way for a color to be passed down to child InputIcon components via an optional, boolean prop. I'm assuming that this prop is added because you're trying to avoid breaking it for users who currently expect the current behavior.

I'm sorry for the confusion.

Wouldn't it be better if the name of the prop was descriptive like color-icon?

@johnleider
Copy link
Member Author

I'm up for a conversation on prop name. @vuetifyjs/core-team

@J-Sek
Copy link
Contributor

J-Sek commented Mar 7, 2025

I agree neither glow nor bloom really suggest what is going to happen. And I would rather expect icon-color to be static and the name could potentially land in other places as string prop (e.g. in VAlert, VSwitch or VListItem), where it would not depend on the focus state. How about icon-color-match?

@johnleider
Copy link
Member Author

The action only occurs on focus as well, not sure if that should play a role in the naming.

@J-Sek
Copy link
Contributor

J-Sek commented Mar 7, 2025

BTW. After seeing it in action I wonder if it should aslo drop the opacity. Weird to see that washed-out blue.
(I don't see any mention of opacity in MD3 spec)

@johnleider
Copy link
Member Author

johnleider commented Mar 7, 2025

#17763 wanted outer icons too (VInput not just VField)

Are we going to need a field-props property so that they can be configured separately?

@J-Sek
Copy link
Contributor

J-Sek commented Mar 7, 2025

Are we going to need a field-props property so that they can be configured separately?

We did not in v2. Issue author seems to want to the previous behavior back.

@johnleider johnleider changed the title feat(VField): add new prop glow for coloring icons on focus feat(VField/VInput): add new props icon-color and glow Mar 7, 2025
@johnleider
Copy link
Member Author

Pushed changes and updated playground.

@johnleider johnleider requested a review from KaelWD March 7, 2025 17:30
johnleider added a commit to webdevnerdstuff/vuetify that referenced this pull request Mar 8, 2025
removed unnecessary code
removed color-pip until we figure out vuetifyjs#21076
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants