chore(CommandPalette)!: rename props to emptyState and closeButton for consistency

This commit is contained in:
Benjamin Canac
2023-05-29 21:55:08 +02:00
parent 8ee2ac10e7
commit daca46371c
5 changed files with 33 additions and 33 deletions

View File

@@ -186,7 +186,7 @@ export default defineAppConfig({
icon: 'i-octicon-search-24',
loadingIcon: 'i-octicon-sync-24',
selectedIcon: 'i-octicon-check-24',
empty: {
emptyState: {
icon: 'i-octicon-search-24'
}
}

View File

@@ -166,7 +166,7 @@ Use the `selected-icon` prop to set a different icon or change it globally in `u
---
padding: false
baseProps:
empty: null
emptyState: null
props:
icon: 'i-heroicons-command-line'
excludedProps:
@@ -184,7 +184,7 @@ Use the `loading-icon` prop to set a different icon or change it globally in `ui
---
padding: false
baseProps:
empty: null
emptyState: null
props:
loading: true
excludedProps:
@@ -200,7 +200,7 @@ Use the `placeholder` prop to change the input placeholder
---
padding: false
baseProps:
empty: null
emptyState: null
props:
placeholder: 'Type a command...'
excludedProps:
@@ -210,31 +210,31 @@ excludedProps:
### Close
Use the `close` prop to display a close button on the right side of the input.
Use the `close-button` prop to display a close button on the right side of the input.
You can pass all the props of the [Button](/elements/button) component to customize it through the `close` prop or globally through `ui.commandPalette.default.close`.
You can pass all the props of the [Button](/elements/button) component to customize it through the `close-button` prop or globally through `ui.commandPalette.default.closeButton`.
::component-card
---
padding: false
baseProps:
empty: null
emptyState: null
props:
close:
closeButton:
icon: 'i-heroicons-x-mark-20-solid'
color: 'gray'
variant: 'link'
padded: false
excludedProps:
- close
- closeButton
---
::
### Empty
Use the `empty` prop to display a message when there are no results.
Use the `empty-state` prop to display a message when there are no results.
You can pass an `object` through the `empty` prop or globally through `ui.commandPalette.default.empty`. Here is the default:
You can pass an `object` through the `empty-state` prop or globally through `ui.commandPalette.default.emptyState`. Here is the default:
You can also set it to `null` to hide the empty label.
@@ -244,12 +244,12 @@ padding: false
baseProps:
placeholder: 'Type something to see the empty label change'
props:
empty:
emptyState:
icon: 'i-heroicons-magnifying-glass-20-solid'
label: "We couldn't find any items."
queryLabel: "We couldn't find any items with that term. Please try again."
excludedProps:
- empty
- emptyState
---
::