@aleph-alpha/ui-library 2.0.0 → 2.3.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.
- package/config.d.ts +0 -19
- package/config.js +65 -81
- package/dist/system/components/UiSnackbar/UiSnackbar.vue.d.ts +5 -0
- package/dist/system/components/UiSnackbar/index.d.ts +3 -0
- package/dist/system/components/UiSnackbar/types.d.ts +96 -0
- package/dist/system/components/UiToggle/UiToggle.vue.d.ts +5 -0
- package/dist/system/components/UiToggle/types.d.ts +13 -0
- package/dist/system/components/core/sonner/Sonner.vue.d.ts +3 -0
- package/dist/system/components/core/sonner/index.d.ts +1 -0
- package/dist/system/components/index.d.ts +1 -1
- package/dist/system/index.d.ts +3 -4
- package/dist/system/lib/heightTransition.d.ts +5 -0
- package/dist/system/lib/useDrag.d.ts +52 -0
- package/dist/system/lib.js +22130 -20210
- package/dist/system/patterns/UiDataTable/UiDataTable.vue.d.ts +22 -3
- package/dist/system/patterns/UiDataTable/UiDataTableColumnFilter.vue.d.ts +14 -0
- package/dist/system/patterns/UiDataTable/constants.d.ts +13 -0
- package/dist/system/patterns/UiDataTable/index.d.ts +2 -0
- package/dist/system/patterns/UiDataTable/types.d.ts +32 -1
- package/dist/system/patterns/UiSidebar/UiSidebarGroupLabel.vue.d.ts +6 -6
- package/dist/system/patterns/UiSidebar/activeIndicator.d.ts +1 -2
- package/dist/system/patterns/UiSidebar/index.d.ts +1 -3
- package/dist/system/patterns/UiSidebar/types.d.ts +1 -95
- package/docs/public-docs/foundations.md +48 -38
- package/hover-mix.d.ts +8 -11
- package/hover-mix.js +7 -15
- package/package.json +6 -4
- package/src/components/UiAccordion/UiAccordion.stories.ts +2 -2
- package/src/components/UiAlert/UiAlert.stories.ts +4 -4
- package/src/components/UiAvatar/UiAvatar.stories.ts +2 -2
- package/src/components/UiButton/UiButton.stories.ts +1 -1
- package/src/components/UiCalendar/UiCalendar.stories.ts +1 -24
- package/src/components/UiCalendar/UiCalendar.vue +16 -0
- package/src/components/UiCard/UiCard.stories.ts +4 -4
- package/src/components/UiChip/UiChip.vue +1 -1
- package/src/components/UiDrawer/UiDrawer.stories.ts +6 -6
- package/src/components/UiDropdownMenu/UiDropdownMenu.stories.ts +4 -4
- package/src/components/UiDropdownMenu/__tests__/UiDropdownMenu.test.ts +70 -3
- package/src/components/UiEmpty/UiEmpty.stories.ts +1 -0
- package/src/components/UiFileItem/UiFileItem.vue +1 -1
- package/src/components/UiFileItem/__tests__/UiFileItem.test.ts +4 -1
- package/src/components/UiFileUploadBox/UiFileUploadBox.stories.ts +2 -2
- package/src/components/UiIcon/UiIcon.stories.ts +90 -18
- package/src/components/UiInput/UiInput.stories.ts +2 -2
- package/src/components/UiKbd/UiKbd.stories.ts +10 -10
- package/src/components/UiLabel/UiLabel.stories.ts +2 -2
- package/src/components/UiListbox/UiListbox.stories.ts +14 -14
- package/src/components/UiListbox/UiListbox.vue +16 -0
- package/src/components/UiNavigationMenu/UiNavigationMenu.stories.ts +24 -13
- package/src/components/UiPopover/UiPopover.stories.ts +6 -6
- package/src/components/UiRadioGroup/UiRadioGroup.stories.ts +22 -22
- package/src/components/UiRangeCalendar/UiRangeCalendar.stories.ts +11 -22
- package/src/components/UiRangeCalendar/UiRangeCalendar.vue +16 -0
- package/src/components/UiSelect/UiSelectItem.vue +1 -1
- package/src/components/UiSeparator/UiSeparator.stories.ts +8 -8
- package/src/components/UiSheet/UiSheet.stories.ts +12 -12
- package/src/components/UiSkeleton/UiSkeleton.stories.ts +20 -20
- package/src/components/UiSlider/UiSlider.stories.ts +6 -6
- package/src/components/UiSnackbar/UiSnackbar.stories.ts +508 -0
- package/src/components/UiSnackbar/UiSnackbar.vue +286 -0
- package/src/components/UiSnackbar/__tests__/UiSnackbar.test.ts +17 -0
- package/src/components/UiSnackbar/index.ts +4 -0
- package/src/components/UiSnackbar/types.ts +97 -0
- package/src/components/UiSwitch/UiSwitch.stories.ts +4 -4
- package/src/components/UiSwitch/__tests__/UiSwitch.test.ts +9 -2
- package/src/components/UiTable/__tests__/UiTableRow.test.ts +23 -4
- package/src/components/UiTabs/UiTabs.stories.ts +2 -2
- package/src/components/UiTabs/__tests__/UiTabs.test.ts +25 -0
- package/src/components/UiTagsInput/UiTagsInput.stories.ts +2 -0
- package/src/components/UiToggle/UiToggle.vue +18 -1
- package/src/components/UiToggle/__tests__/UiToggle.test.ts +42 -3
- package/src/components/UiToggle/types.ts +13 -0
- package/src/components/UiToggleGroup/__tests__/UiToggleGroup.test.ts +18 -0
- package/src/components/UiTooltip/UiTooltip.stories.ts +7 -7
- package/src/components/core/accordion/AccordionContent.vue +36 -1
- package/src/components/core/alert/index.ts +3 -2
- package/src/components/core/button/index.ts +5 -6
- package/src/components/core/calendar/CalendarGrid.vue +1 -1
- package/src/components/core/card/Card.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuCheckboxItem.vue +14 -13
- package/src/components/core/dropdown-menu/DropdownMenuItem.vue +1 -1
- package/src/components/core/dropdown-menu/DropdownMenuRadioItem.vue +23 -13
- package/src/components/core/dropdown-menu/DropdownMenuSubTrigger.vue +1 -1
- package/src/components/core/listbox/ListboxItem.vue +1 -1
- package/src/components/core/popover/PopoverContent.vue +1 -1
- package/src/components/core/range-calendar/RangeCalendarGrid.vue +1 -1
- package/src/components/core/select/SelectItem.vue +1 -1
- package/src/components/core/sidebar/SidebarGroupAction.vue +1 -1
- package/src/components/core/sidebar/SidebarMenuAction.vue +1 -1
- package/src/components/core/sidebar/SidebarMenuSubButton.vue +2 -2
- package/src/components/core/sidebar/SidebarTrigger.vue +4 -4
- package/src/components/core/sidebar/index.ts +4 -3
- package/src/components/core/sonner/Sonner.vue +43 -0
- package/src/components/core/sonner/index.ts +1 -0
- package/src/components/core/switch/Switch.vue +2 -2
- package/src/components/core/table/TableRow.vue +1 -1
- package/src/components/core/tabs/TabsList.vue +1 -1
- package/src/components/core/tabs/TabsTrigger.vue +1 -1
- package/src/components/core/toggle/index.ts +3 -3
- package/src/components/core/toggle-group/index.ts +1 -1
- package/src/components/index.ts +1 -1
- package/src/directives/vHover.stories.ts +1 -1
- package/src/index.ts +3 -0
- package/src/lib/heightTransition.ts +27 -0
- package/src/lib/useDrag.stories.ts +295 -0
- package/src/lib/useDrag.ts +212 -0
- package/src/patterns/UiDataTable/UiDataTable.stories.ts +363 -15
- package/src/patterns/UiDataTable/UiDataTable.vue +558 -22
- package/src/patterns/UiDataTable/UiDataTableColumnFilter.vue +83 -0
- package/src/patterns/UiDataTable/UiDataTableColumnHeader.vue +4 -13
- package/src/patterns/UiDataTable/UiDataTablePagination.vue +3 -3
- package/src/patterns/UiDataTable/UiDataTableToolbar.vue +1 -1
- package/src/patterns/UiDataTable/__tests__/UiDataTable.test.ts +343 -0
- package/src/patterns/UiDataTable/__tests__/UiDataTableColumnFilter.test.ts +194 -0
- package/src/patterns/UiDataTable/__tests__/UiDataTableColumnHeader.test.ts +11 -0
- package/src/patterns/UiDataTable/constants.ts +15 -0
- package/src/patterns/UiDataTable/index.ts +2 -0
- package/src/patterns/UiDataTable/types.ts +33 -0
- package/src/patterns/UiDatePicker/UiDatePicker.stories.ts +4 -4
- package/src/patterns/UiDatePicker/UiDatePicker.vue +2 -0
- package/src/patterns/UiSidebar/UiSidebar.stories.ts +27 -258
- package/src/patterns/UiSidebar/UiSidebarGroup.stories.ts +6 -8
- package/src/patterns/UiSidebar/UiSidebarGroupContent.vue +13 -36
- package/src/patterns/UiSidebar/UiSidebarGroupLabel.stories.ts +15 -10
- package/src/patterns/UiSidebar/UiSidebarGroupLabel.vue +20 -7
- package/src/patterns/UiSidebar/UiSidebarHeader.vue +0 -1
- package/src/patterns/UiSidebar/UiSidebarMenuButton.stories.ts +29 -40
- package/src/patterns/UiSidebar/UiSidebarMenuButton.vue +9 -6
- package/src/patterns/UiSidebar/UiSidebarMenuItem.stories.ts +11 -13
- package/src/patterns/UiSidebar/UiSidebarMenuSubItem.vue +8 -5
- package/src/patterns/UiSidebar/UiSidebarPopoverMenu.stories.ts +6 -8
- package/src/patterns/UiSidebar/UiSidebarPopoverMenuItem.stories.ts +6 -7
- package/src/patterns/UiSidebar/UiSidebarPopoverMenuItem.vue +9 -7
- package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.stories.ts +3 -3
- package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.vue +11 -12
- package/src/patterns/UiSidebar/UiSidebarTrigger.vue +1 -1
- package/src/patterns/UiSidebar/activeIndicator.ts +1 -2
- package/src/patterns/UiSidebar/index.ts +0 -5
- package/src/patterns/UiSidebar/types.ts +1 -111
- package/src/theme/Background.stories.ts +5 -5
- package/src/theme/Border.stories.ts +3 -3
- package/src/theme/Extended.stories.ts +6 -6
- package/src/theme/Flex.stories.ts +10 -10
- package/src/theme/Grid.stories.ts +10 -10
- package/src/theme/HoverLayer.stories.ts +215 -0
- package/src/theme/Overlay.stories.ts +2 -2
- package/src/theme/Shadow.stories.ts +1 -1
- package/src/theme/Theme.stories.ts +4 -4
- package/src/theme/Typography.stories.ts +21 -21
- package/tokens.json +4835 -1369
- package/dist/system/components/UiIconButton/UiIconButton.vue.d.ts +0 -25
- package/dist/system/components/UiIconButton/index.d.ts +0 -7
- package/dist/system/components/UiIconButton/types.d.ts +0 -67
- package/dist/system/patterns/UiSidebar/UiSidebarChatHistory.vue.d.ts +0 -20
- package/dist/system/patterns/UiSidebar/UiSidebarChatHistoryItem.vue.d.ts +0 -34
- package/src/components/UiIconButton/UiIconButton.stories.ts +0 -470
- package/src/components/UiIconButton/UiIconButton.vue +0 -76
- package/src/components/UiIconButton/__tests__/UiIconButton.test.ts +0 -105
- package/src/components/UiIconButton/index.ts +0 -13
- package/src/components/UiIconButton/types.ts +0 -87
- package/src/patterns/UiSidebar/UiSidebarChatHistory.stories.ts +0 -104
- package/src/patterns/UiSidebar/UiSidebarChatHistory.vue +0 -43
- package/src/patterns/UiSidebar/UiSidebarChatHistoryItem.stories.ts +0 -204
- package/src/patterns/UiSidebar/UiSidebarChatHistoryItem.vue +0 -269
- package/src/patterns/UiSidebar/__tests__/UiSidebarChatHistory.test.ts +0 -35
- package/src/patterns/UiSidebar/__tests__/UiSidebarChatHistoryItem.test.ts +0 -49
- package/src/theme/BackgroundHover.stories.ts +0 -182
- package/src/theme/ContentHover.stories.ts +0 -171
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Component
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
2
|
import type { PrimitiveProps } from 'reka-ui';
|
|
3
3
|
import type { SidebarProps } from '@/components/core/sidebar';
|
|
4
4
|
|
|
@@ -221,116 +221,6 @@ export interface UiSidebarMenuSubItemProps extends PrimitiveProps {
|
|
|
221
221
|
isActive?: boolean;
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
/**
|
|
225
|
-
* Pattern wrapper props for sidebar chat history lists.
|
|
226
|
-
* @deprecated Use `CkHistoryWrapperProps` from `@aleph-alpha/chat-kit` instead.
|
|
227
|
-
*/
|
|
228
|
-
export interface UiSidebarChatHistoryProps {
|
|
229
|
-
/**
|
|
230
|
-
* Space between history items.
|
|
231
|
-
* @default true
|
|
232
|
-
*/
|
|
233
|
-
withGap?: boolean;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* Pattern wrapper props for sidebar chat history rows.
|
|
238
|
-
* @deprecated Use `CkHistoryItemProps` from `@aleph-alpha/chat-kit` instead.
|
|
239
|
-
*/
|
|
240
|
-
export interface UiSidebarChatHistoryItemProps extends PrimitiveProps {
|
|
241
|
-
/**
|
|
242
|
-
* Main title of the history item.
|
|
243
|
-
*/
|
|
244
|
-
title: string;
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* First metadata label shown under the title.
|
|
248
|
-
*/
|
|
249
|
-
metaStart?: string;
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* Second metadata label shown under the title.
|
|
253
|
-
*/
|
|
254
|
-
metaEnd?: string;
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Marks the item as active.
|
|
258
|
-
* @default false
|
|
259
|
-
*/
|
|
260
|
-
isActive?: boolean;
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Whether to render the end action button.
|
|
264
|
-
* @default true
|
|
265
|
-
*/
|
|
266
|
-
showAction?: boolean;
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* Whether the end action should only appear on hover/focus.
|
|
270
|
-
* @default true
|
|
271
|
-
*/
|
|
272
|
-
showActionOnHover?: boolean;
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* Tooltip for the end action button.
|
|
276
|
-
*/
|
|
277
|
-
actionTooltip?: string;
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* Accessible label for the end action button.
|
|
281
|
-
* @default 'History item action'
|
|
282
|
-
*/
|
|
283
|
-
actionAriaLabel?: string;
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Custom action icon rendered at the end of the row.
|
|
287
|
-
*/
|
|
288
|
-
actionIcon?: Component;
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* When true, the action control opens a popover (use `#action-popover` slot for body).
|
|
292
|
-
* Tooltip on the action is not used in this mode; set `actionAriaLabel` for accessibility.
|
|
293
|
-
* @default false
|
|
294
|
-
*/
|
|
295
|
-
actionPopover?: boolean;
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Popover side relative to the action trigger.
|
|
299
|
-
* @default 'right'
|
|
300
|
-
*/
|
|
301
|
-
actionPopoverSide?: 'top' | 'right' | 'bottom' | 'left';
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* Popover alignment relative to the trigger.
|
|
305
|
-
* @default 'start'
|
|
306
|
-
*/
|
|
307
|
-
actionPopoverAlign?: 'start' | 'center' | 'end';
|
|
308
|
-
|
|
309
|
-
/**
|
|
310
|
-
* Offset between trigger and popover content.
|
|
311
|
-
* @default 8
|
|
312
|
-
*/
|
|
313
|
-
actionPopoverSideOffset?: number;
|
|
314
|
-
|
|
315
|
-
/**
|
|
316
|
-
* Extra classes for the popover panel (merged with pattern defaults).
|
|
317
|
-
*/
|
|
318
|
-
actionPopoverContentClass?: HTMLAttributes['class'];
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* Emitted events for `UiSidebarChatHistoryItem`.
|
|
323
|
-
* @deprecated Use `CkHistoryItemEmits` from `@aleph-alpha/chat-kit` instead.
|
|
324
|
-
*/
|
|
325
|
-
export interface UiSidebarChatHistoryItemEmits {
|
|
326
|
-
/**
|
|
327
|
-
* Fired when the end action button is clicked.
|
|
328
|
-
* Not emitted when `actionPopover` is `true` — in that mode the click opens
|
|
329
|
-
* the popover and consumers react to interactions inside the `#action-popover` slot.
|
|
330
|
-
*/
|
|
331
|
-
'action-click': [event: MouseEvent];
|
|
332
|
-
}
|
|
333
|
-
|
|
334
224
|
/**
|
|
335
225
|
* Pattern wrapper props for sidebar popover triggers.
|
|
336
226
|
*/
|
|
@@ -36,7 +36,7 @@ const copyScript = `
|
|
|
36
36
|
export const Surface: Story = {
|
|
37
37
|
render: () => ({
|
|
38
38
|
template: `
|
|
39
|
-
<div class="p-8 bg-white dark:bg-background
|
|
39
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
40
40
|
<style>
|
|
41
41
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
42
42
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -152,7 +152,7 @@ export const Surface: Story = {
|
|
|
152
152
|
export const Button: Story = {
|
|
153
153
|
render: () => ({
|
|
154
154
|
template: `
|
|
155
|
-
<div class="p-8 bg-white dark:bg-background
|
|
155
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
156
156
|
<style>
|
|
157
157
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
158
158
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -202,7 +202,7 @@ export const Button: Story = {
|
|
|
202
202
|
export const Input: Story = {
|
|
203
203
|
render: () => ({
|
|
204
204
|
template: `
|
|
205
|
-
<div class="p-8 bg-white dark:bg-background
|
|
205
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
206
206
|
<style>
|
|
207
207
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
208
208
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -237,7 +237,7 @@ export const Input: Story = {
|
|
|
237
237
|
export const Accent: Story = {
|
|
238
238
|
render: () => ({
|
|
239
239
|
template: `
|
|
240
|
-
<div class="p-8 bg-white dark:bg-background
|
|
240
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
241
241
|
<style>
|
|
242
242
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
243
243
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -280,7 +280,7 @@ export const Accent: Story = {
|
|
|
280
280
|
export const Status: Story = {
|
|
281
281
|
render: () => ({
|
|
282
282
|
template: `
|
|
283
|
-
<div class="p-8 bg-white dark:bg-background
|
|
283
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
284
284
|
<style>
|
|
285
285
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
286
286
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -36,7 +36,7 @@ const copyScript = `
|
|
|
36
36
|
export const Surface: Story = {
|
|
37
37
|
render: () => ({
|
|
38
38
|
template: `
|
|
39
|
-
<div class="p-8 bg-white dark:bg-background
|
|
39
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
40
40
|
<style>
|
|
41
41
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
42
42
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -79,7 +79,7 @@ export const Surface: Story = {
|
|
|
79
79
|
export const Input: Story = {
|
|
80
80
|
render: () => ({
|
|
81
81
|
template: `
|
|
82
|
-
<div class="p-8 bg-white dark:bg-background
|
|
82
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
83
83
|
<style>
|
|
84
84
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
85
85
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -129,7 +129,7 @@ export const Input: Story = {
|
|
|
129
129
|
export const Button: Story = {
|
|
130
130
|
render: () => ({
|
|
131
131
|
template: `
|
|
132
|
-
<div class="p-8 bg-white dark:bg-background
|
|
132
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
133
133
|
<style>
|
|
134
134
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
135
135
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -37,7 +37,7 @@ export const Extended1: Story = {
|
|
|
37
37
|
name: '1',
|
|
38
38
|
render: () => ({
|
|
39
39
|
template: `
|
|
40
|
-
<div class="p-8 bg-white dark:bg-background
|
|
40
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
41
41
|
<style>
|
|
42
42
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
43
43
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -71,7 +71,7 @@ export const Extended2: Story = {
|
|
|
71
71
|
name: '2',
|
|
72
72
|
render: () => ({
|
|
73
73
|
template: `
|
|
74
|
-
<div class="p-8 bg-white dark:bg-background
|
|
74
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
75
75
|
<style>
|
|
76
76
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
77
77
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -105,7 +105,7 @@ export const Extended3: Story = {
|
|
|
105
105
|
name: '3',
|
|
106
106
|
render: () => ({
|
|
107
107
|
template: `
|
|
108
|
-
<div class="p-8 bg-white dark:bg-background
|
|
108
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
109
109
|
<style>
|
|
110
110
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
111
111
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -139,7 +139,7 @@ export const Extended4: Story = {
|
|
|
139
139
|
name: '4',
|
|
140
140
|
render: () => ({
|
|
141
141
|
template: `
|
|
142
|
-
<div class="p-8 bg-white dark:bg-background
|
|
142
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
143
143
|
<style>
|
|
144
144
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
145
145
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -173,7 +173,7 @@ export const Extended5: Story = {
|
|
|
173
173
|
name: '5',
|
|
174
174
|
render: () => ({
|
|
175
175
|
template: `
|
|
176
|
-
<div class="p-8 bg-white dark:bg-background
|
|
176
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
177
177
|
<style>
|
|
178
178
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
179
179
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -207,7 +207,7 @@ export const AllExtended: Story = {
|
|
|
207
207
|
name: 'All',
|
|
208
208
|
render: () => ({
|
|
209
209
|
template: `
|
|
210
|
-
<div class="p-8 bg-white dark:bg-background
|
|
210
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
211
211
|
<style>
|
|
212
212
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
213
213
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -36,7 +36,7 @@ const copyScript = `
|
|
|
36
36
|
export const Direction: Story = {
|
|
37
37
|
render: () => ({
|
|
38
38
|
template: `
|
|
39
|
-
<div class="p-8 bg-white dark:bg-background
|
|
39
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
40
40
|
<style>
|
|
41
41
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
42
42
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -50,7 +50,7 @@ export const Direction: Story = {
|
|
|
50
50
|
<p class="body-14-regular text-content-on-surface-muted">Control the direction of flex items. Click class name to copy.</p>
|
|
51
51
|
</div>
|
|
52
52
|
|
|
53
|
-
<div class="
|
|
53
|
+
<div class="gap-y-8">
|
|
54
54
|
<div>
|
|
55
55
|
<code class="copy-btn label-12-regular text-content-on-surface-muted block mb-2 px-1 py-0.5 rounded w-fit" onclick="copyToClipboard('flex flex-row', this)">flex flex-row</code>
|
|
56
56
|
<div class="flex flex-row gap-2 p-4 bg-background-surface-muted rounded-md">
|
|
@@ -90,7 +90,7 @@ export const Direction: Story = {
|
|
|
90
90
|
export const JustifyContent: Story = {
|
|
91
91
|
render: () => ({
|
|
92
92
|
template: `
|
|
93
|
-
<div class="p-8 bg-white dark:bg-background
|
|
93
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
94
94
|
<style>
|
|
95
95
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
96
96
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -104,7 +104,7 @@ export const JustifyContent: Story = {
|
|
|
104
104
|
<p class="body-14-regular text-content-on-surface-muted">Control how items are distributed along the main axis. Click class name to copy.</p>
|
|
105
105
|
</div>
|
|
106
106
|
|
|
107
|
-
<div class="
|
|
107
|
+
<div class="gap-y-8">
|
|
108
108
|
<div>
|
|
109
109
|
<code class="copy-btn label-12-regular text-content-on-surface-muted block mb-2 px-1 py-0.5 rounded w-fit" onclick="copyToClipboard('flex justify-start', this)">flex justify-start</code>
|
|
110
110
|
<div class="flex justify-start gap-2 p-4 bg-background-surface-muted rounded-md">
|
|
@@ -153,7 +153,7 @@ export const JustifyContent: Story = {
|
|
|
153
153
|
export const AlignItems: Story = {
|
|
154
154
|
render: () => ({
|
|
155
155
|
template: `
|
|
156
|
-
<div class="p-8 bg-white dark:bg-background
|
|
156
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
157
157
|
<style>
|
|
158
158
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
159
159
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -167,7 +167,7 @@ export const AlignItems: Story = {
|
|
|
167
167
|
<p class="body-14-regular text-content-on-surface-muted">Control how items are aligned along the cross axis. Click class name to copy.</p>
|
|
168
168
|
</div>
|
|
169
169
|
|
|
170
|
-
<div class="
|
|
170
|
+
<div class="gap-y-8">
|
|
171
171
|
<div>
|
|
172
172
|
<code class="copy-btn label-12-regular text-content-on-surface-muted block mb-2 px-1 py-0.5 rounded w-fit" onclick="copyToClipboard('flex items-start', this)">flex items-start</code>
|
|
173
173
|
<div class="flex items-start gap-2 p-4 bg-background-surface-muted rounded-md h-32">
|
|
@@ -216,7 +216,7 @@ export const AlignItems: Story = {
|
|
|
216
216
|
export const Gap: Story = {
|
|
217
217
|
render: () => ({
|
|
218
218
|
template: `
|
|
219
|
-
<div class="p-8 bg-white dark:bg-background
|
|
219
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
220
220
|
<style>
|
|
221
221
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
222
222
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -230,7 +230,7 @@ export const Gap: Story = {
|
|
|
230
230
|
<p class="body-14-regular text-content-on-surface-muted">Control spacing between flex items. Click class name to copy.</p>
|
|
231
231
|
</div>
|
|
232
232
|
|
|
233
|
-
<div class="
|
|
233
|
+
<div class="gap-y-8">
|
|
234
234
|
<div>
|
|
235
235
|
<code class="copy-btn label-12-regular text-content-on-surface-muted block mb-2 px-1 py-0.5 rounded w-fit" onclick="copyToClipboard('flex gap-1', this)">flex gap-1</code>
|
|
236
236
|
<div class="flex gap-1 p-4 bg-background-surface-muted rounded-md">
|
|
@@ -270,7 +270,7 @@ export const Gap: Story = {
|
|
|
270
270
|
export const Wrap: Story = {
|
|
271
271
|
render: () => ({
|
|
272
272
|
template: `
|
|
273
|
-
<div class="p-8 bg-white dark:bg-background
|
|
273
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
274
274
|
<style>
|
|
275
275
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
276
276
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -284,7 +284,7 @@ export const Wrap: Story = {
|
|
|
284
284
|
<p class="body-14-regular text-content-on-surface-muted">Control how flex items wrap. Click class name to copy.</p>
|
|
285
285
|
</div>
|
|
286
286
|
|
|
287
|
-
<div class="
|
|
287
|
+
<div class="gap-y-8">
|
|
288
288
|
<div>
|
|
289
289
|
<code class="copy-btn label-12-regular text-content-on-surface-muted block mb-2 px-1 py-0.5 rounded w-fit" onclick="copyToClipboard('flex flex-nowrap', this)">flex flex-nowrap</code>
|
|
290
290
|
<div class="flex flex-nowrap gap-2 p-4 bg-background-surface-muted rounded-md overflow-x-auto max-w-md">
|
|
@@ -36,7 +36,7 @@ const copyScript = `
|
|
|
36
36
|
export const Columns: Story = {
|
|
37
37
|
render: () => ({
|
|
38
38
|
template: `
|
|
39
|
-
<div class="p-8 bg-white dark:bg-background
|
|
39
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
40
40
|
<style>
|
|
41
41
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
42
42
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -50,7 +50,7 @@ export const Columns: Story = {
|
|
|
50
50
|
<p class="body-14-regular text-content-on-surface-muted">Control the number of grid columns. Click class name to copy.</p>
|
|
51
51
|
</div>
|
|
52
52
|
|
|
53
|
-
<div class="
|
|
53
|
+
<div class="gap-y-8">
|
|
54
54
|
<div>
|
|
55
55
|
<code class="copy-btn label-12-regular text-content-on-surface-muted block mb-2 px-1 py-0.5 rounded w-fit" onclick="copyToClipboard('grid grid-cols-2', this)">grid grid-cols-2</code>
|
|
56
56
|
<div class="grid grid-cols-2 gap-2 p-4 bg-background-surface-muted rounded-md">
|
|
@@ -99,7 +99,7 @@ export const Columns: Story = {
|
|
|
99
99
|
export const ColumnSpan: Story = {
|
|
100
100
|
render: () => ({
|
|
101
101
|
template: `
|
|
102
|
-
<div class="p-8 bg-white dark:bg-background
|
|
102
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
103
103
|
<style>
|
|
104
104
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
105
105
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -113,7 +113,7 @@ export const ColumnSpan: Story = {
|
|
|
113
113
|
<p class="body-14-regular text-content-on-surface-muted">Make items span multiple columns. Click class name to copy.</p>
|
|
114
114
|
</div>
|
|
115
115
|
|
|
116
|
-
<div class="
|
|
116
|
+
<div class="gap-y-8">
|
|
117
117
|
<div>
|
|
118
118
|
<code class="copy-btn label-12-regular text-content-on-surface-muted block mb-2 px-1 py-0.5 rounded w-fit" onclick="copyToClipboard('col-span-2', this)">col-span-2</code>
|
|
119
119
|
<div class="grid grid-cols-4 gap-2 p-4 bg-background-surface-muted rounded-md">
|
|
@@ -149,7 +149,7 @@ export const ColumnSpan: Story = {
|
|
|
149
149
|
export const Gap: Story = {
|
|
150
150
|
render: () => ({
|
|
151
151
|
template: `
|
|
152
|
-
<div class="p-8 bg-white dark:bg-background
|
|
152
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
153
153
|
<style>
|
|
154
154
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
155
155
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -163,7 +163,7 @@ export const Gap: Story = {
|
|
|
163
163
|
<p class="body-14-regular text-content-on-surface-muted">Control spacing between grid items. Click class name to copy.</p>
|
|
164
164
|
</div>
|
|
165
165
|
|
|
166
|
-
<div class="
|
|
166
|
+
<div class="gap-y-8">
|
|
167
167
|
<div>
|
|
168
168
|
<code class="copy-btn label-12-regular text-content-on-surface-muted block mb-2 px-1 py-0.5 rounded w-fit" onclick="copyToClipboard('grid gap-1', this)">grid gap-1</code>
|
|
169
169
|
<div class="grid grid-cols-3 gap-1 p-4 bg-background-surface-muted rounded-md">
|
|
@@ -215,7 +215,7 @@ export const Gap: Story = {
|
|
|
215
215
|
export const AutoColumns: Story = {
|
|
216
216
|
render: () => ({
|
|
217
217
|
template: `
|
|
218
|
-
<div class="p-8 bg-white dark:bg-background
|
|
218
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
219
219
|
<style>
|
|
220
220
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
221
221
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -229,7 +229,7 @@ export const AutoColumns: Story = {
|
|
|
229
229
|
<p class="body-14-regular text-content-on-surface-muted">Create responsive grids with auto-fit. Click class name to copy.</p>
|
|
230
230
|
</div>
|
|
231
231
|
|
|
232
|
-
<div class="
|
|
232
|
+
<div class="gap-y-8">
|
|
233
233
|
<div>
|
|
234
234
|
<code class="copy-btn label-12-regular text-content-on-surface-muted block mb-2 px-1 py-0.5 rounded w-fit" onclick="copyToClipboard('grid grid-cols-[repeat(auto-fit,minmax(150px,1fr))]', this)">grid grid-cols-[repeat(auto-fit,minmax(150px,1fr))]</code>
|
|
235
235
|
<div class="grid grid-cols-[repeat(auto-fit,minmax(150px,1fr))] gap-4 p-4 bg-background-surface-muted rounded-md">
|
|
@@ -254,7 +254,7 @@ export const AutoColumns: Story = {
|
|
|
254
254
|
export const PlaceItems: Story = {
|
|
255
255
|
render: () => ({
|
|
256
256
|
template: `
|
|
257
|
-
<div class="p-8 bg-white dark:bg-background
|
|
257
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
258
258
|
<style>
|
|
259
259
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
260
260
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -268,7 +268,7 @@ export const PlaceItems: Story = {
|
|
|
268
268
|
<p class="body-14-regular text-content-on-surface-muted">Position all grid items at once. Click class name to copy.</p>
|
|
269
269
|
</div>
|
|
270
270
|
|
|
271
|
-
<div class="
|
|
271
|
+
<div class="gap-y-8">
|
|
272
272
|
<div>
|
|
273
273
|
<code class="copy-btn label-12-regular text-content-on-surface-muted block mb-2 px-1 py-0.5 rounded w-fit" onclick="copyToClipboard('grid place-items-center', this)">grid place-items-center</code>
|
|
274
274
|
<div class="grid grid-cols-3 place-items-center gap-4 p-4 bg-background-surface-muted rounded-md h-48">
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite';
|
|
2
|
+
import { defineComponent, h } from 'vue';
|
|
3
|
+
|
|
4
|
+
const ThemePlaceholder = defineComponent({
|
|
5
|
+
name: 'ThemePlaceholder',
|
|
6
|
+
render() {
|
|
7
|
+
return h('div');
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const meta: Meta<typeof ThemePlaceholder> = {
|
|
12
|
+
title: 'CSS utility/Hover Layer',
|
|
13
|
+
component: ThemePlaceholder,
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
parameters: {
|
|
16
|
+
layout: 'fullscreen',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj<typeof ThemePlaceholder>;
|
|
22
|
+
|
|
23
|
+
const copyScript = `
|
|
24
|
+
function copyToClipboard(text, el) {
|
|
25
|
+
navigator.clipboard.writeText(text).then(() => {
|
|
26
|
+
el.classList.add('copied');
|
|
27
|
+
setTimeout(() => el.classList.remove('copied'), 1500);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
const HOVER_VARIANTS = ['subtle', 'default', 'strong'] as const;
|
|
33
|
+
type HoverVariant = (typeof HOVER_VARIANTS)[number];
|
|
34
|
+
|
|
35
|
+
const EXAMPLES: Array<{
|
|
36
|
+
title: string;
|
|
37
|
+
description: string;
|
|
38
|
+
baseClass: string;
|
|
39
|
+
contentClass: string;
|
|
40
|
+
borderClass: string;
|
|
41
|
+
hoverClass?: string;
|
|
42
|
+
activeClass?: string;
|
|
43
|
+
}> = [
|
|
44
|
+
{
|
|
45
|
+
title: 'Background Surface',
|
|
46
|
+
description: 'Hover layer over a surface background.',
|
|
47
|
+
baseClass: 'bg-background-surface-primary',
|
|
48
|
+
contentClass: 'text-content-on-surface-primary',
|
|
49
|
+
borderClass: 'border-border-surface-default',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
title: 'Content On Button',
|
|
53
|
+
description: 'Hover layer behind button foreground content.',
|
|
54
|
+
baseClass: 'bg-background-button-primary-button',
|
|
55
|
+
contentClass: 'text-content-on-button-primary-button',
|
|
56
|
+
borderClass: 'border-transparent',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
title: 'Bordered Control',
|
|
60
|
+
description: 'Hover layer with an explicit border token.',
|
|
61
|
+
baseClass: 'bg-transparent',
|
|
62
|
+
contentClass: 'text-content-on-surface-primary',
|
|
63
|
+
borderClass: 'border-border-button-outlined',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
title: 'No Existing Background Color',
|
|
67
|
+
description:
|
|
68
|
+
'Use muted-subtle as the hover fill when the component has no background.',
|
|
69
|
+
baseClass: 'bg-transparent',
|
|
70
|
+
contentClass: 'text-content-on-surface-primary',
|
|
71
|
+
borderClass: 'border-border-button-outlined',
|
|
72
|
+
hoverClass: 'hover:bg-background-surface-muted-subtle',
|
|
73
|
+
activeClass: 'bg-background-surface-muted-subtle',
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
const renderCopyCode = (text: string): string => `
|
|
78
|
+
<code
|
|
79
|
+
class="copy-btn label-12-regular text-content-on-surface-muted inline-block px-1 py-0.5 rounded"
|
|
80
|
+
onclick="copyToClipboard('${text}', this)"
|
|
81
|
+
>${text}</code>
|
|
82
|
+
`;
|
|
83
|
+
|
|
84
|
+
const renderPreview = (
|
|
85
|
+
example: (typeof EXAMPLES)[number],
|
|
86
|
+
variant: HoverVariant,
|
|
87
|
+
): string => {
|
|
88
|
+
const hoverClass = `hover-layer hover-layer-${variant}`;
|
|
89
|
+
const className = `${example.baseClass} ${example.contentClass} ${example.borderClass} border ${hoverClass} hover-layer-active`;
|
|
90
|
+
return `
|
|
91
|
+
<td class="p-3 align-top">
|
|
92
|
+
<div class="flex flex-col gap-2">
|
|
93
|
+
<button
|
|
94
|
+
type="button"
|
|
95
|
+
class="${className} h-16 w-36 rounded-md px-3 body-14-medium"
|
|
96
|
+
>
|
|
97
|
+
<span>${variant}</span>
|
|
98
|
+
</button>
|
|
99
|
+
${renderCopyCode(`${example.baseClass} ${hoverClass}`)}
|
|
100
|
+
</div>
|
|
101
|
+
</td>
|
|
102
|
+
`;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const renderFixedHoverPreview = (
|
|
106
|
+
example: (typeof EXAMPLES)[number],
|
|
107
|
+
): string => {
|
|
108
|
+
const hoverClass = example.hoverClass ?? '';
|
|
109
|
+
const activeClass = example.activeClass ?? '';
|
|
110
|
+
const className = `${example.baseClass} ${example.contentClass} ${example.borderClass} border ${hoverClass} ${activeClass}`;
|
|
111
|
+
return `
|
|
112
|
+
<td class="p-3 align-top" colspan="${HOVER_VARIANTS.length}">
|
|
113
|
+
<div class="flex flex-col gap-2">
|
|
114
|
+
<button
|
|
115
|
+
type="button"
|
|
116
|
+
class="${className} h-16 w-36 rounded-md px-3 body-14-medium"
|
|
117
|
+
>
|
|
118
|
+
<span>hover</span>
|
|
119
|
+
</button>
|
|
120
|
+
${renderCopyCode(hoverClass)}
|
|
121
|
+
</div>
|
|
122
|
+
</td>
|
|
123
|
+
`;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const renderExampleRow = (example: (typeof EXAMPLES)[number]): string => `
|
|
127
|
+
<tr class="border-b border-border-surface-default last:border-b-0">
|
|
128
|
+
<td class="p-3 align-top">
|
|
129
|
+
<div class="body-14-medium text-content-on-surface-primary">${example.title}</div>
|
|
130
|
+
<p class="label-12-regular text-content-on-surface-muted mt-1">${example.description}</p>
|
|
131
|
+
</td>
|
|
132
|
+
${
|
|
133
|
+
example.hoverClass
|
|
134
|
+
? renderFixedHoverPreview(example)
|
|
135
|
+
: HOVER_VARIANTS.map((variant) => renderPreview(example, variant)).join(
|
|
136
|
+
'',
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
</tr>
|
|
140
|
+
`;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* General hover layer utilities. Combine a base surface/content/border class
|
|
144
|
+
* with `hover-layer hover-layer-{subtle|default|strong}`. The hover state is
|
|
145
|
+
* painted by a shared `::after` layer using the current overlay hover token.
|
|
146
|
+
*/
|
|
147
|
+
export const All: Story = {
|
|
148
|
+
render: () => ({
|
|
149
|
+
template: `
|
|
150
|
+
<div class="p-8 bg-white dark:bg-background min-h-screen">
|
|
151
|
+
<style>
|
|
152
|
+
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
153
|
+
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
154
|
+
.copy-btn.copied { background: #22c55e22; }
|
|
155
|
+
.copy-btn.copied::after { content: ' ✓'; color: #22c55e; }
|
|
156
|
+
</style>
|
|
157
|
+
<script>${copyScript}</script>
|
|
158
|
+
|
|
159
|
+
<div class="mb-6">
|
|
160
|
+
<h2 class="heading-s text-content-on-surface-primary mb-1">Hover Layer</h2>
|
|
161
|
+
<p class="body-14-regular text-content-on-surface-muted max-w-3xl">
|
|
162
|
+
Use <code class="label-12-medium">hover-layer</code> with
|
|
163
|
+
<code class="label-12-medium">hover-layer-subtle</code>,
|
|
164
|
+
<code class="label-12-medium">hover-layer-default</code>, or
|
|
165
|
+
<code class="label-12-medium">hover-layer-strong</code>.
|
|
166
|
+
The layer is rendered with <code class="label-12-medium">::after</code>
|
|
167
|
+
and uses <code class="label-12-medium">overlay-hover-*</code> tokens directly.
|
|
168
|
+
</p>
|
|
169
|
+
<div class="mt-4 max-w-3xl rounded-md border border-border-surface-default bg-background-surface-muted p-4">
|
|
170
|
+
<h3 class="body-14-bold text-content-on-surface-primary mb-2">Hover Anatomy</h3>
|
|
171
|
+
<div class="grid gap-3 md:grid-cols-2">
|
|
172
|
+
<div>
|
|
173
|
+
<p class="label-12-medium text-content-on-surface-primary mb-1">No existing background color</p>
|
|
174
|
+
<p class="label-12-regular text-content-on-surface-muted">
|
|
175
|
+
State: Hover<br />
|
|
176
|
+
Fill 1: <code class="label-12-medium">hover:bg-background-surface-muted-subtle</code>
|
|
177
|
+
</p>
|
|
178
|
+
</div>
|
|
179
|
+
<div>
|
|
180
|
+
<p class="label-12-medium text-content-on-surface-primary mb-1">Existing background color</p>
|
|
181
|
+
<p class="label-12-regular text-content-on-surface-muted">
|
|
182
|
+
State: Hover<br />
|
|
183
|
+
Fill 1: inherited from the component<br />
|
|
184
|
+
Fill 2: <code class="label-12-medium">hover-layer hover-layer-subtle</code>,
|
|
185
|
+
<code class="label-12-medium">hover-layer hover-layer-default</code>, or
|
|
186
|
+
<code class="label-12-medium">hover-layer hover-layer-strong</code>
|
|
187
|
+
</p>
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
<p class="label-12-regular text-content-on-surface-muted mt-3">
|
|
191
|
+
The design team defines hover strength at component level based on the underlying base color.
|
|
192
|
+
Always check which strength the component uses before changing it.
|
|
193
|
+
</p>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
|
|
197
|
+
<div class="overflow-x-auto">
|
|
198
|
+
<table class="w-full border-collapse text-left">
|
|
199
|
+
<thead>
|
|
200
|
+
<tr class="border-b border-border-surface-default">
|
|
201
|
+
<th class="p-3 label-12-medium text-content-on-surface-muted font-medium">Example</th>
|
|
202
|
+
<th class="p-3 label-12-medium text-content-on-surface-muted font-medium">Subtle</th>
|
|
203
|
+
<th class="p-3 label-12-medium text-content-on-surface-muted font-medium">Default</th>
|
|
204
|
+
<th class="p-3 label-12-medium text-content-on-surface-muted font-medium">Strong</th>
|
|
205
|
+
</tr>
|
|
206
|
+
</thead>
|
|
207
|
+
<tbody>
|
|
208
|
+
${EXAMPLES.map(renderExampleRow).join('')}
|
|
209
|
+
</tbody>
|
|
210
|
+
</table>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
`,
|
|
214
|
+
}),
|
|
215
|
+
};
|
|
@@ -36,7 +36,7 @@ const copyScript = `
|
|
|
36
36
|
export const Surface: Story = {
|
|
37
37
|
render: () => ({
|
|
38
38
|
template: `
|
|
39
|
-
<div class="p-8 bg-white dark:bg-background
|
|
39
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
40
40
|
<style>
|
|
41
41
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
42
42
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -79,7 +79,7 @@ export const Surface: Story = {
|
|
|
79
79
|
export const Hover: Story = {
|
|
80
80
|
render: () => ({
|
|
81
81
|
template: `
|
|
82
|
-
<div class="p-8 bg-white dark:bg-background
|
|
82
|
+
<div class="p-8 bg-white dark:bg-background">
|
|
83
83
|
<style>
|
|
84
84
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
85
85
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
@@ -36,7 +36,7 @@ const copyScript = `
|
|
|
36
36
|
export const DropShadow: Story = {
|
|
37
37
|
render: () => ({
|
|
38
38
|
template: `
|
|
39
|
-
<div class="p-8 bg-background-surface-secondary
|
|
39
|
+
<div class="p-8 bg-background-surface-secondary">
|
|
40
40
|
<style>
|
|
41
41
|
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
42
42
|
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|