@returnless/focus-ui 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Button/Button.vue.d.ts +4 -1
- package/dist/components/Button/types.d.ts +2 -0
- package/dist/components/Link/Link.vue.d.ts +1 -1
- package/dist/components/Tag/Tag.vue.d.ts +6 -2
- package/dist/focus-ui.js +1779 -1769
- package/dist/focus-ui.umd.cjs +21 -21
- package/package.json +2 -3
- 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
- package/src/vite-env.d.ts +0 -1
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { CardSection } from '../Card';
|
|
3
|
-
import { Heading } from '../Heading';
|
|
4
|
-
import { TextStyle } from '../TextStyle';
|
|
5
|
-
|
|
6
|
-
defineProps<{
|
|
7
|
-
title: string;
|
|
8
|
-
value: string;
|
|
9
|
-
}>();
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<template>
|
|
13
|
-
<CardSection>
|
|
14
|
-
<div class="space-y-0.5">
|
|
15
|
-
<TextStyle variant="subdued">
|
|
16
|
-
{{ title }}
|
|
17
|
-
</TextStyle>
|
|
18
|
-
<Heading size="2xl">
|
|
19
|
-
{{ value }}
|
|
20
|
-
</Heading>
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
<div
|
|
24
|
-
v-if="!!$slots.default"
|
|
25
|
-
class="mt-6"
|
|
26
|
-
>
|
|
27
|
-
<slot />
|
|
28
|
-
</div>
|
|
29
|
-
</CardSection>
|
|
30
|
-
</template>
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { Badge, BadgeContent, BadgeIcon, KPICard, KPICardSection } from '../../src/components';
|
|
3
|
-
import api from '../component-meta/KPICard.json';
|
|
4
|
-
import { ArrowTrendingUpIcon, ArrowTrendingDownIcon } from '@heroicons/vue/16/solid';
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
# KPI Card
|
|
8
|
-
|
|
9
|
-
KPI Card is a component that displays a key performance indicator in a card format. It is used to display a single
|
|
10
|
-
metric or a set of metrics that are important to the user.
|
|
11
|
-
|
|
12
|
-
## Usage
|
|
13
|
-
|
|
14
|
-
<ComponentWrapper>
|
|
15
|
-
<KPICard>
|
|
16
|
-
<KPICardSection title="Total returns today" value="952">
|
|
17
|
-
<Badge color="green">
|
|
18
|
-
<BadgeContent>+ 25%</BadgeContent>
|
|
19
|
-
<BadgeIcon>
|
|
20
|
-
<ArrowTrendingUpIcon />
|
|
21
|
-
</BadgeIcon>
|
|
22
|
-
</Badge>
|
|
23
|
-
</KPICardSection>
|
|
24
|
-
<KPICardSection title="Total returns last 30 days" value="10,483">
|
|
25
|
-
<Badge color="red">
|
|
26
|
-
<BadgeIcon>
|
|
27
|
-
<ArrowTrendingDownIcon />
|
|
28
|
-
</BadgeIcon>
|
|
29
|
-
<BadgeContent>- 25%</BadgeContent>
|
|
30
|
-
</Badge>
|
|
31
|
-
</KPICardSection>
|
|
32
|
-
</KPICard>
|
|
33
|
-
</ComponentWrapper>
|
|
34
|
-
|
|
35
|
-
```js-vue
|
|
36
|
-
<script lang="ts" setup>
|
|
37
|
-
import {
|
|
38
|
-
Badge,
|
|
39
|
-
BadgeContent,
|
|
40
|
-
BadgeIcon,
|
|
41
|
-
KPICard,
|
|
42
|
-
KPICardSection,
|
|
43
|
-
} from '@returnless/focus-ui';
|
|
44
|
-
import { ArrowTrendingUpIcon, ArrowTrendingDownIcon } from '@heroicons/vue/16/solid';
|
|
45
|
-
</script>
|
|
46
|
-
|
|
47
|
-
<template>
|
|
48
|
-
<KPICard>
|
|
49
|
-
<KPICardSection title="Total returns today" value="952">
|
|
50
|
-
<Badge color="green">
|
|
51
|
-
<BadgeContent>+ 25%</BadgeContent>
|
|
52
|
-
<BadgeIcon>
|
|
53
|
-
<ArrowTrendingUpIcon />
|
|
54
|
-
</BadgeIcon>
|
|
55
|
-
</Badge>
|
|
56
|
-
</KPICardSection>
|
|
57
|
-
<KPICardSection title="Total returns last 30 days" value="10,483">
|
|
58
|
-
<Badge color="red">
|
|
59
|
-
<BadgeIcon>
|
|
60
|
-
<ArrowTrendingDownIcon />
|
|
61
|
-
</BadgeIcon>
|
|
62
|
-
<BadgeContent>- 25%</BadgeContent>
|
|
63
|
-
</Badge>
|
|
64
|
-
</KPICardSection>
|
|
65
|
-
</KPICard>
|
|
66
|
-
</template>
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Vertical KPI Card
|
|
70
|
-
|
|
71
|
-
<ComponentWrapper>
|
|
72
|
-
<KPICard orientation="vertical">
|
|
73
|
-
<KPICardSection title="Total returns today" value="952">
|
|
74
|
-
<Badge color="green">
|
|
75
|
-
<BadgeContent>+ 25%</BadgeContent>
|
|
76
|
-
<BadgeIcon>
|
|
77
|
-
<ArrowTrendingUpIcon />
|
|
78
|
-
</BadgeIcon>
|
|
79
|
-
</Badge>
|
|
80
|
-
</KPICardSection>
|
|
81
|
-
<KPICardSection title="Total returns last 30 days" value="10,483">
|
|
82
|
-
<Badge color="red">
|
|
83
|
-
<BadgeIcon>
|
|
84
|
-
<ArrowTrendingDownIcon />
|
|
85
|
-
</BadgeIcon>
|
|
86
|
-
<BadgeContent>- 25%</BadgeContent>
|
|
87
|
-
</Badge>
|
|
88
|
-
</KPICardSection>
|
|
89
|
-
</KPICard>
|
|
90
|
-
</ComponentWrapper>
|
|
91
|
-
|
|
92
|
-
```js-vue
|
|
93
|
-
<script lang="ts" setup>
|
|
94
|
-
import {
|
|
95
|
-
Badge,
|
|
96
|
-
BadgeContent,
|
|
97
|
-
BadgeIcon,
|
|
98
|
-
KPICard,
|
|
99
|
-
KPICardSection,
|
|
100
|
-
} from '@returnless/focus-ui';
|
|
101
|
-
import { ArrowTrendingUpIcon, ArrowTrendingDownIcon } from '@heroicons/vue/16/solid';
|
|
102
|
-
</script>
|
|
103
|
-
|
|
104
|
-
<template>
|
|
105
|
-
<KPICard orientation="vertical">
|
|
106
|
-
<KPICardSection title="Total returns today" value="952">
|
|
107
|
-
<Badge color="green">
|
|
108
|
-
<BadgeContent>+ 25%</BadgeContent>
|
|
109
|
-
<BadgeIcon>
|
|
110
|
-
<ArrowTrendingUpIcon />
|
|
111
|
-
</BadgeIcon>
|
|
112
|
-
</Badge>
|
|
113
|
-
</KPICardSection>
|
|
114
|
-
<KPICardSection title="Total returns last 30 days" value="10,483">
|
|
115
|
-
<Badge color="red">
|
|
116
|
-
<BadgeIcon>
|
|
117
|
-
<ArrowTrendingDownIcon />
|
|
118
|
-
</BadgeIcon>
|
|
119
|
-
<BadgeContent>- 25%</BadgeContent>
|
|
120
|
-
</Badge>
|
|
121
|
-
</KPICardSection>
|
|
122
|
-
</KPICard>
|
|
123
|
-
</template>
|
|
124
|
-
```
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { TailwindColor, useTailwindColor, useTheme, useUniqueId } from '../../composables';
|
|
3
|
-
import { TextStyle } from '../TextStyle';
|
|
4
|
-
|
|
5
|
-
const props = defineProps<{
|
|
6
|
-
color: TailwindColor;
|
|
7
|
-
}>();
|
|
8
|
-
|
|
9
|
-
const legendItemId = useUniqueId('legendItem');
|
|
10
|
-
|
|
11
|
-
const colorValue = useTailwindColor(props.color, '500');
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<template>
|
|
15
|
-
<li :aria-labelledby="legendItemId">
|
|
16
|
-
<button
|
|
17
|
-
:class="useTheme('focus')"
|
|
18
|
-
class="flex items-center rounded border border-transparent px-2 space-x-2 py-0.5 hover:bg-slate-100"
|
|
19
|
-
role="button"
|
|
20
|
-
>
|
|
21
|
-
<span
|
|
22
|
-
class="h-2 w-2 rounded-full flex-shrink-0"
|
|
23
|
-
:style="{ backgroundColor: colorValue }"
|
|
24
|
-
/>
|
|
25
|
-
<TextStyle
|
|
26
|
-
:id="legendItemId"
|
|
27
|
-
variant="strong"
|
|
28
|
-
class="whitespace-nowrap"
|
|
29
|
-
>
|
|
30
|
-
<slot />
|
|
31
|
-
</TextStyle>
|
|
32
|
-
</button>
|
|
33
|
-
</li>
|
|
34
|
-
</template>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { Legend, LegendItem } from '../../src/components';
|
|
3
|
-
import api from '../component-meta/Legend.json';
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
# Legend
|
|
7
|
-
|
|
8
|
-
The `Legend` component is used to display a legend for a chart.
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
<ComponentWrapper>
|
|
13
|
-
<Legend>
|
|
14
|
-
<LegendItem color="green">Category 1</LegendItem>
|
|
15
|
-
<LegendItem color="blue">Category 2</LegendItem>
|
|
16
|
-
<LegendItem color="red">Category 3</LegendItem>
|
|
17
|
-
</Legend>
|
|
18
|
-
</ComponentWrapper>
|
|
19
|
-
|
|
20
|
-
```js-vue
|
|
21
|
-
<script lang="ts" setup>
|
|
22
|
-
import { Legend, LegendItem } from '@returnless/focus-ui';
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<template>
|
|
26
|
-
<Legend>
|
|
27
|
-
<LegendItem color="green">Category 1</LegendItem>
|
|
28
|
-
<LegendItem color="blue">Category 2</LegendItem>
|
|
29
|
-
<LegendItem color="red">Category 3</LegendItem>
|
|
30
|
-
</Legend>
|
|
31
|
-
</template>
|
|
32
|
-
```
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
import { InertiaLink } from '../InertiaLink';
|
|
4
|
-
|
|
5
|
-
const props = withDefaults(defineProps<{
|
|
6
|
-
/** The aria-label attribute to be applied to the link */
|
|
7
|
-
accessibilityLabel?: string | null;
|
|
8
|
-
|
|
9
|
-
/** The href attribute to be applied to the link */
|
|
10
|
-
href: string;
|
|
11
|
-
|
|
12
|
-
/** Whether the link should be rendered as a native anchor element */
|
|
13
|
-
native?: boolean;
|
|
14
|
-
}>(), {
|
|
15
|
-
accessibilityLabel: null,
|
|
16
|
-
native: false,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
const componentType = computed(() => {
|
|
20
|
-
return props.native ? 'a' : InertiaLink;
|
|
21
|
-
});
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<template>
|
|
25
|
-
<component
|
|
26
|
-
:is="componentType"
|
|
27
|
-
:aria-label="accessibilityLabel"
|
|
28
|
-
:class="[
|
|
29
|
-
'text-brand-500',
|
|
30
|
-
'cursor-pointer',
|
|
31
|
-
'hover:underline'
|
|
32
|
-
]"
|
|
33
|
-
:href="href"
|
|
34
|
-
v-bind="$attrs"
|
|
35
|
-
>
|
|
36
|
-
<slot />
|
|
37
|
-
</component>
|
|
38
|
-
</template>
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { Link } from '../../src/components';
|
|
3
|
-
import api from '../component-meta/Link.json';
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
# Link
|
|
7
|
-
|
|
8
|
-
Links take users to another place, and usually appear within or directly following a sentence.
|
|
9
|
-
|
|
10
|
-
<ComponentApi :api="api" />
|
|
11
|
-
|
|
12
|
-
## Usage
|
|
13
|
-
|
|
14
|
-
Use for text links inside a paragraph or for standalone text. Default links open in the same browser tab.
|
|
15
|
-
|
|
16
|
-
<ComponentWrapper>
|
|
17
|
-
<Link href="my-page">A link</Link>
|
|
18
|
-
</ComponentWrapper>
|
|
19
|
-
|
|
20
|
-
```js-vue
|
|
21
|
-
<script lang="ts" setup>
|
|
22
|
-
import { Link } from '@returnless/focus-ui';
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<template>
|
|
26
|
-
<Link href="my-page">A link</Link>
|
|
27
|
-
</template>
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Best practices
|
|
31
|
-
|
|
32
|
-
### Buttons versus links
|
|
33
|
-
|
|
34
|
-
Links are used primarily for navigation, and usually appear within or directly following a sentence.
|
|
35
|
-
|
|
36
|
-
Buttons are used primarily for actions, such as "Add", "Close", "Cancel", or "Save". The HTML that renders for
|
|
37
|
-
the `Button` and `Link` components carriers meaning. Using these components intentionally and consistently results in:
|
|
38
|
-
|
|
39
|
-
- A more inclusive experience for assistive technology users.
|
|
40
|
-
- A more cohesive visual experience for sighted users.
|
|
41
|
-
- Products that are easier to maintain at scale.
|
|
42
|
-
|
|
43
|
-
### Open a new tap only when necessary
|
|
44
|
-
|
|
45
|
-
Use default links whenever possible to avoid disorienting users and causing accessibility problems by opening a new tab.
|
|
46
|
-
|
|
47
|
-
External links should be used when users are:
|
|
48
|
-
|
|
49
|
-
- Performing a task or workflow, link creating a product.
|
|
50
|
-
- Navigating to a page outside the application.
|
|
51
|
-
|
|
52
|
-
### No icon
|
|
53
|
-
|
|
54
|
-
Avoid using the `external icon`, as it can add unnecessary visual load inside a sentence or when accompanied by
|
|
55
|
-
other content. Instead, add clarity to external links through clear link text and predictable placement of the link
|
|
56
|
-
in a user's workflow.
|
|
57
|
-
|
|
58
|
-
Edge cases: External icons should not be used to indicate a new tab or window is being opened. However, they may be
|
|
59
|
-
used sparingly in features where symbols help users scan and pick from a list of several kinds of navigation options.
|
|
60
|
-
|
|
61
|
-
## Content guidelines
|
|
62
|
-
|
|
63
|
-
Links need to be clear and predictable. Users should be able to anticipate what will happen when they select a link.
|
|
64
|
-
Never mislead someone by mislabeling a link.
|
|
65
|
-
|
|
66
|
-
Links should never use "click here" or "here" as link text.
|
|
67
|
-
|
|
68
|
-
### Links in sentences
|
|
69
|
-
|
|
70
|
-
Links in full sentences shouldn't link the entire sentence, only the text that describes where users go when they
|
|
71
|
-
select a link.
|
|
72
|
-
|
|
73
|
-
It's better for internationalization to have only single terms or small parts of phrases linked. Linking a full
|
|
74
|
-
phrase is problematic because the word order might change, which would break the link into two parts.
|
|
75
|
-
|
|
76
|
-
### Links outside of sentences
|
|
77
|
-
|
|
78
|
-
Links that aren't in full sentences should use the {verb + noun} pattern and not be punctuated, except question marks.
|
|
79
|
-
|
|
80
|
-
### "Learn more" links
|
|
81
|
-
|
|
82
|
-
When linking out to documentation from help text in the admin, link the relevant keywords. In general, don't add
|
|
83
|
-
another sentence starting with "Learn more...", because it's repetitive and takes up unnecessary space.
|
|
84
|
-
|
|
85
|
-
Only add a "Learn more..." sentence if the help text addresses more than one concept, each of which could be linked
|
|
86
|
-
to their own help doc. In that situation, pick the most appropriate link and contextualize it with "Learn more...".
|
|
87
|
-
|
|
88
|
-
## Accessibility
|
|
89
|
-
|
|
90
|
-
Use the `href` prop to give the link component a valid `href` value. This allows the element to be identified as a
|
|
91
|
-
link to assistive technologies and gives it default keyboard support.
|
|
92
|
-
|
|
93
|
-
The Link component is underlined to give interactive elements a shape. This allows links to not rely on color from
|
|
94
|
-
being the only way users can tell if an element is interactive.
|
|
95
|
-
|
|
96
|
-
### Submitting data
|
|
97
|
-
|
|
98
|
-
Users generally expect links to navigate, and not to submit data or take action. If you need a component that
|
|
99
|
-
doesn't have a URL associated with it, then use the `button component` instead.
|
|
100
|
-
|
|
101
|
-
### Labeling
|
|
102
|
-
|
|
103
|
-
Give text links text that clearly describes their purpose.
|
|
104
|
-
|
|
105
|
-
The `accessibilityLabel` prop adds an `aria-label` attribute to the link, which can be accessed by assistive
|
|
106
|
-
technologies like screen readers. Typically, this label text replaces the visual text on the link for users who use
|
|
107
|
-
assistive technology.
|
|
108
|
-
|
|
109
|
-
To provide consistence and clarity:
|
|
110
|
-
|
|
111
|
-
- Use the same text for links that navigate to the same content.
|
|
112
|
-
- Use different text for links that navigate to different content.
|
|
113
|
-
|
|
114
|
-
### Keyboard support
|
|
115
|
-
|
|
116
|
-
Links use browser defaults for keyboard interaction.
|
|
117
|
-
|
|
118
|
-
- Give links keyboard focus with the tab key (or shift + tab when tabbing backwards).
|
|
119
|
-
- Activate links with the enter/return key.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Link } from './Link.vue';
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
import { InertiaLink } from '../InertiaLink';
|
|
4
|
-
|
|
5
|
-
const props = withDefaults(defineProps<{
|
|
6
|
-
/** Whether the navigation item is active. */
|
|
7
|
-
active?: boolean;
|
|
8
|
-
|
|
9
|
-
/** The URL to navigate to. */
|
|
10
|
-
href: string;
|
|
11
|
-
|
|
12
|
-
/** The icon to display to the left of the navigation item. */
|
|
13
|
-
icon?: (() => void) | null;
|
|
14
|
-
}>(), {
|
|
15
|
-
active: false,
|
|
16
|
-
icon: null,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
const classList = computed((): Record<string, boolean>[] => {
|
|
20
|
-
return [
|
|
21
|
-
{ 'relative bg-slate-200': props.active },
|
|
22
|
-
{ 'text-slate-500 hover:bg-slate-100': !props.active },
|
|
23
|
-
];
|
|
24
|
-
});
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<template>
|
|
28
|
-
<div class="block">
|
|
29
|
-
<InertiaLink :href="href">
|
|
30
|
-
<div
|
|
31
|
-
class="flex items-center rounded px-3 py-2 space-x-3"
|
|
32
|
-
:class="classList"
|
|
33
|
-
>
|
|
34
|
-
<span
|
|
35
|
-
v-if="!!icon"
|
|
36
|
-
class="h-4 w-4 opacity-75"
|
|
37
|
-
>
|
|
38
|
-
<component :is="icon" />
|
|
39
|
-
</span>
|
|
40
|
-
|
|
41
|
-
<span :class="{ 'font-medium': active }">
|
|
42
|
-
<slot />
|
|
43
|
-
</span>
|
|
44
|
-
</div>
|
|
45
|
-
</InertiaLink>
|
|
46
|
-
</div>
|
|
47
|
-
</template>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { TextStyle } from '../TextStyle';
|
|
3
|
-
|
|
4
|
-
withDefaults(defineProps<{
|
|
5
|
-
/** The label for the navigation section. */
|
|
6
|
-
label?: string | null;
|
|
7
|
-
}>(), {
|
|
8
|
-
label: null,
|
|
9
|
-
});
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<template>
|
|
13
|
-
<div class="pb-8">
|
|
14
|
-
<TextStyle
|
|
15
|
-
v-if="label"
|
|
16
|
-
variant="strong"
|
|
17
|
-
>
|
|
18
|
-
<p class="px-3 py-2">
|
|
19
|
-
{{ label }}
|
|
20
|
-
</p>
|
|
21
|
-
</TextStyle>
|
|
22
|
-
|
|
23
|
-
<div class="space-y-0.5">
|
|
24
|
-
<slot />
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
</template>
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { Navigation, NavigationItem, NavigationSecondarySection, NavigationSection } from '../../src/components';
|
|
3
|
-
import api from '../component-meta/Navigation.json';
|
|
4
|
-
import { UserIcon, HandThumbDownIcon, QuestionMarkCircleIcon, BoltIcon } from '@heroicons/vue/16/solid';
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
# Navigation
|
|
8
|
-
|
|
9
|
-
The navigation component is used to display the primary navigation in the sidebar of the interface of an application.
|
|
10
|
-
Navigation includes a list of links that users use to move between sections of the application.
|
|
11
|
-
|
|
12
|
-
<ComponentApi :api="api" />
|
|
13
|
-
|
|
14
|
-
## Usage
|
|
15
|
-
|
|
16
|
-
<ComponentWrapper>
|
|
17
|
-
<Navigation>
|
|
18
|
-
<NavigationSection>
|
|
19
|
-
<NavigationItem href="#">General</NavigationItem>
|
|
20
|
-
</NavigationSection>
|
|
21
|
-
<NavigationSection label="Workflow management">
|
|
22
|
-
<NavigationItem :icon="HandThumbDownIcon" href="#">
|
|
23
|
-
Return reasons
|
|
24
|
-
</NavigationItem>
|
|
25
|
-
<NavigationItem active :icon="QuestionMarkCircleIcon" href="#">
|
|
26
|
-
Return questions
|
|
27
|
-
</NavigationItem>
|
|
28
|
-
<NavigationItem :icon="BoltIcon" href="#">
|
|
29
|
-
Automations
|
|
30
|
-
</NavigationItem>
|
|
31
|
-
<NavigationSecondarySection>
|
|
32
|
-
<NavigationItem href="#">Sub item 1</NavigationItem>
|
|
33
|
-
<NavigationItem href="#">Sub item 2</NavigationItem>
|
|
34
|
-
</NavigationSecondarySection>
|
|
35
|
-
</NavigationSection>
|
|
36
|
-
</Navigation>
|
|
37
|
-
</ComponentWrapper>
|
|
38
|
-
|
|
39
|
-
```js-vue
|
|
40
|
-
<script lang="ts" setup>
|
|
41
|
-
import { Navigation, NavigationItem, NavigationSection } from '@returnless/focus-ui';
|
|
42
|
-
import { UserIcon, HandThumbDownIcon, QuestionMarkCircleIcon, BoltIcon } from '@heroicons/vue/16/solid';
|
|
43
|
-
</script>
|
|
44
|
-
|
|
45
|
-
<template>
|
|
46
|
-
<Navigation>
|
|
47
|
-
<NavigationSection>
|
|
48
|
-
<NavigationItem>General</NavigationItem>
|
|
49
|
-
</NavigationSection>
|
|
50
|
-
<NavigationSection label="Workflow management">
|
|
51
|
-
<NavigationItem>
|
|
52
|
-
<template #icon>
|
|
53
|
-
<HandThumbDownIcon />
|
|
54
|
-
</template>
|
|
55
|
-
Return reasons
|
|
56
|
-
</NavigationItem>
|
|
57
|
-
<NavigationItem active>
|
|
58
|
-
<template #icon>
|
|
59
|
-
<QuestionMarkCircleIcon />
|
|
60
|
-
</template>
|
|
61
|
-
Return questions
|
|
62
|
-
</NavigationItem>
|
|
63
|
-
<NavigationItem>
|
|
64
|
-
<template #icon>
|
|
65
|
-
<BoltIcon />
|
|
66
|
-
</template>
|
|
67
|
-
Automations
|
|
68
|
-
</NavigationItem>
|
|
69
|
-
</NavigationSection>
|
|
70
|
-
</Navigation>
|
|
71
|
-
</template>
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
## Best practices
|
|
75
|
-
|
|
76
|
-
The navigation component should:
|
|
77
|
-
|
|
78
|
-
- Contain primary navigation items that perform an action when clicked. Each action should navigate to a URL or
|
|
79
|
-
trigger another action like a modal overlay.
|
|
80
|
-
- Only use secondary actions for supplementary actions to the primary actions.
|
|
81
|
-
- Provide a non-primary link or action as a secondary action to the section or an item.
|
|
82
|
-
- Group navigation items into sections based on related categories.
|
|
83
|
-
- Use a section title to clarify the category of a section.
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { default as Navigation } from './Navigation.vue';
|
|
2
|
-
export { default as NavigationItem } from './NavigationItem.vue';
|
|
3
|
-
export { default as NavigationSecondarySection } from './NavigationSecondarySection.vue';
|
|
4
|
-
export { default as NavigationSection } from './NavigationSection.vue';
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { Component, computed, h, useSlots } from 'vue';
|
|
3
|
-
|
|
4
|
-
const props = defineProps<{
|
|
5
|
-
/** Navigation component to render in the left column */
|
|
6
|
-
navigation?: Component;
|
|
7
|
-
}>();
|
|
8
|
-
|
|
9
|
-
const slots = useSlots();
|
|
10
|
-
|
|
11
|
-
const hasNavigation = computed((): boolean | Component => props.navigation || !!slots['page-navigation']);
|
|
12
|
-
|
|
13
|
-
const PageNavigation = props.navigation
|
|
14
|
-
? h(props.navigation)
|
|
15
|
-
: h('div');
|
|
16
|
-
|
|
17
|
-
const contentClassList = computed((): string => {
|
|
18
|
-
return hasNavigation.value ? 'col-span-9' : 'col-span-12';
|
|
19
|
-
});
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<template>
|
|
23
|
-
<div class="grid grid-cols-12 gap-x-4">
|
|
24
|
-
<div
|
|
25
|
-
v-if="hasNavigation"
|
|
26
|
-
class="col-span-3"
|
|
27
|
-
>
|
|
28
|
-
<PageNavigation />
|
|
29
|
-
<slot name="page-navigation" />
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
<div :class="contentClassList">
|
|
33
|
-
<slot />
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</template>
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { ArrowLeftIcon } from '@heroicons/vue/16/solid';
|
|
3
|
-
|
|
4
|
-
type BackAction = {
|
|
5
|
-
content: string;
|
|
6
|
-
href: string;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
withDefaults(defineProps<{
|
|
10
|
-
/** The back action to display in the header. */
|
|
11
|
-
backAction?: BackAction | null;
|
|
12
|
-
}>(), {
|
|
13
|
-
backAction: null,
|
|
14
|
-
});
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<template>
|
|
18
|
-
<div class="mb-12 flex">
|
|
19
|
-
<div
|
|
20
|
-
v-if="backAction"
|
|
21
|
-
class="mr-4 mt-0.5"
|
|
22
|
-
>
|
|
23
|
-
<button class="rounded bg-slate-200 p-1 hover:bg-slate-300">
|
|
24
|
-
<ArrowLeftIcon class="h-4 w-4" />
|
|
25
|
-
</button>
|
|
26
|
-
</div>
|
|
27
|
-
|
|
28
|
-
<div class="flex flex-grow flex-col space-y-1.5">
|
|
29
|
-
<slot />
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
<slot name="page-header-actions" />
|
|
33
|
-
</div>
|
|
34
|
-
</template>
|