@returnless/focus-ui 0.0.1
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/LICENSE.md +21 -0
- package/README.md +23 -0
- package/dist/focus-ui.es.js +33 -0
- package/dist/types/components/Accordion/Accordion.vue.d.ts +32 -0
- package/dist/types/components/Accordion/AccordionItem.vue.d.ts +2 -0
- package/dist/types/components/Accordion/index.d.ts +2 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/index.d.ts +7 -0
- package/package.json +53 -0
- package/src/build-utils/generate-component-meta.ts +76 -0
- package/src/build-utils/update-component-list.js +31 -0
- package/src/build-utils/update-component-list.ts +32 -0
- package/src/components/Accordion/Accordion.vue +20 -0
- package/src/components/Accordion/AccordionContent.vue +14 -0
- package/src/components/Accordion/AccordionItem.vue +18 -0
- package/src/components/Accordion/AccordionTrigger.vue +35 -0
- package/src/components/Accordion/README.md +56 -0
- package/src/components/Accordion/index.ts +4 -0
- package/src/components/Alert/Alert.vue +55 -0
- package/src/components/Alert/AlertDescription.vue +8 -0
- package/src/components/Alert/AlertTitle.vue +11 -0
- package/src/components/Alert/DismissableAlertButton.vue +34 -0
- package/src/components/Alert/README.md +121 -0
- package/src/components/Alert/index.ts +3 -0
- package/src/components/AlertDialog/AlertDialog.vue +45 -0
- package/src/components/AlertDialog/AlertDialogActionButton.vue +9 -0
- package/src/components/AlertDialog/AlertDialogCancelButton.vue +15 -0
- package/src/components/AlertDialog/AlertDialogContent.vue +8 -0
- package/src/components/AlertDialog/AlertDialogDescription.vue +11 -0
- package/src/components/AlertDialog/AlertDialogFooter.vue +11 -0
- package/src/components/AlertDialog/AlertDialogHeader.vue +8 -0
- package/src/components/AlertDialog/AlertDialogTitle.vue +7 -0
- package/src/components/AlertDialog/README.md +85 -0
- package/src/components/AlertDialog/index.ts +8 -0
- package/src/components/Avatar/Avatar.vue +78 -0
- package/src/components/Avatar/README.md +122 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Badge/Badge.vue +51 -0
- package/src/components/Badge/BadgeContent.vue +9 -0
- package/src/components/Badge/BadgeIcon.vue +7 -0
- package/src/components/Badge/README.md +131 -0
- package/src/components/Badge/index.ts +3 -0
- package/src/components/Button/Button.vue +63 -0
- package/src/components/Button/ButtonContent.vue +7 -0
- package/src/components/Button/ButtonIcon.vue +7 -0
- package/src/components/Button/README.md +228 -0
- package/src/components/Button/index.ts +3 -0
- package/src/components/ButtonGroup/ButtonGroup.vue +7 -0
- package/src/components/ButtonGroup/README.md +42 -0
- package/src/components/ButtonGroup/index.ts +1 -0
- package/src/components/Card/Card.vue +7 -0
- package/src/components/Card/CardDescription.vue +11 -0
- package/src/components/Card/CardFooter.vue +7 -0
- package/src/components/Card/CardHeader.vue +7 -0
- package/src/components/Card/CardSection.vue +7 -0
- package/src/components/Card/CardTitle.vue +8 -0
- package/src/components/Card/README.md +69 -0
- package/src/components/Card/index.ts +6 -0
- package/src/components/CategoryBar/CategoryBar.vue +25 -0
- package/src/components/CategoryBar/CategoryBarItem.vue +34 -0
- package/src/components/CategoryBar/README.md +17 -0
- package/src/components/CategoryBar/index.ts +2 -0
- package/src/components/Checkbox/Checkbox.vue +49 -0
- package/src/components/Checkbox/README.md +82 -0
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/Collapsible/README.md +25 -0
- package/src/components/DataTable/README.md +56 -0
- package/src/components/DatePicker/DatePicker.vue +140 -0
- package/src/components/DatePicker/DatePickerCard.vue +9 -0
- package/src/components/DatePicker/README.md +59 -0
- package/src/components/DatePicker/index.ts +2 -0
- package/src/components/DescriptionList/DescriptionList.vue +18 -0
- package/src/components/DescriptionList/DescriptionListDescription.vue +8 -0
- package/src/components/DescriptionList/DescriptionListItem.vue +21 -0
- package/src/components/DescriptionList/DescriptionListTerm.vue +11 -0
- package/src/components/DescriptionList/README.md +159 -0
- package/src/components/DescriptionList/index.ts +4 -0
- package/src/components/EmptyState/EmptyState.vue +13 -0
- package/src/components/EmptyState/EmptyStateActions.vue +11 -0
- package/src/components/EmptyState/EmptyStateContent.vue +7 -0
- package/src/components/EmptyState/EmptyStateDescription.vue +11 -0
- package/src/components/EmptyState/EmptyStateTitle.vue +7 -0
- package/src/components/EmptyState/README.md +102 -0
- package/src/components/EmptyState/index.ts +5 -0
- package/src/components/Feed/Feed.vue +7 -0
- package/src/components/Feed/FeedItem.vue +16 -0
- package/src/components/Feed/FeedItemBlock.vue +8 -0
- package/src/components/Feed/FeedItemDateIndicator.vue +11 -0
- package/src/components/Feed/FeedItemIcon.vue +26 -0
- package/src/components/Feed/FeedItemSimple.vue +8 -0
- package/src/components/Feed/README.md +115 -0
- package/src/components/Feed/index.ts +6 -0
- package/src/components/Form/Form.vue +30 -0
- package/src/components/Form/README.md +52 -0
- package/src/components/Form/index.ts +1 -0
- package/src/components/FormLayout/FormLayout.vue +7 -0
- package/src/components/FormLayout/README.md +59 -0
- package/src/components/FormLayout/index.ts +1 -0
- package/src/components/InputLabel/InputLabel.vue +32 -0
- package/src/components/InputLabel/index.ts +1 -0
- package/src/components/Link/Link.vue +38 -0
- package/src/components/Link/README.md +119 -0
- package/src/components/Link/index.ts +1 -0
- package/src/components/MetricCard/MetricCard.vue +11 -0
- package/src/components/MetricCard/MetricCardHeader.vue +7 -0
- package/src/components/MetricCard/MetricCardLabel.vue +9 -0
- package/src/components/MetricCard/MetricCardSection.vue +11 -0
- package/src/components/MetricCard/MetricCardValue.vue +8 -0
- package/src/components/MetricCard/README.md +53 -0
- package/src/components/MetricCard/index.ts +5 -0
- package/src/components/Navigation/Navigation.vue +8 -0
- package/src/components/Navigation/NavigationItem.vue +43 -0
- package/src/components/Navigation/NavigationSection.vue +27 -0
- package/src/components/Navigation/README.md +88 -0
- package/src/components/Navigation/index.ts +3 -0
- package/src/components/Page/Page.vue +38 -0
- package/src/components/Page/PageDescription.vue +11 -0
- package/src/components/Page/PageHeader.vue +34 -0
- package/src/components/Page/PageTitle.vue +9 -0
- package/src/components/Page/README.md +220 -0
- package/src/components/Page/index.ts +4 -0
- package/src/components/Pagination/Pagination.vue +8 -0
- package/src/components/Pagination/PaginationNextButton.vue +10 -0
- package/src/components/Pagination/PaginationPreviousButton.vue +10 -0
- package/src/components/Pagination/README.md +45 -0
- package/src/components/Pagination/index.ts +3 -0
- package/src/components/PinInput/PinInput.vue +169 -0
- package/src/components/PinInput/README.md +35 -0
- package/src/components/PinInput/index.ts +1 -0
- package/src/components/Popover/README.md +51 -0
- package/src/components/ProgressBar/ProgressBar.vue +33 -0
- package/src/components/ProgressBar/ProgressBarIndicator.vue +7 -0
- package/src/components/ProgressBar/README.md +98 -0
- package/src/components/ProgressBar/index.ts +2 -0
- package/src/components/RadioButton/README.md +111 -0
- package/src/components/RadioButton/RadioButton.vue +48 -0
- package/src/components/RadioButton/index.ts +1 -0
- package/src/components/Select/README.md +74 -0
- package/src/components/Select/Select.vue +91 -0
- package/src/components/Select/SelectGroup.vue +12 -0
- package/src/components/Select/SelectOption.vue +12 -0
- package/src/components/Select/index.ts +3 -0
- package/src/components/Separator/README.md +35 -0
- package/src/components/Separator/Separator.vue +7 -0
- package/src/components/Separator/index.ts +1 -0
- package/src/components/Spinner/README.md +53 -0
- package/src/components/Spinner/Spinner.vue +58 -0
- package/src/components/Spinner/index.ts +1 -0
- package/src/components/StatusIndicator/README.md +51 -0
- package/src/components/StatusIndicator/StatusIndicator.vue +38 -0
- package/src/components/StatusIndicator/index.ts +1 -0
- package/src/components/Tabs/README.md +53 -0
- package/src/components/Tabs/TabTrigger.vue +43 -0
- package/src/components/Tabs/Tabs.vue +13 -0
- package/src/components/Tabs/index.ts +2 -0
- package/src/components/Tag/README.md +27 -0
- package/src/components/TextField/README.md +317 -0
- package/src/components/TextField/TextField.vue +115 -0
- package/src/components/TextField/TextFieldPasswordIcon.vue +28 -0
- package/src/components/TextField/TextFieldSearchIcon.vue +11 -0
- package/src/components/TextField/index.ts +1 -0
- package/src/components/TextStyle/README.md +39 -0
- package/src/components/TextStyle/TextStyle.vue +24 -0
- package/src/components/TextStyle/index.ts +1 -0
- package/src/components/Toast/DismissToastAction.vue +34 -0
- package/src/components/Toast/README.md +167 -0
- package/src/components/Toast/Toast.vue +39 -0
- package/src/components/Toast/ToastGroup.vue +9 -0
- package/src/components/Toast/index.ts +2 -0
- package/src/components/Toggle/README.md +66 -0
- package/src/components/Toggle/Toggle.vue +86 -0
- package/src/components/Toggle/index.ts +1 -0
- package/src/components/Tooltip/README.md +51 -0
- package/src/components/Tooltip/Tooltip.vue +50 -0
- package/src/components/Tooltip/index.ts +1 -0
- package/src/components/TopBar/README.md +43 -0
- package/src/components/TopBar/TopBar.vue +7 -0
- package/src/components/TopBar/TopBarLogo.vue +8 -0
- package/src/components/TopBar/TopBarNavigation.vue +7 -0
- package/src/components/TopBar/TopBarNavigationItem.vue +13 -0
- package/src/components/TopBar/TopBarSearch.vue +15 -0
- package/src/components/TopBar/TopBarUserMenu.vue +20 -0
- package/src/components/TopBar/index.ts +6 -0
- package/src/components/VisuallyHidden/README.md +19 -0
- package/src/components/VisuallyHidden/VisuallyHidden.vue +25 -0
- package/src/components/VisuallyHidden/index.ts +1 -0
- package/src/components/index.ts +141 -0
- package/src/composables/index.ts +7 -0
- package/src/composables/useTailwindColor.ts +17 -0
- package/src/composables/useTheme.ts +29 -0
- package/src/composables/useToastNotifications.ts +55 -0
- package/src/composables/useUniqueId.ts +5 -0
- package/src/index.css +20 -0
- package/src/index.ts +12 -0
|
@@ -0,0 +1,159 @@
|
|
|
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 '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 '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.
|
|
@@ -0,0 +1,4 @@
|
|
|
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';
|
|
@@ -0,0 +1,102 @@
|
|
|
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 '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.
|
|
@@ -0,0 +1,5 @@
|
|
|
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';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<template>
|
|
5
|
+
<li class="relative flex gap-x-2 [&:not(:last-child)]:pb-4">
|
|
6
|
+
<div class="absolute top-0 -bottom-0 left-0 flex w-6 justify-center">
|
|
7
|
+
<div class="w-px bg-slate-200" />
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<div class="relative flex h-5 w-6 flex-none items-center justify-center">
|
|
11
|
+
<div class="h-1 w-1 rounded-full bg-slate-100 ring-1 ring-slate-400" />
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<slot />
|
|
15
|
+
</li>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,26 @@
|
|
|
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>
|
|
@@ -0,0 +1,115 @@
|
|
|
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 '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
|
|
@@ -0,0 +1,6 @@
|
|
|
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';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { useUniqueId } from '../../composables';
|
|
3
|
+
|
|
4
|
+
const props = withDefaults(defineProps<{
|
|
5
|
+
/** The encoding type for the form. */
|
|
6
|
+
enctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain' | null;
|
|
7
|
+
|
|
8
|
+
/** The ID of the form. */
|
|
9
|
+
id?: string | null;
|
|
10
|
+
}>(), {
|
|
11
|
+
enctype: null,
|
|
12
|
+
id: null,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
defineEmits<{
|
|
16
|
+
submit: [];
|
|
17
|
+
}>();
|
|
18
|
+
|
|
19
|
+
const elementId = props.id || useUniqueId('form');
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<form
|
|
24
|
+
:id="elementId"
|
|
25
|
+
:enctype="enctype"
|
|
26
|
+
@submit.prevent="$emit('submit')"
|
|
27
|
+
>
|
|
28
|
+
<slot />
|
|
29
|
+
</form>
|
|
30
|
+
</template>
|
|
@@ -0,0 +1,52 @@
|
|
|
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 '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.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Form } from './Form.vue';
|