diff --git a/.storybook/preview.ts b/.storybook/preview.ts index e0df78ce3f6..94f2caf7bd6 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 cleanCodeSnippet from './clean-code-snippet'; @@ -23,6 +23,7 @@ router.on('before', (event) => { setup(async (app) => { window.__ = translate; + window.__n = translateChoice; window.Statamic = { $config: { @@ -54,6 +55,7 @@ setup(async (app) => { }; app.config.globalProperties.__ = translate; + app.config.globalProperties.__n = translateChoice; app.config.globalProperties.$date = new DateFormatter; app.config.globalProperties.cp_url = (url) => url; app.config.globalProperties.$portals = portals; diff --git a/.storybook/storybook.css b/.storybook/storybook.css index ef88592e729..f6c298bd51e 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 c4794abc566..4af951955b7 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/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..f3fd3b88e4b 100644 --- a/resources/js/components/ui/Select/Select.vue +++ b/resources/js/components/ui/Select/Select.vue @@ -5,24 +5,29 @@ import Combobox from '../Combobox/Combobox.vue'; const emit = defineEmits(['update:modelValue']); const props = defineProps({ - clearable: { type: Boolean, default: false }, - disabled: { type: Boolean, default: false }, - /** Icon name. [Browse available icons](/?path=/story/components-icon--all-icons) */ - icon: { type: String, default: null }, - /** The controlled value of the select. */ - modelValue: { type: [Object, String, Number], default: null }, - /** Key of the option's label in the option's object. */ - optionLabel: { type: String, default: 'label' }, - /** Array of option objects */ - options: { type: Array, default: null }, - /** Key of the option's value in the option's object. */ - optionValue: { type: String, default: 'value' }, - placeholder: { type: String, default: () => __('Select...') }, - readOnly: { type: Boolean, default: false }, - /** Controls the size of the select.

Options: `xs`, `sm`, `base`, `lg`, `xl` */ - size: { type: String, default: 'base' }, - /** Controls the appearance of the select.

Options: `default`, `filled`, `ghost`, `subtle` */ - variant: { type: String, default: 'default' }, + /** 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) */ + icon: { type: String, default: null }, + /** The controlled value of the select. */ + modelValue: { type: [Object, String, Number], default: null }, + /** Key of the option's label in the option's object. */ + optionLabel: { type: String, default: 'label' }, + /** Array of option objects */ + options: { type: Array, default: null }, + /** Key of the option's value in the option's object. */ + optionValue: { type: String, default: 'value' }, + placeholder: { type: String, default: () => __('Select...') }, + readOnly: { type: Boolean, default: false }, + /** Controls the size of the select.

Options: `xs`, `sm`, `base`, `lg`, `xl` */ + size: { type: String, default: 'base' }, + /** Controls the appearance of the select.

Options: `default`, `filled`, `ghost`, `subtle` */ + variant: { type: String, default: 'default' }, }); defineOptions({ @@ -52,6 +57,8 @@ const usingOptionSlot = !!slots['option']; :searchable="false" :size :variant + :align + :adaptive-width @update:modelValue="emit('update:modelValue', $event)" >