@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,74 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { Select, SelectGroup, SelectOption } from '../../src/components';
|
|
3
|
-
import api from '../component-meta/Select.json';
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
# Select
|
|
7
|
-
|
|
8
|
-
Select lets users choose one option from an options' menu. Consider select when you have 4 or more options, to void
|
|
9
|
-
cluttering the interface.
|
|
10
|
-
|
|
11
|
-
<ComponentApi :api="api" />
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
<ComponentWrapper>
|
|
16
|
-
<Select label="Select a fruit" placeholder="Select a fruit">
|
|
17
|
-
<SelectOption>Apple</SelectOption>
|
|
18
|
-
<SelectOption>Banana</SelectOption>
|
|
19
|
-
<SelectGroup label="Other fruits">
|
|
20
|
-
<SelectOption>Blueberry</SelectOption>
|
|
21
|
-
<SelectOption>Grapes</SelectOption>
|
|
22
|
-
<SelectOption>Pineapple</SelectOption>
|
|
23
|
-
</SelectGroup>
|
|
24
|
-
</Select>
|
|
25
|
-
</ComponentWrapper>
|
|
26
|
-
|
|
27
|
-
```js-vue
|
|
28
|
-
<script lang="ts" setup>
|
|
29
|
-
import { Select, SelectGroup, SelectOption } from '@returnless/focus-ui';
|
|
30
|
-
</script>
|
|
31
|
-
|
|
32
|
-
<template>
|
|
33
|
-
<Select label="Select a fruit" placeholder="Select a fruit">
|
|
34
|
-
<SelectOption>Apple</SelectOption>
|
|
35
|
-
<SelectOption>Banana</SelectOption>
|
|
36
|
-
<SelectGroup label="Other fruits">
|
|
37
|
-
<SelectOption>Blueberry</SelectOption>
|
|
38
|
-
<SelectOption>Grapes</SelectOption>
|
|
39
|
-
<SelectOption>Pineapple</SelectOption>
|
|
40
|
-
</SelectGroup>
|
|
41
|
-
</Select>
|
|
42
|
-
</template>
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Best practices
|
|
46
|
-
|
|
47
|
-
The select component should:
|
|
48
|
-
|
|
49
|
-
- Be used for selecting between 4 or more pre-defined options.
|
|
50
|
-
- Have a default option selected whenever possible.
|
|
51
|
-
- Use "Select" as a placeholder option only if there's no logical default option.
|
|
52
|
-
|
|
53
|
-
## Content guidelines
|
|
54
|
-
|
|
55
|
-
### Select label
|
|
56
|
-
|
|
57
|
-
Label should:
|
|
58
|
-
|
|
59
|
-
- Given a short description (1-3 words) of the requested input.
|
|
60
|
-
- Be written in sentence case (the first word capitalized, the rest lowercase).
|
|
61
|
-
- Avoid punctuation and articles ("the", "an", "a").
|
|
62
|
-
- Be independent sentences. To support internationalization, they should not act as the first part of a sentence
|
|
63
|
-
that is finished by the component's options.
|
|
64
|
-
- Be descriptive, not instructional. If the selection needs more explanation, use help text below the field.
|
|
65
|
-
|
|
66
|
-
### Select options
|
|
67
|
-
|
|
68
|
-
Options should:
|
|
69
|
-
|
|
70
|
-
- Start with "Select" as a placeholder if there isn't a default option.
|
|
71
|
-
- Be listed alphabetically or in another logical order so users can easily find the option they need.
|
|
72
|
-
- Be written sentence case (the first word capitalized, the rest lowercase) and avoid using commas or semicolons at
|
|
73
|
-
the end of each option.
|
|
74
|
-
- Be clearly labelled based on what the option will do.
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { InputLabel } from '../InputLabel';
|
|
3
|
-
import { useUniqueId, useTheme } from '../../composables';
|
|
4
|
-
import { ChevronUpDownIcon } from '@heroicons/vue/16/solid';
|
|
5
|
-
|
|
6
|
-
const props = withDefaults(defineProps<{
|
|
7
|
-
/** Whether the input is disabled. */
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
|
|
10
|
-
/** The help text to display below the input. */
|
|
11
|
-
helpText?: string | null;
|
|
12
|
-
|
|
13
|
-
/** The ID of the input the label is associated with. */
|
|
14
|
-
id?: string | null;
|
|
15
|
-
|
|
16
|
-
/** The label text. */
|
|
17
|
-
label: string;
|
|
18
|
-
|
|
19
|
-
/** Whether the label is hidden. */
|
|
20
|
-
labelHidden?: boolean;
|
|
21
|
-
|
|
22
|
-
/** The name of the input. */
|
|
23
|
-
name: string;
|
|
24
|
-
|
|
25
|
-
/** The placeholder text. */
|
|
26
|
-
placeholder?: string | null;
|
|
27
|
-
|
|
28
|
-
/** Whether the input is read-only. */
|
|
29
|
-
readonly?: boolean;
|
|
30
|
-
|
|
31
|
-
/** Whether the input is required. */
|
|
32
|
-
required?: boolean;
|
|
33
|
-
}>(), {
|
|
34
|
-
disabled: false,
|
|
35
|
-
helpText: null,
|
|
36
|
-
id: null,
|
|
37
|
-
labelHidden: false,
|
|
38
|
-
placeholder: null,
|
|
39
|
-
readonly: false,
|
|
40
|
-
required: false,
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
const model = defineModel<string | null>();
|
|
44
|
-
|
|
45
|
-
const elementId = props.id || useUniqueId('select');
|
|
46
|
-
</script>
|
|
47
|
-
|
|
48
|
-
<template>
|
|
49
|
-
<div class="w-full space-y-2">
|
|
50
|
-
<InputLabel
|
|
51
|
-
:id="`${elementId}-label`"
|
|
52
|
-
:label="label"
|
|
53
|
-
:label-for="elementId"
|
|
54
|
-
:label-hidden="labelHidden"
|
|
55
|
-
/>
|
|
56
|
-
|
|
57
|
-
<div class="relative">
|
|
58
|
-
<select
|
|
59
|
-
:id="elementId"
|
|
60
|
-
v-model="model"
|
|
61
|
-
:aria-disabled="disabled"
|
|
62
|
-
:aria-labelledby="`${elementId}-label`"
|
|
63
|
-
:aria-readonly="readonly"
|
|
64
|
-
:aria-required="required"
|
|
65
|
-
:class="useTheme('focus')"
|
|
66
|
-
:disabled="disabled"
|
|
67
|
-
:name="name"
|
|
68
|
-
:readonly="readonly"
|
|
69
|
-
class="inline-flex w-full appearance-none rounded-md border bg-white px-4 py-3 leading-none"
|
|
70
|
-
v-bind="$attrs"
|
|
71
|
-
>
|
|
72
|
-
<option
|
|
73
|
-
v-if="placeholder"
|
|
74
|
-
:value="null"
|
|
75
|
-
disabled
|
|
76
|
-
selected
|
|
77
|
-
>
|
|
78
|
-
{{ placeholder }}
|
|
79
|
-
</option>
|
|
80
|
-
|
|
81
|
-
<slot />
|
|
82
|
-
</select>
|
|
83
|
-
|
|
84
|
-
<div
|
|
85
|
-
class="absolute top-3 right-4 h-4 w-4"
|
|
86
|
-
>
|
|
87
|
-
<ChevronUpDownIcon />
|
|
88
|
-
</div>
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
</template>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { Card, CardSection, Separator } from '../../src/components';
|
|
3
|
-
import api from '../component-meta/Separator.json';
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
# Separator
|
|
7
|
-
|
|
8
|
-
Use to separate or group content.
|
|
9
|
-
|
|
10
|
-
<ComponentApi :api="api" />
|
|
11
|
-
|
|
12
|
-
<ComponentWrapper>
|
|
13
|
-
<Card>
|
|
14
|
-
<CardSection>
|
|
15
|
-
Card section content
|
|
16
|
-
<Separator />
|
|
17
|
-
Card section content
|
|
18
|
-
<Separator label="With separator label" />
|
|
19
|
-
Card section content
|
|
20
|
-
</CardSection>
|
|
21
|
-
</Card>
|
|
22
|
-
</ComponentWrapper>
|
|
23
|
-
|
|
24
|
-
```js-vue
|
|
25
|
-
<script lang="ts" setup>
|
|
26
|
-
import { Card, CardSection, Separator } from '@returnless/focus-ui';
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<template>
|
|
30
|
-
<Card>
|
|
31
|
-
<CardSection>
|
|
32
|
-
Card section content
|
|
33
|
-
<Separator />
|
|
34
|
-
Card section content
|
|
35
|
-
<Separator label="With separator label" />
|
|
36
|
-
Card section content
|
|
37
|
-
</CardSection>
|
|
38
|
-
</Card>
|
|
39
|
-
</template>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { TextStyle } from '../TextStyle';
|
|
3
|
-
|
|
4
|
-
withDefaults(defineProps<{
|
|
5
|
-
/** The label to display in the separator. */
|
|
6
|
-
label?: string | null;
|
|
7
|
-
}>(), {
|
|
8
|
-
label: null,
|
|
9
|
-
});
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<template>
|
|
13
|
-
<div class="relative flex h-12 items-center">
|
|
14
|
-
<div class="w-full shrink-0 h-[1px] bg-border" />
|
|
15
|
-
<span
|
|
16
|
-
v-if="label"
|
|
17
|
-
class="absolute left-1/2 -translate-x-1/2 bg-white px-4"
|
|
18
|
-
>
|
|
19
|
-
<TextStyle variant="subdued">
|
|
20
|
-
{{ label }}
|
|
21
|
-
</TextStyle>
|
|
22
|
-
</span>
|
|
23
|
-
</div>
|
|
24
|
-
</template>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Separator } from './Separator.vue';
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { Spinner } from '../../src/components';
|
|
3
|
-
import api from '../component-meta/Spinner.json';
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
# Spinner
|
|
7
|
-
|
|
8
|
-
Spinners are used to notify users that their action is being processed. For loading state, spinners should only be used
|
|
9
|
-
for content that can't be represented with skeleton loading components, like for data charts.
|
|
10
|
-
|
|
11
|
-
<ComponentApi :api="api" />
|
|
12
|
-
|
|
13
|
-
## Variants
|
|
14
|
-
|
|
15
|
-
### Default
|
|
16
|
-
|
|
17
|
-
<ComponentWrapper>
|
|
18
|
-
<Spinner />
|
|
19
|
-
</ComponentWrapper>
|
|
20
|
-
|
|
21
|
-
```js-vue
|
|
22
|
-
<script lang="ts" setup>
|
|
23
|
-
import { Spinner } from '@returnless/focus-ui';
|
|
24
|
-
</script>
|
|
25
|
-
|
|
26
|
-
<template>
|
|
27
|
-
<Spinner />
|
|
28
|
-
</template>
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Accessibility
|
|
32
|
-
|
|
33
|
-
SVGs are often conveyed inconsistently to assistive technologies. The `Spinner` component's accessibility is also
|
|
34
|
-
highly contextual. When the parent component is focusable, you'll need to set the `hasFocusableParent` prop for the
|
|
35
|
-
appropriate `role` attribute to be applied.
|
|
36
|
-
|
|
37
|
-
For optimal user experience, use the `accessibilityLabel` prop to let assistive technology users know the purpose of
|
|
38
|
-
the spinner.
|
|
39
|
-
|
|
40
|
-
## Best practices
|
|
41
|
-
|
|
42
|
-
The spinner component should:
|
|
43
|
-
|
|
44
|
-
- Notify users that their request has been received and the action will soon complete.
|
|
45
|
-
- Not be used to give feedback for an entire page load.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
## Content guidelines
|
|
49
|
-
|
|
50
|
-
Spinner accessibility labels should:
|
|
51
|
-
|
|
52
|
-
- Accurately explain the state of the requested action. For example, "Loading", "Submitting", or "Processing".
|
|
53
|
-
- Use as few words to describe the state as possible.
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
|
|
4
|
-
const props = withDefaults(defineProps<{
|
|
5
|
-
/** Accessible label for the spinner. */
|
|
6
|
-
accessibilityLabel?: string;
|
|
7
|
-
|
|
8
|
-
/** Allows the component to apply the correct accessibility roles based on focus. */
|
|
9
|
-
hasFocusableParent?: boolean;
|
|
10
|
-
}>(), {
|
|
11
|
-
accessibilityLabel: undefined,
|
|
12
|
-
hasFocusableParent: false,
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const accessibilityRole = computed((): string | undefined => {
|
|
16
|
-
return props.hasFocusableParent ? 'status' : undefined;
|
|
17
|
-
});
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<template>
|
|
21
|
-
<div
|
|
22
|
-
:aria-label="accessibilityLabel"
|
|
23
|
-
:role="accessibilityRole"
|
|
24
|
-
class="spinner"
|
|
25
|
-
>
|
|
26
|
-
<svg
|
|
27
|
-
width="20"
|
|
28
|
-
height="20"
|
|
29
|
-
stroke-width="15"
|
|
30
|
-
viewBox="-3.00 -3.00 106.00 106.00"
|
|
31
|
-
>
|
|
32
|
-
<path
|
|
33
|
-
class="head"
|
|
34
|
-
d="M 50,50 m 0, -45 a 45, 45 0 1 1 0,90 a 45,45 0 1 1 0,-90"
|
|
35
|
-
pathLength="600"
|
|
36
|
-
stroke-dasharray="280 280"
|
|
37
|
-
/>
|
|
38
|
-
</svg>
|
|
39
|
-
</div>
|
|
40
|
-
</template>
|
|
41
|
-
|
|
42
|
-
<style scoped>
|
|
43
|
-
.spinner {
|
|
44
|
-
display: inline-flex;
|
|
45
|
-
animation: spinner 0.75s linear infinite;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
path {
|
|
49
|
-
fill-opacity: 0;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.head {
|
|
53
|
-
stroke: black;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@keyframes spinner {
|
|
57
|
-
0% {
|
|
58
|
-
transform: rotate(0deg);
|
|
59
|
-
}
|
|
60
|
-
to {
|
|
61
|
-
transform: rotate(1turn);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
</style>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Spinner } from './Spinner.vue';
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { StatusIndicator } from '../../src/components';
|
|
3
|
-
import api from '../component-meta/StatusIndicator.json';
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
# Status indicator
|
|
7
|
-
|
|
8
|
-
Status indicator is a component that shows the status of a given entity. It can be used to show the status of a
|
|
9
|
-
services, shipment, a user, etc.
|
|
10
|
-
|
|
11
|
-
<ComponentApi :api="api" />
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
<ComponentWrapper>
|
|
16
|
-
<ComponentGrid>
|
|
17
|
-
<StatusIndicator color="yellow">In transit</StatusIndicator>
|
|
18
|
-
<StatusIndicator color="red">Request rejected</StatusIndicator>
|
|
19
|
-
<StatusIndicator color="blue">Announced</StatusIndicator>
|
|
20
|
-
<StatusIndicator color="green">Return approved</StatusIndicator>
|
|
21
|
-
</ComponentGrid>
|
|
22
|
-
</ComponentWrapper>
|
|
23
|
-
|
|
24
|
-
```js-vue
|
|
25
|
-
<script lang="ts" setup>
|
|
26
|
-
import { StatusIndicator } from '@returnless/focus-ui';
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<template>
|
|
30
|
-
<StatusIndicator>In Transit</StatusIndicator>
|
|
31
|
-
<StatusIndicator color="red">Request rejected</StatusIndicator>
|
|
32
|
-
<StatusIndicator color="blue">Announced</StatusIndicator>
|
|
33
|
-
<StatusIndicator color="green">Return approved</StatusIndicator>
|
|
34
|
-
</template>
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Best practices
|
|
38
|
-
|
|
39
|
-
Status indicators benefit users by:
|
|
40
|
-
|
|
41
|
-
- Using established color patterns so that users can quickly identify their tone or importance level.
|
|
42
|
-
- Being clearly labeled with short, scannable text.
|
|
43
|
-
- Being positioned to clearly identify the object they're informing or labelling.
|
|
44
|
-
|
|
45
|
-
## Content guidelines
|
|
46
|
-
|
|
47
|
-
Status indicator labels should:
|
|
48
|
-
|
|
49
|
-
- Use a single word to describe the tone of an object.
|
|
50
|
-
- Only use two words if you need to describe a complex state. For example "Partially refunded" and "Partially paid".
|
|
51
|
-
- Always describe the tone in the past tense. For example, refunded not refund.
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed, CSSProperties } from 'vue';
|
|
3
|
-
import { TailwindColor, useTailwindColor, useUniqueId } from '../../composables';
|
|
4
|
-
import { TextStyle } from '../TextStyle';
|
|
5
|
-
|
|
6
|
-
const props = withDefaults(defineProps<{
|
|
7
|
-
/** Accessible label for the avatar image. */
|
|
8
|
-
accessibilityLabel?: string | null;
|
|
9
|
-
|
|
10
|
-
/** The color of the badge. */
|
|
11
|
-
color: TailwindColor;
|
|
12
|
-
}>(), {
|
|
13
|
-
accessibilityLabel: null,
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const statusLabelId = useUniqueId('statusLabel');
|
|
17
|
-
|
|
18
|
-
const colorValues = computed((): CSSProperties => {
|
|
19
|
-
return {
|
|
20
|
-
backgroundColor: useTailwindColor(props.color, '300'),
|
|
21
|
-
color: useTailwindColor(props.color, '900'),
|
|
22
|
-
};
|
|
23
|
-
});
|
|
24
|
-
</script>
|
|
25
|
-
|
|
26
|
-
<template>
|
|
27
|
-
<div
|
|
28
|
-
:aria-labelledby="statusLabelId"
|
|
29
|
-
:style="{ color: colorValues.color }"
|
|
30
|
-
aria-live="polite"
|
|
31
|
-
class="inline-flex items-center space-x-2"
|
|
32
|
-
role="status"
|
|
33
|
-
>
|
|
34
|
-
<div
|
|
35
|
-
class="w-3 h-3 rounded-full"
|
|
36
|
-
:style="{ backgroundColor: colorValues.backgroundColor }"
|
|
37
|
-
/>
|
|
38
|
-
<TextStyle variant="strong">
|
|
39
|
-
<span :id="statusLabelId">
|
|
40
|
-
<slot />
|
|
41
|
-
</span>
|
|
42
|
-
</TextStyle>
|
|
43
|
-
</div>
|
|
44
|
-
</template>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as StatusIndicator } from './StatusIndicator.vue';
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { Stepper } from '../../src/components';
|
|
3
|
-
import api from '../component-meta/Stepper.json';
|
|
4
|
-
import { ref } from "vue";
|
|
5
|
-
|
|
6
|
-
const stepperNumber = ref(0);
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
# Stepper
|
|
10
|
-
|
|
11
|
-
<ComponentApi :api="api" />
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
<ComponentWrapper>
|
|
16
|
-
<Stepper
|
|
17
|
-
v-model="stepperNumber"
|
|
18
|
-
:min="0"
|
|
19
|
-
:max="5"
|
|
20
|
-
label="QTY Received"
|
|
21
|
-
/>
|
|
22
|
-
</ComponentWrapper>
|
|
23
|
-
|
|
24
|
-
```js-vue
|
|
25
|
-
<script lang="ts" setup>
|
|
26
|
-
import { Stepper } from '@returnless/focus-ui';
|
|
27
|
-
|
|
28
|
-
const stepperNumber = ref(0);
|
|
29
|
-
</script>
|
|
30
|
-
|
|
31
|
-
<template>
|
|
32
|
-
<Stepper
|
|
33
|
-
v-model="stepperNumber"
|
|
34
|
-
:max="5"
|
|
35
|
-
label="QTY Received"
|
|
36
|
-
/>
|
|
37
|
-
</template>
|
|
38
|
-
```
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/vue/16/solid';
|
|
3
|
-
import { TextStyle } from '../TextStyle';
|
|
4
|
-
import { useTheme } from '../../composables';
|
|
5
|
-
|
|
6
|
-
const props = withDefaults(defineProps<{
|
|
7
|
-
/** The label for the stepper. */
|
|
8
|
-
label: string;
|
|
9
|
-
|
|
10
|
-
/** The maximum value of the stepper. */
|
|
11
|
-
max: number;
|
|
12
|
-
|
|
13
|
-
/** The minimum value of the stepper. */
|
|
14
|
-
min: number;
|
|
15
|
-
}>(), {
|
|
16
|
-
min: undefined,
|
|
17
|
-
max: undefined,
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const model = defineModel<number>();
|
|
21
|
-
|
|
22
|
-
function decrement(): void {
|
|
23
|
-
if (model.value! <= props.min) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
model.value!--;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function increment(): void {
|
|
31
|
-
if (model.value! >= props.max) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
model.value!++;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function handleFocus(event: Event): void {
|
|
39
|
-
(event.target as HTMLInputElement).select();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function handleInput(event: InputEvent | Event): void {
|
|
43
|
-
const target = event.target as HTMLInputElement;
|
|
44
|
-
let value = Number(target.value);
|
|
45
|
-
|
|
46
|
-
if (value > props.max) {
|
|
47
|
-
value = props.max;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (value < props.min) {
|
|
51
|
-
value = props.min;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
model.value = value;
|
|
55
|
-
target.valueAsNumber = value;
|
|
56
|
-
}
|
|
57
|
-
</script>
|
|
58
|
-
|
|
59
|
-
<template>
|
|
60
|
-
<div class="inline-flex select-none flex-col space-y-2">
|
|
61
|
-
<div class="inline-flex items-stretch rounded border shadow-sm">
|
|
62
|
-
<button
|
|
63
|
-
:class="useTheme('focus')"
|
|
64
|
-
:disabled="model === props.min"
|
|
65
|
-
class="rounded-l bg-white px-3 hover:bg-slate-100 focus:z-10 disabled:pointer-events-none disabled:opacity-20"
|
|
66
|
-
type="button"
|
|
67
|
-
@click="decrement"
|
|
68
|
-
>
|
|
69
|
-
<ChevronLeftIcon class="h-4 w-4" />
|
|
70
|
-
</button>
|
|
71
|
-
<input
|
|
72
|
-
:class="useTheme('focus')"
|
|
73
|
-
:value="model"
|
|
74
|
-
class="relative w-12 appearance-none border-x bg-slate-100 py-2 text-center"
|
|
75
|
-
inputmode="numeric"
|
|
76
|
-
type="number"
|
|
77
|
-
@focus="handleFocus"
|
|
78
|
-
@input="handleInput"
|
|
79
|
-
>
|
|
80
|
-
<button
|
|
81
|
-
:class="useTheme('focus')"
|
|
82
|
-
:disabled="model === props.max"
|
|
83
|
-
class="rounded-r bg-white px-3 hover:bg-slate-100 focus:z-10 disabled:pointer-events-none disabled:opacity-20"
|
|
84
|
-
type="button"
|
|
85
|
-
@click="increment"
|
|
86
|
-
>
|
|
87
|
-
<ChevronRightIcon class="h-4 w-4" />
|
|
88
|
-
</button>
|
|
89
|
-
</div>
|
|
90
|
-
<div class="select-text text-center text-xs">
|
|
91
|
-
<TextStyle variant="subdued">
|
|
92
|
-
{{ label }}
|
|
93
|
-
</TextStyle>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
</template>
|
|
97
|
-
|
|
98
|
-
<style scoped>
|
|
99
|
-
input[type="number"]::-webkit-inner-spin-button,
|
|
100
|
-
input[type="number"]::-webkit-outer-spin-button {
|
|
101
|
-
-webkit-appearance: none;
|
|
102
|
-
margin: 0;
|
|
103
|
-
}
|
|
104
|
-
</style>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Stepper } from './Stepper.vue';
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { Tabs, TabTrigger } from '../../src/components';
|
|
3
|
-
import api from '../component-meta/Select.json';
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
# Tabs
|
|
7
|
-
|
|
8
|
-
Use to alternate among related views within the same context.
|
|
9
|
-
|
|
10
|
-
<ComponentApi :api="api" />
|
|
11
|
-
|
|
12
|
-
## Usage
|
|
13
|
-
|
|
14
|
-
<ComponentWrapper>
|
|
15
|
-
<Tabs>
|
|
16
|
-
<TabTrigger active>Apple</TabTrigger>
|
|
17
|
-
<TabTrigger>Banana</TabTrigger>
|
|
18
|
-
<TabTrigger>Pineapple</TabTrigger>
|
|
19
|
-
</Tabs>
|
|
20
|
-
</ComponentWrapper>
|
|
21
|
-
|
|
22
|
-
```js-vue
|
|
23
|
-
<script lang="ts" setup>
|
|
24
|
-
import { Tabs, TabTrigger } from '@returnless/focus-ui';
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<template>
|
|
28
|
-
<Tabs>
|
|
29
|
-
<TabTrigger active>Apple</TabTrigger>
|
|
30
|
-
<TabTrigger>Banana</TabTrigger>
|
|
31
|
-
<TabTrigger>Pineapple</TabTrigger>
|
|
32
|
-
</Tabs>
|
|
33
|
-
</template>
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Best Practices
|
|
37
|
-
|
|
38
|
-
Tabs should:
|
|
39
|
-
|
|
40
|
-
- Represent the same kind of content, such as a list-view with different filters applied. Don't use tabs to group
|
|
41
|
-
content that is dissimilar.
|
|
42
|
-
- Only be active one at a time.
|
|
43
|
-
- Not force users to jump back and forth to do a single task. Users should be able to complete their work and find
|
|
44
|
-
what they need under each tab.
|
|
45
|
-
- Not be used for primary navigation.
|
|
46
|
-
|
|
47
|
-
## Content guidelines
|
|
48
|
-
|
|
49
|
-
Tabs should:
|
|
50
|
-
|
|
51
|
-
- Be clearly labeled to help differentiate the different sections beneath them.
|
|
52
|
-
- Have short and scannable labels, generally kept to single word.
|
|
53
|
-
- Relate to the section of the content they represent.
|