@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,156 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
3
|
-
AspectRatio,
|
|
4
|
-
Button,
|
|
5
|
-
ButtonIcon,
|
|
6
|
-
ButtonContent,
|
|
7
|
-
ButtonGroup,
|
|
8
|
-
Card,
|
|
9
|
-
CardDescription,
|
|
10
|
-
CardFooter,
|
|
11
|
-
CardHeader,
|
|
12
|
-
CardHelp,
|
|
13
|
-
CardSection,
|
|
14
|
-
CardTitle,
|
|
15
|
-
Heading,
|
|
16
|
-
} from '../../src/components';
|
|
17
|
-
import api from '../component-meta/Card.json';
|
|
18
|
-
import { ArrowDownTrayIcon } from '@heroicons/vue/16/solid';
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
# Card
|
|
22
|
-
|
|
23
|
-
Cards are used to group similar concepts and tasks together for users to scan, read, and get things done. It displays
|
|
24
|
-
content in a familiar and recognizable style.
|
|
25
|
-
|
|
26
|
-
<ComponentApi :api="api" />
|
|
27
|
-
|
|
28
|
-
## Variants
|
|
29
|
-
|
|
30
|
-
<ComponentWrapper>
|
|
31
|
-
<Card>
|
|
32
|
-
<CardHeader>
|
|
33
|
-
<CardTitle>
|
|
34
|
-
Notifications
|
|
35
|
-
<CardHelp href="/help">Learn more</CardHelp>
|
|
36
|
-
</CardTitle>
|
|
37
|
-
<CardDescription>You have 3 unread messages.</CardDescription>
|
|
38
|
-
</CardHeader>
|
|
39
|
-
<CardSection>
|
|
40
|
-
<div>Card content</div>
|
|
41
|
-
</CardSection>
|
|
42
|
-
<CardFooter>
|
|
43
|
-
<Button variant="primary">Button</Button>
|
|
44
|
-
</CardFooter>
|
|
45
|
-
</Card>
|
|
46
|
-
</ComponentWrapper>
|
|
47
|
-
|
|
48
|
-
```js-vue
|
|
49
|
-
<script lang="ts" setup>
|
|
50
|
-
import {
|
|
51
|
-
Button,
|
|
52
|
-
Card,
|
|
53
|
-
CardDescription,
|
|
54
|
-
CardFooter,
|
|
55
|
-
CardHeader,
|
|
56
|
-
CardHelp,
|
|
57
|
-
CardSection,
|
|
58
|
-
CardTitle,
|
|
59
|
-
} from '@returnless/focus-ui';
|
|
60
|
-
</script>
|
|
61
|
-
|
|
62
|
-
<template>
|
|
63
|
-
<Card>
|
|
64
|
-
<CardHeader>
|
|
65
|
-
<CardTitle>
|
|
66
|
-
Notifications
|
|
67
|
-
<CardHelp href="/help">Learn more</CardHelp>
|
|
68
|
-
</CardTitle>
|
|
69
|
-
<CardDescription>You have 3 unread messages.</CardDescription>
|
|
70
|
-
</CardHeader>
|
|
71
|
-
<CardSection>
|
|
72
|
-
<div>Card content</div>
|
|
73
|
-
</CardSection>
|
|
74
|
-
<CardFooter>
|
|
75
|
-
<Button variant="primary">Button</Button>
|
|
76
|
-
</CardFooter>
|
|
77
|
-
</Card>
|
|
78
|
-
</template>
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### Example with media image
|
|
82
|
-
|
|
83
|
-
<ComponentWrapper>
|
|
84
|
-
<div style="width: 400px;">
|
|
85
|
-
<Card>
|
|
86
|
-
<AspectRatio :ratio="16 / 9">
|
|
87
|
-
<img
|
|
88
|
-
src="https://www.retourneren.nl/media/catalog/product/cache/8d4d2075b1a30681853bef5bdc41b164/r/e/returnless_afbeelding.jpg"
|
|
89
|
-
class="h-full w-full object-cover"
|
|
90
|
-
>
|
|
91
|
-
</AspectRatio>
|
|
92
|
-
<CardHeader>
|
|
93
|
-
<CardTitle>Focus-UI return form</CardTitle>
|
|
94
|
-
<CardDescription>Returnless webshop</CardDescription>
|
|
95
|
-
</CardHeader>
|
|
96
|
-
<CardSection>
|
|
97
|
-
<ButtonGroup>
|
|
98
|
-
<Button variant="secondary">Settings</Button>
|
|
99
|
-
<Button variant="ghost">Preview</Button>
|
|
100
|
-
</ButtonGroup>
|
|
101
|
-
</CardSection>
|
|
102
|
-
</Card>
|
|
103
|
-
</div>
|
|
104
|
-
</ComponentWrapper>
|
|
105
|
-
|
|
106
|
-
```js-vue
|
|
107
|
-
<script lang="ts" setup>
|
|
108
|
-
import {
|
|
109
|
-
AspectRatio,
|
|
110
|
-
Button,
|
|
111
|
-
ButtonGroup,
|
|
112
|
-
Card,
|
|
113
|
-
CardDescription,
|
|
114
|
-
CardFooter,
|
|
115
|
-
CardHeader,
|
|
116
|
-
CardHelp,
|
|
117
|
-
CardSection,
|
|
118
|
-
CardTitle,
|
|
119
|
-
} from '@returnless/focus-ui';
|
|
120
|
-
</script>
|
|
121
|
-
|
|
122
|
-
<template>
|
|
123
|
-
<div style="width: 400px;">
|
|
124
|
-
<Card>
|
|
125
|
-
<AspectRatio :ratio="16 / 9">
|
|
126
|
-
<img
|
|
127
|
-
src="https://www.retourneren.nl/media/catalog/product/cache/8d4d2075b1a30681853bef5bdc41b164/r/e/returnless_afbeelding.jpg"
|
|
128
|
-
class="h-full w-full object-cover"
|
|
129
|
-
>
|
|
130
|
-
</AspectRatio>
|
|
131
|
-
<CardHeader>
|
|
132
|
-
<CardTitle>Focus-UI return form</CardTitle>
|
|
133
|
-
<CardDescription>Returnless webshop</CardDescription>
|
|
134
|
-
</CardHeader>
|
|
135
|
-
<CardSection>
|
|
136
|
-
<ButtonGroup>
|
|
137
|
-
<Button variant="secondary">Settings</Button>
|
|
138
|
-
<Button variant="ghost">Preview</Button>
|
|
139
|
-
</ButtonGroup>
|
|
140
|
-
</CardSection>
|
|
141
|
-
</Card>
|
|
142
|
-
</div>
|
|
143
|
-
</template>
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
## Best practices
|
|
147
|
-
|
|
148
|
-
Cards should:
|
|
149
|
-
|
|
150
|
-
- Group related information.
|
|
151
|
-
- Display information in a way that prioritizes what the user needs to know most first.
|
|
152
|
-
- Use headings that set clear expectations about the card's purpose.
|
|
153
|
-
- Stick to single user flows or break more complicated flows into multiple sections.
|
|
154
|
-
- Avoid too many call-to-action buttons or links and only one primary call to action per card.
|
|
155
|
-
- Use calls to action on bottom of the card for next steps and use the space in the upper right corner of the card
|
|
156
|
-
for persistent, option actions (such as Edit).
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { default as Card } from './Card.vue';
|
|
2
|
-
export { default as CardDescription } from './CardDescription.vue';
|
|
3
|
-
export { default as CardFooter } from './CardFooter.vue';
|
|
4
|
-
export { default as CardHeader } from './CardHeader.vue';
|
|
5
|
-
export { default as CardHelp } from './CardHelp.vue';
|
|
6
|
-
export { default as CardSection } from './CardSection.vue';
|
|
7
|
-
export { default as CardTitle } from './CardTitle.vue';
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed, ref } from 'vue';
|
|
3
|
-
import { InputLabel } from '../InputLabel';
|
|
4
|
-
import { useUniqueId, useTheme } from '../../composables';
|
|
5
|
-
import { TextStyle } from '../TextStyle';
|
|
6
|
-
|
|
7
|
-
const props = withDefaults(defineProps<{
|
|
8
|
-
/** The help text to display with the checkbox. */
|
|
9
|
-
helpText?: string | null;
|
|
10
|
-
|
|
11
|
-
/** The ID of the checkbox. */
|
|
12
|
-
id?: string | null;
|
|
13
|
-
|
|
14
|
-
/** The label for the checkbox. */
|
|
15
|
-
label: string;
|
|
16
|
-
|
|
17
|
-
/** Whether the label is hidden. */
|
|
18
|
-
labelHidden?: boolean;
|
|
19
|
-
|
|
20
|
-
/** The value of the checkbox. */
|
|
21
|
-
value: any;
|
|
22
|
-
}>(), {
|
|
23
|
-
id: null,
|
|
24
|
-
helpText: null,
|
|
25
|
-
labelHidden: false,
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
const $checkboxElement = ref<HTMLInputElement | null>(null);
|
|
29
|
-
|
|
30
|
-
const model = defineModel<boolean | boolean[]>();
|
|
31
|
-
|
|
32
|
-
const elementId = props.id || useUniqueId('checkbox');
|
|
33
|
-
|
|
34
|
-
const elementIsChecked = computed((): boolean | undefined => {
|
|
35
|
-
if (Array.isArray(model.value)) {
|
|
36
|
-
return model.value.includes(props.value);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return model.value;
|
|
40
|
-
});
|
|
41
|
-
</script>
|
|
42
|
-
|
|
43
|
-
<template>
|
|
44
|
-
<div
|
|
45
|
-
:aria-checked="elementIsChecked"
|
|
46
|
-
:aria-labelledby="elementId"
|
|
47
|
-
class="flex items-start space-x-2"
|
|
48
|
-
role="checkbox"
|
|
49
|
-
>
|
|
50
|
-
<input
|
|
51
|
-
:id="elementId"
|
|
52
|
-
ref="$checkboxElement"
|
|
53
|
-
v-model="model"
|
|
54
|
-
:class="useTheme('focus')"
|
|
55
|
-
:value="value"
|
|
56
|
-
class="h-4 w-4 flex-shrink-0 appearance-none rounded border border-slate-400 bg-white shadow-sm text-brand-500"
|
|
57
|
-
type="checkbox"
|
|
58
|
-
>
|
|
59
|
-
<div
|
|
60
|
-
v-if="!labelHidden"
|
|
61
|
-
class="-mt-[2px] space-y-1"
|
|
62
|
-
>
|
|
63
|
-
<InputLabel
|
|
64
|
-
:label="label"
|
|
65
|
-
:label-for="elementId"
|
|
66
|
-
/>
|
|
67
|
-
|
|
68
|
-
<TextStyle variant="subdued">
|
|
69
|
-
{{ helpText }}
|
|
70
|
-
</TextStyle>
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
</template>
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { FormLayout, Checkbox } from '../../src/components';
|
|
3
|
-
import api from '../component-meta/Checkbox.json';
|
|
4
|
-
import { ref } from "vue";
|
|
5
|
-
|
|
6
|
-
const checkboxValues = ref([]);
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
# Checkbox
|
|
10
|
-
|
|
11
|
-
Checkboxes are most commonly used to give users a way to make a range of sections (zero, one, or multiple). They may
|
|
12
|
-
also be used as a way to have users indicate they agree to specific terms and services.
|
|
13
|
-
|
|
14
|
-
<ComponentApi :api="api" />
|
|
15
|
-
|
|
16
|
-
## Usage
|
|
17
|
-
|
|
18
|
-
<ComponentWrapper>
|
|
19
|
-
<FormLayout>
|
|
20
|
-
<Checkbox
|
|
21
|
-
v-model="checkboxValues"
|
|
22
|
-
value="comments"
|
|
23
|
-
label="Comments"
|
|
24
|
-
help-text="Get notified when someones posts a comment on a posting." />
|
|
25
|
-
<Checkbox
|
|
26
|
-
v-model="checkboxValues"
|
|
27
|
-
value="candidates"
|
|
28
|
-
label="Candidates"
|
|
29
|
-
help-text="Get notified when a candidate applies for a job." />
|
|
30
|
-
<Checkbox
|
|
31
|
-
v-model="checkboxValues"
|
|
32
|
-
value="offers"
|
|
33
|
-
label="Offers"
|
|
34
|
-
help-text="Get notified when a candidate accepts or rejects an offer." />
|
|
35
|
-
</FormLayout>
|
|
36
|
-
<pre class="mt-4">{{ checkboxValues }}</pre>
|
|
37
|
-
</ComponentWrapper>
|
|
38
|
-
|
|
39
|
-
```js-vue
|
|
40
|
-
<script lang="ts" setup>
|
|
41
|
-
import { ref } from 'vue';
|
|
42
|
-
import { FormLayout, Checkbox } from '@returnless/focus-ui';
|
|
43
|
-
|
|
44
|
-
const checkboxValues = ref([]);
|
|
45
|
-
</script>
|
|
46
|
-
|
|
47
|
-
<template>
|
|
48
|
-
<FormLayout>
|
|
49
|
-
<Checkbox
|
|
50
|
-
v-model="checkboxValues"
|
|
51
|
-
value="comments"
|
|
52
|
-
label="Comments"
|
|
53
|
-
help-text="Get notified when someones posts a comment on a posting." />
|
|
54
|
-
<Checkbox
|
|
55
|
-
v-model="checkboxValues"
|
|
56
|
-
value="candidates"
|
|
57
|
-
label="Candidates"
|
|
58
|
-
help-text="Get notified when a candidate applies for a job." />
|
|
59
|
-
<Checkbox
|
|
60
|
-
v-model="checkboxValues"
|
|
61
|
-
value="offers"
|
|
62
|
-
label="Offers"
|
|
63
|
-
help-text="Get notified when a candidate accepts or rejects an offer." />
|
|
64
|
-
</FormLayout>
|
|
65
|
-
</template>
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Best practices
|
|
69
|
-
|
|
70
|
-
Checkboxes should:
|
|
71
|
-
|
|
72
|
-
- Work independently of each other. Selecting one checkbox shouldn't change the selection status of another
|
|
73
|
-
checkbox in the list The exception is when a checkbox is used to make a bulk selection of multiple items.
|
|
74
|
-
- Be framed positively. For example, say "Publish form" instead of "Hide form".
|
|
75
|
-
- Always have a label when used to activate or deactivate a setting.
|
|
76
|
-
- Be listed according to logical order, whether it's alphabetical, numerical, time-based, or some other clear system.
|
|
77
|
-
- Link to more information or include a subtitle as required to provide more explanation. Don't rely on tooltips to
|
|
78
|
-
explain a checkbox.
|
|
79
|
-
|
|
80
|
-
## Content guidelines
|
|
81
|
-
|
|
82
|
-
List that use checkboxes should:
|
|
83
|
-
|
|
84
|
-
- Start with a capital letter.
|
|
85
|
-
- Not use commas or semicolons at the end of each item.
|
|
86
|
-
- In the rare case where the checkbox is asking users to agree to terms or services, use the first person.
|
|
87
|
-
|
|
88
|
-
## Accessibility
|
|
89
|
-
|
|
90
|
-
Screen readers convey the state of the checkboxes automatically.
|
|
91
|
-
|
|
92
|
-
- Use the `disabled` prop to apply the HTML `disabled` attribute to the checkbox `<input>`. This prevents users from
|
|
93
|
-
being able to interact with the checkbox, and conveys its inactive state to assistive technologies.
|
|
94
|
-
- Use the `id` prop to provide a unique `id` attribute value for the checkbox. If an `id` isn't provide, the component
|
|
95
|
-
generates one automatically. All checkboxes must have a unique `id` value to work correctly with assistive
|
|
96
|
-
technologies.
|
|
97
|
-
- Setting `checked="ideterminate"` conveys the state of the checkbox as `aria-checked="mixed"`.
|
|
98
|
-
- Setting the `ariaControls` prop conveys the ID of the element whose contents or presence are controlled by the
|
|
99
|
-
checkbox to screen reader users with the `aria-controls` attribute.
|
|
100
|
-
|
|
101
|
-
### Labeling
|
|
102
|
-
|
|
103
|
-
- The required `label` prop conveys the purpose of the checkbox to all users.
|
|
104
|
-
- Use the `labelHidden` prop to visually hide the label but make it available to assistive technologies.
|
|
105
|
-
- When you provide help text via the `helpText` prop or an inline error message via the `error` prop, the help or
|
|
106
|
-
error content is conveyed to screen reader users with the `aria-describedby` attribute.
|
|
107
|
-
|
|
108
|
-
### Keyboard support
|
|
109
|
-
|
|
110
|
-
- Move focus to each checkbox using the tab key (or shift + tab when tabbing backwards).
|
|
111
|
-
- To interact with the checkbox when it has keyboard focus, press the space key.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Checkbox } from './Checkbox.vue';
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# Collapsible
|
|
2
|
-
|
|
3
|
-
The collapsible component is used to put long sections of information under a block that users can expand or collapse.
|
|
4
|
-
|
|
5
|
-
## Best practices
|
|
6
|
-
|
|
7
|
-
The collapsible component should:
|
|
8
|
-
|
|
9
|
-
- Be used for information that is lower priority or that users don't need to see all the time.
|
|
10
|
-
- Not be used to hide error messages or other critical information that requires an immediate action.
|
|
11
|
-
|
|
12
|
-
## Content guidelines
|
|
13
|
-
|
|
14
|
-
Collapsible containers are cards with expanded and collapsible functionality, and should follow the content guidelines
|
|
15
|
-
for cards.
|
|
16
|
-
|
|
17
|
-
## Accessibility
|
|
18
|
-
|
|
19
|
-
Use the collapsible component in conjunction with a button. Place the collapsible content immediately after the
|
|
20
|
-
button that controls it, so users with vision or attention issues can easily discover what content is being affected.
|
|
21
|
-
|
|
22
|
-
- Use the required `id` prop of the collapsible component to give the content a unique `id` value.
|
|
23
|
-
- Use the `ariaExpanded` prop on the button component to add an `aria-expanded` attribute, which conveys the
|
|
24
|
-
expanded or collapsed state to screen reader users.
|
|
25
|
-
- Use the `ariaControls` prop on the button component, and set its value to the `id` value of the collapsible component.
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# Data table
|
|
2
|
-
|
|
3
|
-
Data tables are used to organize and display all information from a data set. While a data visualization represents part
|
|
4
|
-
of a data set, a data table lets users view details from the entire set. This helps users compare and analyze the data.
|
|
5
|
-
|
|
6
|
-
## Best practices
|
|
7
|
-
|
|
8
|
-
Data tables should:
|
|
9
|
-
|
|
10
|
-
- Show values across multiple categories and measures.
|
|
11
|
-
- Allow for filtering and ordering when comparison is not a priority.
|
|
12
|
-
- Help users visualize and scan many values from an entire data set.
|
|
13
|
-
- Help users find other values in the data hierarchy through use of links.
|
|
14
|
-
- Minimize clutter by only including values that supports the data's purpose.
|
|
15
|
-
- Include a summary row to surface the column totals.
|
|
16
|
-
- Not include calculations within the summary row.
|
|
17
|
-
- Wrap instead of truncate content. This is because if row titles start with the same word, they'll all appear the
|
|
18
|
-
same when truncated.
|
|
19
|
-
- Not be used for an actionable list of items that link to detail pages.
|
|
20
|
-
|
|
21
|
-
### Alignment
|
|
22
|
-
|
|
23
|
-
Column content types are build into the component props so the following alignment rules are followed:
|
|
24
|
-
|
|
25
|
-
- Numerical: right-aligned
|
|
26
|
-
- Textual data: left-aligned
|
|
27
|
-
- Align headers with their related data.
|
|
28
|
-
- Don't center align.
|
|
29
|
-
|
|
30
|
-
## Content guidelines
|
|
31
|
-
|
|
32
|
-
Headers should:
|
|
33
|
-
|
|
34
|
-
- Be informative and descriptive.
|
|
35
|
-
- Concise and scannable.
|
|
36
|
-
- Include units of measurement symbols sy they aren't repeated throughout the columns.
|
|
37
|
-
- Use sentence case (first word capitalized, the rest lowercase).
|
|
38
|
-
|
|
39
|
-
Columns should:
|
|
40
|
-
|
|
41
|
-
- Be concise and scannable.
|
|
42
|
-
- Not include units of measurement symbols (put those in the headers).
|
|
43
|
-
- Use sentence case (first word capitalized, the rest lowercase).
|
|
44
|
-
|
|
45
|
-
### Decimals
|
|
46
|
-
|
|
47
|
-
Keep decimals consistent. For example, don't use 3 decimals in one row and 2 in others.
|
|
48
|
-
|
|
49
|
-
## Accessibility
|
|
50
|
-
|
|
51
|
-
Native HTML tables provide a large amount of structural information to screen reader users. Users who rely on screen
|
|
52
|
-
readers can navigate tables and identify relationships between data cells (`<td>`) and header cells (`<th>`) using
|
|
53
|
-
keys specific to their screen reader.
|
|
54
|
-
|
|
55
|
-
Sortable tables use the `aria-sort` attribute to convey which columns are sortable (and in what direction). They
|
|
56
|
-
also use `aria-label` on sorting buttons to convey what activating the button will do.
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/vue/24/solid';
|
|
3
|
-
import dayjs, { Dayjs } from 'dayjs';
|
|
4
|
-
import { TextStyle } from '../TextStyle';
|
|
5
|
-
import { computed, ref } from 'vue';
|
|
6
|
-
|
|
7
|
-
type Day = {
|
|
8
|
-
dimmed: boolean;
|
|
9
|
-
value: Dayjs;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
withDefaults(defineProps<{
|
|
13
|
-
locale?: string;
|
|
14
|
-
}>(), {
|
|
15
|
-
locale: 'en',
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
function getCalendarMonthDays(input: Dayjs): Day[] {
|
|
19
|
-
const startOfMonth = input.startOf('month');
|
|
20
|
-
const days = [];
|
|
21
|
-
const rows = 42;
|
|
22
|
-
|
|
23
|
-
const amountOfPreviousDays = startOfMonth.day() === 0
|
|
24
|
-
? 6
|
|
25
|
-
: startOfMonth.day() - 1;
|
|
26
|
-
|
|
27
|
-
const startOfCalendar = startOfMonth.clone().subtract(amountOfPreviousDays, 'day');
|
|
28
|
-
|
|
29
|
-
for (let i = 0; i < rows; i++) {
|
|
30
|
-
const currentDay = startOfCalendar.clone().add(i, 'day');
|
|
31
|
-
|
|
32
|
-
days.push({
|
|
33
|
-
dimmed: currentDay.month() !== startOfMonth.month(),
|
|
34
|
-
value: currentDay,
|
|
35
|
-
} as Day);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return days;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const selectedDate = defineModel<string>({
|
|
42
|
-
required: true,
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
const currentDate = ref(dayjs(selectedDate.value));
|
|
46
|
-
|
|
47
|
-
const days = computed(() => {
|
|
48
|
-
return getCalendarMonthDays(dayjs(currentDate.value));
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
function selectDate(date: Day): void {
|
|
52
|
-
selectedDate.value = date.value.format('YYYY-MM-DD');
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function selectPreviousMonth(): void {
|
|
56
|
-
currentDate.value = dayjs(currentDate.value).subtract(1, 'month');
|
|
57
|
-
}
|
|
58
|
-
function selectNextMonth(): void {
|
|
59
|
-
currentDate.value = dayjs(currentDate.value).add(1, 'month');
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function isSelected(date: Day): boolean {
|
|
63
|
-
return dayjs(selectedDate.value).format('YYYY-MM-DD') === date.value.format('YYYY-MM-DD');
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function isToday(date: Day): boolean {
|
|
67
|
-
return dayjs().format('YYYY-MM-DD') === date.value.format('YYYY-MM-DD');
|
|
68
|
-
}
|
|
69
|
-
</script>
|
|
70
|
-
|
|
71
|
-
<template>
|
|
72
|
-
<div class="w-full space-y-4">
|
|
73
|
-
<div class="flex items-center justify-between">
|
|
74
|
-
<button
|
|
75
|
-
class="cursor-pointer"
|
|
76
|
-
@click="selectPreviousMonth"
|
|
77
|
-
>
|
|
78
|
-
<ChevronLeftIcon class="h-4 w-4" />
|
|
79
|
-
</button>
|
|
80
|
-
|
|
81
|
-
<TextStyle variant="strong">
|
|
82
|
-
{{ currentDate.format('MMM YYYY') }}
|
|
83
|
-
</TextStyle>
|
|
84
|
-
|
|
85
|
-
<button
|
|
86
|
-
class="cursor-pointer"
|
|
87
|
-
@click="selectNextMonth"
|
|
88
|
-
>
|
|
89
|
-
<ChevronRightIcon class="h-4 w-4" />
|
|
90
|
-
</button>
|
|
91
|
-
</div>
|
|
92
|
-
|
|
93
|
-
<div class="grid grid-cols-7 [&>*]:text-center [&>*]:font-medium [&>*]:text-slate-500">
|
|
94
|
-
<div>Mo</div>
|
|
95
|
-
<div>Tu</div>
|
|
96
|
-
<div>We</div>
|
|
97
|
-
<div>Tu</div>
|
|
98
|
-
<div>Fr</div>
|
|
99
|
-
<div>Sat</div>
|
|
100
|
-
<div>Su</div>
|
|
101
|
-
</div>
|
|
102
|
-
|
|
103
|
-
<div class="grid grid-cols-7 gap-0.5">
|
|
104
|
-
<div
|
|
105
|
-
v-for="day in days"
|
|
106
|
-
:key="day.value.toString()"
|
|
107
|
-
:class="{
|
|
108
|
-
'hover:bg-slate-200': !isSelected(day),
|
|
109
|
-
'text-slate-400': day.dimmed && !isSelected(day),
|
|
110
|
-
'border-transparant bg-brand-500 text-white': isSelected(day),
|
|
111
|
-
'ring-2 border border-brand-500': isToday(day),
|
|
112
|
-
}"
|
|
113
|
-
class="flex h-8 cursor-pointer items-center justify-center rounded"
|
|
114
|
-
@click="selectDate(day)"
|
|
115
|
-
>
|
|
116
|
-
{{ day.value.date() }}
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
</div>
|
|
120
|
-
</template>
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { DatePicker, DatePickerCard } from '../../src/components';
|
|
3
|
-
import api from '../component-meta/DatePicker.json';
|
|
4
|
-
import { ref } from "vue";
|
|
5
|
-
|
|
6
|
-
const selectedDate = ref('2024-01-01');
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
# Date picker
|
|
10
|
-
|
|
11
|
-
Date pickers let users choose dates from a visual calendar that's consistently applied wherever dates need to be
|
|
12
|
-
selected across the interface.
|
|
13
|
-
|
|
14
|
-
<ComponentApi :api="api" />
|
|
15
|
-
|
|
16
|
-
## Usage
|
|
17
|
-
|
|
18
|
-
<ComponentWrapper>
|
|
19
|
-
<DatePickerCard>
|
|
20
|
-
<DatePicker v-model="selectedDate" />
|
|
21
|
-
</DatePickerCard>
|
|
22
|
-
<pre class="mt-4">selected-date: {{ selectedDate }}</pre>
|
|
23
|
-
</ComponentWrapper>
|
|
24
|
-
|
|
25
|
-
```js-vue
|
|
26
|
-
<script lang="ts" setup>
|
|
27
|
-
import { DatePicker, DatePickerCard } from '@returnless/focus-ui';
|
|
28
|
-
</script>
|
|
29
|
-
|
|
30
|
-
<template>
|
|
31
|
-
<DatePickerCard>
|
|
32
|
-
<DatePicker />
|
|
33
|
-
</DatePickerCard>
|
|
34
|
-
</template>
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Best practices
|
|
38
|
-
|
|
39
|
-
Date pickers should:
|
|
40
|
-
|
|
41
|
-
- Use smart defaults and highlight common selections.
|
|
42
|
-
- Close after a single date is selected unless a range with a start and end date is required.
|
|
43
|
-
- Set the start date on first click or tap and the end date on second click or tap if a range is required.
|
|
44
|
-
- Not be used to enter date that is many years in the future or past.
|
|
45
|
-
|
|
46
|
-
## Accessibility
|
|
47
|
-
|
|
48
|
-
Some users might find interacting with date pickers to be challenging. When you use the date picker component,
|
|
49
|
-
always give users the option to enter the date using a text field component as well.
|
|
50
|
-
|
|
51
|
-
If you use the date picker within a popover component, then use a button to trigger the popover instead of
|
|
52
|
-
displaying the popover when the text input gets focus. This gives users more control over their experience.
|
|
53
|
-
|
|
54
|
-
### Keyboard support
|
|
55
|
-
|
|
56
|
-
- Press the tab key or move forward and shift + tab to move backwards through the previous button, next button, and
|
|
57
|
-
the calendar.
|
|
58
|
-
- When focus is in the calendar, move keyboard focus between the dates using the arrow keys.
|
|
59
|
-
- To select a date that has focus, press the enter/return key.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { provide } from 'vue';
|
|
3
|
-
|
|
4
|
-
const props = withDefaults(defineProps<{
|
|
5
|
-
/** The alignment of the description list. */
|
|
6
|
-
align?: 'horizontal' | 'vertical';
|
|
7
|
-
}>(), {
|
|
8
|
-
align: 'horizontal',
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
provide('descriptionListAlignment', props.align);
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<template>
|
|
15
|
-
<dl>
|
|
16
|
-
<slot />
|
|
17
|
-
</dl>
|
|
18
|
-
</template>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed, inject } from 'vue';
|
|
3
|
-
|
|
4
|
-
const descriptionListAlignment = inject<'horizontal' | 'vertical'>('descriptionListAlignment');
|
|
5
|
-
|
|
6
|
-
const classList = computed((): Record<string, boolean>[] => {
|
|
7
|
-
return [
|
|
8
|
-
{ 'grid-cols-4 gap-4 py-3': descriptionListAlignment === 'horizontal' },
|
|
9
|
-
{ 'py-2': descriptionListAlignment === 'vertical' },
|
|
10
|
-
];
|
|
11
|
-
});
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<template>
|
|
15
|
-
<div
|
|
16
|
-
class="grid"
|
|
17
|
-
:class="classList"
|
|
18
|
-
>
|
|
19
|
-
<slot />
|
|
20
|
-
</div>
|
|
21
|
-
</template>
|