@returnless/focus-ui 0.0.4 → 0.0.6
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/package.json +3 -2
- package/src/build-utils/generate-component-meta.ts +0 -80
- package/src/build-utils/update-component-list.js +0 -31
- package/src/build-utils/update-component-list.ts +0 -32
- package/src/components/Accordion/Accordion.vue +0 -20
- package/src/components/Accordion/AccordionContent.vue +0 -43
- package/src/components/Accordion/AccordionItem.vue +0 -21
- package/src/components/Accordion/AccordionTrigger.vue +0 -38
- package/src/components/Accordion/README.md +0 -56
- package/src/components/Accordion/index.ts +0 -4
- package/src/components/ActionList/ActionList.vue +0 -9
- package/src/components/ActionList/ActionListBody.vue +0 -11
- package/src/components/ActionList/ActionListItem.vue +0 -37
- package/src/components/ActionList/ActionListSection.vue +0 -7
- package/src/components/ActionList/ActionListTrigger.vue +0 -9
- package/src/components/ActionList/README.md +0 -113
- package/src/components/ActionList/index.ts +0 -5
- package/src/components/Alert/Alert.vue +0 -68
- package/src/components/Alert/AlertDescription.vue +0 -20
- package/src/components/Alert/AlertTitle.vue +0 -11
- package/src/components/Alert/DismissableAlertButton.vue +0 -36
- package/src/components/Alert/README.md +0 -150
- package/src/components/Alert/index.ts +0 -5
- package/src/components/Alert/types.ts +0 -1
- package/src/components/AlertDialog/AlertDialog.vue +0 -54
- package/src/components/AlertDialog/AlertDialogActionButton.vue +0 -16
- package/src/components/AlertDialog/AlertDialogCancelButton.vue +0 -15
- package/src/components/AlertDialog/AlertDialogContent.vue +0 -8
- package/src/components/AlertDialog/AlertDialogDescription.vue +0 -17
- package/src/components/AlertDialog/AlertDialogFooter.vue +0 -11
- package/src/components/AlertDialog/AlertDialogHeader.vue +0 -8
- package/src/components/AlertDialog/AlertDialogTitle.vue +0 -15
- package/src/components/AlertDialog/README.md +0 -84
- package/src/components/AlertDialog/index.ts +0 -8
- package/src/components/AspectRatio/AspectRatio.vue +0 -19
- package/src/components/AspectRatio/README.md +0 -36
- package/src/components/AspectRatio/index.ts +0 -1
- package/src/components/Avatar/Avatar.vue +0 -122
- package/src/components/Avatar/README.md +0 -116
- package/src/components/Avatar/index.ts +0 -1
- package/src/components/Badge/Badge.vue +0 -51
- package/src/components/Badge/BadgeContent.vue +0 -9
- package/src/components/Badge/BadgeIcon.vue +0 -7
- package/src/components/Badge/README.md +0 -131
- package/src/components/Badge/index.ts +0 -3
- package/src/components/BarChart/BarChart.vue +0 -80
- package/src/components/BarChart/BarChartContainer.vue +0 -7
- package/src/components/BarChart/BarChartStacked.vue +0 -93
- package/src/components/BarChart/README.md +0 -83
- package/src/components/BarChart/index.ts +0 -3
- package/src/components/Breadcrumbs/Breadcrumb.vue +0 -7
- package/src/components/Breadcrumbs/BreadcrumbEllipsis.vue +0 -12
- package/src/components/Breadcrumbs/BreadcrumbItem.vue +0 -8
- package/src/components/Breadcrumbs/BreadcrumbLink.vue +0 -13
- package/src/components/Breadcrumbs/BreadcrumbList.vue +0 -8
- package/src/components/Breadcrumbs/BreadcrumbPage.vue +0 -13
- package/src/components/Breadcrumbs/BreadcrumbSeparator.vue +0 -12
- package/src/components/Breadcrumbs/README.md +0 -91
- package/src/components/Breadcrumbs/index.ts +0 -7
- package/src/components/Button/Button.vue +0 -75
- package/src/components/Button/ButtonContent.vue +0 -7
- package/src/components/Button/ButtonIcon.vue +0 -32
- package/src/components/Button/README.md +0 -231
- package/src/components/Button/index.ts +0 -5
- package/src/components/Button/types.ts +0 -30
- package/src/components/ButtonGroup/ButtonGroup.vue +0 -7
- package/src/components/ButtonGroup/README.md +0 -42
- package/src/components/ButtonGroup/index.ts +0 -1
- package/src/components/Card/Card.vue +0 -7
- package/src/components/Card/CardDescription.vue +0 -11
- package/src/components/Card/CardFooter.vue +0 -7
- package/src/components/Card/CardHeader.vue +0 -7
- package/src/components/Card/CardHelp.vue +0 -23
- package/src/components/Card/CardSection.vue +0 -22
- package/src/components/Card/CardTitle.vue +0 -11
- package/src/components/Card/README.md +0 -156
- package/src/components/Card/index.ts +0 -7
- package/src/components/Checkbox/Checkbox.vue +0 -73
- package/src/components/Checkbox/README.md +0 -111
- package/src/components/Checkbox/index.ts +0 -1
- package/src/components/Collapsible/README.md +0 -25
- package/src/components/DataTable/README.md +0 -56
- package/src/components/DatePicker/DatePicker.vue +0 -120
- package/src/components/DatePicker/DatePickerCard.vue +0 -9
- package/src/components/DatePicker/README.md +0 -59
- package/src/components/DatePicker/index.ts +0 -2
- package/src/components/DescriptionList/DescriptionList.vue +0 -18
- package/src/components/DescriptionList/DescriptionListDescription.vue +0 -8
- package/src/components/DescriptionList/DescriptionListItem.vue +0 -21
- package/src/components/DescriptionList/DescriptionListTerm.vue +0 -11
- package/src/components/DescriptionList/README.md +0 -159
- package/src/components/DescriptionList/index.ts +0 -4
- package/src/components/Dialog/README.md +0 -2
- package/src/components/Dialog/index.ts +0 -0
- package/src/components/DropZone/DropZone.vue +0 -105
- package/src/components/DropZone/README.md +0 -48
- package/src/components/DropZone/index.ts +0 -1
- package/src/components/EmptyState/EmptyState.vue +0 -13
- package/src/components/EmptyState/EmptyStateActions.vue +0 -11
- package/src/components/EmptyState/EmptyStateContent.vue +0 -7
- package/src/components/EmptyState/EmptyStateDescription.vue +0 -11
- package/src/components/EmptyState/EmptyStateTitle.vue +0 -7
- package/src/components/EmptyState/README.md +0 -102
- package/src/components/EmptyState/index.ts +0 -5
- package/src/components/Feed/Feed.vue +0 -7
- package/src/components/Feed/FeedItem.vue +0 -19
- package/src/components/Feed/FeedItemBlock.vue +0 -11
- package/src/components/Feed/FeedItemDateIndicator.vue +0 -11
- package/src/components/Feed/FeedItemIcon.vue +0 -26
- package/src/components/Feed/FeedItemSimple.vue +0 -8
- package/src/components/Feed/README.md +0 -115
- package/src/components/Feed/index.ts +0 -6
- package/src/components/FileUploadButton/FileUploadButton.vue +0 -62
- package/src/components/FileUploadButton/index.ts +0 -1
- package/src/components/Form/Form.vue +0 -35
- package/src/components/Form/README.md +0 -52
- package/src/components/Form/index.ts +0 -1
- package/src/components/FormLayout/FormLayout.vue +0 -25
- package/src/components/FormLayout/README.md +0 -97
- package/src/components/FormLayout/index.ts +0 -1
- package/src/components/Heading/Heading.vue +0 -32
- package/src/components/Heading/index.ts +0 -3
- package/src/components/Heading/types.ts +0 -3
- package/src/components/Image/Image.vue +0 -30
- package/src/components/Image/index.ts +0 -1
- package/src/components/InertiaLink/InertiaLink.vue +0 -11
- package/src/components/InertiaLink/index.ts +0 -1
- package/src/components/InlineError/InlineError.vue +0 -21
- package/src/components/InlineError/README.md +0 -63
- package/src/components/InlineError/index.ts +0 -1
- package/src/components/InputLabel/InputLabel.vue +0 -32
- package/src/components/InputLabel/index.ts +0 -1
- package/src/components/KPICard/KPICard.vue +0 -28
- package/src/components/KPICard/KPICardSection.vue +0 -30
- package/src/components/KPICard/README.md +0 -124
- package/src/components/KPICard/index.ts +0 -2
- package/src/components/Legend/Legend.vue +0 -7
- package/src/components/Legend/LegendItem.vue +0 -34
- package/src/components/Legend/README.md +0 -32
- package/src/components/Legend/index.ts +0 -2
- package/src/components/Link/Link.vue +0 -38
- package/src/components/Link/README.md +0 -119
- package/src/components/Link/index.ts +0 -1
- package/src/components/Navigation/Navigation.vue +0 -8
- package/src/components/Navigation/NavigationItem.vue +0 -47
- package/src/components/Navigation/NavigationSecondarySection.vue +0 -12
- package/src/components/Navigation/NavigationSection.vue +0 -27
- package/src/components/Navigation/README.md +0 -83
- package/src/components/Navigation/index.ts +0 -4
- package/src/components/Page/Page.vue +0 -7
- package/src/components/Page/PageBody.vue +0 -36
- package/src/components/Page/PageDescription.vue +0 -11
- package/src/components/Page/PageHeader.vue +0 -34
- package/src/components/Page/PageTitle.vue +0 -12
- package/src/components/Page/README.md +0 -226
- package/src/components/Page/index.ts +0 -5
- package/src/components/Pagination/Pagination.vue +0 -8
- package/src/components/Pagination/PaginationNextButton.vue +0 -10
- package/src/components/Pagination/PaginationPreviousButton.vue +0 -10
- package/src/components/Pagination/README.md +0 -45
- package/src/components/Pagination/index.ts +0 -3
- package/src/components/PinInput/PinInput.vue +0 -169
- package/src/components/PinInput/README.md +0 -35
- package/src/components/PinInput/index.ts +0 -1
- package/src/components/Popover/Popover.vue +0 -18
- package/src/components/Popover/PopoverBody.vue +0 -11
- package/src/components/Popover/PopoverTrigger.vue +0 -9
- package/src/components/Popover/README.md +0 -79
- package/src/components/Popover/index.ts +0 -3
- package/src/components/Popper/Popper.vue +0 -91
- package/src/components/Popper/PopperBody.vue +0 -19
- package/src/components/Popper/PopperTrigger.vue +0 -14
- package/src/components/Popper/README.md +0 -42
- package/src/components/Popper/index.ts +0 -3
- package/src/components/ProgressBar/ProgressBar.vue +0 -51
- package/src/components/ProgressBar/ProgressBarIndicator.vue +0 -7
- package/src/components/ProgressBar/README.md +0 -98
- package/src/components/ProgressBar/index.ts +0 -2
- package/src/components/RadioButton/README.md +0 -111
- package/src/components/RadioButton/RadioButton.vue +0 -49
- package/src/components/RadioButton/index.ts +0 -1
- package/src/components/ResourceList/README.md +0 -160
- package/src/components/ResourceList/ResourceList.vue +0 -7
- package/src/components/ResourceList/ResourceListItem.vue +0 -7
- package/src/components/ResourceList/ResourceListItemContent.vue +0 -7
- package/src/components/ResourceList/index.ts +0 -3
- package/src/components/Select/README.md +0 -74
- package/src/components/Select/Select.vue +0 -91
- package/src/components/Select/SelectGroup.vue +0 -12
- package/src/components/Select/SelectOption.vue +0 -12
- package/src/components/Select/index.ts +0 -3
- package/src/components/Separator/README.md +0 -39
- package/src/components/Separator/Separator.vue +0 -24
- package/src/components/Separator/index.ts +0 -1
- package/src/components/Spinner/README.md +0 -53
- package/src/components/Spinner/Spinner.vue +0 -64
- package/src/components/Spinner/index.ts +0 -1
- package/src/components/StatusIndicator/README.md +0 -51
- package/src/components/StatusIndicator/StatusIndicator.vue +0 -44
- package/src/components/StatusIndicator/index.ts +0 -1
- package/src/components/Stepper/README.md +0 -38
- package/src/components/Stepper/Stepper.vue +0 -104
- package/src/components/Stepper/index.ts +0 -1
- package/src/components/Tabs/README.md +0 -53
- package/src/components/Tabs/TabTrigger.vue +0 -44
- package/src/components/Tabs/Tabs.vue +0 -16
- package/src/components/Tabs/index.ts +0 -2
- package/src/components/Tag/README.md +0 -27
- package/src/components/Tag/Tag.vue +0 -45
- package/src/components/Tag/index.ts +0 -1
- package/src/components/TextField/README.md +0 -335
- package/src/components/TextField/TextField.vue +0 -135
- package/src/components/TextField/TextFieldIcon.vue +0 -19
- package/src/components/TextField/TextFieldPasswordIcon.vue +0 -28
- package/src/components/TextField/TextFieldSearchIcon.vue +0 -11
- package/src/components/TextField/index.ts +0 -1
- package/src/components/TextStyle/README.md +0 -39
- package/src/components/TextStyle/TextStyle.vue +0 -24
- package/src/components/TextStyle/index.ts +0 -1
- package/src/components/Toast/DismissToastAction.vue +0 -34
- package/src/components/Toast/README.md +0 -167
- package/src/components/Toast/Toast.vue +0 -39
- package/src/components/Toast/ToastGroup.vue +0 -9
- package/src/components/Toast/index.ts +0 -2
- package/src/components/Toggle/README.md +0 -66
- package/src/components/Toggle/Toggle.vue +0 -89
- package/src/components/Toggle/index.ts +0 -1
- package/src/components/Tooltip/README.md +0 -51
- package/src/components/Tooltip/Tooltip.vue +0 -24
- package/src/components/Tooltip/index.ts +0 -1
- package/src/components/TopBar/README.md +0 -43
- package/src/components/TopBar/TopBar.vue +0 -7
- package/src/components/TopBar/TopBarLogo.vue +0 -8
- package/src/components/TopBar/TopBarNavigation.vue +0 -7
- package/src/components/TopBar/TopBarNavigationItem.vue +0 -13
- package/src/components/TopBar/TopBarSearch.vue +0 -15
- package/src/components/TopBar/TopBarUserMenu.vue +0 -20
- package/src/components/TopBar/index.ts +0 -6
- package/src/components/VisuallyHidden/README.md +0 -19
- package/src/components/VisuallyHidden/VisuallyHidden.vue +0 -25
- package/src/components/VisuallyHidden/index.ts +0 -1
- package/src/components/index.ts +0 -197
- package/src/components/types.ts +0 -5
- package/src/composables/index.ts +0 -7
- package/src/composables/useTailwindColor.ts +0 -17
- package/src/composables/useTheme.ts +0 -41
- package/src/composables/useToastNotifications.ts +0 -55
- package/src/composables/useUniqueId.ts +0 -6
- package/src/index.css +0 -24
- package/src/index.ts +0 -1
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
3
|
-
Breadcrumb,
|
|
4
|
-
BreadcrumbEllipsis,
|
|
5
|
-
BreadcrumbItem,
|
|
6
|
-
BreadcrumbLink,
|
|
7
|
-
BreadcrumbList,
|
|
8
|
-
BreadcrumbPage,
|
|
9
|
-
BreadcrumbSeparator,
|
|
10
|
-
} from '../../src/components';
|
|
11
|
-
import api from '../component-meta/Breadcrumb.json';
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
# Breadcrumbs
|
|
15
|
-
|
|
16
|
-
Breadcrumbs are a secondary navigation aid that helps users understand where they are in the application and how to
|
|
17
|
-
navigate back to a previous page.
|
|
18
|
-
|
|
19
|
-
<ComponentApi :api="api" />
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
<ComponentWrapper>
|
|
24
|
-
<Breadcrumb>
|
|
25
|
-
<BreadcrumbList>
|
|
26
|
-
<BreadcrumbItem>
|
|
27
|
-
<BreadcrumbLink href="/">
|
|
28
|
-
Home
|
|
29
|
-
</BreadcrumbLink>
|
|
30
|
-
</BreadcrumbItem>
|
|
31
|
-
<BreadcrumbSeparator />
|
|
32
|
-
<BreadcrumbItem>
|
|
33
|
-
<BreadcrumbEllipsis />
|
|
34
|
-
</BreadcrumbItem>
|
|
35
|
-
<BreadcrumbSeparator />
|
|
36
|
-
<BreadcrumbItem>
|
|
37
|
-
<BreadcrumbLink href="/">
|
|
38
|
-
Components
|
|
39
|
-
</BreadcrumbLink>
|
|
40
|
-
</BreadcrumbItem>
|
|
41
|
-
<BreadcrumbSeparator />
|
|
42
|
-
<BreadcrumbItem>
|
|
43
|
-
<BreadcrumbPage>
|
|
44
|
-
Breadcrumb
|
|
45
|
-
</BreadcrumbPage>
|
|
46
|
-
</BreadcrumbItem>
|
|
47
|
-
</BreadcrumbList>
|
|
48
|
-
</Breadcrumb>
|
|
49
|
-
</ComponentWrapper>
|
|
50
|
-
|
|
51
|
-
```js-vue
|
|
52
|
-
<script lang="ts" setup>
|
|
53
|
-
import {
|
|
54
|
-
Breadcrumb,
|
|
55
|
-
BreadcrumbEllipsis,
|
|
56
|
-
BreadcrumbItem,
|
|
57
|
-
BreadcrumbLink,
|
|
58
|
-
BreadcrumbList,
|
|
59
|
-
BreadcrumbPage,
|
|
60
|
-
BreadcrumbSeparator,
|
|
61
|
-
} from '@returnless/focus-ui';
|
|
62
|
-
</script>
|
|
63
|
-
|
|
64
|
-
<template>
|
|
65
|
-
<Breadcrumb>
|
|
66
|
-
<BreadcrumbList>
|
|
67
|
-
<BreadcrumbItem>
|
|
68
|
-
<BreadcrumbLink href="/">
|
|
69
|
-
Home
|
|
70
|
-
</BreadcrumbLink>
|
|
71
|
-
</BreadcrumbItem>
|
|
72
|
-
<BreadcrumbSeparator />
|
|
73
|
-
<BreadcrumbItem>
|
|
74
|
-
<BreadcrumbEllipsis />
|
|
75
|
-
</BreadcrumbItem>
|
|
76
|
-
<BreadcrumbSeparator />
|
|
77
|
-
<BreadcrumbItem>
|
|
78
|
-
<BreadcrumbLink href="/">
|
|
79
|
-
Components
|
|
80
|
-
</BreadcrumbLink>
|
|
81
|
-
</BreadcrumbItem>
|
|
82
|
-
<BreadcrumbSeparator />
|
|
83
|
-
<BreadcrumbItem>
|
|
84
|
-
<BreadcrumbPage>
|
|
85
|
-
Breadcrumb
|
|
86
|
-
</BreadcrumbPage>
|
|
87
|
-
</BreadcrumbItem>
|
|
88
|
-
</BreadcrumbList>
|
|
89
|
-
</Breadcrumb>
|
|
90
|
-
</template>
|
|
91
|
-
```
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { default as Breadcrumb } from './Breadcrumb.vue';
|
|
2
|
-
export { default as BreadcrumbEllipsis } from './BreadcrumbEllipsis.vue';
|
|
3
|
-
export { default as BreadcrumbItem } from './BreadcrumbItem.vue';
|
|
4
|
-
export { default as BreadcrumbLink } from './BreadcrumbLink.vue';
|
|
5
|
-
export { default as BreadcrumbList } from './BreadcrumbList.vue';
|
|
6
|
-
export { default as BreadcrumbPage } from './BreadcrumbPage.vue';
|
|
7
|
-
export { default as BreadcrumbSeparator } from './BreadcrumbSeparator.vue';
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
import { Spinner } from '../';
|
|
4
|
-
import { useTheme, useUniqueId } from '../../composables';
|
|
5
|
-
import { ChevronDownIcon } from '@heroicons/vue/16/solid';
|
|
6
|
-
import { ButtonProps } from './types';
|
|
7
|
-
|
|
8
|
-
const props = withDefaults(defineProps<ButtonProps>(), {
|
|
9
|
-
disabled: false,
|
|
10
|
-
disclosure: false,
|
|
11
|
-
external: false,
|
|
12
|
-
fullWidth: false,
|
|
13
|
-
href: null,
|
|
14
|
-
loading: false,
|
|
15
|
-
size: 'normal',
|
|
16
|
-
type: 'button',
|
|
17
|
-
variant: 'primary',
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const buttonLabelId = useUniqueId('buttonLabel');
|
|
21
|
-
|
|
22
|
-
const classList = computed((): (Record<string, boolean> | string)[] => {
|
|
23
|
-
return [
|
|
24
|
-
{ 'bg-brand-500 hover:bg-brand-600 text-white': props.variant === 'primary' },
|
|
25
|
-
{ 'bg-slate-200 hover:bg-slate-300': props.variant === 'secondary' },
|
|
26
|
-
{ 'bg-red-500/20 hover:bg-red-500/30 text-red-600': props.variant === 'destructive' },
|
|
27
|
-
{ 'hover:bg-slate-200': props.variant === 'ghost' },
|
|
28
|
-
|
|
29
|
-
{ 'px-4 py-3': props.size === 'normal' },
|
|
30
|
-
{ 'px-3 py-2': props.size === 'small' },
|
|
31
|
-
|
|
32
|
-
{ 'opacity-50 cursor-not-allowed': props.disabled },
|
|
33
|
-
{ 'pointer-events-none opacity-75 justify-center': props.loading },
|
|
34
|
-
|
|
35
|
-
{ 'w-full': props.fullWidth },
|
|
36
|
-
|
|
37
|
-
...useTheme('focus', props.variant === 'destructive' ? 'destructive' : 'default'),
|
|
38
|
-
];
|
|
39
|
-
});
|
|
40
|
-
</script>
|
|
41
|
-
|
|
42
|
-
<template>
|
|
43
|
-
<span>
|
|
44
|
-
<button
|
|
45
|
-
:aria-busy="loading"
|
|
46
|
-
:aria-disabled="disabled || loading"
|
|
47
|
-
:aria-labelledby="buttonLabelId"
|
|
48
|
-
:class="classList"
|
|
49
|
-
:disabled="disabled || loading"
|
|
50
|
-
:type="type"
|
|
51
|
-
class="inline-flex items-center rounded text-sm font-medium leading-none active:opacity-80 active:shadow-inner"
|
|
52
|
-
role="button"
|
|
53
|
-
>
|
|
54
|
-
<span
|
|
55
|
-
:id="buttonLabelId"
|
|
56
|
-
:class="{ 'invisible': loading }"
|
|
57
|
-
class="inline-flex items-center justify-center space-x-4"
|
|
58
|
-
>
|
|
59
|
-
<slot />
|
|
60
|
-
|
|
61
|
-
<span
|
|
62
|
-
v-if="disclosure"
|
|
63
|
-
class="ml-2"
|
|
64
|
-
>
|
|
65
|
-
<ChevronDownIcon class="h-4 w-4" />
|
|
66
|
-
</span>
|
|
67
|
-
</span>
|
|
68
|
-
|
|
69
|
-
<Spinner
|
|
70
|
-
v-if="loading"
|
|
71
|
-
class="absolute"
|
|
72
|
-
/>
|
|
73
|
-
</button>
|
|
74
|
-
</span>
|
|
75
|
-
</template>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { Image } from '../Image';
|
|
3
|
-
|
|
4
|
-
withDefaults(defineProps<{
|
|
5
|
-
/** The alt text for the icon */
|
|
6
|
-
alt?: string | undefined;
|
|
7
|
-
|
|
8
|
-
/** The name of the icon to display */
|
|
9
|
-
name?: (() => void) | null;
|
|
10
|
-
|
|
11
|
-
/** The source of the icon to display */
|
|
12
|
-
source?: string | null;
|
|
13
|
-
}>(), {
|
|
14
|
-
alt: undefined,
|
|
15
|
-
name: null,
|
|
16
|
-
source: null,
|
|
17
|
-
});
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<template>
|
|
21
|
-
<div class="flex-shrink-0 h-4 w-4 -mt-0.5 -mb-0.5">
|
|
22
|
-
<component
|
|
23
|
-
:is="name"
|
|
24
|
-
v-if="name"
|
|
25
|
-
/>
|
|
26
|
-
<Image
|
|
27
|
-
v-if="source"
|
|
28
|
-
:alt="alt!"
|
|
29
|
-
:source="source"
|
|
30
|
-
/>
|
|
31
|
-
</div>
|
|
32
|
-
</template>
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { Button, ButtonIcon, ButtonContent } from '../../src/components';
|
|
3
|
-
import api from '../component-meta/Button.json';
|
|
4
|
-
import { ArrowDownTrayIcon } from '@heroicons/vue/16/solid';
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
# Button
|
|
8
|
-
|
|
9
|
-
Buttons are used primarily for actions, such as “Add”, “Close”, “Cancel”, or “Save”. Plain buttons, which look similar
|
|
10
|
-
to links, are used for less important or less commonly used actions, such as “view shipping settings”.
|
|
11
|
-
|
|
12
|
-
<ComponentApi :api="api" />
|
|
13
|
-
|
|
14
|
-
## Variants
|
|
15
|
-
|
|
16
|
-
### Primary
|
|
17
|
-
|
|
18
|
-
Use to highlight the most important actions in any experience. Don’t use more than one primary button in a section or
|
|
19
|
-
screen to avoid overwhelming users.
|
|
20
|
-
|
|
21
|
-
<ComponentWrapper>
|
|
22
|
-
<Button variant="primary">Primary</Button>
|
|
23
|
-
</ComponentWrapper>
|
|
24
|
-
|
|
25
|
-
```js-vue
|
|
26
|
-
<script lang="ts" setup>
|
|
27
|
-
import { Button } from '@returnless/focus-ui';
|
|
28
|
-
</script>
|
|
29
|
-
|
|
30
|
-
<template>
|
|
31
|
-
<Button variant="primary">Primary</Button>
|
|
32
|
-
</template>
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Secondary
|
|
36
|
-
|
|
37
|
-
Used most in the interface. Only use another style if a button requires more or less visual weight.
|
|
38
|
-
|
|
39
|
-
<ComponentWrapper>
|
|
40
|
-
<Button variant="secondary">Secondary</Button>
|
|
41
|
-
</ComponentWrapper>
|
|
42
|
-
|
|
43
|
-
```js-vue
|
|
44
|
-
<script lang="ts" setup>
|
|
45
|
-
import { Button } from '@returnless/focus-ui';
|
|
46
|
-
</script>
|
|
47
|
-
|
|
48
|
-
<template>
|
|
49
|
-
<Button variant="secondary">Primary</Button>
|
|
50
|
-
</template>
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### Destructive
|
|
54
|
-
|
|
55
|
-
Used when the action will delete user data or be otherwise difficult to recover from. Destructive buttons should
|
|
56
|
-
trigger a confirmation dialog before the action is completed. Be thoughtful about using destructive buttons because
|
|
57
|
-
they can feel stressful for users.
|
|
58
|
-
|
|
59
|
-
<ComponentWrapper>
|
|
60
|
-
<Button variant="destructive">Destructive</Button>
|
|
61
|
-
</ComponentWrapper>
|
|
62
|
-
|
|
63
|
-
```js-vue
|
|
64
|
-
<script lang="ts" setup>
|
|
65
|
-
import { Button } from '@returnless/focus-ui';
|
|
66
|
-
</script>
|
|
67
|
-
|
|
68
|
-
<template>
|
|
69
|
-
<Button variant="destructive">Destructive</Button>
|
|
70
|
-
</template>
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Ghost
|
|
74
|
-
|
|
75
|
-
Used for less important or less commonly used actions. Ghost buttons are less prominent than other button styles,
|
|
76
|
-
|
|
77
|
-
<ComponentWrapper>
|
|
78
|
-
<Button variant="ghost">Ghost</Button>
|
|
79
|
-
</ComponentWrapper>
|
|
80
|
-
|
|
81
|
-
```js-vue
|
|
82
|
-
<script lang="ts" setup>
|
|
83
|
-
import { Button } from '@returnless/focus-ui';
|
|
84
|
-
</script>
|
|
85
|
-
|
|
86
|
-
<template>
|
|
87
|
-
<Button variant="ghost">Ghost</Button>
|
|
88
|
-
</template>
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Loading
|
|
92
|
-
|
|
93
|
-
Use when a button has been pressed and the associated action is in progress.
|
|
94
|
-
|
|
95
|
-
<ComponentWrapper>
|
|
96
|
-
<Button variant="secondary" loading>
|
|
97
|
-
Loading button
|
|
98
|
-
</Button>
|
|
99
|
-
</ComponentWrapper>
|
|
100
|
-
|
|
101
|
-
```js-vue
|
|
102
|
-
<script lang="ts" setup>
|
|
103
|
-
import { Button } from '@returnless/focus-ui';
|
|
104
|
-
</script>
|
|
105
|
-
|
|
106
|
-
<template>
|
|
107
|
-
<Button variant="secondary" loading>
|
|
108
|
-
Loading button
|
|
109
|
-
</Button>
|
|
110
|
-
</template>
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
### Button with icon
|
|
114
|
-
|
|
115
|
-
Use when a button needs to be paired with an icon to help convey its purpose.
|
|
116
|
-
|
|
117
|
-
<ComponentWrapper>
|
|
118
|
-
<ComponentGrid>
|
|
119
|
-
<Button variant="primary">
|
|
120
|
-
<ButtonIcon :name="ArrowDownTrayIcon" />
|
|
121
|
-
<ButtonContent>Button with icon on the left</ButtonContent>
|
|
122
|
-
</Button>
|
|
123
|
-
<Button variant="primary">
|
|
124
|
-
<ButtonContent>Button with icon on the right</ButtonContent>
|
|
125
|
-
<ButtonIcon :name="ArrowDownTrayIcon" />
|
|
126
|
-
</Button>
|
|
127
|
-
</ComponentGrid>
|
|
128
|
-
</ComponentWrapper>
|
|
129
|
-
|
|
130
|
-
### Button with image
|
|
131
|
-
|
|
132
|
-
Use when a button needs to be paired with an image to help convey its purpose.
|
|
133
|
-
|
|
134
|
-
<ComponentWrapper>
|
|
135
|
-
<ComponentGrid>
|
|
136
|
-
<Button variant="secondary">
|
|
137
|
-
<ButtonIcon source="https://panel.returnless.test/img/integrations/demo-logo.svg" />
|
|
138
|
-
<ButtonContent>Create coupon</ButtonContent>
|
|
139
|
-
</Button>
|
|
140
|
-
<Button variant="secondary">
|
|
141
|
-
<ButtonContent>Button with icon on the right</ButtonContent>
|
|
142
|
-
<ButtonIcon source="https://panel.returnless.test/img/integrations/demo-logo.svg" />
|
|
143
|
-
</Button>
|
|
144
|
-
</ComponentGrid>
|
|
145
|
-
</ComponentWrapper>
|
|
146
|
-
|
|
147
|
-
## Best practices
|
|
148
|
-
|
|
149
|
-
Buttons should:
|
|
150
|
-
|
|
151
|
-
- Be clearly and accurately labeled.
|
|
152
|
-
- Lead with a strong, actionable verb.
|
|
153
|
-
- Use established button colors appropriately. For example, only use a red button for an action that's difficult or
|
|
154
|
-
impossible to undo.
|
|
155
|
-
- Prioritize the most important actions. Too many calls to action can cause confusion and make users unsure of what
|
|
156
|
-
to do next.
|
|
157
|
-
- Be positioned in consistent locations in the interface.
|
|
158
|
-
|
|
159
|
-
### Buttons versus links
|
|
160
|
-
|
|
161
|
-
Buttons are used primarily for actions, such as "Add", "Close", "Cancel", or "Save". Plain buttons, which look
|
|
162
|
-
similar to links, are used for less important or less commonly used actions, such as "view shipping settings".
|
|
163
|
-
|
|
164
|
-
Links are used primarily for navigation, and usually appear within or directly following a sentence.
|
|
165
|
-
|
|
166
|
-
The HTML that renders for the `Button` and `Link` components carriers meaning. Using these components intentionally
|
|
167
|
-
and consistently results in:
|
|
168
|
-
|
|
169
|
-
- A more inclusive experience for assistive technology users.
|
|
170
|
-
- A more cohesive visual experience for sighted users.
|
|
171
|
-
- Products that are easier to maintain at scale.
|
|
172
|
-
|
|
173
|
-
## Content guidelines
|
|
174
|
-
|
|
175
|
-
Buttons need to be clear and predictable. Users should be able to anticipate what will happen when they select a
|
|
176
|
-
button. Never mislead someone by mislabeling a button.
|
|
177
|
-
|
|
178
|
-
Buttons should always lead with a strong verb that encourages action. To provide enough context to users, use the
|
|
179
|
-
{verb} + {noun} content formula on buttons except in the case of common actions like "Done", "Close", "Cancel", or "OK".
|
|
180
|
-
|
|
181
|
-
Always write button text in sentence case, which means the first word is capitalized and the rest are lowercase
|
|
182
|
-
(unless a term is a proper noun).
|
|
183
|
-
|
|
184
|
-
Avoid unnecessary words and articles such as "the", "an", or "a" to keep button text short and actionable.
|
|
185
|
-
|
|
186
|
-
## Accessibility
|
|
187
|
-
|
|
188
|
-
Buttons can have different states that are visually and programmatically conveyed to users.
|
|
189
|
-
|
|
190
|
-
- Use the `ariaControls` prop to add an `aria-controls` attribute to the button. Use the attribute to point to the
|
|
191
|
-
unique `id` of the content that the button manages.
|
|
192
|
-
- If a button expands or collapses adjacent content, then use the `ariaExpanded` prop to add the `aria-expanded`
|
|
193
|
-
attribute to the button. Set the value to convey the current expanded (`true`) or collapsed (`false`) state of the
|
|
194
|
-
content.
|
|
195
|
-
- Use the `disabled` prop to set the `disabled` state of the button. This prevents users from being able to interact
|
|
196
|
-
with the button, and conveys its inactive state to assistive technologies.
|
|
197
|
-
- Use the `pressed` prop to add an `aria-pressed` attribute to the button.
|
|
198
|
-
|
|
199
|
-
### Navigation
|
|
200
|
-
|
|
201
|
-
Users generally expect buttons to submit data or take action, and for links to navigate. If navigation is required
|
|
202
|
-
for the button component, use the `href` prop. The control will output an anchor styled as a button, instead of a
|
|
203
|
-
button in HTML, to help convey this difference.
|
|
204
|
-
|
|
205
|
-
### Labeling
|
|
206
|
-
|
|
207
|
-
THe `accessibilityLabel` prop adds an `aria-label` attribute to the button, which can be accessed by assistive
|
|
208
|
-
technologies like screen readers. Typically, this label text replaces the visible text on the button for users who
|
|
209
|
-
use assistive technologies.
|
|
210
|
-
|
|
211
|
-
Use `accessibilityLabel` for a button if:
|
|
212
|
-
|
|
213
|
-
- The button's visible text does not adequately convey the purpose of the button to non-visual users.
|
|
214
|
-
- The button has no text and relies on an icon alone to convey its purpose.
|
|
215
|
-
|
|
216
|
-
To help support users who use speech activation software as well as sighted screen reader users, make sure that the
|
|
217
|
-
`aria-label` text includes any button text that's visible. Mismatches between visible and programmatic labeling can
|
|
218
|
-
cause confusion, and might prevent voice recognition commands from working.
|
|
219
|
-
|
|
220
|
-
When possible, give the button visible text that clearly conveys its purpose without the user of
|
|
221
|
-
`accessibilityLabel`. When no additional content is needed, duplication the button text with `accessibilityLabel`
|
|
222
|
-
isn't necessary.
|
|
223
|
-
|
|
224
|
-
### External links
|
|
225
|
-
|
|
226
|
-
When you use the button component to create a link to an external resource:
|
|
227
|
-
|
|
228
|
-
- Use the `external` prop to make the link open in a new tab (or window, depending on the user's browser settings).
|
|
229
|
-
- Use the `icon` prop to add the `external` icon to the button.
|
|
230
|
-
- Use the `accessibilityLabel` prop to include the warning about opening a new tab in the button text for non-visual
|
|
231
|
-
screen reader users.
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export type ButtonVariant = 'primary' | 'secondary' | 'destructive' | 'ghost';
|
|
2
|
-
|
|
3
|
-
export interface ButtonProps {
|
|
4
|
-
/** Whether the button is disabled. */
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
|
|
7
|
-
/** Displays the button with a disclosure icon. Defaults to `down` when set to true. */
|
|
8
|
-
disclosure?: boolean;
|
|
9
|
-
|
|
10
|
-
/** Whether the button should open the link in a new tab. */
|
|
11
|
-
external?: boolean;
|
|
12
|
-
|
|
13
|
-
/** Whether the button should span the full width of its parent. (INTERNAL USE ONLY) */
|
|
14
|
-
fullWidth?: boolean;
|
|
15
|
-
|
|
16
|
-
/** The URL the button should navigate to. */
|
|
17
|
-
href?: string | null;
|
|
18
|
-
|
|
19
|
-
/** Whether the button is in a loading state. */
|
|
20
|
-
loading?: boolean;
|
|
21
|
-
|
|
22
|
-
/** The button size. (INTERNAL USE ONLY) */
|
|
23
|
-
size?: 'small' | 'normal';
|
|
24
|
-
|
|
25
|
-
/** The type of the button. */
|
|
26
|
-
type?: 'button' | 'reset' | 'submit';
|
|
27
|
-
|
|
28
|
-
/** The variant of the button. */
|
|
29
|
-
variant?: ButtonVariant;
|
|
30
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { Button, ButtonGroup } from '../../src/components';
|
|
3
|
-
import api from '../component-meta/ButtonGroup.json';
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
# Button Group
|
|
7
|
-
|
|
8
|
-
Button group displays multiple related actions stacked or in a horizontal row to help with arrangement and spacing.
|
|
9
|
-
|
|
10
|
-
<ComponentApi :api="api" />
|
|
11
|
-
|
|
12
|
-
## Usage
|
|
13
|
-
|
|
14
|
-
<ComponentWrapper>
|
|
15
|
-
<ButtonGroup>
|
|
16
|
-
<Button variant="secondary">Cancel</Button>
|
|
17
|
-
<Button variant="primary">Save</Button>
|
|
18
|
-
</ButtonGroup>
|
|
19
|
-
</ComponentWrapper>
|
|
20
|
-
|
|
21
|
-
```js-vue
|
|
22
|
-
<script lang="ts" setup>
|
|
23
|
-
import { Button, ButtonGroup } from '@returnless/focus-ui';
|
|
24
|
-
</script>
|
|
25
|
-
|
|
26
|
-
<template>
|
|
27
|
-
<ButtonGroup>
|
|
28
|
-
<Button variant="secondary">Cancel</Button>
|
|
29
|
-
<Button variant="primary">Save</Button>
|
|
30
|
-
</ButtonGroup>
|
|
31
|
-
</template>
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Best practices
|
|
35
|
-
|
|
36
|
-
Button groups should:
|
|
37
|
-
|
|
38
|
-
- Only use buttons that follow the best practices outlined in the button component.
|
|
39
|
-
- Group together calls to action that have a relationship.
|
|
40
|
-
- Be used with consideration that too many calls to action can cause users to be unsure of what to do next.
|
|
41
|
-
- Be thoughtful about how multiple buttons will look and work on small screens.
|
|
42
|
-
- Only be used in groups of up to six buttons if the buttons contain an icon with no text.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as ButtonGroup } from './ButtonGroup.vue';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { Link } from '@inertiajs/vue3';
|
|
3
|
-
import { InformationCircleIcon } from '@heroicons/vue/16/solid';
|
|
4
|
-
|
|
5
|
-
defineProps<{
|
|
6
|
-
href: string;
|
|
7
|
-
}>();
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<template>
|
|
11
|
-
<Link
|
|
12
|
-
:href="href"
|
|
13
|
-
class="ml-2 flex items-center rounded-full border border-transparent px-1 py-1 pr-2 text-xs font-normal leading-none text-slate-500 group hover:border-slate-300 hover:bg-slate-100"
|
|
14
|
-
native
|
|
15
|
-
target="_blank"
|
|
16
|
-
v-bind="$attrs"
|
|
17
|
-
>
|
|
18
|
-
<InformationCircleIcon class="h-4 w-4 group-hover:text-brand-500" />
|
|
19
|
-
<span class="ml-1 hidden text-black group-hover:block">
|
|
20
|
-
<slot />
|
|
21
|
-
</span>
|
|
22
|
-
</Link>
|
|
23
|
-
</template>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
|
|
4
|
-
const props = withDefaults(defineProps<{
|
|
5
|
-
flush?: boolean;
|
|
6
|
-
}>(), {
|
|
7
|
-
flush: false,
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
const classList = computed((): Record<string, boolean> => {
|
|
11
|
-
return {
|
|
12
|
-
'py-6': props.flush,
|
|
13
|
-
'p-6': !props.flush,
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<template>
|
|
19
|
-
<div :class="classList">
|
|
20
|
-
<slot />
|
|
21
|
-
</div>
|
|
22
|
-
</template>
|