@aleph-alpha/ui-library 5.3.0 → 5.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/system/components/UiTooltip/UiTooltip.vue.d.ts +1 -0
- package/dist/system/components/UiTooltip/types.d.ts +8 -0
- package/dist/system/components/core/tooltip/TooltipContent.vue.d.ts +2 -0
- package/dist/system/lib.js +3148 -3137
- package/dist/system/patterns/UiFloatActions/UiFloatActions.vue.d.ts +3 -1
- package/docs/public-docs/quick-start.md +43 -0
- package/package.json +1 -1
- package/src/components/UiAccordion/UiAccordion.stories.ts +2 -2
- package/src/components/UiAutocomplete/UiAutocomplete.stories.ts +2 -2
- package/src/components/UiAutocomplete/UiAutocomplete.vue +3 -3
- package/src/components/UiBadge/UiBadge.stories.ts +9 -9
- package/src/components/UiDropdownMenu/UiDropdownMenu.stories.ts +4 -4
- package/src/components/UiField/UiField.stories.ts +6 -6
- package/src/components/UiInput/UiInput.vue +1 -1
- package/src/components/UiKbd/UiKbd.stories.ts +3 -3
- package/src/components/UiKbd/UiKbd.vue +1 -1
- package/src/components/UiNavigationMenu/UiNavigationMenu.stories.ts +28 -28
- package/src/components/UiPopover/UiPopover.stories.ts +20 -20
- package/src/components/UiRadioGroup/UiRadioGroup.stories.ts +24 -24
- package/src/components/UiResizable/UiResizable.stories.ts +14 -14
- package/src/components/UiSelect/UiSelect.stories.ts +1 -1
- package/src/components/UiSheet/UiSheet.stories.ts +14 -14
- package/src/components/UiSlider/UiSlider.stories.ts +8 -8
- package/src/components/UiSpinner/UiSpinner.stories.ts +8 -8
- package/src/components/UiSwitch/UiSwitch.stories.ts +4 -4
- package/src/components/UiTabs/UiTabs.stories.ts +46 -46
- package/src/components/UiToggleGroup/UiToggleGroup.stories.ts +14 -14
- package/src/components/UiTooltip/UiTooltip.vue +2 -0
- package/src/components/UiTooltip/types.ts +9 -0
- package/src/components/core/accordion/AccordionContent.vue +1 -1
- package/src/components/core/accordion/AccordionTrigger.vue +1 -1
- package/src/components/core/alert/AlertDescription.vue +1 -1
- package/src/components/core/alert/index.ts +1 -1
- package/src/components/core/calendar/Calendar.vue +4 -4
- package/src/components/core/calendar/CalendarCell.vue +1 -1
- package/src/components/core/drawer/DrawerDescription.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuCheckboxItem.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuItem.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuLabel.vue +1 -3
- package/src/components/core/dropdown-menu/DropdownMenuRadioItem.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuShortcut.vue +4 -1
- package/src/components/core/dropdown-menu/DropdownMenuSubTrigger.vue +1 -1
- package/src/components/core/field/FieldDescription.vue +1 -1
- package/src/components/core/field/FieldLegend.vue +2 -2
- package/src/components/core/field/FieldSeparator.vue +1 -1
- package/src/components/core/input/Input.vue +1 -1
- package/src/components/core/item/index.ts +1 -1
- package/src/components/core/label/Label.vue +1 -1
- package/src/components/core/listbox/ListboxFilter.vue +1 -1
- package/src/components/core/listbox/ListboxGroupLabel.vue +1 -1
- package/src/components/core/listbox/ListboxItem.vue +1 -1
- package/src/components/core/native-select/NativeSelect.vue +1 -1
- package/src/components/core/navigation-menu/NavigationMenuLink.vue +1 -1
- package/src/components/core/navigation-menu/index.ts +1 -1
- package/src/components/core/range-calendar/RangeCalendarCell.vue +1 -1
- package/src/components/core/select/SelectItem.vue +1 -1
- package/src/components/core/select/SelectLabel.vue +3 -1
- package/src/components/core/select/SelectTrigger.vue +1 -1
- package/src/components/core/sidebar/SidebarGroupContent.vue +1 -1
- package/src/components/core/sidebar/SidebarGroupLabel.vue +1 -1
- package/src/components/core/sidebar/SidebarMenuBadge.vue +1 -1
- package/src/components/core/sidebar/SidebarMenuSubButton.vue +2 -2
- package/src/components/core/sidebar/index.ts +4 -4
- package/src/components/core/slider/Slider.vue +3 -3
- package/src/components/core/stepper/StepperDescription.vue +1 -1
- package/src/components/core/table/Table.vue +1 -1
- package/src/components/core/table/TableEmpty.vue +1 -1
- package/src/components/core/tabs/TabsTrigger.vue +1 -1
- package/src/components/core/tags-input/TagsInput.vue +1 -1
- package/src/components/core/tags-input/TagsInputItem.vue +1 -1
- package/src/components/core/textarea/Textarea.vue +1 -1
- package/src/components/core/toggle/index.ts +1 -1
- package/src/components/core/toggle-group/index.ts +1 -1
- package/src/components/core/tooltip/TooltipContent.vue +10 -4
- package/src/lib/useDrag.stories.ts +12 -12
- package/src/patterns/UiDatePicker/UiDatePicker.stories.ts +8 -8
- package/src/patterns/UiFloatActions/UiFloatActionItems.vue +9 -3
- package/src/patterns/UiFloatActions/UiFloatActions.stories.ts +159 -26
- package/src/patterns/UiFloatActions/UiFloatActions.vue +5 -1
- package/src/patterns/UiSidebar/UiSidebarGroupLabel.stories.ts +2 -2
- package/src/patterns/UiSidebar/UiSidebarMenuButton.stories.ts +3 -3
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
* </UiFloatActionItems>
|
|
42
42
|
* ```
|
|
43
43
|
*/
|
|
44
|
-
import { cn } from '@/lib/utils';
|
|
44
|
+
import { cn, omitClass } from '@/lib/utils';
|
|
45
45
|
import {
|
|
46
46
|
computed,
|
|
47
47
|
inject,
|
|
@@ -215,6 +215,11 @@ const tabIndex = computed(() =>
|
|
|
215
215
|
parentContext ? parentContext.getTabIndex(itemId) : undefined,
|
|
216
216
|
);
|
|
217
217
|
|
|
218
|
+
// Forward inherited attributes (minus `class`, which is merged via `cn` into the
|
|
219
|
+
// element class) so a `button` item can compose with wrappers like UiTooltip that
|
|
220
|
+
// rely on `as-child` to pass event handlers and ARIA attributes to the trigger.
|
|
221
|
+
const forwardedAttrs = computed(() => omitClass(attrs));
|
|
222
|
+
|
|
218
223
|
const toolbarClass = computed(() =>
|
|
219
224
|
cn(
|
|
220
225
|
'inline-flex items-center gap-0.5 rounded-full border border-border-surface-default bg-background-surface-floating p-1 shadow-xs',
|
|
@@ -231,14 +236,14 @@ const buttonClass = computed(() =>
|
|
|
231
236
|
|
|
232
237
|
const inputClass = computed(() =>
|
|
233
238
|
cn(
|
|
234
|
-
'h-8 min-w-16 rounded-full border-0 bg-background-input-default px-3
|
|
239
|
+
'h-8 min-w-16 rounded-full border-0 bg-background-input-default px-3 label-14-regular text-content-on-surface-primary outline-none focus-visible:ring-2 focus-visible:ring-border-surface-focus-ring',
|
|
235
240
|
attrs.class ?? '',
|
|
236
241
|
),
|
|
237
242
|
);
|
|
238
243
|
|
|
239
244
|
const textClass = computed(() =>
|
|
240
245
|
cn(
|
|
241
|
-
'inline-flex h-8 min-w-8 items-center justify-center px-1
|
|
246
|
+
'inline-flex h-8 min-w-8 items-center justify-center px-1 label-14-regular text-content-on-surface-primary',
|
|
242
247
|
attrs.class ?? '',
|
|
243
248
|
),
|
|
244
249
|
);
|
|
@@ -273,6 +278,7 @@ const separatorClass = computed(() =>
|
|
|
273
278
|
<button
|
|
274
279
|
v-else-if="isButton"
|
|
275
280
|
ref="itemRef"
|
|
281
|
+
v-bind="forwardedAttrs"
|
|
276
282
|
type="button"
|
|
277
283
|
data-slot="float-item-action"
|
|
278
284
|
:aria-label="props.ariaLabel"
|
|
@@ -3,6 +3,7 @@ import { ref, useId, watch } from 'vue';
|
|
|
3
3
|
import UiFloatActions from './UiFloatActions.vue';
|
|
4
4
|
import { UiFloatActionItems } from './index';
|
|
5
5
|
import { UiIcon } from '../../components/UiIcon';
|
|
6
|
+
import { UiTooltip } from '../../components/UiTooltip';
|
|
6
7
|
import { useAnchorFloat } from '../../lib/useAnchorFloat';
|
|
7
8
|
import type { UiFloatActionsPlacement, UiFloatActionsTrigger } from './types';
|
|
8
9
|
|
|
@@ -100,7 +101,7 @@ function createFloatRender(config: FloatRenderConfig = {}) {
|
|
|
100
101
|
const {
|
|
101
102
|
helperText,
|
|
102
103
|
anchorText = 'Hover or Tab to this paragraph to reveal contextual actions.',
|
|
103
|
-
anchorClass = 'max-w-sm rounded-md border border-border-surface-default bg-background-surface-primary px-4 py-6
|
|
104
|
+
anchorClass = 'max-w-sm rounded-md border border-border-surface-default bg-background-surface-primary px-4 py-6 body-14-regular leading-6',
|
|
104
105
|
useCardAnchor = false,
|
|
105
106
|
showPagination = false,
|
|
106
107
|
} = config;
|
|
@@ -143,7 +144,7 @@ function createFloatRender(config: FloatRenderConfig = {}) {
|
|
|
143
144
|
},
|
|
144
145
|
template: `
|
|
145
146
|
<div :class="showPagination ? 'mx-auto max-w-2xl space-y-4 p-8' : 'flex min-h-64 flex-col items-center justify-center gap-3 p-8'">
|
|
146
|
-
<p v-if="helperText" class="text-muted-foreground max-w-sm
|
|
147
|
+
<p v-if="helperText" class="text-muted-foreground max-w-sm body-14-regular">
|
|
147
148
|
{{ helperText }}
|
|
148
149
|
</p>
|
|
149
150
|
<UiFloatActions
|
|
@@ -163,7 +164,7 @@ function createFloatRender(config: FloatRenderConfig = {}) {
|
|
|
163
164
|
class="rounded-lg border border-border-surface-default bg-background-surface-secondary p-4 shadow-lg"
|
|
164
165
|
>
|
|
165
166
|
<h3 class="label-14-medium">Floating card</h3>
|
|
166
|
-
<p class="text-muted-foreground mt-2
|
|
167
|
+
<p class="text-muted-foreground mt-2 body-14-regular">{{ anchorText }}</p>
|
|
167
168
|
</article>
|
|
168
169
|
<p v-else :class="anchorClass">{{ anchorText }}</p>
|
|
169
170
|
</template>
|
|
@@ -212,7 +213,7 @@ function createFloatRender(config: FloatRenderConfig = {}) {
|
|
|
212
213
|
}
|
|
213
214
|
|
|
214
215
|
const flatActionsSource = `<script setup lang="ts">
|
|
215
|
-
import { UiFloatActions, UiFloatActionItems, UiIcon } from '@aleph-alpha/ui-library';
|
|
216
|
+
import { UiFloatActions, UiFloatActionItems, UiIcon, UiTooltip } from '@aleph-alpha/ui-library';
|
|
216
217
|
</script>
|
|
217
218
|
|
|
218
219
|
<template>
|
|
@@ -220,32 +221,122 @@ import { UiFloatActions, UiFloatActionItems, UiIcon } from '@aleph-alpha/ui-libr
|
|
|
220
221
|
<template #container>
|
|
221
222
|
<p>Hover or Tab to this paragraph to reveal contextual actions.</p>
|
|
222
223
|
</template>
|
|
223
|
-
<template #action>
|
|
224
|
+
<template #action="{ panelEl }">
|
|
224
225
|
<UiFloatActionItems aria-label="Text actions">
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
<
|
|
229
|
-
<
|
|
230
|
-
|
|
226
|
+
<!-- Icon-only buttons: wrap each in a tooltip to name the action.
|
|
227
|
+
Teleport the tooltip into the top-layer panel (:to="panelEl") so it
|
|
228
|
+
is not painted underneath it. -->
|
|
229
|
+
<UiTooltip content="Edit" :to="panelEl">
|
|
230
|
+
<UiFloatActionItems type="button" aria-label="Edit">
|
|
231
|
+
<UiIcon name="edit" size="s" />
|
|
232
|
+
</UiFloatActionItems>
|
|
233
|
+
</UiTooltip>
|
|
234
|
+
<UiTooltip content="Copy" :to="panelEl">
|
|
235
|
+
<UiFloatActionItems type="button" aria-label="Copy">
|
|
236
|
+
<UiIcon name="copy" size="s" />
|
|
237
|
+
</UiFloatActionItems>
|
|
238
|
+
</UiTooltip>
|
|
231
239
|
</UiFloatActionItems>
|
|
232
240
|
</template>
|
|
233
241
|
</UiFloatActions>
|
|
234
242
|
</template>`;
|
|
235
243
|
|
|
236
244
|
/**
|
|
237
|
-
* Flat row of icon actions revealed on pointer hover or keyboard focus.
|
|
245
|
+
* Flat row of icon-only actions revealed on pointer hover or keyboard focus.
|
|
246
|
+
* Each icon button is wrapped in a `UiTooltip` so its purpose is discoverable —
|
|
247
|
+
* a `button` item forwards attributes, so it can be dropped inside any wrapper.
|
|
238
248
|
* Use the controls panel to try triggers, placement, offset, and dismiss behaviour.
|
|
239
249
|
*/
|
|
240
250
|
export const FlatActions: Story = {
|
|
241
|
-
render:
|
|
251
|
+
render: (args) => ({
|
|
252
|
+
components: { UiFloatActions, UiFloatActionItems, UiIcon, UiTooltip },
|
|
253
|
+
setup() {
|
|
254
|
+
const open = ref(args?.open ?? false);
|
|
255
|
+
watch(
|
|
256
|
+
() => args?.open,
|
|
257
|
+
(value) => {
|
|
258
|
+
if (value !== undefined) open.value = value;
|
|
259
|
+
},
|
|
260
|
+
);
|
|
261
|
+
return { args, open };
|
|
262
|
+
},
|
|
263
|
+
template: `
|
|
264
|
+
<div class="flex min-h-64 flex-col items-center justify-center gap-3 p-8">
|
|
265
|
+
<UiFloatActions
|
|
266
|
+
v-model:open="open"
|
|
267
|
+
:trigger="args.trigger"
|
|
268
|
+
:placement="args.placement"
|
|
269
|
+
:offset="args.offset"
|
|
270
|
+
:open-delay="args.openDelay"
|
|
271
|
+
:close-delay="args.closeDelay"
|
|
272
|
+
:dismiss-on-outside-click="args.dismissOnOutsideClick"
|
|
273
|
+
:dismiss-on-escape="args.dismissOnEscape"
|
|
274
|
+
:aria-label="args.ariaLabel"
|
|
275
|
+
>
|
|
276
|
+
<template #container>
|
|
277
|
+
<p class="max-w-sm rounded-md border border-border-surface-default bg-background-surface-primary px-4 py-6 body-14-regular leading-6">
|
|
278
|
+
Hover or Tab to this paragraph to reveal contextual actions.
|
|
279
|
+
</p>
|
|
280
|
+
</template>
|
|
281
|
+
<template #action="{ panelEl }">
|
|
282
|
+
<UiFloatActionItems aria-label="Text actions">
|
|
283
|
+
<UiTooltip content="Edit" :to="panelEl">
|
|
284
|
+
<UiFloatActionItems type="button" aria-label="Edit">
|
|
285
|
+
<UiIcon name="edit" size="s" />
|
|
286
|
+
</UiFloatActionItems>
|
|
287
|
+
</UiTooltip>
|
|
288
|
+
<UiTooltip content="Copy" :to="panelEl">
|
|
289
|
+
<UiFloatActionItems type="button" aria-label="Copy">
|
|
290
|
+
<UiIcon name="copy" size="s" />
|
|
291
|
+
</UiFloatActionItems>
|
|
292
|
+
</UiTooltip>
|
|
293
|
+
<UiTooltip content="Comment" :to="panelEl">
|
|
294
|
+
<UiFloatActionItems type="button" aria-label="Comment">
|
|
295
|
+
<UiIcon name="message-circle" size="s" />
|
|
296
|
+
</UiFloatActionItems>
|
|
297
|
+
</UiTooltip>
|
|
298
|
+
<UiTooltip content="Delete" :to="panelEl">
|
|
299
|
+
<UiFloatActionItems type="button" aria-label="Delete">
|
|
300
|
+
<UiIcon name="trash" size="s" />
|
|
301
|
+
</UiFloatActionItems>
|
|
302
|
+
</UiTooltip>
|
|
303
|
+
</UiFloatActionItems>
|
|
304
|
+
</template>
|
|
305
|
+
</UiFloatActions>
|
|
306
|
+
</div>
|
|
307
|
+
`,
|
|
308
|
+
}),
|
|
242
309
|
parameters: {
|
|
243
310
|
docs: { source: { code: flatActionsSource } },
|
|
244
311
|
},
|
|
245
312
|
};
|
|
246
313
|
|
|
314
|
+
const clickTriggerSource = `<script setup lang="ts">
|
|
315
|
+
import { UiFloatActions, UiFloatActionItems, UiIcon } from '@aleph-alpha/ui-library';
|
|
316
|
+
</script>
|
|
317
|
+
|
|
318
|
+
<template>
|
|
319
|
+
<UiFloatActions trigger="click" placement="bottom" :offset="10" aria-label="Open text actions">
|
|
320
|
+
<template #container>
|
|
321
|
+
<p>Click this paragraph to toggle the floating toolbar.</p>
|
|
322
|
+
</template>
|
|
323
|
+
<template #action>
|
|
324
|
+
<UiFloatActionItems aria-label="Text actions">
|
|
325
|
+
<!-- Icon + visible text label: no tooltip needed. -->
|
|
326
|
+
<UiFloatActionItems type="button" aria-label="Edit" class="w-auto gap-1.5 px-3 label-14-medium">
|
|
327
|
+
<UiIcon name="edit" size="s" />Edit
|
|
328
|
+
</UiFloatActionItems>
|
|
329
|
+
<UiFloatActionItems type="button" aria-label="Copy" class="w-auto gap-1.5 px-3 label-14-medium">
|
|
330
|
+
<UiIcon name="copy" size="s" />Copy
|
|
331
|
+
</UiFloatActionItems>
|
|
332
|
+
</UiFloatActionItems>
|
|
333
|
+
</template>
|
|
334
|
+
</UiFloatActions>
|
|
335
|
+
</template>`;
|
|
336
|
+
|
|
247
337
|
/**
|
|
248
338
|
* Click trigger for toggling a floating toolbar with pointer or keyboard.
|
|
339
|
+
* Actions pair an icon with a visible text label, so no tooltip is required.
|
|
249
340
|
* The anchor exposes `aria-expanded`, `aria-haspopup`, and `aria-controls`
|
|
250
341
|
* for screen readers. Enter and Space also toggle the panel.
|
|
251
342
|
*/
|
|
@@ -255,11 +346,53 @@ export const ClickTrigger: Story = {
|
|
|
255
346
|
placement: 'bottom',
|
|
256
347
|
ariaLabel: 'Open text actions',
|
|
257
348
|
},
|
|
258
|
-
render:
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
349
|
+
render: (args) => ({
|
|
350
|
+
components: { UiFloatActions, UiFloatActionItems, UiIcon },
|
|
351
|
+
setup() {
|
|
352
|
+
const open = ref(args?.open ?? false);
|
|
353
|
+
watch(
|
|
354
|
+
() => args?.open,
|
|
355
|
+
(value) => {
|
|
356
|
+
if (value !== undefined) open.value = value;
|
|
357
|
+
},
|
|
358
|
+
);
|
|
359
|
+
return { args, open };
|
|
360
|
+
},
|
|
361
|
+
template: `
|
|
362
|
+
<div class="flex min-h-64 flex-col items-center justify-center gap-3 p-8">
|
|
363
|
+
<UiFloatActions
|
|
364
|
+
v-model:open="open"
|
|
365
|
+
:trigger="args.trigger"
|
|
366
|
+
:placement="args.placement"
|
|
367
|
+
:offset="args.offset"
|
|
368
|
+
:open-delay="args.openDelay"
|
|
369
|
+
:close-delay="args.closeDelay"
|
|
370
|
+
:dismiss-on-outside-click="args.dismissOnOutsideClick"
|
|
371
|
+
:dismiss-on-escape="args.dismissOnEscape"
|
|
372
|
+
:aria-label="args.ariaLabel"
|
|
373
|
+
>
|
|
374
|
+
<template #container>
|
|
375
|
+
<p class="max-w-sm rounded-md border border-border-surface-default bg-background-surface-primary px-4 py-6 body-14-regular">
|
|
376
|
+
Click this paragraph to toggle the floating toolbar.
|
|
377
|
+
</p>
|
|
378
|
+
</template>
|
|
379
|
+
<template #action>
|
|
380
|
+
<UiFloatActionItems aria-label="Text actions">
|
|
381
|
+
<UiFloatActionItems type="button" aria-label="Edit" class="w-auto gap-1.5 px-3 label-14-medium">
|
|
382
|
+
<UiIcon name="edit" size="s" />Edit
|
|
383
|
+
</UiFloatActionItems>
|
|
384
|
+
<UiFloatActionItems type="button" aria-label="Copy" class="w-auto gap-1.5 px-3 label-14-medium">
|
|
385
|
+
<UiIcon name="copy" size="s" />Copy
|
|
386
|
+
</UiFloatActionItems>
|
|
387
|
+
</UiFloatActionItems>
|
|
388
|
+
</template>
|
|
389
|
+
</UiFloatActions>
|
|
390
|
+
</div>
|
|
391
|
+
`,
|
|
262
392
|
}),
|
|
393
|
+
parameters: {
|
|
394
|
+
docs: { source: { code: clickTriggerSource } },
|
|
395
|
+
},
|
|
263
396
|
};
|
|
264
397
|
|
|
265
398
|
/**
|
|
@@ -304,7 +437,7 @@ export const Placements: Story = {
|
|
|
304
437
|
:aria-label="placement + ' placement demo'"
|
|
305
438
|
>
|
|
306
439
|
<template #container>
|
|
307
|
-
<span class="rounded-md border border-border-surface-default px-4 py-2
|
|
440
|
+
<span class="rounded-md border border-border-surface-default px-4 py-2 body-14-regular capitalize">
|
|
308
441
|
{{ placement }}
|
|
309
442
|
</span>
|
|
310
443
|
</template>
|
|
@@ -370,7 +503,7 @@ export const ToolbarItemTypes: Story = {
|
|
|
370
503
|
<div class="flex min-h-48 flex-col items-center justify-center gap-6 p-8">
|
|
371
504
|
<UiFloatActions trigger="hover" placement="top" :offset="10">
|
|
372
505
|
<template #container>
|
|
373
|
-
<p class="max-w-sm rounded-md border border-border-surface-default bg-background-surface-primary px-4 py-6
|
|
506
|
+
<p class="max-w-sm rounded-md border border-border-surface-default bg-background-surface-primary px-4 py-6 body-14-regular">
|
|
374
507
|
Hover or Tab to explore toolbar item types.
|
|
375
508
|
</p>
|
|
376
509
|
</template>
|
|
@@ -471,7 +604,7 @@ export const AllStates: Story = {
|
|
|
471
604
|
<span class="label-14-medium text-content-on-surface-secondary">Hover</span>
|
|
472
605
|
<UiFloatActions trigger="hover" placement="top" :offset="10">
|
|
473
606
|
<template #container>
|
|
474
|
-
<span class="rounded-md border border-border-surface-default px-4 py-2
|
|
607
|
+
<span class="rounded-md border border-border-surface-default px-4 py-2 body-14-regular">
|
|
475
608
|
Hover or Tab
|
|
476
609
|
</span>
|
|
477
610
|
</template>
|
|
@@ -488,7 +621,7 @@ export const AllStates: Story = {
|
|
|
488
621
|
<span class="label-14-medium text-content-on-surface-secondary">Click</span>
|
|
489
622
|
<UiFloatActions trigger="click" placement="top" :offset="10" aria-label="Click actions">
|
|
490
623
|
<template #container>
|
|
491
|
-
<span class="rounded-md border border-border-surface-default px-4 py-2
|
|
624
|
+
<span class="rounded-md border border-border-surface-default px-4 py-2 body-14-regular">
|
|
492
625
|
Click or Enter
|
|
493
626
|
</span>
|
|
494
627
|
</template>
|
|
@@ -505,7 +638,7 @@ export const AllStates: Story = {
|
|
|
505
638
|
<span class="label-14-medium text-content-on-surface-secondary">Focus</span>
|
|
506
639
|
<UiFloatActions trigger="focus" placement="top" :offset="10" aria-label="Focus actions">
|
|
507
640
|
<template #container>
|
|
508
|
-
<span class="rounded-md border border-border-surface-default px-4 py-2
|
|
641
|
+
<span class="rounded-md border border-border-surface-default px-4 py-2 body-14-regular">
|
|
509
642
|
Tab to focus
|
|
510
643
|
</span>
|
|
511
644
|
</template>
|
|
@@ -534,7 +667,7 @@ export const AllStates: Story = {
|
|
|
534
667
|
:aria-label="placement + ' placement'"
|
|
535
668
|
>
|
|
536
669
|
<template #container>
|
|
537
|
-
<span class="rounded-md border border-border-surface-default px-4 py-2
|
|
670
|
+
<span class="rounded-md border border-border-surface-default px-4 py-2 body-14-regular capitalize">
|
|
538
671
|
{{ placement }}
|
|
539
672
|
</span>
|
|
540
673
|
</template>
|
|
@@ -556,7 +689,7 @@ export const AllStates: Story = {
|
|
|
556
689
|
<span class="label-14-medium text-content-on-surface-secondary">Open</span>
|
|
557
690
|
<UiFloatActions trigger="manual" v-model:open="openPanel" placement="top" :offset="10" aria-label="Open panel">
|
|
558
691
|
<template #container>
|
|
559
|
-
<span class="rounded-md border border-border-surface-default px-4 py-2
|
|
692
|
+
<span class="rounded-md border border-border-surface-default px-4 py-2 body-14-regular">
|
|
560
693
|
Panel open
|
|
561
694
|
</span>
|
|
562
695
|
</template>
|
|
@@ -576,7 +709,7 @@ export const AllStates: Story = {
|
|
|
576
709
|
<span class="label-14-medium text-content-on-surface-secondary">Closed</span>
|
|
577
710
|
<UiFloatActions trigger="manual" v-model:open="closedPanel" placement="top" :offset="10" aria-label="Closed panel">
|
|
578
711
|
<template #container>
|
|
579
|
-
<span class="rounded-md border border-border-surface-default px-4 py-2
|
|
712
|
+
<span class="rounded-md border border-border-surface-default px-4 py-2 body-14-regular">
|
|
580
713
|
Panel closed
|
|
581
714
|
</span>
|
|
582
715
|
</template>
|
|
@@ -723,7 +856,7 @@ export const ComposableUsage: Story = {
|
|
|
723
856
|
:aria-expanded="open"
|
|
724
857
|
aria-haspopup="true"
|
|
725
858
|
:aria-controls="open ? contentId : undefined"
|
|
726
|
-
class="rounded-md border border-border-surface-default bg-background-surface-primary px-6 py-10
|
|
859
|
+
class="rounded-md border border-border-surface-default bg-background-surface-primary px-6 py-10 body-14-regular outline-none transition-[color,box-shadow,background-color,border-color] focus-visible:border-border-surface-focus-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]"
|
|
727
860
|
@mouseenter="onReferenceMouseEnter"
|
|
728
861
|
@mouseleave="onReferenceMouseLeave"
|
|
729
862
|
@focus="onReferenceFocus"
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
* The anchor element the floating panel is bound to.
|
|
24
24
|
* @slot action
|
|
25
25
|
* Floating content rendered in a teleported panel (typically a {@link UiFloatActionItems} toolbar).
|
|
26
|
+
* Exposes `panelEl` (the panel element) so nested overlays such as a tooltip can
|
|
27
|
+
* teleport into the top-layer panel via `UiTooltip`'s `to` prop.
|
|
26
28
|
* @example Hover toolbar
|
|
27
29
|
* ```vue
|
|
28
30
|
* <UiFloatActions trigger="hover" placement="top" aria-label="Paragraph actions">
|
|
@@ -213,7 +215,9 @@ const floatingAnimationClass = computed(() =>
|
|
|
213
215
|
@focusin="onFloatingFocusIn"
|
|
214
216
|
@focusout="onFloatingFocusOut"
|
|
215
217
|
>
|
|
216
|
-
|
|
218
|
+
<!-- `panelEl` lets slot content teleport overlays (e.g. a tooltip) into
|
|
219
|
+
this top-layer panel so they are not painted beneath it. -->
|
|
220
|
+
<slot name="action" :panel-el="floatingRef" />
|
|
217
221
|
</div>
|
|
218
222
|
</Teleport>
|
|
219
223
|
</span>
|
|
@@ -112,7 +112,7 @@ const renderStory = (args: Story['args']) => ({
|
|
|
112
112
|
Projects
|
|
113
113
|
</UiSidebarGroupLabel>
|
|
114
114
|
<UiSidebarGroupContent v-if="open">
|
|
115
|
-
<div class="px-2 py-2
|
|
115
|
+
<div class="px-2 py-2 body-14-regular text-content-on-surface-muted">Group content</div>
|
|
116
116
|
</UiSidebarGroupContent>
|
|
117
117
|
</UiSidebarGroup>
|
|
118
118
|
</UiSidebarContent>
|
|
@@ -179,7 +179,7 @@ export const CustomIcons: Story = {
|
|
|
179
179
|
Projects
|
|
180
180
|
</UiSidebarGroupLabel>
|
|
181
181
|
<UiSidebarGroupContent v-if="open">
|
|
182
|
-
<div class="px-2 py-2
|
|
182
|
+
<div class="px-2 py-2 body-14-regular text-content-on-surface-muted">Group content</div>
|
|
183
183
|
</UiSidebarGroupContent>
|
|
184
184
|
</UiSidebarGroup>
|
|
185
185
|
</UiSidebarContent>
|
|
@@ -128,7 +128,7 @@ const renderMode = (mode: MenuButtonStoryConfig) => ({
|
|
|
128
128
|
<template v-if="mode.endIcon || mode.badge" #end-icon>
|
|
129
129
|
<span
|
|
130
130
|
v-if="mode.badge"
|
|
131
|
-
class="min-w-6 rounded-sm bg-background-surface-muted px-1.5 py-0.5 text-center
|
|
131
|
+
class="min-w-6 rounded-sm bg-background-surface-muted px-1.5 py-0.5 text-center label-12-regular text-content-on-surface-primary"
|
|
132
132
|
>
|
|
133
133
|
{{ mode.badge }}
|
|
134
134
|
</span>
|
|
@@ -166,7 +166,7 @@ const renderMode = (mode: MenuButtonStoryConfig) => ({
|
|
|
166
166
|
<template v-if="mode.endIcon || mode.badge" #end-icon>
|
|
167
167
|
<span
|
|
168
168
|
v-if="mode.badge"
|
|
169
|
-
class="min-w-6 rounded-sm bg-background-surface-muted px-1.5 py-0.5 text-center
|
|
169
|
+
class="min-w-6 rounded-sm bg-background-surface-muted px-1.5 py-0.5 text-center label-12-regular text-content-on-surface-primary"
|
|
170
170
|
>
|
|
171
171
|
{{ mode.badge }}
|
|
172
172
|
</span>
|
|
@@ -178,7 +178,7 @@ const renderMode = (mode: MenuButtonStoryConfig) => ({
|
|
|
178
178
|
</UiSidebarContent>
|
|
179
179
|
</UiSidebar>
|
|
180
180
|
</UiSidebarProvider>
|
|
181
|
-
<p v-if="mode.endIconClickable" class="mt-3
|
|
181
|
+
<p v-if="mode.endIconClickable" class="mt-3 label-12-regular text-content-on-surface-muted">
|
|
182
182
|
End icon clicks: {{ actionCount }}
|
|
183
183
|
</p>
|
|
184
184
|
</div>
|