diff --git a/.storybook/preview.ts b/.storybook/preview.ts index 43fcd3da74d..277835ad7db 100644 --- a/.storybook/preview.ts +++ b/.storybook/preview.ts @@ -5,7 +5,7 @@ import {router} from '@inertiajs/vue3'; import {action} from 'storybook/actions'; import './storybook.css'; import './theme.css'; -import {translate} from '@/translations/translator'; +import {translate, translateChoice} from '@/translations/translator'; import registerUiComponents from '@/bootstrap/ui'; import DateFormatter from '@/components/DateFormatter'; import NumberFormatter from '@/components/NumberFormatter'; @@ -25,6 +25,7 @@ router.on('before', (event) => { setup(async (app) => { window.__ = translate; + window.__n = translateChoice; window.Statamic = { $config: { @@ -63,6 +64,7 @@ setup(async (app) => { }; app.config.globalProperties.__ = translate; + app.config.globalProperties.__n = translateChoice; app.config.globalProperties.$date = new DateFormatter; app.config.globalProperties.$number = new NumberFormatter; app.config.globalProperties.cp_url = (url) => url; diff --git a/.storybook/storybook.css b/.storybook/storybook.css index 6cdf7c8c4c5..9a141f91e16 100644 --- a/.storybook/storybook.css +++ b/.storybook/storybook.css @@ -9,6 +9,8 @@ @custom-variant dark (&:where(.dark, .dark *)); :root { + --focus-outline-color: var(--color-blue-400); + /* GROUP VARIABLES -- DECORATION -- COLOURS =================================================== */ --color-code-background: hsl(287deg 80% 93.5%); diff --git a/resources/js/components/SiteSelector.vue b/resources/js/components/SiteSelector.vue index fc78763f689..8b7090cfb4e 100644 --- a/resources/js/components/SiteSelector.vue +++ b/resources/js/components/SiteSelector.vue @@ -15,6 +15,8 @@ defineEmits(['update:modelValue']); :options="sites" option-label="name" option-value="handle" + align="end" + :adaptive-width="true" :model-value="modelValue" @update:model-value="$emit('update:modelValue', $event)" /> diff --git a/resources/js/components/field-conditions/Condition.vue b/resources/js/components/field-conditions/Condition.vue index 213a2f3649b..2b8590dd0ab 100644 --- a/resources/js/components/field-conditions/Condition.vue +++ b/resources/js/components/field-conditions/Condition.vue @@ -15,10 +15,10 @@ diff --git a/resources/js/components/global-header/SiteSelector.vue b/resources/js/components/global-header/SiteSelector.vue index d6a2051e937..1db9ea61fc6 100644 --- a/resources/js/components/global-header/SiteSelector.vue +++ b/resources/js/components/global-header/SiteSelector.vue @@ -10,6 +10,8 @@ size="sm" variant="ghost" icon="globe-arrow" + align="end" + :adaptive-width="true" class="[&_[data-ui-combobox-trigger]]:text-white/85" /> diff --git a/resources/js/components/inputs/relationship/SelectField.vue b/resources/js/components/inputs/relationship/SelectField.vue index 856f045a0c2..ffe66b49924 100644 --- a/resources/js/components/inputs/relationship/SelectField.vue +++ b/resources/js/components/inputs/relationship/SelectField.vue @@ -11,6 +11,7 @@ :placeholder="__(config.placeholder) || __('Choose...')" :read-only="readOnly" :taggable="isTaggable" + :close-on-select="isTaggable" option-label="title" option-value="id" @update:modelValue="itemsSelected" @@ -27,7 +28,7 @@
diff --git a/resources/js/components/ui/Combobox/Scrollbar.vue b/resources/js/components/ui/Combobox/Scrollbar.vue deleted file mode 100644 index a568c91f69e..00000000000 --- a/resources/js/components/ui/Combobox/Scrollbar.vue +++ /dev/null @@ -1,128 +0,0 @@ - - - \ No newline at end of file diff --git a/resources/js/components/ui/Select/Select.vue b/resources/js/components/ui/Select/Select.vue index e5c5b2c5875..78a1f0aeebe 100644 --- a/resources/js/components/ui/Select/Select.vue +++ b/resources/js/components/ui/Select/Select.vue @@ -5,6 +5,11 @@ import Combobox from '../Combobox/Combobox.vue'; const emit = defineEmits(['update:modelValue']); const props = defineProps({ + /** When `true`, the dropdown will expand to fit longer option labels. */ + adaptiveWidth: { type: Boolean, default: false }, + /** The preferred alignment against the trigger. May change when collisions occur.

Options: `start`, `center`, `end` */ + align: { type: String, default: 'start' }, + /** When `true`, the selected value will be clearable. */ clearable: { type: Boolean, default: false }, disabled: { type: Boolean, default: false }, /** Icon name. [Browse available icons](/?path=/story/components-icon--all-icons) */ @@ -52,6 +57,8 @@ const usingOptionSlot = !!slots['option']; :searchable="false" :size :variant + :align + :adaptive-width @update:modelValue="emit('update:modelValue', $event)" >