@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.
Files changed (250) hide show
  1. package/package.json +3 -2
  2. package/src/build-utils/generate-component-meta.ts +0 -80
  3. package/src/build-utils/update-component-list.js +0 -31
  4. package/src/build-utils/update-component-list.ts +0 -32
  5. package/src/components/Accordion/Accordion.vue +0 -20
  6. package/src/components/Accordion/AccordionContent.vue +0 -43
  7. package/src/components/Accordion/AccordionItem.vue +0 -21
  8. package/src/components/Accordion/AccordionTrigger.vue +0 -38
  9. package/src/components/Accordion/README.md +0 -56
  10. package/src/components/Accordion/index.ts +0 -4
  11. package/src/components/ActionList/ActionList.vue +0 -9
  12. package/src/components/ActionList/ActionListBody.vue +0 -11
  13. package/src/components/ActionList/ActionListItem.vue +0 -37
  14. package/src/components/ActionList/ActionListSection.vue +0 -7
  15. package/src/components/ActionList/ActionListTrigger.vue +0 -9
  16. package/src/components/ActionList/README.md +0 -113
  17. package/src/components/ActionList/index.ts +0 -5
  18. package/src/components/Alert/Alert.vue +0 -68
  19. package/src/components/Alert/AlertDescription.vue +0 -20
  20. package/src/components/Alert/AlertTitle.vue +0 -11
  21. package/src/components/Alert/DismissableAlertButton.vue +0 -36
  22. package/src/components/Alert/README.md +0 -150
  23. package/src/components/Alert/index.ts +0 -5
  24. package/src/components/Alert/types.ts +0 -1
  25. package/src/components/AlertDialog/AlertDialog.vue +0 -54
  26. package/src/components/AlertDialog/AlertDialogActionButton.vue +0 -16
  27. package/src/components/AlertDialog/AlertDialogCancelButton.vue +0 -15
  28. package/src/components/AlertDialog/AlertDialogContent.vue +0 -8
  29. package/src/components/AlertDialog/AlertDialogDescription.vue +0 -17
  30. package/src/components/AlertDialog/AlertDialogFooter.vue +0 -11
  31. package/src/components/AlertDialog/AlertDialogHeader.vue +0 -8
  32. package/src/components/AlertDialog/AlertDialogTitle.vue +0 -15
  33. package/src/components/AlertDialog/README.md +0 -84
  34. package/src/components/AlertDialog/index.ts +0 -8
  35. package/src/components/AspectRatio/AspectRatio.vue +0 -19
  36. package/src/components/AspectRatio/README.md +0 -36
  37. package/src/components/AspectRatio/index.ts +0 -1
  38. package/src/components/Avatar/Avatar.vue +0 -122
  39. package/src/components/Avatar/README.md +0 -116
  40. package/src/components/Avatar/index.ts +0 -1
  41. package/src/components/Badge/Badge.vue +0 -51
  42. package/src/components/Badge/BadgeContent.vue +0 -9
  43. package/src/components/Badge/BadgeIcon.vue +0 -7
  44. package/src/components/Badge/README.md +0 -131
  45. package/src/components/Badge/index.ts +0 -3
  46. package/src/components/BarChart/BarChart.vue +0 -80
  47. package/src/components/BarChart/BarChartContainer.vue +0 -7
  48. package/src/components/BarChart/BarChartStacked.vue +0 -93
  49. package/src/components/BarChart/README.md +0 -83
  50. package/src/components/BarChart/index.ts +0 -3
  51. package/src/components/Breadcrumbs/Breadcrumb.vue +0 -7
  52. package/src/components/Breadcrumbs/BreadcrumbEllipsis.vue +0 -12
  53. package/src/components/Breadcrumbs/BreadcrumbItem.vue +0 -8
  54. package/src/components/Breadcrumbs/BreadcrumbLink.vue +0 -13
  55. package/src/components/Breadcrumbs/BreadcrumbList.vue +0 -8
  56. package/src/components/Breadcrumbs/BreadcrumbPage.vue +0 -13
  57. package/src/components/Breadcrumbs/BreadcrumbSeparator.vue +0 -12
  58. package/src/components/Breadcrumbs/README.md +0 -91
  59. package/src/components/Breadcrumbs/index.ts +0 -7
  60. package/src/components/Button/Button.vue +0 -75
  61. package/src/components/Button/ButtonContent.vue +0 -7
  62. package/src/components/Button/ButtonIcon.vue +0 -32
  63. package/src/components/Button/README.md +0 -231
  64. package/src/components/Button/index.ts +0 -5
  65. package/src/components/Button/types.ts +0 -30
  66. package/src/components/ButtonGroup/ButtonGroup.vue +0 -7
  67. package/src/components/ButtonGroup/README.md +0 -42
  68. package/src/components/ButtonGroup/index.ts +0 -1
  69. package/src/components/Card/Card.vue +0 -7
  70. package/src/components/Card/CardDescription.vue +0 -11
  71. package/src/components/Card/CardFooter.vue +0 -7
  72. package/src/components/Card/CardHeader.vue +0 -7
  73. package/src/components/Card/CardHelp.vue +0 -23
  74. package/src/components/Card/CardSection.vue +0 -22
  75. package/src/components/Card/CardTitle.vue +0 -11
  76. package/src/components/Card/README.md +0 -156
  77. package/src/components/Card/index.ts +0 -7
  78. package/src/components/Checkbox/Checkbox.vue +0 -73
  79. package/src/components/Checkbox/README.md +0 -111
  80. package/src/components/Checkbox/index.ts +0 -1
  81. package/src/components/Collapsible/README.md +0 -25
  82. package/src/components/DataTable/README.md +0 -56
  83. package/src/components/DatePicker/DatePicker.vue +0 -120
  84. package/src/components/DatePicker/DatePickerCard.vue +0 -9
  85. package/src/components/DatePicker/README.md +0 -59
  86. package/src/components/DatePicker/index.ts +0 -2
  87. package/src/components/DescriptionList/DescriptionList.vue +0 -18
  88. package/src/components/DescriptionList/DescriptionListDescription.vue +0 -8
  89. package/src/components/DescriptionList/DescriptionListItem.vue +0 -21
  90. package/src/components/DescriptionList/DescriptionListTerm.vue +0 -11
  91. package/src/components/DescriptionList/README.md +0 -159
  92. package/src/components/DescriptionList/index.ts +0 -4
  93. package/src/components/Dialog/README.md +0 -2
  94. package/src/components/Dialog/index.ts +0 -0
  95. package/src/components/DropZone/DropZone.vue +0 -105
  96. package/src/components/DropZone/README.md +0 -48
  97. package/src/components/DropZone/index.ts +0 -1
  98. package/src/components/EmptyState/EmptyState.vue +0 -13
  99. package/src/components/EmptyState/EmptyStateActions.vue +0 -11
  100. package/src/components/EmptyState/EmptyStateContent.vue +0 -7
  101. package/src/components/EmptyState/EmptyStateDescription.vue +0 -11
  102. package/src/components/EmptyState/EmptyStateTitle.vue +0 -7
  103. package/src/components/EmptyState/README.md +0 -102
  104. package/src/components/EmptyState/index.ts +0 -5
  105. package/src/components/Feed/Feed.vue +0 -7
  106. package/src/components/Feed/FeedItem.vue +0 -19
  107. package/src/components/Feed/FeedItemBlock.vue +0 -11
  108. package/src/components/Feed/FeedItemDateIndicator.vue +0 -11
  109. package/src/components/Feed/FeedItemIcon.vue +0 -26
  110. package/src/components/Feed/FeedItemSimple.vue +0 -8
  111. package/src/components/Feed/README.md +0 -115
  112. package/src/components/Feed/index.ts +0 -6
  113. package/src/components/FileUploadButton/FileUploadButton.vue +0 -62
  114. package/src/components/FileUploadButton/index.ts +0 -1
  115. package/src/components/Form/Form.vue +0 -35
  116. package/src/components/Form/README.md +0 -52
  117. package/src/components/Form/index.ts +0 -1
  118. package/src/components/FormLayout/FormLayout.vue +0 -25
  119. package/src/components/FormLayout/README.md +0 -97
  120. package/src/components/FormLayout/index.ts +0 -1
  121. package/src/components/Heading/Heading.vue +0 -32
  122. package/src/components/Heading/index.ts +0 -3
  123. package/src/components/Heading/types.ts +0 -3
  124. package/src/components/Image/Image.vue +0 -30
  125. package/src/components/Image/index.ts +0 -1
  126. package/src/components/InertiaLink/InertiaLink.vue +0 -11
  127. package/src/components/InertiaLink/index.ts +0 -1
  128. package/src/components/InlineError/InlineError.vue +0 -21
  129. package/src/components/InlineError/README.md +0 -63
  130. package/src/components/InlineError/index.ts +0 -1
  131. package/src/components/InputLabel/InputLabel.vue +0 -32
  132. package/src/components/InputLabel/index.ts +0 -1
  133. package/src/components/KPICard/KPICard.vue +0 -28
  134. package/src/components/KPICard/KPICardSection.vue +0 -30
  135. package/src/components/KPICard/README.md +0 -124
  136. package/src/components/KPICard/index.ts +0 -2
  137. package/src/components/Legend/Legend.vue +0 -7
  138. package/src/components/Legend/LegendItem.vue +0 -34
  139. package/src/components/Legend/README.md +0 -32
  140. package/src/components/Legend/index.ts +0 -2
  141. package/src/components/Link/Link.vue +0 -38
  142. package/src/components/Link/README.md +0 -119
  143. package/src/components/Link/index.ts +0 -1
  144. package/src/components/Navigation/Navigation.vue +0 -8
  145. package/src/components/Navigation/NavigationItem.vue +0 -47
  146. package/src/components/Navigation/NavigationSecondarySection.vue +0 -12
  147. package/src/components/Navigation/NavigationSection.vue +0 -27
  148. package/src/components/Navigation/README.md +0 -83
  149. package/src/components/Navigation/index.ts +0 -4
  150. package/src/components/Page/Page.vue +0 -7
  151. package/src/components/Page/PageBody.vue +0 -36
  152. package/src/components/Page/PageDescription.vue +0 -11
  153. package/src/components/Page/PageHeader.vue +0 -34
  154. package/src/components/Page/PageTitle.vue +0 -12
  155. package/src/components/Page/README.md +0 -226
  156. package/src/components/Page/index.ts +0 -5
  157. package/src/components/Pagination/Pagination.vue +0 -8
  158. package/src/components/Pagination/PaginationNextButton.vue +0 -10
  159. package/src/components/Pagination/PaginationPreviousButton.vue +0 -10
  160. package/src/components/Pagination/README.md +0 -45
  161. package/src/components/Pagination/index.ts +0 -3
  162. package/src/components/PinInput/PinInput.vue +0 -169
  163. package/src/components/PinInput/README.md +0 -35
  164. package/src/components/PinInput/index.ts +0 -1
  165. package/src/components/Popover/Popover.vue +0 -18
  166. package/src/components/Popover/PopoverBody.vue +0 -11
  167. package/src/components/Popover/PopoverTrigger.vue +0 -9
  168. package/src/components/Popover/README.md +0 -79
  169. package/src/components/Popover/index.ts +0 -3
  170. package/src/components/Popper/Popper.vue +0 -91
  171. package/src/components/Popper/PopperBody.vue +0 -19
  172. package/src/components/Popper/PopperTrigger.vue +0 -14
  173. package/src/components/Popper/README.md +0 -42
  174. package/src/components/Popper/index.ts +0 -3
  175. package/src/components/ProgressBar/ProgressBar.vue +0 -51
  176. package/src/components/ProgressBar/ProgressBarIndicator.vue +0 -7
  177. package/src/components/ProgressBar/README.md +0 -98
  178. package/src/components/ProgressBar/index.ts +0 -2
  179. package/src/components/RadioButton/README.md +0 -111
  180. package/src/components/RadioButton/RadioButton.vue +0 -49
  181. package/src/components/RadioButton/index.ts +0 -1
  182. package/src/components/ResourceList/README.md +0 -160
  183. package/src/components/ResourceList/ResourceList.vue +0 -7
  184. package/src/components/ResourceList/ResourceListItem.vue +0 -7
  185. package/src/components/ResourceList/ResourceListItemContent.vue +0 -7
  186. package/src/components/ResourceList/index.ts +0 -3
  187. package/src/components/Select/README.md +0 -74
  188. package/src/components/Select/Select.vue +0 -91
  189. package/src/components/Select/SelectGroup.vue +0 -12
  190. package/src/components/Select/SelectOption.vue +0 -12
  191. package/src/components/Select/index.ts +0 -3
  192. package/src/components/Separator/README.md +0 -39
  193. package/src/components/Separator/Separator.vue +0 -24
  194. package/src/components/Separator/index.ts +0 -1
  195. package/src/components/Spinner/README.md +0 -53
  196. package/src/components/Spinner/Spinner.vue +0 -64
  197. package/src/components/Spinner/index.ts +0 -1
  198. package/src/components/StatusIndicator/README.md +0 -51
  199. package/src/components/StatusIndicator/StatusIndicator.vue +0 -44
  200. package/src/components/StatusIndicator/index.ts +0 -1
  201. package/src/components/Stepper/README.md +0 -38
  202. package/src/components/Stepper/Stepper.vue +0 -104
  203. package/src/components/Stepper/index.ts +0 -1
  204. package/src/components/Tabs/README.md +0 -53
  205. package/src/components/Tabs/TabTrigger.vue +0 -44
  206. package/src/components/Tabs/Tabs.vue +0 -16
  207. package/src/components/Tabs/index.ts +0 -2
  208. package/src/components/Tag/README.md +0 -27
  209. package/src/components/Tag/Tag.vue +0 -45
  210. package/src/components/Tag/index.ts +0 -1
  211. package/src/components/TextField/README.md +0 -335
  212. package/src/components/TextField/TextField.vue +0 -135
  213. package/src/components/TextField/TextFieldIcon.vue +0 -19
  214. package/src/components/TextField/TextFieldPasswordIcon.vue +0 -28
  215. package/src/components/TextField/TextFieldSearchIcon.vue +0 -11
  216. package/src/components/TextField/index.ts +0 -1
  217. package/src/components/TextStyle/README.md +0 -39
  218. package/src/components/TextStyle/TextStyle.vue +0 -24
  219. package/src/components/TextStyle/index.ts +0 -1
  220. package/src/components/Toast/DismissToastAction.vue +0 -34
  221. package/src/components/Toast/README.md +0 -167
  222. package/src/components/Toast/Toast.vue +0 -39
  223. package/src/components/Toast/ToastGroup.vue +0 -9
  224. package/src/components/Toast/index.ts +0 -2
  225. package/src/components/Toggle/README.md +0 -66
  226. package/src/components/Toggle/Toggle.vue +0 -89
  227. package/src/components/Toggle/index.ts +0 -1
  228. package/src/components/Tooltip/README.md +0 -51
  229. package/src/components/Tooltip/Tooltip.vue +0 -24
  230. package/src/components/Tooltip/index.ts +0 -1
  231. package/src/components/TopBar/README.md +0 -43
  232. package/src/components/TopBar/TopBar.vue +0 -7
  233. package/src/components/TopBar/TopBarLogo.vue +0 -8
  234. package/src/components/TopBar/TopBarNavigation.vue +0 -7
  235. package/src/components/TopBar/TopBarNavigationItem.vue +0 -13
  236. package/src/components/TopBar/TopBarSearch.vue +0 -15
  237. package/src/components/TopBar/TopBarUserMenu.vue +0 -20
  238. package/src/components/TopBar/index.ts +0 -6
  239. package/src/components/VisuallyHidden/README.md +0 -19
  240. package/src/components/VisuallyHidden/VisuallyHidden.vue +0 -25
  241. package/src/components/VisuallyHidden/index.ts +0 -1
  242. package/src/components/index.ts +0 -197
  243. package/src/components/types.ts +0 -5
  244. package/src/composables/index.ts +0 -7
  245. package/src/composables/useTailwindColor.ts +0 -17
  246. package/src/composables/useTheme.ts +0 -41
  247. package/src/composables/useToastNotifications.ts +0 -55
  248. package/src/composables/useUniqueId.ts +0 -6
  249. package/src/index.css +0 -24
  250. package/src/index.ts +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@returnless/focus-ui",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -38,9 +38,9 @@
