@aleph-alpha/ui-library 2.0.0 → 2.2.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/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.js +20658 -19240
- 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 +10 -0
- 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/__tests__/UiToggle.test.ts +9 -0
- package/src/components/UiToggleGroup/__tests__/UiToggleGroup.test.ts +18 -0
- package/src/components/UiTooltip/UiTooltip.stories.ts +7 -7
- 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 +1 -1
- 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/patterns/UiDataTable/UiDataTable.stories.ts +15 -15
- package/src/patterns/UiDataTable/UiDataTableColumnHeader.vue +1 -1
- package/src/patterns/UiDataTable/UiDataTablePagination.vue +3 -3
- package/src/patterns/UiDataTable/UiDataTableToolbar.vue +1 -1
- package/src/patterns/UiDataTable/__tests__/UiDataTable.test.ts +14 -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/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,171 +0,0 @@
|
|
|
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/Content Hover',
|
|
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 HOVER_VARIANTS = ['subtle', 'default', 'strong'] as const;
|
|
24
|
-
type HoverVariant = (typeof HOVER_VARIANTS)[number];
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Given a base text utility class (e.g. `text-content-on-surface-primary`),
|
|
28
|
-
* return the utility class that renders the text color for a given hover
|
|
29
|
-
* variant. Classes are generated by `hover-mix.js` + `config.js` and backed by
|
|
30
|
-
* the CSS variable `--<token>-hover-<variant>`.
|
|
31
|
-
* @param textClass
|
|
32
|
-
* @param variant
|
|
33
|
-
*/
|
|
34
|
-
const getHoverMixClass = (textClass: string, variant: HoverVariant): string =>
|
|
35
|
-
`${textClass}-hover-${variant}`;
|
|
36
|
-
|
|
37
|
-
/** Content/text tokens to preview, mirroring the `Content` story layout. */
|
|
38
|
-
const CONTENT_GROUPS: Array<{
|
|
39
|
-
title: string;
|
|
40
|
-
description: string;
|
|
41
|
-
tokens: string[];
|
|
42
|
-
}> = [
|
|
43
|
-
{
|
|
44
|
-
title: 'On Surface',
|
|
45
|
-
description:
|
|
46
|
-
'Text colors on surface backgrounds composited with the three hover tiers.',
|
|
47
|
-
tokens: [
|
|
48
|
-
'text-content-on-surface-primary',
|
|
49
|
-
'text-content-on-surface-secondary',
|
|
50
|
-
'text-content-on-surface-muted',
|
|
51
|
-
'text-content-on-surface-inverse',
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
title: 'On Button',
|
|
56
|
-
description:
|
|
57
|
-
'Text colors used inside buttons, composited with the three hover tiers.',
|
|
58
|
-
tokens: [
|
|
59
|
-
'text-content-on-button-primary-button',
|
|
60
|
-
'text-content-on-button-secondary-button',
|
|
61
|
-
'text-content-on-button-danger-button',
|
|
62
|
-
],
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
title: 'On Accent',
|
|
66
|
-
description: 'Text colors paired with accent backgrounds.',
|
|
67
|
-
tokens: ['text-content-on-accent-default', 'text-content-on-accent-soft'],
|
|
68
|
-
},
|
|
69
|
-
];
|
|
70
|
-
|
|
71
|
-
const copyScript = `
|
|
72
|
-
function copyToClipboard(text, el) {
|
|
73
|
-
navigator.clipboard.writeText(text).then(() => {
|
|
74
|
-
el.classList.add('copied');
|
|
75
|
-
setTimeout(() => el.classList.remove('copied'), 1500);
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
`;
|
|
79
|
-
|
|
80
|
-
const renderSample = (className: string): string => `
|
|
81
|
-
<span class="body-14-medium ${className}">Aa</span>
|
|
82
|
-
`;
|
|
83
|
-
|
|
84
|
-
const renderCopyCode = (text: string): string => `
|
|
85
|
-
<code
|
|
86
|
-
class="copy-btn label-12-regular text-content-on-surface-muted inline-block px-1 py-0.5 rounded"
|
|
87
|
-
onclick="copyToClipboard('${text}', this)"
|
|
88
|
-
>${text}</code>
|
|
89
|
-
`;
|
|
90
|
-
|
|
91
|
-
const renderTokenRow = (textClass: string): string => {
|
|
92
|
-
const variantCells = HOVER_VARIANTS.map((variant) => {
|
|
93
|
-
const mixedClass = getHoverMixClass(textClass, variant);
|
|
94
|
-
return `
|
|
95
|
-
<td class="p-3 align-middle">
|
|
96
|
-
<div class="flex items-center gap-3">
|
|
97
|
-
${renderSample(mixedClass)}
|
|
98
|
-
${renderCopyCode(mixedClass)}
|
|
99
|
-
</div>
|
|
100
|
-
</td>
|
|
101
|
-
`;
|
|
102
|
-
}).join('');
|
|
103
|
-
|
|
104
|
-
return `
|
|
105
|
-
<tr class="border-b border-border-surface-default last:border-b-0">
|
|
106
|
-
<td class="p-3 align-middle">${renderSample(textClass)}</td>
|
|
107
|
-
<td class="p-3 align-middle">${renderCopyCode(textClass)}</td>
|
|
108
|
-
${variantCells}
|
|
109
|
-
</tr>
|
|
110
|
-
`;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
const renderGroup = (group: (typeof CONTENT_GROUPS)[number]): string => `
|
|
114
|
-
<div class="mb-10">
|
|
115
|
-
<h3 class="body-14-bold text-content-on-surface-primary mb-1">${group.title}</h3>
|
|
116
|
-
<p class="label-12-regular text-content-on-surface-muted mb-3">${group.description}</p>
|
|
117
|
-
<div class="overflow-x-auto">
|
|
118
|
-
<table class="w-full border-collapse text-left">
|
|
119
|
-
<thead>
|
|
120
|
-
<tr class="border-b border-border-surface-default">
|
|
121
|
-
<th class="p-3 label-12-medium text-content-on-surface-muted font-medium w-20">Base</th>
|
|
122
|
-
<th class="p-3 label-12-medium text-content-on-surface-muted font-medium">Token</th>
|
|
123
|
-
<th class="p-3 label-12-medium text-content-on-surface-muted font-medium">Subtle</th>
|
|
124
|
-
<th class="p-3 label-12-medium text-content-on-surface-muted font-medium">Default</th>
|
|
125
|
-
<th class="p-3 label-12-medium text-content-on-surface-muted font-medium">Strong</th>
|
|
126
|
-
</tr>
|
|
127
|
-
</thead>
|
|
128
|
-
<tbody>
|
|
129
|
-
${group.tokens.map(renderTokenRow).join('')}
|
|
130
|
-
</tbody>
|
|
131
|
-
</table>
|
|
132
|
-
</div>
|
|
133
|
-
</div>
|
|
134
|
-
`;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Preview of every content (text) token composited with each hover overlay
|
|
138
|
-
* tier (`subtle`, `default`, `strong`). Classes are produced by the same
|
|
139
|
-
* hover-mix utility that backs the background variants, and are the
|
|
140
|
-
* recommended replacement for the deprecated `v-hover` directive on text.
|
|
141
|
-
*/
|
|
142
|
-
export const All: Story = {
|
|
143
|
-
render: () => ({
|
|
144
|
-
template: `
|
|
145
|
-
<div class="p-8 bg-white dark:bg-background min-h-screen">
|
|
146
|
-
<style>
|
|
147
|
-
.copy-btn { cursor: pointer; transition: all 0.15s; }
|
|
148
|
-
.copy-btn:hover { background: rgba(0,0,0,0.05); }
|
|
149
|
-
.copy-btn.copied { background: #22c55e22; }
|
|
150
|
-
.copy-btn.copied::after { content: ' ✓'; color: #22c55e; }
|
|
151
|
-
</style>
|
|
152
|
-
<script>${copyScript}</script>
|
|
153
|
-
|
|
154
|
-
<div class="mb-6">
|
|
155
|
-
<h2 class="heading-s text-content-on-surface-primary mb-1">Content Hover</h2>
|
|
156
|
-
<p class="body-14-regular text-content-on-surface-muted">
|
|
157
|
-
For each content/text token, the three samples show the flat color produced by the
|
|
158
|
-
hover-mix formula combining the base with
|
|
159
|
-
<code class="label-12-medium">overlay-hover-subtle</code>,
|
|
160
|
-
<code class="label-12-medium">overlay-hover-default</code> and
|
|
161
|
-
<code class="label-12-medium">overlay-hover-strong</code>.
|
|
162
|
-
Class names take the form <code class="label-12-medium">text-<token>-hover-<variant></code>.
|
|
163
|
-
Click a label to copy.
|
|
164
|
-
</p>
|
|
165
|
-
</div>
|
|
166
|
-
|
|
167
|
-
${CONTENT_GROUPS.map(renderGroup).join('')}
|
|
168
|
-
</div>
|
|
169
|
-
`,
|
|
170
|
-
}),
|
|
171
|
-
};
|