@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,159 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
3
|
-
DescriptionList,
|
|
4
|
-
DescriptionListDescription,
|
|
5
|
-
DescriptionListItem,
|
|
6
|
-
DescriptionListTerm,
|
|
7
|
-
} from '../../src/components';
|
|
8
|
-
import api from '../component-meta/DescriptionList.json';
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
# Description list
|
|
12
|
-
|
|
13
|
-
Description lists are a way to organize and explain related information. They're particularly useful when you need to
|
|
14
|
-
list and define terms.
|
|
15
|
-
|
|
16
|
-
<ComponentApi :api="api" />
|
|
17
|
-
|
|
18
|
-
## Usage
|
|
19
|
-
|
|
20
|
-
<ComponentWrapper>
|
|
21
|
-
<DescriptionList>
|
|
22
|
-
<DescriptionListItem>
|
|
23
|
-
<DescriptionListTerm>Logistics</DescriptionListTerm>
|
|
24
|
-
<DescriptionListDescription>
|
|
25
|
-
The management of products or other resources as they travel between a point of origin and a destination.
|
|
26
|
-
</DescriptionListDescription>
|
|
27
|
-
</DescriptionListItem>
|
|
28
|
-
<DescriptionListItem>
|
|
29
|
-
<DescriptionListTerm>Sole proprietorship</DescriptionListTerm>
|
|
30
|
-
<DescriptionListDescription>A business structure where a single individual both owns and runs the company.</DescriptionListDescription>
|
|
31
|
-
</DescriptionListItem>
|
|
32
|
-
<DescriptionListItem>
|
|
33
|
-
<DescriptionListTerm>Discount code</DescriptionListTerm>
|
|
34
|
-
<DescriptionListDescription>
|
|
35
|
-
A series of numbers and/or letters that an online shopper may enter at checkout to get a discount or special offer.
|
|
36
|
-
</DescriptionListDescription>
|
|
37
|
-
</DescriptionListItem>
|
|
38
|
-
</DescriptionList>
|
|
39
|
-
</ComponentWrapper>
|
|
40
|
-
|
|
41
|
-
```js-vue
|
|
42
|
-
<script lang="ts" setup>
|
|
43
|
-
import {
|
|
44
|
-
DescriptionList,
|
|
45
|
-
DescriptionListDescription,
|
|
46
|
-
DescriptionListItem,
|
|
47
|
-
DescriptionListTerm,
|
|
48
|
-
} from '@returnless/focus-ui';
|
|
49
|
-
</script>
|
|
50
|
-
|
|
51
|
-
<template>
|
|
52
|
-
<DescriptionList>
|
|
53
|
-
<DescriptionListItem>
|
|
54
|
-
<DescriptionListTerm>Logistics</DescriptionListTerm>
|
|
55
|
-
<DescriptionListDescription>
|
|
56
|
-
The management of products or other resources as they travel between a point of origin and a destination.
|
|
57
|
-
</DescriptionListDescription>
|
|
58
|
-
</DescriptionListItem>
|
|
59
|
-
<DescriptionListItem>
|
|
60
|
-
<DescriptionListTerm>Sole proprietorship</DescriptionListTerm>
|
|
61
|
-
<DescriptionListDescription>A business structure where a single individual both owns and runs the company.</DescriptionListDescription>
|
|
62
|
-
</DescriptionListItem>
|
|
63
|
-
<DescriptionListItem>
|
|
64
|
-
<DescriptionListTerm>Discount code</DescriptionListTerm>
|
|
65
|
-
<DescriptionListDescription>
|
|
66
|
-
A series of numbers and/or letters that an online shopper may enter at checkout to get a discount or special offer.
|
|
67
|
-
</DescriptionListDescription>
|
|
68
|
-
</DescriptionListItem>
|
|
69
|
-
</DescriptionList>
|
|
70
|
-
</template>
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Description list with vertical alignment
|
|
74
|
-
|
|
75
|
-
<ComponentWrapper>
|
|
76
|
-
<DescriptionList align="vertical">
|
|
77
|
-
<DescriptionListItem>
|
|
78
|
-
<DescriptionListTerm>Logistics</DescriptionListTerm>
|
|
79
|
-
<DescriptionListDescription>
|
|
80
|
-
The management of products or other resources as they travel between a point of origin and a destination.
|
|
81
|
-
</DescriptionListDescription>
|
|
82
|
-
</DescriptionListItem>
|
|
83
|
-
<DescriptionListItem>
|
|
84
|
-
<DescriptionListTerm>Sole proprietorship</DescriptionListTerm>
|
|
85
|
-
<DescriptionListDescription>A business structure where a single individual both owns and runs the company.</DescriptionListDescription>
|
|
86
|
-
</DescriptionListItem>
|
|
87
|
-
<DescriptionListItem>
|
|
88
|
-
<DescriptionListTerm>Discount code</DescriptionListTerm>
|
|
89
|
-
<DescriptionListDescription>
|
|
90
|
-
A series of numbers and/or letters that an online shopper may enter at checkout to get a discount or special offer.
|
|
91
|
-
</DescriptionListDescription>
|
|
92
|
-
</DescriptionListItem>
|
|
93
|
-
</DescriptionList>
|
|
94
|
-
</ComponentWrapper>
|
|
95
|
-
|
|
96
|
-
```js-vue
|
|
97
|
-
<script lang="ts" setup>
|
|
98
|
-
import {
|
|
99
|
-
DescriptionList,
|
|
100
|
-
DescriptionListDescription,
|
|
101
|
-
DescriptionListItem,
|
|
102
|
-
DescriptionListTerm,
|
|
103
|
-
} from '@returnless/focus-ui';
|
|
104
|
-
</script>
|
|
105
|
-
|
|
106
|
-
<template>
|
|
107
|
-
<DescriptionList align="vertical">
|
|
108
|
-
<DescriptionListItem>
|
|
109
|
-
<DescriptionListTerm>Logistics</DescriptionListTerm>
|
|
110
|
-
<DescriptionListDescription>
|
|
111
|
-
The management of products or other resources as they travel between a point of origin and a destination.
|
|
112
|
-
</DescriptionListDescription>
|
|
113
|
-
</DescriptionListItem>
|
|
114
|
-
<DescriptionListItem>
|
|
115
|
-
<DescriptionListTerm>Sole proprietorship</DescriptionListTerm>
|
|
116
|
-
<DescriptionListDescription>A business structure where a single individual both owns and runs the company.</DescriptionListDescription>
|
|
117
|
-
</DescriptionListItem>
|
|
118
|
-
<DescriptionListItem>
|
|
119
|
-
<DescriptionListTerm>Discount code</DescriptionListTerm>
|
|
120
|
-
<DescriptionListDescription>
|
|
121
|
-
A series of numbers and/or letters that an online shopper may enter at checkout to get a discount or special offer.
|
|
122
|
-
</DescriptionListDescription>
|
|
123
|
-
</DescriptionListItem>
|
|
124
|
-
</DescriptionList>
|
|
125
|
-
</template>
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## Best practices
|
|
129
|
-
|
|
130
|
-
Description lists should:
|
|
131
|
-
|
|
132
|
-
- Contain terms and associated explanations, or descriptions for each term.
|
|
133
|
-
- Provide information that isn't action-oriented.
|
|
134
|
-
- Not be an excuse for using unnecessarily complicated or jargon-filled language. Generally, if users need a description
|
|
135
|
-
list to understand the language in your application, you should look for opportunities to simplify the language.
|
|
136
|
-
- Not be used to upsell users on a feature or service.
|
|
137
|
-
|
|
138
|
-
## Content guidelines
|
|
139
|
-
|
|
140
|
-
### Terms
|
|
141
|
-
|
|
142
|
-
Terms should be:
|
|
143
|
-
|
|
144
|
-
- Written in sentence case (the first word capitalized, the rest lowercase).
|
|
145
|
-
|
|
146
|
-
### Term description
|
|
147
|
-
|
|
148
|
-
Thems descriptions should be:
|
|
149
|
-
|
|
150
|
-
- Directly related to the term they're describing.
|
|
151
|
-
- Written to describe the users benefit or utility.
|
|
152
|
-
- Written in sentence case with all appropriate punctuation, including ending each sentence with a period.
|
|
153
|
-
- Conversational by using articles ("the", "a", "an").
|
|
154
|
-
- Written in plain language.
|
|
155
|
-
|
|
156
|
-
## Accessibility
|
|
157
|
-
|
|
158
|
-
The description list component produces a description list wrapper (`<dl>`), terms (`<dt>`), and definitions (`<dd>`)
|
|
159
|
-
to convey the relationships between the list items to assistive technology users.
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { default as DescriptionList } from './DescriptionList.vue';
|
|
2
|
-
export { default as DescriptionListDescription } from './DescriptionListDescription.vue';
|
|
3
|
-
export { default as DescriptionListItem } from './DescriptionListItem.vue';
|
|
4
|
-
export { default as DescriptionListTerm } from './DescriptionListTerm.vue';
|
|
File without changes
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { useFileDialog, useDropZone } from '@vueuse/core';
|
|
3
|
-
import { Button } from '../Button';
|
|
4
|
-
import { computed, ref } from 'vue';
|
|
5
|
-
import { FileAccepts } from '../types';
|
|
6
|
-
|
|
7
|
-
const props = withDefaults(defineProps<{
|
|
8
|
-
/** The file types to accept. */
|
|
9
|
-
accepts: FileAccepts;
|
|
10
|
-
|
|
11
|
-
label: string;
|
|
12
|
-
|
|
13
|
-
/** The label for the action button. */
|
|
14
|
-
actionLabel: string;
|
|
15
|
-
|
|
16
|
-
/** Whether to accept multiple files. */
|
|
17
|
-
multiple?: boolean;
|
|
18
|
-
}>(), {
|
|
19
|
-
accepts: '*',
|
|
20
|
-
multiple: false,
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const model = defineModel<File[]>({
|
|
24
|
-
default: [],
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
const dropZoneRef = ref<HTMLDivElement>();
|
|
28
|
-
|
|
29
|
-
const acceptTypes = computed(() => {
|
|
30
|
-
switch (props.accepts) {
|
|
31
|
-
case 'image':
|
|
32
|
-
return 'image/*';
|
|
33
|
-
case 'pdf':
|
|
34
|
-
return 'application/pdf';
|
|
35
|
-
default:
|
|
36
|
-
return '*';
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
const { open, onChange } = useFileDialog({
|
|
41
|
-
accept: acceptTypes.value,
|
|
42
|
-
multiple: props.multiple,
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
const { isOverDropZone } = useDropZone(dropZoneRef, {
|
|
46
|
-
onDrop: onFileUpload,
|
|
47
|
-
// specify the types of data to be received.
|
|
48
|
-
dataTypes: (types: readonly string[]) => {
|
|
49
|
-
if (props.accepts === '*') {
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (props.accepts === 'image') {
|
|
54
|
-
return types.some((type) => type.startsWith('image'));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return types.includes(props.accepts);
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
onChange((files: FileList | null): void => {
|
|
62
|
-
const listOfFiles: File[] = Array.from(files || []);
|
|
63
|
-
|
|
64
|
-
onFileUpload(listOfFiles);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
function onFileUpload(files: File[] | null): void {
|
|
68
|
-
if (files === null) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
model.value = props.multiple
|
|
73
|
-
? [...model.value, ...files]
|
|
74
|
-
: [files[0]];
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const classList = computed((): Record<string, boolean>[] => {
|
|
78
|
-
return [
|
|
79
|
-
{ 'bg-blue-500': isOverDropZone.value },
|
|
80
|
-
];
|
|
81
|
-
});
|
|
82
|
-
</script>
|
|
83
|
-
|
|
84
|
-
<template>
|
|
85
|
-
<button
|
|
86
|
-
ref="dropZoneRef"
|
|
87
|
-
:class="classList"
|
|
88
|
-
class="block w-full cursor-pointer rounded border border-dashed bg-white hover:border-solid hover:bg-slate-50"
|
|
89
|
-
@click="() => open()"
|
|
90
|
-
>
|
|
91
|
-
<span class="flex flex-col justify-center px-4 py-12 space-y-4">
|
|
92
|
-
<span>
|
|
93
|
-
<Button variant="secondary">
|
|
94
|
-
{{ actionLabel }}
|
|
95
|
-
</Button>
|
|
96
|
-
</span>
|
|
97
|
-
<span
|
|
98
|
-
v-if="label"
|
|
99
|
-
class="block"
|
|
100
|
-
>
|
|
101
|
-
{{ label }}
|
|
102
|
-
</span>
|
|
103
|
-
</span>
|
|
104
|
-
</button>
|
|
105
|
-
</template>
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# Drop zone
|
|
2
|
-
|
|
3
|
-
The drop zone component lets users upload files by dragging and dropping the files into an area on a page, or activating
|
|
4
|
-
a button.
|
|
5
|
-
|
|
6
|
-
## Usage
|
|
7
|
-
|
|
8
|
-
## Best practices
|
|
9
|
-
|
|
10
|
-
Drop zones should:
|
|
11
|
-
|
|
12
|
-
- Inform users when the file(s) can't be uploaded.
|
|
13
|
-
- When possible, use validation errors on drag to detect and explain things like file size limits or file types
|
|
14
|
-
accepted.
|
|
15
|
-
- Use the banner component with a critical status to communicate errors that happen on the server.
|
|
16
|
-
- Provide feedback once the file(s) have been dropped and uploading begins.
|
|
17
|
-
- Provide a file upload button to allow users to select files for upload in traditional way.
|
|
18
|
-
|
|
19
|
-
### Validation errors
|
|
20
|
-
|
|
21
|
-
The drop zone component validates file type by default. File types you wish to accept can be defined by editing the
|
|
22
|
-
`accept` property. This component also accepts custom validations using the `customValidator` property. When
|
|
23
|
-
validation fails, the components sets itself to error mode.
|
|
24
|
-
|
|
25
|
-
## Content guidelines
|
|
26
|
-
|
|
27
|
-
### Client-side validation error messages
|
|
28
|
-
|
|
29
|
-
Validation error messages should be:
|
|
30
|
-
|
|
31
|
-
- Explicit: help users understand why their file can't be uploaded and what they should change to successfully upload
|
|
32
|
-
their file
|
|
33
|
-
- In sentence case: capitalize only the first word in a message
|
|
34
|
-
- Concise: use simple, clear language that can be read at a glance: For example:
|
|
35
|
-
- `File size must be less than 20MB`
|
|
36
|
-
- `File type must be .pdf, .doc, or .docx`
|
|
37
|
-
|
|
38
|
-
## Accessibility
|
|
39
|
-
|
|
40
|
-
The drop zone component builds on the native HTML `<input type="upload" />` element. It includes a visual `<button>`
|
|
41
|
-
as well as a drag and drop area that can receive keyboard focus.
|
|
42
|
-
|
|
43
|
-
## Keyboard support
|
|
44
|
-
|
|
45
|
-
To upload a file with the keyboard, users can interact with the drag-and-drop region.
|
|
46
|
-
|
|
47
|
-
- To give the input keyboard focus, use the tab key (or shift + tab when tabbing backwards)
|
|
48
|
-
- To activate the input, use the enter/return or space keys
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as DropZone } from './DropZone.vue';
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
3
|
-
Button,
|
|
4
|
-
EmptyState,
|
|
5
|
-
EmptyStateActions,
|
|
6
|
-
EmptyStateContent,
|
|
7
|
-
EmptyStateDescription,
|
|
8
|
-
EmptyStateTitle,
|
|
9
|
-
} from '../../src/components';
|
|
10
|
-
import api from '../component-meta/EmptyState.json';
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
# Empty state
|
|
14
|
-
|
|
15
|
-
Empty states are used when a list, table, or chart has no items or data to show. This is an opportunity to provide
|
|
16
|
-
explanation or guidance to help users progress. The empty state component is intended for use when a full page is
|
|
17
|
-
empty, and not for individual elements or areas in the interface.
|
|
18
|
-
|
|
19
|
-
<ComponentApi :api="api" />
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
<ComponentWrapper>
|
|
24
|
-
<EmptyState>
|
|
25
|
-
<EmptyStateContent>
|
|
26
|
-
<EmptyStateTitle>Manage your inventory transfers</EmptyStateTitle>
|
|
27
|
-
<EmptyStateDescription>Track and receive your incoming inventory from suppliers.</EmptyStateDescription>
|
|
28
|
-
</EmptyStateContent>
|
|
29
|
-
<EmptyStateActions>
|
|
30
|
-
<Button variant="secondary">Learn more</Button>
|
|
31
|
-
<Button>Add transfer</Button>
|
|
32
|
-
</EmptyStateActions>
|
|
33
|
-
</EmptyState>
|
|
34
|
-
</ComponentWrapper>
|
|
35
|
-
|
|
36
|
-
```js-vue
|
|
37
|
-
<script lang="ts" setup>
|
|
38
|
-
import {
|
|
39
|
-
Button,
|
|
40
|
-
EmptyState,
|
|
41
|
-
EmptyStateActions,
|
|
42
|
-
EmptyStateContent,
|
|
43
|
-
EmptyStateDescription,
|
|
44
|
-
EmptyStateTitle,
|
|
45
|
-
} from '@returnless/focus-ui';
|
|
46
|
-
</script>
|
|
47
|
-
|
|
48
|
-
<template>
|
|
49
|
-
<EmptyState>
|
|
50
|
-
<EmptyStateContent>
|
|
51
|
-
<EmptyStateTitle>Manage your inventory transfers</EmptyStateTitle>
|
|
52
|
-
<EmptyStateDescription>Track and receive your incoming inventory from suppliers.</EmptyStateDescription>
|
|
53
|
-
</EmptyStateContent>
|
|
54
|
-
<EmptyStateActions>
|
|
55
|
-
<Button variant="secondary">Learn more</Button>
|
|
56
|
-
<Button>Add transfer</Button>
|
|
57
|
-
</EmptyStateActions>
|
|
58
|
-
</EmptyState>
|
|
59
|
-
</template>
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Best practices
|
|
63
|
-
|
|
64
|
-
Empty states should:
|
|
65
|
-
|
|
66
|
-
- Orient users by clearly explaining the benefit and utility of a product or feature.
|
|
67
|
-
- Simplify a complicated experience by focusing on a few key features and benefits.
|
|
68
|
-
- Use simple and clear language that empowers users to move their business forward.
|
|
69
|
-
- Be encouraging and never make users feel unsuccessful or guilty because they haven't used a product or feature.
|
|
70
|
-
- Explain the steps users need to take to activate a product or feature.
|
|
71
|
-
- Use only one primary call-to-action button.
|
|
72
|
-
|
|
73
|
-
## Content guidelines
|
|
74
|
-
|
|
75
|
-
### Title
|
|
76
|
-
|
|
77
|
-
Empty state titles should:
|
|
78
|
-
|
|
79
|
-
- Be action-oriented: encourage users to take the step required to activate the product or feature.
|
|
80
|
-
|
|
81
|
-
### Subtitle
|
|
82
|
-
|
|
83
|
-
Empty state subtitles act like body content. They should:
|
|
84
|
-
|
|
85
|
-
- Describe or explain what's in the empty state title or item title.
|
|
86
|
-
- Be conversational: include articles such as "the", "a", and "an".
|
|
87
|
-
|
|
88
|
-
### Primary action
|
|
89
|
-
|
|
90
|
-
Buttons are used for the most important actions you want users to take. They should be:
|
|
91
|
-
|
|
92
|
-
- Clear and predictable: users should be able to anticipate what will happen when they click a button. Never deceive
|
|
93
|
-
users by misleading titles.
|
|
94
|
-
- Action-led: buttons should always lead with a strong verb that encourages action. To provide enough context to
|
|
95
|
-
users use the {verb + noun} format on buttons except in the case of common actions like "Save", "Close", "Cancel",
|
|
96
|
-
or "Ok".
|
|
97
|
-
- Scannable: avoid unnecessary words and articles such as "the", "an", or "a".
|
|
98
|
-
|
|
99
|
-
### Secondary action
|
|
100
|
-
|
|
101
|
-
Secondary actions are used for less important actions such as "Learn more" or "Close" buttons. They should follow
|
|
102
|
-
all the other content rules outlined for primary buttons.
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { default as EmptyState } from './EmptyState.vue';
|
|
2
|
-
export { default as EmptyStateActions } from './EmptyStateActions.vue';
|
|
3
|
-
export { default as EmptyStateContent } from './EmptyStateContent.vue';
|
|
4
|
-
export { default as EmptyStateDescription } from './EmptyStateDescription.vue';
|
|
5
|
-
export { default as EmptyStateTitle } from './EmptyStateTitle.vue';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
</script>
|
|
3
|
-
|
|
4
|
-
<template>
|
|
5
|
-
<li
|
|
6
|
-
class="relative flex gap-x-2 [&:not(:last-child)]:pb-4"
|
|
7
|
-
role="listitem"
|
|
8
|
-
>
|
|
9
|
-
<div class="absolute top-0 -bottom-0 left-0 flex w-6 justify-center">
|
|
10
|
-
<div class="w-px bg-slate-200" />
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
<div class="relative flex h-5 w-6 flex-none items-center justify-center">
|
|
14
|
-
<div class="h-1 w-1 rounded-full bg-slate-100 ring-1 ring-slate-400" />
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
<slot />
|
|
18
|
-
</li>
|
|
19
|
-
</template>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed, CSSProperties } from 'vue';
|
|
3
|
-
import { TailwindColor, useTailwindColor } from '../../composables';
|
|
4
|
-
|
|
5
|
-
const props = withDefaults(defineProps<{
|
|
6
|
-
/** The color of the badge. */
|
|
7
|
-
color: TailwindColor;
|
|
8
|
-
}>(), {});
|
|
9
|
-
|
|
10
|
-
const colorValue = computed((): CSSProperties => {
|
|
11
|
-
return {
|
|
12
|
-
backgroundColor: useTailwindColor(props.color, '500'),
|
|
13
|
-
};
|
|
14
|
-
});
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<template>
|
|
18
|
-
<div
|
|
19
|
-
class="absolute flex h-5 w-5 items-center justify-center rounded bg-green-400 ml-0.5"
|
|
20
|
-
:style="colorValue"
|
|
21
|
-
>
|
|
22
|
-
<div class="h-4 w-4 text-white">
|
|
23
|
-
<slot />
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
</template>
|