@aleph-alpha/ui-library 5.3.0 → 5.4.0

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.
Files changed (124) hide show
  1. package/config.d.ts +29 -3
  2. package/config.js +91 -3
  3. package/dist/system/components/UiTooltip/UiTooltip.vue.d.ts +1 -0
  4. package/dist/system/components/UiTooltip/types.d.ts +8 -0
  5. package/dist/system/components/core/tooltip/TooltipContent.vue.d.ts +2 -0
  6. package/dist/system/lib.js +4266 -4161
  7. package/dist/system/patterns/UiDataTable/UiDataTableFilterMenu.vue.d.ts +24 -0
  8. package/dist/system/patterns/UiDataTable/constants.d.ts +10 -0
  9. package/dist/system/patterns/UiDataTable/index.d.ts +1 -0
  10. package/dist/system/patterns/UiDataTable/types.d.ts +23 -1
  11. package/dist/system/patterns/UiFloatActions/UiFloatActions.vue.d.ts +3 -1
  12. package/docs/public-docs/getting-started-designers.md +3 -1
  13. package/docs/public-docs/quick-start.md +43 -0
  14. package/package.json +1 -1
  15. package/src/components/UiAccordion/UiAccordion.stories.ts +2 -2
  16. package/src/components/UiAutocomplete/UiAutocomplete.stories.ts +2 -2
  17. package/src/components/UiAutocomplete/UiAutocomplete.vue +6 -6
  18. package/src/components/UiBadge/UiBadge.stories.ts +9 -9
  19. package/src/components/UiButton/UiButton.stories.ts +5 -5
  20. package/src/components/UiCheckbox/UiCheckbox.stories.ts +7 -9
  21. package/src/components/UiChip/UiChip.vue +1 -1
  22. package/src/components/UiDrawer/UiDrawer.stories.ts +2 -2
  23. package/src/components/UiDropdownMenu/UiDropdownMenu.stories.ts +6 -6
  24. package/src/components/UiEmpty/UiEmpty.vue +2 -2
  25. package/src/components/UiField/UiField.stories.ts +6 -6
  26. package/src/components/UiField/UiFieldLabelInfo.vue +1 -1
  27. package/src/components/UiFileUploadBox/UiFileUploadBox.stories.ts +2 -2
  28. package/src/components/UiFileUploadBox/UiFileUploadBox.vue +2 -2
  29. package/src/components/UiInput/UiInput.vue +3 -3
  30. package/src/components/UiKbd/UiKbd.stories.ts +14 -14
  31. package/src/components/UiKbd/UiKbd.vue +1 -1
  32. package/src/components/UiNavigationMenu/UiNavigationMenu.stories.ts +66 -66
  33. package/src/components/UiPopover/UiPopover.stories.ts +20 -20
  34. package/src/components/UiRadioGroup/UiRadioGroup.stories.ts +24 -24
  35. package/src/components/UiResizable/UiResizable.stories.ts +15 -14
  36. package/src/components/UiSelect/UiSelect.stories.ts +1 -1
  37. package/src/components/UiSeparator/UiSeparator.stories.ts +6 -6
  38. package/src/components/UiSheet/UiSheet.stories.ts +14 -14
  39. package/src/components/UiSlider/UiSlider.stories.ts +8 -8
  40. package/src/components/UiSpinner/UiSpinner.stories.ts +8 -8
  41. package/src/components/UiSwitch/UiSwitch.stories.ts +4 -4
  42. package/src/components/UiTabs/UiTabs.stories.ts +46 -46
  43. package/src/components/UiToggle/__tests__/UiToggle.test.ts +5 -3
  44. package/src/components/UiToggleGroup/UiToggleGroup.stories.ts +14 -14
  45. package/src/components/UiTooltip/UiTooltip.stories.ts +3 -3
  46. package/src/components/UiTooltip/UiTooltip.vue +2 -0
  47. package/src/components/UiTooltip/types.ts +9 -0
  48. package/src/components/core/accordion/AccordionContent.vue +1 -1
  49. package/src/components/core/accordion/AccordionTrigger.vue +2 -2
  50. package/src/components/core/alert/AlertDescription.vue +1 -1
  51. package/src/components/core/alert/index.ts +1 -1
  52. package/src/components/core/badge/index.ts +1 -1
  53. package/src/components/core/button/index.ts +2 -2
  54. package/src/components/core/calendar/Calendar.vue +4 -4
  55. package/src/components/core/calendar/CalendarCell.vue +1 -1
  56. package/src/components/core/calendar/CalendarCellTrigger.vue +2 -2
  57. package/src/components/core/calendar/CalendarHeadCell.vue +1 -1
  58. package/src/components/core/card/CardDescription.vue +1 -1
  59. package/src/components/core/checkbox/Checkbox.vue +1 -1
  60. package/src/components/core/drawer/DrawerDescription.vue +1 -1
  61. package/src/components/core/dropdown-menu/DropdownMenuCheckboxItem.vue +1 -1
  62. package/src/components/core/dropdown-menu/DropdownMenuItem.vue +1 -1
  63. package/src/components/core/dropdown-menu/DropdownMenuLabel.vue +1 -3
  64. package/src/components/core/dropdown-menu/DropdownMenuRadioItem.vue +1 -1
  65. package/src/components/core/dropdown-menu/DropdownMenuShortcut.vue +4 -1
  66. package/src/components/core/dropdown-menu/DropdownMenuSubTrigger.vue +1 -1
  67. package/src/components/core/field/FieldDescription.vue +1 -1
  68. package/src/components/core/field/FieldLabel.vue +1 -1
  69. package/src/components/core/field/FieldLegend.vue +2 -2
  70. package/src/components/core/field/FieldSeparator.vue +2 -2
  71. package/src/components/core/input/Input.vue +2 -2
  72. package/src/components/core/item/index.ts +1 -1
  73. package/src/components/core/kbd/Kbd.vue +1 -1
  74. package/src/components/core/label/Label.vue +1 -1
  75. package/src/components/core/listbox/ListboxFilter.vue +1 -1
  76. package/src/components/core/listbox/ListboxGroupLabel.vue +4 -1
  77. package/src/components/core/listbox/ListboxItem.vue +1 -1
  78. package/src/components/core/native-select/NativeSelect.vue +3 -3
  79. package/src/components/core/navigation-menu/NavigationMenuLink.vue +1 -1
  80. package/src/components/core/navigation-menu/index.ts +1 -1
  81. package/src/components/core/radio-group/RadioGroupItem.vue +1 -1
  82. package/src/components/core/range-calendar/RangeCalendarCell.vue +1 -1
  83. package/src/components/core/range-calendar/RangeCalendarCellTrigger.vue +2 -2
  84. package/src/components/core/range-calendar/RangeCalendarHeadCell.vue +1 -1
  85. package/src/components/core/select/SelectItem.vue +1 -1
  86. package/src/components/core/select/SelectLabel.vue +6 -1
  87. package/src/components/core/select/SelectTrigger.vue +1 -1
  88. package/src/components/core/sheet/SheetDescription.vue +3 -1
  89. package/src/components/core/sidebar/SidebarGroupContent.vue +1 -1
  90. package/src/components/core/sidebar/SidebarGroupLabel.vue +1 -1
  91. package/src/components/core/sidebar/SidebarMenuBadge.vue +1 -1
  92. package/src/components/core/sidebar/SidebarMenuSubButton.vue +2 -2
  93. package/src/components/core/sidebar/index.ts +4 -4
  94. package/src/components/core/slider/Slider.vue +3 -3
  95. package/src/components/core/stepper/StepperDescription.vue +1 -1
  96. package/src/components/core/switch/Switch.vue +1 -1
  97. package/src/components/core/table/Table.vue +1 -1
  98. package/src/components/core/table/TableCaption.vue +3 -1
  99. package/src/components/core/table/TableEmpty.vue +1 -1
  100. package/src/components/core/tabs/TabsList.vue +1 -1
  101. package/src/components/core/tabs/TabsTrigger.vue +1 -1
  102. package/src/components/core/tags-input/TagsInput.vue +1 -1
  103. package/src/components/core/tags-input/TagsInputInput.vue +1 -1
  104. package/src/components/core/tags-input/TagsInputItem.vue +1 -1
  105. package/src/components/core/tags-input/TagsInputItemDelete.vue +1 -1
  106. package/src/components/core/textarea/Textarea.vue +1 -1
  107. package/src/components/core/toggle/index.ts +3 -3
  108. package/src/components/core/toggle-group/index.ts +2 -2
  109. package/src/components/core/tooltip/TooltipContent.vue +10 -4
  110. package/src/lib/useDrag.stories.ts +12 -12
  111. package/src/patterns/UiDataTable/UiDataTable.stories.ts +420 -10
  112. package/src/patterns/UiDataTable/UiDataTableColumnFilter.vue +1 -1
  113. package/src/patterns/UiDataTable/UiDataTableFilterMenu.vue +91 -0
  114. package/src/patterns/UiDataTable/UiDataTablePagination.vue +1 -1
  115. package/src/patterns/UiDataTable/constants.ts +12 -0
  116. package/src/patterns/UiDataTable/index.ts +1 -0
  117. package/src/patterns/UiDataTable/types.ts +24 -0
  118. package/src/patterns/UiDatePicker/UiDatePicker.stories.ts +8 -8
  119. package/src/patterns/UiDatePicker/UiDatePicker.vue +1 -1
  120. package/src/patterns/UiFloatActions/UiFloatActionItems.vue +11 -4
  121. package/src/patterns/UiFloatActions/UiFloatActions.stories.ts +416 -377
  122. package/src/patterns/UiFloatActions/UiFloatActions.vue +6 -2
  123. package/src/patterns/UiSidebar/UiSidebarGroupLabel.stories.ts +2 -2
  124. package/src/patterns/UiSidebar/UiSidebarMenuButton.stories.ts +5 -5