38
38
  "vue-tsc": "^2.0.19"
39
39
  },
40
40
  "files": [
41
- "src",
42
41
  "dist"
43
42
  ],
43
+ "main": "./dist/focus-ui.umd.js",
44
44
  "module": "./dist/focus-ui.js",
45
45
  "exports": {
46
46
  ".": {
@@ -49,6 +49,7 @@
49
49
  },
50
50
  "./style.css": "./dist/style.css"
51
51
  },
52
+ "types": "./dist/index.d.ts",
52
53
  "repository": {
53
54
  "type": "git",
54
55
  "url": "git+https://github.com/Returnless-com/focus-ui.git"
@@ -1,80 +0,0 @@
1
- import fs, { existsSync, mkdirSync } from 'fs';
2
- import { dirname, join, parse, resolve } from 'path';
3
- import { fileURLToPath } from 'url';
4
- import fg from 'fast-glob';
5
- import type { ComponentMeta, MetaCheckerOptions } from 'vue-component-meta';
6
- import { createComponentMetaChecker } from 'vue-component-meta';
7
-
8
- const __filename = fileURLToPath(import.meta.url);
9
- const __dirname = dirname(__filename);
10
-
11
- export interface ComponentApiProps {
12
- name: ComponentMeta['props'][number]['name'];
13
- description: ComponentMeta['props'][number]['description'];
14
-
15
- // required: ComponentMeta['props'][number]['required']
16
- type: ComponentMeta['props'][number]['type'];
17
- default: ComponentMeta['props'][number]['default'];
18
- }
19
-
20
- export interface ComponentApi {
21
- props: ComponentApiProps[];
22
- events: ComponentMeta['events'];
23
- slots: ComponentMeta['slots'];
24
- }
25
-
26
- const checkerOptions: MetaCheckerOptions = {
27
- forceUseTs: true,
28
- schema: { ignore: ['MyIgnoredNestedProps'] },
29
- printer: { newLine: 1 },
30
- };
31
-
32
- const tsconfigChecker = createComponentMetaChecker(
33
- resolve(__dirname, '../../tsconfig.json'),
34
- checkerOptions,
35
- );
36
-
37
- function filterMeta(meta: ComponentMeta): ComponentApi {
38
- const props: ComponentApiProps[] = [];
39
-
40
- meta.props.forEach((prop) => {
41
- if (prop.global) {
42
- return;
43
- }
44
-
45
- const { name, description, required, type, default: defaultValue } = prop;
46
-
47
- props.push({
48
- name: `${name}${required ? '' : '?'}`,
49
- description: description,
50
- type,
51
- default: defaultValue || 'unknown',
52
- });
53
- });
54
-
55
- return {
56
- props,
57
- events: meta.events,
58
- slots: meta.slots.map((s) => ({ ...s, description: s.description })),
59
- };
60
- }
61
-
62
- const components = fg.sync(['src/components/**/*.vue'], {
63
- cwd: resolve(__dirname, '../../'),
64
- absolute: true,
65
- });
66
-
67
- components.forEach((componentPath: string) => {
68
- const componentName = parse(componentPath).name;
69
-
70
- const metaDirPath = resolve(__dirname, '../../docs/component-meta');
71
-
72
- if (!existsSync(metaDirPath)) {
73
- mkdirSync(metaDirPath);
74
- }
75
-
76
- const metaJsonFilePath = join(metaDirPath, `${componentName}.json`);
77
- const meta = filterMeta(tsconfigChecker.getComponentMeta(componentPath));
78
-
79
- fs.writeFileSync(metaJsonFilePath, JSON.stringify(meta, null, 2));
80
- });
@@ -1,31 +0,0 @@
1
- console.log('gaaf');
2
- // import { readdirSync, existsSync, copyFileSync, writeFileSync } from 'fs';
3
- // import { resolve, dirname } from 'path';
4
- //
5
- // const __dirname = resolve(dirname(''));
6
- //
7
- // const componentList = readdirSync(resolve(__dirname, '../components'))
8
- // .filter((component: string) => existsSync(resolve(__dirname, `../components/${component}/README.md`)));
9
- //
10
- // // Copy the readme files.
11
- // componentList.forEach((component: string) => {
12
- // copyFileSync(
13
- // resolve(__dirname, `../components/${component}/README.md`),
14
- // resolve(__dirname, `../../docs/components/${component}.md`),
15
- // );
16
- // });
17
- //
18
- // const componentsFileContent = `\
19
- // /**
20
- // * Generated by: src/build-utils/update-comoonent-list.js
21
- // * Generated on: ${new Date().toDateString()}
22
- // */
23
- //
24
- // module.exports = [
25
- // ${componentList
26
- // .map((component: string) => ` '/components/${component}',`)
27
- // .join('\n')}
28
- // ];
29
- // `;
30
- //
31
- // writeFileSync(resolve(__dirname, '../../docs/.vuepress/component-list.js'), componentsFileContent);
@@ -1,32 +0,0 @@
1
- import { readdirSync, existsSync, copyFileSync, writeFileSync } from 'fs';
2
- import { resolve, dirname } from 'path';
3
- import { fileURLToPath } from 'url';
4
-
5
- const __filename = fileURLToPath(import.meta.url);
6
- const __dirname = dirname(__filename);
7
-
8
- const componentList = readdirSync(resolve(__dirname, '../components'))
9
- .filter((component: string) => existsSync(resolve(__dirname, `../components/${component}/README.md`)));
10
-
11
- // Copy the readme files.
12
- componentList.forEach((component: string) => {
13
- copyFileSync(
14
- resolve(__dirname, `../components/${component}/README.md`),
15
- resolve(__dirname, `../../docs/components/${component}.md`),
16
- );
17
- });
18
-
19
- const componentsFileContent = `\
20
- /**
21
- * Generated by: src/build-utils/update-component-list.js
22
- * Generated on: ${new Date().toDateString()}
23
- */
24
-
25
- export default [
26
- ${componentList
27
- .map((component: string) => ` { text: '${component}', link: 'components/${component}' },`)
28
- .join('\n')}
29
- ];
30
- `;
31
-
32
- writeFileSync(resolve(__dirname, '../../docs/component-list.ts'), componentsFileContent);
@@ -1,20 +0,0 @@
1
- <script lang="ts" setup>
2
- import { provide, ref } from 'vue';
3
-
4
- withDefaults(defineProps<{
5
- /** The orientation of the accordion. */
6
- orientation?: 'horizontal' | 'vertical';
7
- }>(), {
8
- orientation: 'vertical',
9
- });
10
-
11
- const activeAccordionItem = ref<string | null>(null);
12
-
13
- provide('activeAccordionItem', activeAccordionItem);
14
- </script>
15
-
16
- <template>
17
- <div class="w-full">
18
- <slot />
19
- </div>
20
- </template>
@@ -1,43 +0,0 @@
1
- <script lang="ts" setup>
2
- import { inject } from 'vue';
3
-
4
- const accordionItemActive = inject<boolean>('accordionItemActive');
5
- const accordionItemId = inject<string>('accordionItemId')!;
6
-
7
- function beforeEnter(element: Element): void {
8
- (element as HTMLElement).style.height = '0';
9
- }
10
-
11
- function enter(element: Element): void {
12
- (element as HTMLElement).style.height = element.scrollHeight + 'px';
13
- }
14
-
15
- function beforeLeave(element: Element): void {
16
- (element as HTMLElement).style.height = element.scrollHeight + 'px';
17
- }
18
-
19
- function leave(element: Element): void {
20
- (element as HTMLElement).style.height = '0';
21
- }
22
- </script>
23
-
24
- <template>
25
- <transition
26
- name="accordion"
27
- @enter="enter"
28
- @leave="leave"
29
- @before-enter="beforeEnter"
30
- @before-leave="beforeLeave"
31
- >
32
- <div
33
- v-show="accordionItemActive"
34
- :id="accordionItemId"
35
- class="transition-all duration-200 ease-in-out overflow-hidden"
36
- role="region"
37
- >
38
- <div class="py-3">
39
- <slot />
40
- </div>
41
- </div>
42
- </transition>
43
- </template>
@@ -1,21 +0,0 @@
1
- <script lang="ts" setup>
2
- import { computed, inject, provide, Ref } from 'vue';
3
- import { useUniqueId } from '../../composables';
4
-
5
- const accordionItemId = useUniqueId('accordionItem');
6
- const activeAccordionItem = inject<Ref<string>>('activeAccordionItem')!;
7
-
8
- const accordionItemActive = computed((): boolean => activeAccordionItem.value === accordionItemId);
9
-
10
- provide('accordionItemId', accordionItemId);
11
- provide('accordionItemActive', accordionItemActive);
12
- </script>
13
-
14
- <template>
15
- <div
16
- class="border-b"
17
- :aria-expanded="accordionItemActive"
18
- >
19
- <slot />
20
- </div>
21
- </template>
@@ -1,38 +0,0 @@
1
- <script lang="ts" setup>
2
- import { inject, Ref } from 'vue';
3
- import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/vue/16/solid';
4
- import { TextStyle } from '../TextStyle';
5
-
6
- const activeAccordionItem = inject<Ref<string | null>>('activeAccordionItem')!;
7
- const accordionItemId = inject<string>('accordionItemId')!;
8
- const accordionItemActive = inject<boolean>('accordionItemActive');
9
-
10
- function toggleAccordionItem(): void {
11
- activeAccordionItem.value = activeAccordionItem.value !== accordionItemId
12
- ? accordionItemId
13
- : null;
14
- }
15
- </script>
16
-
17
- <template>
18
- <button
19
- :aria-controls="accordionItemId"
20
- class="w-full flex flex-1 items-center justify-between group"
21
- @click="toggleAccordionItem"
22
- >
23
- <span class="py-3 group-hover:underline">
24
- <TextStyle variant="strong">
25
- <slot />
26
- </TextStyle>
27
- </span>
28
-
29
- <ChevronDownIcon
30
- v-if="!accordionItemActive"
31
- class="w-4 h-4"
32
- />
33
- <ChevronUpIcon
34
- v-if="accordionItemActive"
35
- class="w-4 h-4"
36
- />
37
- </button>
38
- </template>
@@ -1,56 +0,0 @@
1
- <script lang="ts" setup>
2
- import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '../../src/components';
3
- import api from '../component-meta/Accordion.json';
4
- </script>
5
-
6
- # Accordion
7
-
8
- A vertically stacked set of interactive headings that each reveal a section of content.
9
-
10
- <ComponentApi :api="api" />
11
-
12
- ## Variants
13
-
14
- ### Default
15
-
16
- Use to display a list of questions and answers. The user can click on a question to reveal the answer.
17
-
18
- <ComponentWrapper>
19
- <Accordion>
20
- <AccordionItem>
21
- <AccordionTrigger>Is it accessible?</AccordionTrigger>
22
- <AccordionContent>Yes. It adheres to the AI-ARIA design system</AccordionContent>
23
- </AccordionItem>
24
- <AccordionItem>
25
- <AccordionTrigger>Is it styled?</AccordionTrigger>
26
- <AccordionContent>Yes. It comes with default styles that matches the other components' aesthetic.</AccordionContent>
27
- </AccordionItem>
28
- <AccordionItem>
29
- <AccordionTrigger>Is it animated?</AccordionTrigger>
30
- <AccordionContent>Yes. It's animated by default, but you can disable it if you prefer.</AccordionContent>
31
- </AccordionItem>
32
- </Accordion>
33
- </ComponentWrapper>
34
-
35
- ```js-vue
36
- <script lang="ts" setup>
37
- import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from '@returnless/focus-ui';
38
- </script>
39
-
40
- <template>
41
- <Accordion>
42
- <AccordionItem>
43
- <AccordionTrigger>Is it accessible?</AccordionTrigger>
44
- <AccordionContent>Yes. It adheres to the AI-ARIA design system</AccordionContent>
45
- </AccordionItem>
46
- <AccordionItem>
47
- <AccordionTrigger>Is it styled?</AccordionTrigger>
48
- <AccordionContent>Yes. It comes with default styles that matches the other components' aesthetic.</AccordionContent>
49
- </AccordionItem>
50
- <AccordionItem>
51
- <AccordionTrigger>Is it animated?</AccordionTrigger>
52
- <AccordionContent>Yes. It's animated by default, but you can disable it if you prefer.</AccordionContent>
53
- </AccordionItem>
54
- </Accordion>
55
- </template>
56
- ```
@@ -1,4 +0,0 @@
1
- export { default as Accordion } from './Accordion.vue';
2
- export { default as AccordionContent } from './AccordionContent.vue';
3
- export { default as AccordionItem } from './AccordionItem.vue';
4
- export { default as AccordionTrigger } from './AccordionTrigger.vue';
@@ -1,9 +0,0 @@
1
- <script lang="ts" setup>
2
- import { Popover } from '../Popover';
3
- </script>
4
-
5
- <template>
6
- <Popover alignment="start">
7
- <slot />
8
- </Popover>
9
- </template>
@@ -1,11 +0,0 @@
1
- <script lang="ts" setup>
2
- import { PopoverBody } from '../Popover';
3
- </script>
4
-
5
- <template>
6
- <PopoverBody>
7
- <div class="min-w-[200px]">
8
- <slot />
9
- </div>
10
- </PopoverBody>
11
- </template>
@@ -1,37 +0,0 @@
1
- <script lang="ts" setup>
2
- import { Button, ButtonContent, ButtonVariant } from '../Button';
3
-
4
- withDefaults(defineProps<{
5
- /** Whether the action list item is active. */
6
- active?: boolean;
7
-
8
- /** The icon to display next to the action list item. */
9
- icon: () => void | null;
10
-
11
- variant?: ButtonVariant;
12
- }>(), {
13
- active: false,
14
- variant: 'ghost',
15
- });
16
- </script>
17
-
18
- <template>
19
- <li class="block">
20
- <Button
21
- :active="active"
22
- :variant="variant"
23
- full-width
24
- role="menuitem"
25
- size="small"
26
- >
27
- <component
28
- :is="icon"
29
- v-if="icon"
30
- class="w-4 h-4"
31
- />
32
- <ButtonContent>
33
- <slot />
34
- </ButtonContent>
35
- </Button>
36
- </li>
37
- </template>
@@ -1,7 +0,0 @@
1
- <script lang="ts" setup></script>
2
-
3
- <template>
4
- <ul class="[&:not(:last-child)]:border-b p-1.5 space-y-0.5">
5
- <slot />
6
- </ul>
7
- </template>
@@ -1,9 +0,0 @@
1
- <script lang="ts" setup>
2
- import { PopoverTrigger } from '../Popover';
3
- </script>
4
-
5
- <template>
6
- <PopoverTrigger>
7
- <slot />
8
- </PopoverTrigger>
9
- </template>
@@ -1,113 +0,0 @@
1
- <script lang="ts" setup>
2
- import {
3
- ActionList,
4
- ActionListBody,
5
- ActionListItem,
6
- ActionListSection,
7
- ActionListTrigger,
8
- Button,
9
- } from '../../src/components';
10
- import { Link } from '@inertiajs/vue3';
11
- import api from '../component-meta/ActionList.json';
12
- import { TrashIcon, PencilIcon, ArrowUpTrayIcon, ArrowDownTrayIcon } from '@heroicons/vue/16/solid';
13
- </script>
14
-
15
- # Action list
16
-
17
- Action lists render a list of actions or selectable options. This component is usually placed inside a popover container
18
- to create a dropdown menu or let users select from a list of options.
19
-
20
- <ComponentApi :api="api" />
21
-
22
- ## Usage
23
-
24
- <ComponentWrapper>
25
- <ActionList>
26
- <ActionListTrigger>
27
- <Button disclosure variant="ghost">Action trigger</Button>
28
- </ActionListTrigger>
29
- <ActionListBody>
30
- <ActionListSection label="File options">
31
- <ActionListItem :icon="ArrowDownTrayIcon" href="#" as="link">
32
- Import file
33
- </ActionListItem>
34
- <ActionListItem :icon="ArrowUpTrayIcon" active as="button">
35
- Export file
36
- </ActionListItem>
37
- </ActionListSection>
38
- <ActionListSection label="Bulk actions">
39
- <ActionListItem :icon="PencilIcon" as="button">
40
- Edit
41
- </ActionListItem>
42
- <ActionListItem :icon="TrashIcon" as="button" variant="destructive">
43
- Delete
44
- </ActionListItem>
45
- </ActionListSection>
46
- </ActionListBody>
47
- </ActionList>
48
- </ComponentWrapper>
49
-
50
- ```js-vue
51
- <script lang="ts" setup>
52
- import {
53
- ActionList,
54
- ActionListBody,
55
- ActionListItem,
56
- ActionListSection,
57
- ActionListTrigger,
58
- Button,
59
- } from '@returnless/focus-ui';
60
- import { TrashIcon, PencilIcon, ArrowUpTrayIcon, ArrowDownTrayIcon } from '@heroicons/vue/16/solid';
61
- </script>
62
-
63
- <template>
64
- <ActionList>
65
- <ActionListTrigger>
66
- <Button disclosure variant="ghost">Action trigger</Button>
67
- </ActionListTrigger>
68
- <ActionListBody>
69
- <ActionListSection label="File options">
70
- <ActionListItem :icon="ArrowDownTrayIcon" href="#" as="link">
71
- Import file
72
- </ActionListItem>
73
- <ActionListItem :icon="ArrowUpTrayIcon" active as="button">
74
- Export file
75
- </ActionListItem>
76
- </ActionListSection>
77
- <ActionListSection label="Bulk actions">
78
- <ActionListItem :icon="PencilIcon" as="button">
79
- Edit
80
- </ActionListItem>
81
- <ActionListItem :icon="TrashIcon" as="button" variant="destructive">
82
- Delete
83
- </ActionListItem>
84
- </ActionListSection>
85
- </ActionListBody>
86
- </ActionList>
87
- </template>
88
- ```
89
-
90
- ## Best practices
91
-
92
- Action lists should:
93
-
94
- - Be used for secondary or less important information and actions since they're hidden until users expose them by
95
- opening a popover
96
- - Contain actions that are related to each other
97
-
98
- ## Content guidelines
99
-
100
- ### Action lists
101
-
102
- Each item in an action list should be clear and predictable. Users should be able to anticipate what will happen
103
- when they click on an action.
104
-
105
- Each item in an action list should always lead with a strong verb that encourages action. To provide enough context
106
- use the {verb}+{noun} format unless the action is clear with a single verb.
107
-
108
- Each item in an action list should be scannable avoiding unnecessary words and articles such as "the", "an", or "a".
109
-
110
- ## Accessibility
111
-
112
- Items in an action list are organized as list items (`<li>`) in an unordered list (`<ul>`) and are conveyed as a
113
- group of related elements to assistive technology users. Each item is implemented as a button.
@@ -1,5 +0,0 @@
1
- export { default as ActionList } from './ActionList.vue';
2
- export { default as ActionListBody } from './ActionListBody.vue';
3
- export { default as ActionListItem } from './ActionListItem.vue';
4
- export { default as ActionListSection } from './ActionListSection.vue';
5
- export { default as ActionListTrigger } from './ActionListTrigger.vue';
@@ -1,68 +0,0 @@
1
- <script lang="ts" setup>
2
- import { computed, provide, ref } from 'vue';
3
- import { AlertVariant } from './types';
4
- import DismissibleAlertButton from './DismissableAlertButton.vue';
5
-
6
- const props = withDefaults(defineProps<{
7
- /** Whether the alert is flush to the borders. */
8
- flush?: boolean;
9
-
10
- /** Whether the alert can be dismissed. */
11
- dismissible?: boolean;
12
-
13
- /** The variant of the alert. */
14
- variant?: AlertVariant;
15
- }>(), {
16
- flush: false,
17
- dismissible: true,
18
- variant: 'default',
19
- });
20
-
21
- const emits = defineEmits<{
22
- /** Emitted when the alert is dismissed. */
23
- dismiss: [];
24
- }>();
25
-
26
- provide('alertVariant', props.variant);
27
-
28
- const alertDismissed = ref(false);
29
-
30
- const classList = computed((): Record<string, boolean>[] => {
31
- return [
32
- { 'bg-white': props.variant === 'default' },
33
- { 'bg-red-50 border-red-500/40 text-red-800': props.variant === 'destructive' },
34
- { 'bg-yellow-50 border-yellow-500/40 text-yellow-800': props.variant === 'warning' },
35
-
36
- { 'border rounded px-4 py-3': !props.flush },
37
- { 'border-y px-6 py-3 mt-6': props.flush },
38
- ];
39
- });
40
-
41
- const role = computed(() => props.variant === 'destructive' ? 'alert' : 'status');
42
- const liveRegion = computed(() => props.variant === 'destructive' ? 'assertive' : 'polite');
43
-
44
- function dismissAlert(): void {
45
- emits('dismiss');
46
-
47
- alertDismissed.value = true;
48
- }
49
- </script>
50
-
51
- <template>
52
- <div
53
- v-if="! alertDismissed"
54
- :class="classList"
55
- :role="role"
56
- :aria-live="liveRegion"
57
- class="relative shadow-sm"
58
- tabindex="0"
59
- >
60
- <slot />
61
-
62
- <DismissibleAlertButton
63
- v-if="dismissible"
64
- :variant="variant"
65
- @dismiss="dismissAlert"
66
- />
67
- </div>
68
- </template>
@@ -1,20 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, inject } from 'vue';
3
- import { AlertVariant } from './types';
4
-
5
- const alertVariant = inject<AlertVariant>('alertVariant');
6
-
7
- const classList = computed((): Record<string, boolean> => {
8
- return {
9
- 'text-red-900/80': alertVariant === 'destructive',
10
- 'text-yellow-900/80': alertVariant === 'warning',
11
- 'text-gray-900/80': alertVariant === 'default',
12
- };
13
- });
14
- </script>
15
-
16
- <template>
17
- <div :class="classList">
18
- <slot />
19
- </div>
20
- </template>
@@ -1,11 +0,0 @@
1
- <script setup lang="ts">
2
- import { TextStyle } from '../TextStyle';
3
- </script>
4
-
5
- <template>
6
- <h5 class="mb-4 leading-none">
7
- <TextStyle variant="strong">
8
- <slot />
9
- </TextStyle>
10
- </h5>
11
- </template>