@returnless/focus-ui 0.0.5 → 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 +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,115 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
3
|
-
Feed,
|
|
4
|
-
FeedItem,
|
|
5
|
-
FeedItemSimple,
|
|
6
|
-
FeedItemBlock,
|
|
7
|
-
FeedItemDateIndicator,
|
|
8
|
-
FeedItemIcon,
|
|
9
|
-
TextStyle,
|
|
10
|
-
} from '../../src/components';
|
|
11
|
-
import api from '../component-meta/Feed.json';
|
|
12
|
-
import { CheckIcon, ChatBubbleBottomCenterIcon } from '@heroicons/vue/16/solid';
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
# Feed
|
|
16
|
-
|
|
17
|
-
Use this component to display a feed of notes, posts, or other content.
|
|
18
|
-
|
|
19
|
-
<ComponentApi :api="api" />
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
<ComponentWrapper>
|
|
24
|
-
<Feed>
|
|
25
|
-
<FeedItem>
|
|
26
|
-
<FeedItemIcon color="indigo">
|
|
27
|
-
<CheckIcon />
|
|
28
|
-
</FeedItemIcon>
|
|
29
|
-
<FeedItemSimple>
|
|
30
|
-
<TextStyle variant="strong">Application user</TextStyle> created the return order.
|
|
31
|
-
<FeedItemDateIndicator>5 days ago</FeedItemDateIndicator>
|
|
32
|
-
</FeedItemSimple>
|
|
33
|
-
</FeedItem>
|
|
34
|
-
<FeedItem>
|
|
35
|
-
<FeedItemSimple>
|
|
36
|
-
<TextStyle variant="strong">Application user</TextStyle> edited the return order.
|
|
37
|
-
<FeedItemDateIndicator>5 days ago</FeedItemDateIndicator>
|
|
38
|
-
</FeedItemSimple>
|
|
39
|
-
</FeedItem>
|
|
40
|
-
<FeedItem>
|
|
41
|
-
<FeedItemIcon color="slate">
|
|
42
|
-
<ChatBubbleBottomCenterIcon />
|
|
43
|
-
</FeedItemIcon>
|
|
44
|
-
<FeedItemBlock>
|
|
45
|
-
<TextStyle variant="strong">Application user</TextStyle> commented
|
|
46
|
-
<p>Called client, they reassured me the invoice would be paid by the 25th.</p>
|
|
47
|
-
<FeedItemDateIndicator>just now</FeedItemDateIndicator>
|
|
48
|
-
</FeedItemBlock>
|
|
49
|
-
</FeedItem>
|
|
50
|
-
<FeedItem>
|
|
51
|
-
<FeedItemSimple>
|
|
52
|
-
<TextStyle variant="strong">Application user</TextStyle> sent the return order.
|
|
53
|
-
<FeedItemDateIndicator>just now</FeedItemDateIndicator>
|
|
54
|
-
</FeedItemSimple>
|
|
55
|
-
</FeedItem>
|
|
56
|
-
</Feed>
|
|
57
|
-
</ComponentWrapper>
|
|
58
|
-
|
|
59
|
-
```js-vue
|
|
60
|
-
<script lang="ts" setup>
|
|
61
|
-
import {
|
|
62
|
-
Feed,
|
|
63
|
-
FeedItem,
|
|
64
|
-
FeedItemSimple,
|
|
65
|
-
FeedItemBlock,
|
|
66
|
-
FeedItemDateIndicator,
|
|
67
|
-
FeedItemIcon,
|
|
68
|
-
TextStyle,
|
|
69
|
-
} from '@returnless/focus-ui';
|
|
70
|
-
</script>
|
|
71
|
-
|
|
72
|
-
<template>
|
|
73
|
-
<Feed>
|
|
74
|
-
<FeedItem>
|
|
75
|
-
<FeedItemIcon color="indigo">
|
|
76
|
-
<CheckIcon />
|
|
77
|
-
</FeedItemIcon>
|
|
78
|
-
<FeedItemSimple>
|
|
79
|
-
<TextStyle variant="strong">Application user</TextStyle> created the return order.
|
|
80
|
-
<FeedItemDateIndicator>5 days ago</FeedItemDateIndicator>
|
|
81
|
-
</FeedItemSimple>
|
|
82
|
-
</FeedItem>
|
|
83
|
-
<FeedItem>
|
|
84
|
-
<FeedItemSimple>
|
|
85
|
-
<TextStyle variant="strong">Application user</TextStyle> edited the return order.
|
|
86
|
-
<FeedItemDateIndicator>5 days ago</FeedItemDateIndicator>
|
|
87
|
-
</FeedItemSimple>
|
|
88
|
-
</FeedItem>
|
|
89
|
-
<FeedItem>
|
|
90
|
-
<FeedItemIcon color="slate">
|
|
91
|
-
<ChatBubbleBottomCenterIcon />
|
|
92
|
-
</FeedItemIcon>
|
|
93
|
-
<FeedItemBlock>
|
|
94
|
-
<TextStyle variant="strong">Application user</TextStyle> commented
|
|
95
|
-
<p>Called client, they reassured me the invoice would be paid by the 25th.</p>
|
|
96
|
-
<FeedItemDateIndicator>just now</FeedItemDateIndicator>
|
|
97
|
-
</FeedItemBlock>
|
|
98
|
-
</FeedItem>
|
|
99
|
-
<FeedItem>
|
|
100
|
-
<FeedItemSimple>
|
|
101
|
-
<TextStyle variant="strong">Application user</TextStyle> sent the return order.
|
|
102
|
-
<FeedItemDateIndicator>just now</FeedItemDateIndicator>
|
|
103
|
-
</FeedItemSimple>
|
|
104
|
-
</FeedItem>
|
|
105
|
-
</Feed>
|
|
106
|
-
</template>
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
## Best practices
|
|
110
|
-
|
|
111
|
-
todo
|
|
112
|
-
|
|
113
|
-
## Content guidelines
|
|
114
|
-
|
|
115
|
-
todo
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { default as Feed } from './Feed.vue';
|
|
2
|
-
export { default as FeedItem } from './FeedItem.vue';
|
|
3
|
-
export { default as FeedItemBlock } from './FeedItemBlock.vue';
|
|
4
|
-
export { default as FeedItemDateIndicator } from './FeedItemDateIndicator.vue';
|
|
5
|
-
export { default as FeedItemIcon } from './FeedItemIcon.vue';
|
|
6
|
-
export { default as FeedItemSimple } from './FeedItemSimple.vue';
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
import { useFileDialog } from '@vueuse/core';
|
|
4
|
-
import { Button, ButtonProps } from '../Button';
|
|
5
|
-
import { FileAccepts } from '../types';
|
|
6
|
-
|
|
7
|
-
const props = withDefaults(defineProps<ButtonProps & {
|
|
8
|
-
/** The file types to accept. */
|
|
9
|
-
accepts: FileAccepts;
|
|
10
|
-
|
|
11
|
-
/** Whether to accept multiple files. */
|
|
12
|
-
multiple?: boolean;
|
|
13
|
-
}>(), {
|
|
14
|
-
accepts: '*',
|
|
15
|
-
multiple: false,
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const model = defineModel<File[]>({
|
|
19
|
-
default: [],
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
const acceptTypes = computed(() => {
|
|
23
|
-
switch (props.accepts) {
|
|
24
|
-
case 'image':
|
|
25
|
-
return 'image/*';
|
|
26
|
-
case 'pdf':
|
|
27
|
-
return 'application/pdf';
|
|
28
|
-
default:
|
|
29
|
-
return '*';
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
const { open, onChange } = useFileDialog({
|
|
34
|
-
accept: acceptTypes.value,
|
|
35
|
-
multiple: props.multiple,
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
onChange((files: FileList | null): void => {
|
|
39
|
-
const listOfFiles: File[] = Array.from(files || []);
|
|
40
|
-
|
|
41
|
-
onFileUpload(listOfFiles);
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
function onFileUpload(files: File[] | null): void {
|
|
45
|
-
if (files === null) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
model.value = props.multiple
|
|
50
|
-
? [...model.value, ...files]
|
|
51
|
-
: [files[0]];
|
|
52
|
-
}
|
|
53
|
-
</script>
|
|
54
|
-
|
|
55
|
-
<template>
|
|
56
|
-
<Button
|
|
57
|
-
v-bind="$props"
|
|
58
|
-
@click="open"
|
|
59
|
-
>
|
|
60
|
-
<slot />
|
|
61
|
-
</Button>
|
|
62
|
-
</template>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as FileUploadButton } from './FileUploadButton.vue';
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { useUniqueId } from '../../composables';
|
|
3
|
-
|
|
4
|
-
const props = withDefaults(defineProps<{
|
|
5
|
-
/** The aria-label attribute to be applied to the link */
|
|
6
|
-
accessibilityLabel?: string;
|
|
7
|
-
|
|
8
|
-
/** The encoding type for the form. */
|
|
9
|
-
enctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
|
|
10
|
-
|
|
11
|
-
/** The ID of the form. */
|
|
12
|
-
id?: string | null;
|
|
13
|
-
}>(), {
|
|
14
|
-
accessibilityLabel: undefined,
|
|
15
|
-
enctype: undefined,
|
|
16
|
-
id: null,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
defineEmits<{
|
|
20
|
-
submit: [];
|
|
21
|
-
}>();
|
|
22
|
-
|
|
23
|
-
const elementId = props.id || useUniqueId('form');
|
|
24
|
-
</script>
|
|
25
|
-
|
|
26
|
-
<template>
|
|
27
|
-
<form
|
|
28
|
-
:id="elementId"
|
|
29
|
-
:aria-label="accessibilityLabel"
|
|
30
|
-
:enctype="enctype"
|
|
31
|
-
@submit.prevent="$emit('submit')"
|
|
32
|
-
>
|
|
33
|
-
<slot />
|
|
34
|
-
</form>
|
|
35
|
-
</template>
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { Form, FormLayout, TextField, Button } from '../../src/components';
|
|
3
|
-
import api from '../component-meta/Form.json';
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
# Form
|
|
7
|
-
|
|
8
|
-
A wrapper component that handles the submission of forms.
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
<ComponentWrapper>
|
|
13
|
-
<Form>
|
|
14
|
-
<FormLayout>
|
|
15
|
-
<TextField label="Name" />
|
|
16
|
-
<TextField label="Email" help-text="We’ll use this email address to inform you on future changes." />
|
|
17
|
-
<Button>Submit</Button>
|
|
18
|
-
</FormLayout>
|
|
19
|
-
</Form>
|
|
20
|
-
</ComponentWrapper>
|
|
21
|
-
|
|
22
|
-
```js-vue
|
|
23
|
-
<script lang="ts" setup>
|
|
24
|
-
import { Form, FormLayout, TextField, Button } from '@returnless/focus-ui';
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<template>
|
|
28
|
-
<Form>
|
|
29
|
-
<FormLayout>
|
|
30
|
-
<TextField label="Name" />
|
|
31
|
-
<TextField label="Email" type="email" help-text="We’ll use this email address to inform you on future changes." />
|
|
32
|
-
<Button>Submit</Button>
|
|
33
|
-
</FormLayout>
|
|
34
|
-
</Form>
|
|
35
|
-
</template>
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## Best practices
|
|
39
|
-
|
|
40
|
-
The form component should be used to:
|
|
41
|
-
|
|
42
|
-
- Wrap around all form input elements.
|
|
43
|
-
- Emulate the native HTML `form` element behavior with a custom `onSubmit` callback.
|
|
44
|
-
|
|
45
|
-
## Accessibility
|
|
46
|
-
|
|
47
|
-
The form component wraps content in an HTML `<form>` element. This helps to support assistive technologies that use
|
|
48
|
-
different interaction and browse modes.
|
|
49
|
-
|
|
50
|
-
Forms can have only one submit button, and it must be at the end of the form. By default, buttons added to the form
|
|
51
|
-
are given a `type` attribute set to `button` to avoid conflicts. To make a button the submit button instead
|
|
52
|
-
(`type="submit"`), set the `submit` prop on the button.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Form } from './Form.vue';
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
|
|
4
|
-
const props = withDefaults(defineProps<{
|
|
5
|
-
columns: number;
|
|
6
|
-
}>(), {
|
|
7
|
-
columns: 1,
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
const classList = computed((): Record<string, boolean>[] => {
|
|
11
|
-
return [
|
|
12
|
-
{ 'md:grid-cols-1': props.columns === 1 },
|
|
13
|
-
{ 'md:grid-cols-2': props.columns === 2 },
|
|
14
|
-
];
|
|
15
|
-
});
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<template>
|
|
19
|
-
<div
|
|
20
|
-
class="grid grid-cols-1 gap-4"
|
|
21
|
-
:class="classList"
|
|
22
|
-
>
|
|
23
|
-
<slot />
|
|
24
|
-
</div>
|
|
25
|
-
</template>
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { FormLayout, TextField } from '../../src/components';
|
|
3
|
-
import api from '../component-meta/Form.json';
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
# Form layout
|
|
7
|
-
|
|
8
|
-
Use form layout to arrange fields with a form using standard spacing. By default, it stacks fields vertically but also
|
|
9
|
-
support horizontal groups of fields.
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
<ComponentWrapper>
|
|
14
|
-
<FormLayout>
|
|
15
|
-
<TextField label="Name" />
|
|
16
|
-
<TextField label="Email" />
|
|
17
|
-
</FormLayout>
|
|
18
|
-
</ComponentWrapper>
|
|
19
|
-
|
|
20
|
-
```js-vue
|
|
21
|
-
<script lang="ts" setup>
|
|
22
|
-
import { FormLayout, TextField } from '@returnless/focus-ui';
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<template>
|
|
26
|
-
<FormLayout>
|
|
27
|
-
<TextField label="Name" />
|
|
28
|
-
<TextField label="Email" type="email" />
|
|
29
|
-
</FormLayout>
|
|
30
|
-
</template>
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### Horizontal form layout
|
|
34
|
-
|
|
35
|
-
<ComponentWrapper>
|
|
36
|
-
<FormLayout :columns="2">
|
|
37
|
-
<TextField label="Company name" />
|
|
38
|
-
<TextField label="Invoice email" />
|
|
39
|
-
<TextField label="Street + house number" />
|
|
40
|
-
<FormLayout :columns="2">
|
|
41
|
-
<TextField label="Postcode" />
|
|
42
|
-
<TextField label="City" />
|
|
43
|
-
</FormLayout>
|
|
44
|
-
<TextField label="Country" />
|
|
45
|
-
<TextField label="VAT number" />
|
|
46
|
-
<TextField label="P.O. number / reference" />
|
|
47
|
-
</FormLayout>
|
|
48
|
-
</ComponentWrapper>
|
|
49
|
-
|
|
50
|
-
```js-vue
|
|
51
|
-
<script lang="ts" setup>
|
|
52
|
-
import { FormLayout, TextField } from '@returnless/focus-ui';
|
|
53
|
-
</script>
|
|
54
|
-
|
|
55
|
-
<template>
|
|
56
|
-
<FormLayout :columns="2">
|
|
57
|
-
<TextField label="Company name" />
|
|
58
|
-
<TextField label="Invoice email" />
|
|
59
|
-
<TextField label="Street + house number" />
|
|
60
|
-
<FormLayout :columns="2">
|
|
61
|
-
<TextField label="Postcode" />
|
|
62
|
-
<TextField label="City" />
|
|
63
|
-
</FormLayout>
|
|
64
|
-
<TextField label="Country" />
|
|
65
|
-
<TextField label="VAT number" />
|
|
66
|
-
<TextField label="P.O. number / reference" />
|
|
67
|
-
</FormLayout>
|
|
68
|
-
</template>
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Best practices
|
|
72
|
-
|
|
73
|
-
Forms should:
|
|
74
|
-
|
|
75
|
-
- Be considerate of users’ time and privacy by only asking for information that’s required
|
|
76
|
-
- Group related tasks under section titles to provide more context and make the interface easier to scan
|
|
77
|
-
- Follow a logical, predictable order—for example, always ask for first-name first, and last-name second on forms
|
|
78
|
-
|
|
79
|
-
## Content guidelines
|
|
80
|
-
|
|
81
|
-
### Form section title
|
|
82
|
-
|
|
83
|
-
Form section titles should follow the content guidelines for headings and subheadings.
|
|
84
|
-
|
|
85
|
-
### Field label
|
|
86
|
-
|
|
87
|
-
A label is a short description of a field. Labels are not help text, and they shouldn’t be used to provide instruction,
|
|
88
|
-
but they should be meaningful and clearly indicate what is expected. Labels should be:
|
|
89
|
-
|
|
90
|
-
- Placed above or beside the form field
|
|
91
|
-
- Short and succinct (1–3 words)
|
|
92
|
-
- Written in sentence case (the first word capitalized, the rest lowercase)
|
|
93
|
-
|
|
94
|
-
### Help text
|
|
95
|
-
|
|
96
|
-
Help text provides extra guidance to people filling out a form field. This text is easy for people to ignore, so users
|
|
97
|
-
should not need to depend on it to fill out a form. As with all forms, help text should be succinct and easy to read.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as FormLayout } from './FormLayout.vue';
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
import { HeadingLevel, HeadingSize } from './types';
|
|
4
|
-
|
|
5
|
-
const props = withDefaults(defineProps<{
|
|
6
|
-
/** The heading level. */
|
|
7
|
-
level?: HeadingLevel;
|
|
8
|
-
|
|
9
|
-
/** The heading size. */
|
|
10
|
-
size?: HeadingSize;
|
|
11
|
-
}>(), {
|
|
12
|
-
level: 'h2',
|
|
13
|
-
size: 'xl',
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const classList = computed((): Record<string, boolean> => {
|
|
17
|
-
return {
|
|
18
|
-
'text-xl': props.size === 'xl',
|
|
19
|
-
'text-2xl': props.size === '2xl',
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<template>
|
|
25
|
-
<component
|
|
26
|
-
:is="level"
|
|
27
|
-
:class="classList"
|
|
28
|
-
class="font-semibold leading-none"
|
|
29
|
-
>
|
|
30
|
-
<slot />
|
|
31
|
-
</component>
|
|
32
|
-
</template>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
withDefaults(defineProps<{
|
|
3
|
-
/** The alt text for the image. */
|
|
4
|
-
alt: string;
|
|
5
|
-
|
|
6
|
-
/** The source URL of the image. */
|
|
7
|
-
source: string;
|
|
8
|
-
|
|
9
|
-
/** The cross-origin attribute of the image. */
|
|
10
|
-
crossOrigin?: 'anonymous' | 'use-credentials' | undefined;
|
|
11
|
-
}>(), {
|
|
12
|
-
crossOrigin: undefined,
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
defineEmits<{
|
|
16
|
-
load: [];
|
|
17
|
-
error: [];
|
|
18
|
-
}>();
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<template>
|
|
22
|
-
<img
|
|
23
|
-
:alt="alt"
|
|
24
|
-
:crossorigin="crossOrigin"
|
|
25
|
-
:src="source"
|
|
26
|
-
v-bind="$attrs"
|
|
27
|
-
@error="$emit('error')"
|
|
28
|
-
@load="$emit('load')"
|
|
29
|
-
>
|
|
30
|
-
</template>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Image } from './Image.vue';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as InertiaLink } from './InertiaLink.vue';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { ExclamationCircleIcon } from '@heroicons/vue/24/outline';
|
|
3
|
-
|
|
4
|
-
defineProps<{
|
|
5
|
-
/** The id of the element */
|
|
6
|
-
id: string;
|
|
7
|
-
|
|
8
|
-
/** The message to display */
|
|
9
|
-
message: string;
|
|
10
|
-
}>();
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<template>
|
|
14
|
-
<div
|
|
15
|
-
:id="id"
|
|
16
|
-
class="flex items-center text-red-600 space-x-2"
|
|
17
|
-
>
|
|
18
|
-
<ExclamationCircleIcon class="h-4 w-4" />
|
|
19
|
-
<span>{{ message }}</span>
|
|
20
|
-
</div>
|
|
21
|
-
</template>
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { FormLayout, TextField, InlineError } from '../../src/components';
|
|
3
|
-
import api from '../component-meta/InlineError.json';
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
# Inline error
|
|
7
|
-
|
|
8
|
-
Inline errors are brief, in-context messages that tell users something went wrong with a single or group of inputs in a
|
|
9
|
-
form. Use inline errors to help users understand why a form input may not be valid en how to fix it.
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
<ComponentWrapper>
|
|
14
|
-
<InlineError
|
|
15
|
-
message="Store name is required"
|
|
16
|
-
field-id="my-field-id"
|
|
17
|
-
/>
|
|
18
|
-
</ComponentWrapper>
|
|
19
|
-
|
|
20
|
-
```js-vue
|
|
21
|
-
<script lang="ts" setup>
|
|
22
|
-
import { InlineError } from '@returnless/focus-ui';
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<template>
|
|
26
|
-
<InlineError
|
|
27
|
-
message="Store name is required"
|
|
28
|
-
field-id="my-field-id"
|
|
29
|
-
/>
|
|
30
|
-
</template>
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Best practices
|
|
34
|
-
|
|
35
|
-
Inline errors should:
|
|
36
|
-
|
|
37
|
-
- Be brief.
|
|
38
|
-
- Be written in sentence case.
|
|
39
|
-
- Be visible immediately upon a form input that is not valid.
|
|
40
|
-
- Be removed as soon as the input is valid so users can immediately tell they fixed the issue.
|
|
41
|
-
- Describe specific solutions so users can successfully complete their task in the form.
|
|
42
|
-
- Not be placed out of context of the input or group of inputs they describe.
|
|
43
|
-
|
|
44
|
-
## Content guidelines
|
|
45
|
-
|
|
46
|
-
### Inline error messages
|
|
47
|
-
|
|
48
|
-
Since the error message is directly below the source of the problem, the copy only needs to explain why the error
|
|
49
|
-
happened. Optionally, the message can clarify what to do next or offer a one-click fix.
|
|
50
|
-
|
|
51
|
-
Inline error messages should:
|
|
52
|
-
|
|
53
|
-
- Clearly explain what went wrong, give a next step, or offer a one-click fix.
|
|
54
|
-
- Be short and concise, no more than a single sentence.
|
|
55
|
-
- Use passive voice so users don't feel like they're being blamed for the error.
|
|
56
|
-
|
|
57
|
-
## Accessibility
|
|
58
|
-
|
|
59
|
-
- Use the required `fieldId` prop to give the inline error a unique `id`. This ties the error to a form field using
|
|
60
|
-
`aria-describedby` so that it's conveyed to screen reader users.
|
|
61
|
-
- Use the required `message` prop to provide the text that describes the error.
|
|
62
|
-
- The inline error icon helps visually identify the error message for users who have difficulty seeing colors or who
|
|
63
|
-
use settings that remove color from the page.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as InlineError } from './InlineError.vue';
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
import { VisuallyHidden } from '../VisuallyHidden';
|
|
4
|
-
import { TextStyle } from '../TextStyle';
|
|
5
|
-
|
|
6
|
-
const props = withDefaults(defineProps<{
|
|
7
|
-
/** The label text. */
|
|
8
|
-
label: string;
|
|
9
|
-
|
|
10
|
-
/** The ID of the input the label is associated with. */
|
|
11
|
-
labelFor: string;
|
|
12
|
-
|
|
13
|
-
/** Whether the label should be hidden. */
|
|
14
|
-
labelHidden?: boolean;
|
|
15
|
-
}>(), {
|
|
16
|
-
labelHidden: false,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
const componentType = computed(() => props.labelHidden ? VisuallyHidden : 'label');
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<template>
|
|
23
|
-
<component
|
|
24
|
-
:is="componentType"
|
|
25
|
-
:for="labelFor"
|
|
26
|
-
class="block w-fit cursor-pointer truncate text-sm leading-0 align-baseline"
|
|
27
|
-
>
|
|
28
|
-
<TextStyle variant="strong">
|
|
29
|
-
{{ label }}
|
|
30
|
-
</TextStyle>
|
|
31
|
-
</component>
|
|
32
|
-
</template>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as InputLabel } from './InputLabel.vue';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { Card } from '../Card';
|
|
3
|
-
import { computed } from 'vue';
|
|
4
|
-
|
|
5
|
-
const props = withDefaults(defineProps<{
|
|
6
|
-
orientation?: 'horizontal' | 'vertical';
|
|
7
|
-
}>(), {
|
|
8
|
-
orientation: 'horizontal',
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
const classList = computed(() => {
|
|
12
|
-
return {
|
|
13
|
-
'flex flex-col divide-y': props.orientation === 'vertical',
|
|
14
|
-
'flex flex-row divide-x': props.orientation === 'horizontal',
|
|
15
|
-
};
|
|
16
|
-
});
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<template>
|
|
20
|
-
<Card>
|
|
21
|
-
<div
|
|
22
|
-
:class="classList"
|
|
23
|
-
class="[&>*]:flex-1"
|
|
24
|
-
>
|
|
25
|
-
<slot />
|
|
26
|
-
</div>
|
|
27
|
-
</Card>
|
|
28
|
-
</template>
|