Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions docs/app/components/playground/PlaygroundTransferFunds.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ const to = ref('savings')
</UFormField>

<UFormField label="From">
<USelect v-model="from" :items="accounts" class="w-full" :ui="{ trailingIcon: 'group-data-[state=open]:rotate-180 transition-transform duration-200' }" />
<USelect v-model="from" :items="accounts" class="w-full" />
</UFormField>

<UFormField label="To">
<USelect v-model="to" :items="accounts" class="w-full" :ui="{ trailingIcon: 'group-data-[state=open]:rotate-180 transition-transform duration-200' }" />
<USelect v-model="to" :items="accounts" class="w-full" />
</UFormField>

<div class="space-y-1.5 text-sm">
Expand Down
1 change: 0 additions & 1 deletion docs/app/components/theme-studio/ThemeStudioRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ const showTextLabel = computed(() => !props.icon && !shade.value)
:content="{ bodyLock: false, disableOutsidePointerEvents: false }"
:aria-label="ariaLabel ?? label"
class="flex-1 group"
:ui="{ trailingIcon: 'transition-transform duration-200 group-data-[state=open]:rotate-180' }"
>
<template v-if="!!slots.leading" #leading>
<slot name="leading" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function faceOf(value?: string) {
:aria-label="ariaLabel"
size="sm"
class="w-full"
:ui="{ content: 'w-(--reka-combobox-trigger-width)', trailingIcon: ['transition-transform duration-200', open && 'rotate-180'] }"
:ui="{ content: 'w-(--reka-combobox-trigger-width)' }"
>
<!-- No inline face on the trigger: the panel already renders in the body
font, so the name inherits it. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ const ui = {
variant="ghost"
size="sm"
class="data-[state=open]:bg-soft"
:ui="{ trailingIcon: 'group-data-[state=open]:rotate-180 transition-transform duration-200' }"
/>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,7 @@ const pageTitles: Record<Page, string> = {
class="data-[state=open]:bg-soft"
:ui="{
value: 'capitalize',
itemLabel: 'capitalize',
trailingIcon: 'group-data-[state=open]:rotate-180 transition-transform duration-200'
itemLabel: 'capitalize'
}"
/>
</template>
Expand Down Expand Up @@ -945,7 +944,6 @@ const pageTitles: Record<Page, string> = {
<USelect
v-model="customerStatusFilter"
:items="customerStatusItems"
:ui="{ trailingIcon: 'group-data-[state=open]:rotate-180 transition-transform duration-200' }"
placeholder="Filter status"
class="min-w-28"
/>
Expand Down
9 changes: 9 additions & 0 deletions docs/content/docs/1.getting-started/3.migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,15 @@ A class you set on `filter` to remove the border, like `border-b-0`, is no longe
<USelectMenu :filter="{ variant: 'none' }" :ui="{ filter: 'm-0 rounded-none border-b border-default' }" />
```

### Rotating chevrons

The chevron of Select, SelectMenu and InputMenu now turns over while the menu is open, like the one of Accordion or NavigationMenu. Remove a `group-data-[state=open]:rotate-180` you added to their `trailingIcon` through `ui`, it's the default now. A rotation your code binds to the open state, like `open && 'rotate-180'`, or one inside a `ui` object built at runtime won't show up in a find-and-replace, so check those by hand. To keep a chevron still, a plain `rotate-0` isn't enough, set `group-data-[state=open]/select:rotate-0` on Select and SelectMenu or `group-data-[state=open]/input-menu:rotate-0` on InputMenu. The trigger icon of ProseCodeCollapse also animates when it turns.

```diff
-<USelect :ui="{ trailingIcon: 'group-data-[state=open]:rotate-180 transition-transform duration-200' }" />
+<USelect />
```

### Stacked toasts

Toasts are now stacked by default: the `expand` prop of the Toaster defaults to `false`, and hovering or focusing the stack expands it. Set it back to `true` on the App to keep every toast visible:
Expand Down
10 changes: 0 additions & 10 deletions docs/content/docs/2.components/input-menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -819,16 +819,6 @@ name: 'input-menu-search-term-example'
---
::

### With rotating icon

Here is an example with a rotating icon that indicates the open state of the InputMenu.

::component-example
---
name: 'input-menu-icon-example'
---
::

### With floating label :badge{label="4.12+" class="align-text-top"}

You can use the `#default` slot to add a floating label to the InputMenu.
Expand Down
10 changes: 0 additions & 10 deletions docs/content/docs/2.components/select-menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -845,16 +845,6 @@ name: 'select-menu-search-term-example'
---
::

### With rotating icon

Here is an example with a rotating icon that indicates the open state of the SelectMenu.

::component-example
---
name: 'select-menu-icon-example'
---
::

### With create item

Use the `create-item` prop to enable users to add custom values that aren't in the predefined options.
Expand Down
10 changes: 0 additions & 10 deletions docs/content/docs/2.components/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -743,16 +743,6 @@ name: 'select-open-example'
In this example, leveraging [`defineShortcuts`](/docs/composables/define-shortcuts), you can toggle the Select by pressing :kbd{value="O"}.
::

### With rotating icon

Here is an example with a rotating icon that indicates the open state of the Select.

::component-example
---
name: 'select-icon-example'
---
::

### With fetched items

You can fetch items from an API and use them in the Select.
Expand Down
5 changes: 4 additions & 1 deletion src/runtime/theme/input-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ export default extendTheme(input, {
// The tags sit on the reading line, so their row gives back the difference,
// and keeps the height of the field when it only holds the input
tags: 'flex flex-wrap items-center flex-1 min-w-0 gap-(--ui-control-gap) px-(--ui-control-px) py-(--ui-control-py)',
trailing: () => 'group flex items-center pe-(--ui-control-px) disabled:cursor-not-allowed focus:outline-none',
trailing: () => 'group group/input-menu flex items-center pe-(--ui-control-px) disabled:cursor-not-allowed focus:outline-none',
trailingClear: 'p-0',
// The chevron turns over while the menu is open, the named group keeps an open
// ancestor from turning it
trailingIcon: 'group-data-[state=open]/input-menu:rotate-180 transition-transform duration-200 ease-out motion-reduce:transition-none',
arrow: 'fill-bg stroke-default',
content: 'max-h-[min(15rem,var(--reka-combobox-content-available-height,15rem))] w-(--reka-combobox-trigger-width) bg-overlay shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)] origin-(--reka-combobox-content-transform-origin) pointer-events-auto flex flex-col cursor-default',
viewport: 'relative scroll-py-1 overflow-y-auto flex-1',
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/theme/prose/code-collapse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default defineTheme({
root: 'relative my-5 bg-default [&>div]:my-0 [&_pre]:max-h-[80vh] [&_pre]:pb-12',
footer: 'h-16 absolute inset-x-px bottom-px rounded-b-md flex items-center justify-center',
trigger: 'group relative',
triggerIcon: 'group-data-[state=open]:rotate-180'
triggerIcon: 'group-data-[state=open]:rotate-180 transition-transform duration-200 ease-out motion-reduce:transition-none'
},
variants: {
open: {
Expand Down
6 changes: 4 additions & 2 deletions src/runtime/theme/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import { defineTheme } from '../utils/theme'
// `base` is the box, the `<button>` of the trigger
export default defineTheme({
slots: {
base: 'group relative inline-flex items-center rounded-md text-strong disabled:cursor-not-allowed disabled:opacity-(--ui-disabled-opacity) transition-colors',
base: 'group group/select relative inline-flex items-center rounded-md text-strong disabled:cursor-not-allowed disabled:opacity-(--ui-disabled-opacity) transition-colors',
// The invisible character gives the leading the baseline of the text, see `input.ts`
leading: `flex items-center before:content-['x'] before:w-0 before:invisible`,
leadingIcon: 'shrink-0 text-faint',
leadingAvatar: 'shrink-0',
trailing: 'ms-auto flex items-center',
trailingIcon: 'shrink-0 text-faint',
// The chevron turns over while the menu is open, the named group keeps an open
// ancestor from turning it
trailingIcon: 'shrink-0 text-faint group-data-[state=open]/select:rotate-180 transition-transform duration-200 ease-out motion-reduce:transition-none',
value: 'truncate pointer-events-none',
placeholder: 'truncate text-faint',
arrow: 'fill-bg stroke-default',
Expand Down
Loading
Loading