@@ -1,8 +1,10 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
- import { ref, useId, watch } from 'vue';
2
+ import { ref, useId } 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';
7
+ import { UiSwitch } from '../../components/UiSwitch';
6
8
  import { useAnchorFloat } from '../../lib/useAnchorFloat';
7
9
  import type { UiFloatActionsPlacement, UiFloatActionsTrigger } from './types';
8
10
 
@@ -88,145 +90,217 @@ const meta = {
88
90
  export default meta;
89
91
  type Story = StoryObj<typeof meta>;
90
92
 
91
- type FloatRenderConfig = {
92
- helperText?: string;
93
- anchorText?: string;
94
- anchorClass?: string;
95
- useCardAnchor?: boolean;
96
- showPagination?: boolean;
97
- };
98
-
99
- function createFloatRender(config: FloatRenderConfig = {}) {
100
- const {
101
- helperText,
102
- 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 text-sm leading-6',
104
- useCardAnchor = false,
105
- showPagination = false,
106
- } = config;
107
-
108
- return (args: Story['args']) => ({
109
- components: { UiFloatActions, UiFloatActionItems, UiIcon },
93
+ /**
94
+ * Trigger modes: `hover`, `click`, `focus`, and `manual`.
95
+ * Each anchor renders as a focusable button, so keyboard users get the same
96
+ * `ui-focus-ring` treatment (matching UiButton: focus-ring border + 3px ring) as
97
+ * the rest of the library. Tab to any anchor to see the shared focus style.
98
+ */
99
+ export const ShowModes: Story = {
100
+ name: 'Show modes',
101
+ render: () => ({
102
+ components: { UiFloatActions, UiFloatActionItems, UiIcon, UiSwitch },
110
103
  setup() {
111
- const open = ref(args?.open ?? false);
112
- const page = ref(2);
113
- const total = ref(2);
114
-
115
- watch(
116
- () => args?.open,
117
- (value) => {
118
- if (value !== undefined) open.value = value;
104
+ const manualOpen = ref(false);
105
+ const modes = [
106
+ {
107
+ trigger: 'hover' as const,
108
+ label: 'Hover',
109
+ hint: 'Point at or Tab to the anchor',
110
+ icon: 'edit',
111
+ },
112
+ {
113
+ trigger: 'click' as const,
114
+ label: 'Click',
115
+ hint: 'Click or press Enter / Space',
116
+ icon: 'copy',
119
117
  },
120
- );
118
+ {
119
+ trigger: 'focus' as const,
120
+ label: 'Focus',
121
+ hint: 'Tab to the anchor to reveal',
122
+ icon: 'message-circle',
123
+ },
124
+ {
125
+ trigger: 'manual' as const,
126
+ label: 'Manual',
127
+ hint: 'Controlled via v-model:open',
128
+ icon: 'star',
129
+ },
130
+ ];
131
+ return { modes, manualOpen };
132
+ },
133
+ template: `
134
+ <div class="grid min-h-96 grid-cols-1 place-items-center gap-10 p-8 md:grid-cols-2">
135
+ <div
136
+ v-for="mode in modes"
137
+ :key="mode.trigger"
138
+ class="flex flex-col items-center gap-3"
139
+ >
140
+ <span class="label-14-medium text-content-on-surface-secondary">{{ mode.label }}</span>
141
+ <UiFloatActions
142
+ :trigger="mode.trigger"
143
+ :open="mode.trigger === 'manual' ? manualOpen : undefined"
144
+ placement="top"
145
+ :offset="10"
146
+ :aria-label="mode.label + ' actions'"
147
+ >
148
+ <template #container>
149
+ <span class="rounded-md border border-border-surface-default bg-background-surface-primary px-4 py-2 body-14-regular">
150
+ {{ mode.hint }}
151
+ </span>
152
+ </template>
153
+ <template #action>
154
+ <UiFloatActionItems :aria-label="mode.label + ' actions'">
155
+ <UiFloatActionItems type="button" :aria-label="mode.label">
156
+ <UiIcon :name="mode.icon" size="s" />
157
+ </UiFloatActionItems>
158
+ <UiFloatActionItems type="button" aria-label="More">
159
+ <UiIcon name="more-vertical" size="s" />
160
+ </UiFloatActionItems>
161
+ </UiFloatActionItems>
162
+ </template>
163
+ </UiFloatActions>
164
+ <label
165
+ v-if="mode.trigger === 'manual'"
166
+ class="flex items-center gap-2 label-14-regular text-content-on-surface-secondary"
167
+ >
168
+ <UiSwitch v-model="manualOpen" name="manual-open" />
169
+ {{ manualOpen ? 'Open' : 'Closed' }}
170
+ </label>
171
+ </div>
172
+ </div>
173
+ `,
174
+ }),
175
+ parameters: {
176
+ controls: { disable: true },
177
+ docs: { canvas: { sourceState: 'none' } },
178
+ },
179
+ };
121
180
 
122
- function previousPage() {
123
- page.value = Math.max(1, page.value - 1);
124
- }
181
+ const iconOnlyWithTooltipSource = `<script setup lang="ts">
182
+ import { UiFloatActions, UiFloatActionItems, UiIcon, UiTooltip } from '@aleph-alpha/ui-library';
183
+ </script>
125
184
 
126
- function nextPage() {
127
- page.value = Math.min(total.value, page.value + 1);
128
- }
185
+ <template>
186
+ <UiFloatActions trigger="hover" placement="top" :offset="10" :open="true">
187
+ <template #container>
188
+ <p>Hover an icon to reveal its tooltip.</p>
189
+ </template>
190
+ <!-- Teleport each tooltip into the top-layer panel (:to="panelEl") so it is
191
+ not painted underneath it. Use the tooltip's \`side\` to place it. -->
192
+ <template #action="{ panelEl }">
193
+ <UiFloatActionItems aria-label="Icon actions">
194
+ <UiTooltip content="Top" side="top" :to="panelEl" delayDuration={0}>
195
+ <UiFloatActionItems type="button" aria-label="Edit">
196
+ <UiIcon name="edit" size="s" />
197
+ </UiFloatActionItems>
198
+ </UiTooltip>
199
+ <UiTooltip content="Right" side="right" :to="panelEl" delayDuration={0}>
200
+ <UiFloatActionItems type="button" aria-label="Copy">
201
+ <UiIcon name="copy" size="s" />
202
+ </UiFloatActionItems>
203
+ </UiTooltip>
204
+ <UiTooltip content="Bottom" side="bottom" :to="panelEl" delayDuration={0}>
205
+ <UiFloatActionItems type="button" aria-label="Comment">
206
+ <UiIcon name="message-circle" size="s" />
207
+ </UiFloatActionItems>
208
+ </UiTooltip>
209
+ <UiTooltip content="Left" side="left" :to="panelEl" delayDuration={0}>
210
+ <UiFloatActionItems type="button" aria-label="Delete">
211
+ <UiIcon name="trash" size="s" />
212
+ </UiFloatActionItems>
213
+ </UiTooltip>
214
+ </UiFloatActionItems>
215
+ </template>
216
+ </UiFloatActions>
217
+ </template>`;
129
218
 
130
- return {
131
- args,
132
- open,
133
- page,
134
- total,
135
- previousPage,
136
- nextPage,
137
- helperText,
138
- anchorText,
139
- anchorClass,
140
- useCardAnchor,
141
- showPagination,
142
- };
219
+ /**
220
+ * Icon-only actions where each button is named by a `UiTooltip`.
221
+ * Tooltips are placed on all four sides — `right`, `top`, `bottom`, `left` — via
222
+ * the tooltip `side` prop. Teleport each tooltip into the panel (`:to="panelEl"`)
223
+ * so it shares the panel's top layer instead of rendering beneath it.
224
+ */
225
+ export const IconOnlyWithTooltip: Story = {
226
+ name: 'Icon only with tooltip',
227
+ render: () => ({
228
+ components: { UiFloatActions, UiFloatActionItems, UiIcon, UiTooltip },
229
+ setup() {
230
+ const open = ref(false);
231
+ return { open };
143
232
  },
144
233
  template: `
145
- <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 text-sm">
147
- {{ helperText }}
234
+ <div class="flex min-h-64 flex-col items-center justify-center gap-4 p-8">
235
+ <p class="max-w-sm text-center body-14-regular text-content-on-surface-secondary">
236
+ Hover or focus each icon to reveal its tooltip on a different side.
148
237
  </p>
149
238
  <UiFloatActions
150
239
  v-model:open="open"
151
- :trigger="args.trigger"
152
- :placement="args.placement"
153
- :offset="args.offset"
154
- :open-delay="args.openDelay"
155
- :close-delay="args.closeDelay"
156
- :dismiss-on-outside-click="args.dismissOnOutsideClick"
157
- :dismiss-on-escape="args.dismissOnEscape"
158
- :aria-label="args.ariaLabel"
240
+ trigger="hover"
241
+ placement="top"
242
+ :offset="10"
243
+ aria-label="Icon actions"
159
244
  >
160
245
  <template #container>
161
- <article
162
- v-if="useCardAnchor"
163
- class="rounded-lg border border-border-surface-default bg-background-surface-secondary p-4 shadow-lg"
164
- >
165
- <h3 class="label-14-medium">Floating card</h3>
166
- <p class="text-muted-foreground mt-2 text-sm">{{ anchorText }}</p>
167
- </article>
168
- <p v-else :class="anchorClass">{{ anchorText }}</p>
246
+ <span class="rounded-md border border-border-surface-default bg-background-surface-primary px-4 py-2 body-14-regular">
247
+ Icon toolbar
248
+ </span>
169
249
  </template>
170
- <template #action>
171
- <UiFloatActionItems aria-label="Text actions">
172
- <UiFloatActionItems type="button" aria-label="Edit">
173
- <UiIcon name="edit" size="s" />
174
- </UiFloatActionItems>
175
- <UiFloatActionItems type="button" aria-label="Copy">
176
- <UiIcon name="copy" size="s" />
177
- </UiFloatActionItems>
178
- <UiFloatActionItems v-if="showPagination" type="separator" />
179
- <UiFloatActionItems v-if="showPagination" type="group">
180
- <UiFloatActionItems
181
- type="button"
182
- aria-label="Previous match"
183
- :disabled="page <= 1"
184
- @click="previousPage"
185
- >
186
- <UiIcon name="chevron-left" size="s" />
250
+ <template #action="{ panelEl }">
251
+ <UiFloatActionItems aria-label="Icon actions">
252
+ <UiTooltip content="Right" side="right" :to="panelEl" delayDuration={0}>
253
+ <UiFloatActionItems type="button" aria-label="Edit">
254
+ <UiIcon name="edit" size="s" />
187
255
  </UiFloatActionItems>
188
- <UiFloatActionItems type="text">{{ page }}/{{ total }}</UiFloatActionItems>
189
- <UiFloatActionItems
190
- type="button"
191
- aria-label="Next match"
192
- :disabled="page >= total"
193
- @click="nextPage"
194
- >
195
- <UiIcon name="chevron-right" size="s" />
256
+ </UiTooltip>
257
+ <UiTooltip content="Top" side="top" :to="panelEl" delayDuration={0}>
258
+ <UiFloatActionItems type="button" aria-label="Copy">
259
+ <UiIcon name="copy" size="s" />
196
260
  </UiFloatActionItems>
197
- </UiFloatActionItems>
198
- <template v-if="!showPagination">
261
+ </UiTooltip>
262
+ <UiTooltip content="Bottom" side="bottom" :to="panelEl" delayDuration={0}>
199
263
  <UiFloatActionItems type="button" aria-label="Comment">
200
264
  <UiIcon name="message-circle" size="s" />
201
265
  </UiFloatActionItems>
266
+ </UiTooltip>
267
+ <UiTooltip content="Left" side="left" :to="panelEl" delayDuration={0}>
202
268
  <UiFloatActionItems type="button" aria-label="Delete">
203
269
  <UiIcon name="trash" size="s" />
204
270
  </UiFloatActionItems>
205
- </template>
271
+ </UiTooltip>
206
272
  </UiFloatActionItems>
207
273
  </template>
208
274
  </UiFloatActions>
209
275
  </div>
210
276
  `,
211
- });
212
- }
277
+ }),
278
+ parameters: {
279
+ controls: { disable: true },
280
+ docs: { source: { code: iconOnlyWithTooltipSource } },
281
+ },
282
+ };
213
283
 
214
- const flatActionsSource = `<script setup lang="ts">
284
+ const buttonWithTextSource = `<script setup lang="ts">
215
285
  import { UiFloatActions, UiFloatActionItems, UiIcon } from '@aleph-alpha/ui-library';
216
286
  </script>
217
287
 
218
288
  <template>
219
- <UiFloatActions trigger="hover" placement="top" :offset="10">
289
+ <UiFloatActions trigger="click" placement="bottom" :offset="10" aria-label="Text actions">
220
290
  <template #container>
221
- <p>Hover or Tab to this paragraph to reveal contextual actions.</p>
291
+ <p>Click to toggle a labelled toolbar.</p>
222
292
  </template>
223
293
  <template #action>
224
294
  <UiFloatActionItems aria-label="Text actions">
225
- <UiFloatActionItems type="button" aria-label="Edit">
226
- <UiIcon name="edit" size="s" />
295
+ <!-- Icon + visible text label: no tooltip needed. -->
296
+ <UiFloatActionItems type="button" aria-label="Edit" class="w-auto gap-1.5 px-3 label-14-medium">
297
+ <UiIcon name="edit" size="s" />Edit
227
298
  </UiFloatActionItems>
228
- <UiFloatActionItems type="button" aria-label="Copy">
229
- <UiIcon name="copy" size="s" />
299
+ <UiFloatActionItems type="button" aria-label="Copy" class="w-auto gap-1.5 px-3 label-14-medium">
300
+ <UiIcon name="copy" size="s" />Copy
301
+ </UiFloatActionItems>
302
+ <UiFloatActionItems type="button" aria-label="Delete" class="w-auto gap-1.5 px-3 label-14-medium">
303
+ <UiIcon name="trash" size="s" />Delete
230
304
  </UiFloatActionItems>
231
305
  </UiFloatActionItems>
232
306
  </template>
@@ -234,84 +308,42 @@ import { UiFloatActions, UiFloatActionItems, UiIcon } from '@aleph-alpha/ui-libr
234
308
  </template>`;
235
309
 
236
310
  /**
237
- * Flat row of icon actions revealed on pointer hover or keyboard focus.
238
- * Use the controls panel to try triggers, placement, offset, and dismiss behaviour.
239
- */
240
- export const FlatActions: Story = {
241
- render: createFloatRender(),
242
- parameters: {
243
- docs: { source: { code: flatActionsSource } },
244
- },
245
- };
246
-
247
- /**
248
- * Click trigger for toggling a floating toolbar with pointer or keyboard.
249
- * The anchor exposes `aria-expanded`, `aria-haspopup`, and `aria-controls`
250
- * for screen readers. Enter and Space also toggle the panel.
251
- */
252
- export const ClickTrigger: Story = {
253
- args: {
254
- trigger: 'click',
255
- placement: 'bottom',
256
- ariaLabel: 'Open text actions',
257
- },
258
- render: createFloatRender({
259
- anchorText: 'Click this paragraph to toggle the floating toolbar.',
260
- anchorClass:
261
- 'max-w-sm rounded-md border border-border-surface-default bg-background-surface-primary px-4 py-6 text-sm',
262
- }),
263
- };
264
-
265
- /**
266
- * Focus-only trigger for keyboard-first workflows.
267
- * The panel opens when the anchor receives focus and closes on blur or Escape.
268
- * Focus stays on the anchor; Tab into toolbar items to use arrow-key navigation.
311
+ * Actions that pair an icon with a visible text label.
312
+ * A readable label makes the action self-describing, so no tooltip is required.
313
+ * Widen the button (`w-auto`) and add horizontal padding to fit the text.
269
314
  */
270
- export const FocusTrigger: Story = {
271
- args: {
272
- trigger: 'focus',
273
- placement: 'top',
274
- offset: 10,
275
- ariaLabel: 'Paragraph actions',
276
- },
277
- render: createFloatRender({
278
- helperText:
279
- 'Tab to the paragraph below. The toolbar opens on focus. Tab again to reach toolbar actions, then use arrow keys to move between them.',
280
- anchorText: 'Tab here to reveal focus-triggered actions.',
281
- }),
282
- };
283
-
284
- /**
285
- * Placement and offset configuration.
286
- * The panel auto-flips via floating-ui when there is not enough viewport space.
287
- */
288
- export const Placements: Story = {
289
- render: (args) => ({
315
+ export const ButtonWithText: Story = {
316
+ name: 'Button with text (no tooltip)',
317
+ render: () => ({
290
318
  components: { UiFloatActions, UiFloatActionItems, UiIcon },
291
319
  setup() {
292
- return { args };
320
+ const open = ref(false);
321
+ return { open };
293
322
  },
294
323
  template: `
295
- <div class="grid min-h-96 grid-cols-2 place-items-center gap-8 p-8">
324
+ <div class="flex min-h-64 flex-col items-center justify-center gap-3 p-8">
296
325
  <UiFloatActions
297
- v-for="placement in ['top', 'bottom', 'left', 'right']"
298
- :key="placement"
299
- :trigger="args.trigger"
300
- :placement="placement"
301
- :offset="args.offset"
302
- :open-delay="args.openDelay"
303
- :close-delay="args.closeDelay"
304
- :aria-label="placement + ' placement demo'"
326
+ v-model:open="open"
327
+ trigger="hover"
328
+ placement="top"
329
+ :offset="10"
330
+ aria-label="Text actions"
305
331
  >
306
332
  <template #container>
307
- <span class="rounded-md border border-border-surface-default px-4 py-2 text-sm capitalize">
308
- {{ placement }}
333
+ <span class="rounded-md border border-border-surface-default bg-background-surface-primary px-4 py-2 body-14-regular">
334
+ Labelled toolbar
309
335
  </span>
310
336
  </template>
311
337
  <template #action>
312
- <UiFloatActionItems :aria-label="placement + ' actions'">
313
- <UiFloatActionItems type="button" aria-label="Action">
314
- <UiIcon name="more-vertical" size="s" />
338
+ <UiFloatActionItems aria-label="Text actions">
339
+ <UiFloatActionItems type="button" aria-label="Edit" class="w-auto gap-1.5 px-3 label-14-medium">
340
+ <UiIcon name="edit" size="s" />Edit
341
+ </UiFloatActionItems>
342
+ <UiFloatActionItems type="button" aria-label="Copy" class="w-auto gap-1.5 px-3 label-14-medium">
343
+ <UiIcon name="copy" size="s" />Copy
344
+ </UiFloatActionItems>
345
+ <UiFloatActionItems type="button" aria-label="Delete" class="w-auto gap-1.5 px-3 label-14-medium">
346
+ <UiIcon name="trash" size="s" />Delete
315
347
  </UiFloatActionItems>
316
348
  </UiFloatActionItems>
317
349
  </template>
@@ -319,142 +351,163 @@ export const Placements: Story = {
319
351
  </div>
320
352
  `,
321
353
  }),
322
- argTypes: {
323
- placement: { control: false },
324
- open: { control: false },
325
- ariaLabel: { control: false },
354
+ parameters: {
355
+ controls: { disable: true },
356
+ docs: { source: { code: buttonWithTextSource } },
326
357
  },
327
358
  };
328
359
 
329
- /**
330
- * UiFloatActionItems item types: `button`, `input`, `text`, `group`, and `separator`.
331
- * Nest items inside a root `toolbar` container. Each icon button requires an
332
- * `aria-label` because it renders without visible text.
333
- */
334
- const toolbarItemTypesTemplateSource = `<script setup lang="ts">
335
- import { UiFloatActions, UiFloatActionItems, UiIcon } from '@aleph-alpha/ui-library';
360
+ const orientationSource = `<script setup lang="ts">
361
+ import { UiFloatActionItems, UiIcon } from '@aleph-alpha/ui-library';
336
362
  </script>
337
363
 
338
364
  <template>
339
- <UiFloatActions trigger="hover" placement="top" :offset="10">
340
- <template #container>
341
- <p>Hover or Tab to explore toolbar item types.</p>
342
- </template>
343
- <template #action>
344
- <UiFloatActionItems aria-label="Mixed actions">
345
- <UiFloatActionItems type="button" aria-label="Edit">
346
- <UiIcon name="edit" size="s" />
347
- </UiFloatActionItems>
348
- <UiFloatActionItems type="button" aria-label="Copy">
349
- <UiIcon name="copy" size="s" />
350
- </UiFloatActionItems>
351
- <UiFloatActionItems type="separator" />
352
- <UiFloatActionItems type="group">
353
- <UiFloatActionItems type="button" aria-label="Previous page">
354
- <UiIcon name="chevron-left" size="s" />
355
- </UiFloatActionItems>
356
- <UiFloatActionItems type="text">2/2</UiFloatActionItems>
357
- <UiFloatActionItems type="button" aria-label="Next page">
358
- <UiIcon name="chevron-right" size="s" />
359
- </UiFloatActionItems>
360
- </UiFloatActionItems>
361
- </UiFloatActionItems>
362
- </template>
363
- </UiFloatActions>
365
+ <!-- Horizontal (default): ArrowLeft / ArrowRight move between items. -->
366
+ <UiFloatActionItems aria-label="Horizontal actions" orientation="horizontal">
367
+ <UiFloatActionItems type="button" aria-label="Edit"><UiIcon name="edit" size="s" /></UiFloatActionItems>
368
+ <UiFloatActionItems type="button" aria-label="Copy"><UiIcon name="copy" size="s" /></UiFloatActionItems>
369
+ <UiFloatActionItems type="button" aria-label="Delete"><UiIcon name="trash" size="s" /></UiFloatActionItems>
370
+ </UiFloatActionItems>
371
+
372
+ <!-- Vertical: ArrowUp / ArrowDown move between items; the pill stacks. -->
373
+ <UiFloatActionItems aria-label="Vertical actions" orientation="vertical">
374
+ <UiFloatActionItems type="button" aria-label="Edit"><UiIcon name="edit" size="s" /></UiFloatActionItems>
375
+ <UiFloatActionItems type="button" aria-label="Copy"><UiIcon name="copy" size="s" /></UiFloatActionItems>
376
+ <UiFloatActionItems type="button" aria-label="Delete"><UiIcon name="trash" size="s" /></UiFloatActionItems>
377
+ </UiFloatActionItems>
364
378
  </template>`;
365
379
 
366
- export const ToolbarItemTypes: Story = {
380
+ /**
381
+ * Toolbar orientation controls both layout and roving arrow-key navigation.
382
+ * `horizontal` (default) stacks items in a row and maps ArrowLeft / ArrowRight;
383
+ * `vertical` stacks items in a column and maps ArrowUp / ArrowDown.
384
+ */
385
+ export const Orientation: Story = {
386
+ name: 'Action items orientation',
367
387
  render: () => ({
368
- components: { UiFloatActions, UiFloatActionItems, UiIcon },
388
+ components: { UiFloatActionItems, UiIcon },
369
389
  template: `
370
- <div class="flex min-h-48 flex-col items-center justify-center gap-6 p-8">
371
- <UiFloatActions trigger="hover" placement="top" :offset="10">
372
- <template #container>
373
- <p class="max-w-sm rounded-md border border-border-surface-default bg-background-surface-primary px-4 py-6 text-sm">
374
- Hover or Tab to explore toolbar item types.
375
- </p>
376
- </template>
377
- <template #action>
378
- <UiFloatActionItems aria-label="Mixed actions">
379
- <UiFloatActionItems type="button" aria-label="Edit">
380
- <UiIcon name="edit" size="s" />
381
- </UiFloatActionItems>
382
- <UiFloatActionItems type="button" aria-label="Copy">
383
- <UiIcon name="copy" size="s" />
384
- </UiFloatActionItems>
385
- <UiFloatActionItems type="separator" />
386
- <UiFloatActionItems type="group">
387
- <UiFloatActionItems type="button" aria-label="Previous page">
388
- <UiIcon name="chevron-left" size="s" />
389
- </UiFloatActionItems>
390
- <UiFloatActionItems type="text">2/2</UiFloatActionItems>
391
- <UiFloatActionItems type="button" aria-label="Next page">
392
- <UiIcon name="chevron-right" size="s" />
393
- </UiFloatActionItems>
394
- </UiFloatActionItems>
390
+ <div class="flex min-h-64 flex-wrap items-start justify-center gap-12 p-8">
391
+ <div class="flex flex-col items-center gap-3">
392
+ <span class="label-14-medium text-content-on-surface-secondary">Horizontal</span>
393
+ <UiFloatActionItems aria-label="Horizontal actions" orientation="horizontal">
394
+ <UiFloatActionItems type="button" aria-label="Edit">
395
+ <UiIcon name="edit" size="s" />
396
+ </UiFloatActionItems>
397
+ <UiFloatActionItems type="button" aria-label="Copy">
398
+ <UiIcon name="copy" size="s" />
399
+ </UiFloatActionItems>
400
+ <UiFloatActionItems type="button" aria-label="Delete">
401
+ <UiIcon name="trash" size="s" />
395
402
  </UiFloatActionItems>
396
- </template>
397
- </UiFloatActions>
398
-
399
- <UiFloatActionItems aria-label="Filter actions">
400
- <UiFloatActionItems
401
- type="input"
402
- aria-label="Filter value"
403
- placeholder="Filter..."
404
- />
405
- <UiFloatActionItems type="button" aria-label="Apply filter">
406
- <UiIcon name="check" size="s" />
407
403
  </UiFloatActionItems>
408
- </UiFloatActionItems>
404
+ </div>
405
+ <div class="flex flex-col items-center gap-3">
406
+ <span class="label-14-medium text-content-on-surface-secondary">Vertical</span>
407
+ <UiFloatActionItems aria-label="Vertical actions" orientation="vertical">
408
+ <UiFloatActionItems type="button" aria-label="Edit">
409
+ <UiIcon name="edit" size="s" />
410
+ </UiFloatActionItems>
411
+ <UiFloatActionItems type="button" aria-label="Copy">
412
+ <UiIcon name="copy" size="s" />
413
+ </UiFloatActionItems>
414
+ <UiFloatActionItems type="button" aria-label="Delete">
415
+ <UiIcon name="trash" size="s" />
416
+ </UiFloatActionItems>
417
+ </UiFloatActionItems>
418
+ </div>
409
419
  </div>
410
420
  `,
411
421
  }),
412
422
  parameters: {
413
423
  controls: { disable: true },
414
- docs: { source: { code: toolbarItemTypesTemplateSource } },
424
+ docs: { source: { code: orientationSource } },
415
425
  },
416
426
  };
417
427
 
418
- /**
419
- * Text-selection toolbar with pagination controls.
420
- * Demonstrates a decoupled pattern: the float anchors to any element without
421
- * coupling toolbar items to a specific domain model. Arrow keys navigate items.
422
- */
423
- export const TextSelectionToolbar: Story = {
424
- args: {
425
- trigger: 'hover',
426
- placement: 'top',
427
- offset: 10,
428
- },
429
- render: createFloatRender({
430
- showPagination: true,
431
- helperText:
432
- 'Hover or Tab to the highlighted paragraph to reveal the floating action bar. Tab into toolbar actions, then use arrow keys to move between them.',
433
- anchorText:
434
- 'Design systems thrive when primitives stay decoupled. This pattern anchors a pill toolbar to any element without coupling the toolbar items to a specific domain model.',
435
- }),
436
- };
428
+ const itemTypesSource = `<script setup lang="ts">
429
+ import { UiFloatActionItems, UiIcon } from '@aleph-alpha/ui-library';
430
+ </script>
431
+
432
+ <template>
433
+ <UiFloatActionItems aria-label="All item types">
434
+ <!-- button -->
435
+ <UiFloatActionItems type="button" aria-label="Edit">
436
+ <UiIcon name="edit" size="s" />
437
+ </UiFloatActionItems>
438
+ <!-- separator -->
439
+ <UiFloatActionItems type="separator" />
440
+ <!-- group + text -->
441
+ <UiFloatActionItems type="group">
442
+ <UiFloatActionItems type="button" aria-label="Previous page">
443
+ <UiIcon name="chevron-left" size="s" />
444
+ </UiFloatActionItems>
445
+ <UiFloatActionItems type="text">2/2</UiFloatActionItems>
446
+ <UiFloatActionItems type="button" aria-label="Next page">
447
+ <UiIcon name="chevron-right" size="s" />
448
+ </UiFloatActionItems>
449
+ </UiFloatActionItems>
450
+ <UiFloatActionItems type="separator" />
451
+ <!-- input -->
452
+ <UiFloatActionItems type="input" aria-label="Filter value" placeholder="Filter..." />
453
+ </UiFloatActionItems>
454
+ </template>`;
437
455
 
438
456
  /**
439
- * Click-bound card actions anchored below the card.
440
- * Use `placement="bottom-start"` to align the toolbar with the card's leading edge.
457
+ * All item types nested inside a root `toolbar` container:
458
+ * `button`, `input`, `text`, `group`, and `separator`.
459
+ * Icon-only `button` items require an `aria-label` because they have no visible text.
441
460
  */
442
- export const ClickBoundCardActions: Story = {
443
- args: {
444
- trigger: 'click',
445
- placement: 'bottom-start',
446
- ariaLabel: 'Open card actions',
447
- },
448
- render: createFloatRender({
449
- useCardAnchor: true,
450
- anchorText: 'Click anywhere on this card to reveal inline actions.',
461
+ export const ItemTypes: Story = {
462
+ name: 'Action items types',
463
+ render: () => ({
464
+ components: { UiFloatActionItems, UiIcon },
465
+ template: `
466
+ <div class="flex min-h-64 flex-col items-center justify-center gap-6 p-8">
467
+ <UiFloatActionItems aria-label="All item types">
468
+ <UiFloatActionItems type="button" aria-label="Edit">
469
+ <UiIcon name="edit" size="s" />
470
+ </UiFloatActionItems>
471
+ <UiFloatActionItems type="button" aria-label="Copy">
472
+ <UiIcon name="copy" size="s" />
473
+ </UiFloatActionItems>
474
+ <UiFloatActionItems type="separator" />
475
+ <UiFloatActionItems type="group">
476
+ <UiFloatActionItems type="button" aria-label="Previous page">
477
+ <UiIcon name="chevron-left" size="s" />
478
+ </UiFloatActionItems>
479
+ <UiFloatActionItems type="text">2/2</UiFloatActionItems>
480
+ <UiFloatActionItems type="button" aria-label="Next page">
481
+ <UiIcon name="chevron-right" size="s" />
482
+ </UiFloatActionItems>
483
+ </UiFloatActionItems>
484
+ <UiFloatActionItems type="separator" />
485
+ <UiFloatActionItems type="input" aria-label="Filter value" placeholder="Filter..." />
486
+ </UiFloatActionItems>
487
+
488
+ <dl class="grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 body-14-regular text-content-on-surface-secondary">
489
+ <dt class="label-14-medium text-content-on-surface-primary">button</dt><dd>Icon or labelled action</dd>
490
+ <dt class="label-14-medium text-content-on-surface-primary">separator</dt><dd>Vertical divider</dd>
491
+ <dt class="label-14-medium text-content-on-surface-primary">group</dt><dd>Groups related items</dd>
492
+ <dt class="label-14-medium text-content-on-surface-primary">text</dt><dd>Non-interactive label</dd>
493
+ <dt class="label-14-medium text-content-on-surface-primary">input</dt><dd>Inline text field</dd>
494
+ </dl>
495
+ </div>
496
+ `,
451
497
  }),
498
+ parameters: {
499
+ controls: { disable: true },
500
+ docs: { source: { code: itemTypesSource } },
501
+ },
452
502
  };
453
503
 
454
504
  /**
455
- * All float states and variations in a single view for visual QA and reference.
505
+ * All button states side by side for visual QA: default, hover, focus (shared
506
+ * `ui-focus-ring`), disabled, plus toolbar-level triggers and open / closed panels.
507
+ * Tab through the buttons to see the focus ring; hover to see the hover surface.
456
508
  */
457
509
  export const AllStates: Story = {
510
+ name: 'All states with button',
458
511
  render: () => ({
459
512
  components: { UiFloatActions, UiFloatActionItems, UiIcon },
460
513
  setup() {
@@ -463,17 +516,62 @@ export const AllStates: Story = {
463
516
  return { openPanel, closedPanel };
464
517
  },
465
518
  template: `
466
- <div class="flex flex-col gap-10 p-8">
467
- <section class="flex flex-col gap-4">
468
- <h3 class="body-16-medium text-content-on-surface-primary">Triggers</h3>
469
- <div class="grid gap-6 md:grid-cols-3">
470
- <div class="flex flex-col items-center gap-2">
471
- <span class="label-14-medium text-content-on-surface-secondary">Hover</span>
472
- <UiFloatActions trigger="hover" placement="top" :offset="10">
519
+ <div class="mx-auto flex max-w-4xl flex-col gap-12 p-8">
520
+ <section class="flex flex-col gap-5">
521
+ <div class="flex flex-col gap-1">
522
+ <h3 class="body-16-medium text-content-on-surface-primary">Button states</h3>
523
+ <p class="body-14-regular text-content-on-surface-secondary">
524
+ Tab to a button to reveal the focus ring; hover to see the hover surface.
525
+ </p>
526
+ </div>
527
+ <div class="grid grid-cols-2 gap-4 sm:grid-cols-4">
528
+ <div class="flex flex-col items-center justify-center gap-4 rounded-lg border border-border-surface-default bg-background-surface-primary p-6">
529
+ <UiFloatActionItems aria-label="Default state">
530
+ <UiFloatActionItems type="button" aria-label="Edit">
531
+ <UiIcon name="edit" size="s" />
532
+ </UiFloatActionItems>
533
+ </UiFloatActionItems>
534
+ <span class="label-12-medium text-content-on-surface-secondary">Default</span>
535
+ </div>
536
+ <div class="flex flex-col items-center justify-center gap-4 rounded-lg border border-border-surface-default bg-background-surface-primary p-6">
537
+ <UiFloatActionItems aria-label="Hover state">
538
+ <UiFloatActionItems type="button" aria-label="Edit" >
539
+ <UiIcon name="edit" size="s" />
540
+ </UiFloatActionItems>
541
+ </UiFloatActionItems>
542
+ <span class="label-12-medium text-content-on-surface-secondary">Hover</span>
543
+ </div>
544
+ <div class="flex flex-col items-center justify-center gap-4 rounded-lg border border-border-surface-default bg-background-surface-primary p-6">
545
+ <UiFloatActionItems aria-label="Focus state">
546
+ <UiFloatActionItems type="button" aria-label="Edit">
547
+ <UiIcon name="edit" size="s" />
548
+ </UiFloatActionItems>
549
+ </UiFloatActionItems>
550
+ <span class="label-12-medium text-content-on-surface-secondary">Focus (Tab)</span>
551
+ </div>
552
+ <div class="flex flex-col items-center justify-center gap-4 rounded-lg border border-border-surface-default bg-background-surface-primary p-6">
553
+ <UiFloatActionItems aria-label="Disabled state">
554
+ <UiFloatActionItems type="button" aria-label="Edit" disabled>
555
+ <UiIcon name="edit" size="s" />
556
+ </UiFloatActionItems>
557
+ </UiFloatActionItems>
558
+ <span class="label-12-medium text-content-on-surface-secondary">Disabled</span>
559
+ </div>
560
+ </div>
561
+ </section>
562
+
563
+ <section class="flex flex-col gap-5">
564
+ <div class="flex flex-col gap-1">
565
+ <h3 class="body-16-medium text-content-on-surface-primary">Triggers</h3>
566
+ <p class="body-14-regular text-content-on-surface-secondary">
567
+ How the floating panel opens for each interaction mode.
568
+ </p>
569
+ </div>
570
+ <div class="grid gap-4 sm:grid-cols-3">
571
+ <div class="flex min-h-44 flex-col items-center justify-end gap-4 rounded-lg border border-border-surface-default bg-background-surface-primary p-6">
572
+ <UiFloatActions trigger="hover" placement="top" :offset="10" aria-label="Hover actions">
473
573
  <template #container>
474
- <span class="rounded-md border border-border-surface-default px-4 py-2 text-sm">
475
- Hover or Tab
476
- </span>
574
+ <span class="rounded-md border border-border-surface-default px-4 py-2 body-14-regular">Hover or Tab</span>
477
575
  </template>
478
576
  <template #action>
479
577
  <UiFloatActionItems aria-label="Hover actions">
@@ -483,14 +581,12 @@ export const AllStates: Story = {
483
581
  </UiFloatActionItems>
484
582
  </template>
485
583
  </UiFloatActions>
584
+ <span class="label-12-medium text-content-on-surface-secondary">Hover</span>
486
585
  </div>
487
- <div class="flex flex-col items-center gap-2">
488
- <span class="label-14-medium text-content-on-surface-secondary">Click</span>
586
+ <div class="flex min-h-44 flex-col items-center justify-end gap-4 rounded-lg border border-border-surface-default bg-background-surface-primary p-6">
489
587
  <UiFloatActions trigger="click" placement="top" :offset="10" aria-label="Click actions">
490
588
  <template #container>
491
- <span class="rounded-md border border-border-surface-default px-4 py-2 text-sm">
492
- Click or Enter
493
- </span>
589
+ <span class="rounded-md border border-border-surface-default px-4 py-2 body-14-regular">Click or Enter</span>
494
590
  </template>
495
591
  <template #action>
496
592
  <UiFloatActionItems aria-label="Click actions">
@@ -500,14 +596,12 @@ export const AllStates: Story = {
500
596
  </UiFloatActionItems>
501
597
  </template>
502
598
  </UiFloatActions>
599
+ <span class="label-12-medium text-content-on-surface-secondary">Click</span>
503
600
  </div>
504
- <div class="flex flex-col items-center gap-2">
505
- <span class="label-14-medium text-content-on-surface-secondary">Focus</span>
601
+ <div class="flex min-h-44 flex-col items-center justify-end gap-4 rounded-lg border border-border-surface-default bg-background-surface-primary p-6">
506
602
  <UiFloatActions trigger="focus" placement="top" :offset="10" aria-label="Focus actions">
507
603
  <template #container>
508
- <span class="rounded-md border border-border-surface-default px-4 py-2 text-sm">
509
- Tab to focus
510
- </span>
604
+ <span class="rounded-md border border-border-surface-default px-4 py-2 body-14-regular">Tab to focus</span>
511
605
  </template>
512
606
  <template #action>
513
607
  <UiFloatActionItems aria-label="Focus actions">
@@ -517,48 +611,23 @@ export const AllStates: Story = {
517
611
  </UiFloatActionItems>
518
612
  </template>
519
613
  </UiFloatActions>
614
+ <span class="label-12-medium text-content-on-surface-secondary">Focus</span>
520
615
  </div>
521
616
  </div>
522
617
  </section>
523
618
 
524
- <section class="flex flex-col gap-4">
525
- <h3 class="body-16-medium text-content-on-surface-primary">Placements</h3>
526
- <div class="grid min-h-80 grid-cols-2 place-items-center gap-8">
527
- <UiFloatActions
528
- v-for="placement in ['top', 'bottom', 'left', 'right']"
529
- :key="'placement-' + placement"
530
- trigger="manual"
531
- v-model:open="openPanel"
532
- :placement="placement"
533
- :offset="12"
534
- :aria-label="placement + ' placement'"
535
- >
536
- <template #container>
537
- <span class="rounded-md border border-border-surface-default px-4 py-2 text-sm capitalize">
538
- {{ placement }}
539
- </span>
540
- </template>
541
- <template #action>
542
- <UiFloatActionItems :aria-label="placement + ' actions'">
543
- <UiFloatActionItems type="button" aria-label="Action">
544
- <UiIcon name="more-vertical" size="s" />
545
- </UiFloatActionItems>
546
- </UiFloatActionItems>
547
- </template>
548
- </UiFloatActions>
619
+ <section class="flex flex-col gap-5">
620
+ <div class="flex flex-col gap-1">
621
+ <h3 class="body-16-medium text-content-on-surface-primary">Open vs closed</h3>
622
+ <p class="body-14-regular text-content-on-surface-secondary">
623
+ Controlled panels via <code class="label-14-regular">v-model:open</code>.
624
+ </p>
549
625
  </div>
550
- </section>
551
-
552
- <section class="flex flex-col gap-4">
553
- <h3 class="body-16-medium text-content-on-surface-primary">Open vs closed</h3>
554
- <div class="grid gap-8 md:grid-cols-2">
555
- <div class="flex flex-col items-center gap-2">
556
- <span class="label-14-medium text-content-on-surface-secondary">Open</span>
626
+ <div class="grid gap-4 sm:grid-cols-2">
627
+ <div class="flex min-h-44 flex-col items-center justify-end gap-4 rounded-lg border border-border-surface-default bg-background-surface-primary p-6">
557
628
  <UiFloatActions trigger="manual" v-model:open="openPanel" placement="top" :offset="10" aria-label="Open panel">
558
629
  <template #container>
559
- <span class="rounded-md border border-border-surface-default px-4 py-2 text-sm">
560
- Panel open
561
- </span>
630
+ <span class="rounded-md border border-border-surface-default px-4 py-2 body-14-regular">Panel open</span>
562
631
  </template>
563
632
  <template #action>
564
633
  <UiFloatActionItems aria-label="Open panel actions">
@@ -571,14 +640,12 @@ export const AllStates: Story = {
571
640
  </UiFloatActionItems>
572
641
  </template>
573
642
  </UiFloatActions>
643
+ <span class="label-12-medium text-content-on-surface-secondary">Open</span>
574
644
  </div>
575
- <div class="flex flex-col items-center gap-2">
576
- <span class="label-14-medium text-content-on-surface-secondary">Closed</span>
645
+ <div class="flex min-h-44 flex-col items-center justify-end gap-4 rounded-lg border border-border-surface-default bg-background-surface-primary p-6">
577
646
  <UiFloatActions trigger="manual" v-model:open="closedPanel" placement="top" :offset="10" aria-label="Closed panel">
578
647
  <template #container>
579
- <span class="rounded-md border border-border-surface-default px-4 py-2 text-sm">
580
- Panel closed
581
- </span>
648
+ <span class="rounded-md border border-border-surface-default px-4 py-2 body-14-regular">Panel closed</span>
582
649
  </template>
583
650
  <template #action>
584
651
  <UiFloatActionItems aria-label="Closed panel actions">
@@ -588,39 +655,10 @@ export const AllStates: Story = {
588
655
  </UiFloatActionItems>
589
656
  </template>
590
657
  </UiFloatActions>
658
+ <span class="label-12-medium text-content-on-surface-secondary">Closed</span>
591
659
  </div>
592
660
  </div>
593
661
  </section>
594
-
595
- <section class="flex flex-col gap-4">
596
- <h3 class="body-16-medium text-content-on-surface-primary">Toolbar item types</h3>
597
- <div class="flex flex-col items-center gap-6">
598
- <UiFloatActionItems aria-label="Mixed actions">
599
- <UiFloatActionItems type="button" aria-label="Edit">
600
- <UiIcon name="edit" size="s" />
601
- </UiFloatActionItems>
602
- <UiFloatActionItems type="button" aria-label="Copy">
603
- <UiIcon name="copy" size="s" />
604
- </UiFloatActionItems>
605
- <UiFloatActionItems type="separator" />
606
- <UiFloatActionItems type="group">
607
- <UiFloatActionItems type="button" aria-label="Previous page">
608
- <UiIcon name="chevron-left" size="s" />
609
- </UiFloatActionItems>
610
- <UiFloatActionItems type="text">2/2</UiFloatActionItems>
611
- <UiFloatActionItems type="button" aria-label="Next page">
612
- <UiIcon name="chevron-right" size="s" />
613
- </UiFloatActionItems>
614
- </UiFloatActionItems>
615
- </UiFloatActionItems>
616
- <UiFloatActionItems aria-label="Filter actions">
617
- <UiFloatActionItems type="input" aria-label="Filter value" placeholder="Filter..." />
618
- <UiFloatActionItems type="button" aria-label="Apply filter">
619
- <UiIcon name="check" size="s" />
620
- </UiFloatActionItems>
621
- </UiFloatActionItems>
622
- </div>
623
- </section>
624
662
  </div>
625
663
  `,
626
664
  }),
@@ -632,9 +670,9 @@ export const AllStates: Story = {
632
670
  },
633
671
  };
634
672
 
635
- const composableUsageTemplateSource = `<script setup lang="ts">
673
+ const composableUsageSource = `<script setup lang="ts">
636
674
  import { useId } from 'vue';
637
- import { useAnchorFloat, UiFloatActions, UiFloatActionItems, UiIcon } from '@aleph-alpha/ui-library';
675
+ import { useAnchorFloat, UiFloatActionItems, UiIcon } from '@aleph-alpha/ui-library';
638
676
 
639
677
  // Prefer UiFloatActions for the standard component API. Use useAnchorFloat when
640
678
  // you need full control over markup, animation, or teleport targets.
@@ -659,6 +697,7 @@ const {
659
697
  </script>
660
698
 
661
699
  <template>
700
+ <!-- Add the shared \`ui-focus-ring\` utility to any focusable element. -->
662
701
  <button
663
702
  ref="referenceRef"
664
703
  type="button"
@@ -666,6 +705,7 @@ const {
666
705
  :aria-expanded="open"
667
706
  aria-haspopup="true"
668
707
  :aria-controls="open ? contentId : undefined"
708
+ class="ui-focus-ring rounded-md border border-transparent"
669
709
  @mouseenter="onReferenceMouseEnter"
670
710
  @mouseleave="onReferenceMouseLeave"
671
711
  @focus="onReferenceFocus"
@@ -673,8 +713,6 @@ const {
673
713
  >
674
714
  Hover or Tab to reveal actions
675
715
  </button>
676
- <!-- popover="manual" promotes the panel to the top layer and, when shown via
677
- showPopover({ source }), wires the anchor → panel keyboard focus order. -->
678
716
  <Teleport to="body">
679
717
  <div
680
718
  v-if="open"
@@ -699,10 +737,11 @@ const {
699
737
  /**
700
738
  * Headless usage with the `useAnchorFloat` composable.
701
739
  * Use when you need full control over markup, animation, or teleport targets
702
- * beyond what {@link UiFloatActions} provides. Wire focus handlers and popup ARIA on
703
- * the anchor yourself when using `hover` or `focus` triggers.
740
+ * beyond what `UiFloatActions` provides. Wire focus handlers and popup ARIA on
741
+ * the anchor yourself, and add the shared `ui-focus-ring` utility for a consistent
742
+ * keyboard focus style.
704
743
  */
705
- export const ComposableUsage: Story = {
744
+ export const Composable: Story = {
706
745
  render: () => ({
707
746
  components: { UiFloatActionItems, UiIcon },
708
747
  setup() {
@@ -723,7 +762,7 @@ export const ComposableUsage: Story = {
723
762
  :aria-expanded="open"
724
763
  aria-haspopup="true"
725
764
  :aria-controls="open ? contentId : undefined"
726
- class="rounded-md border border-border-surface-default bg-background-surface-primary px-6 py-10 text-sm 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]"
765
+ class="ui-focus-ring rounded-md border border-transparent bg-background-surface-primary px-6 py-10 body-14-regular"
727
766
  @mouseenter="onReferenceMouseEnter"
728
767
  @mouseleave="onReferenceMouseLeave"
729
768
  @focus="onReferenceFocus"
@@ -762,6 +801,6 @@ export const ComposableUsage: Story = {
762
801
  }),
763
802
  parameters: {
764
803
  controls: { disable: true },
765
- docs: { source: { code: composableUsageTemplateSource } },
804
+ docs: { source: { code: composableUsageSource } },
766
805
  },
767
806
  };