@returnless/focus-ui 0.0.5 → 0.0.7

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 (257) hide show
  1. package/dist/components/Button/Button.vue.d.ts +4 -1
  2. package/dist/components/Button/types.d.ts +2 -0
  3. package/dist/components/Link/Link.vue.d.ts +1 -1
  4. package/dist/components/Tag/Tag.vue.d.ts +6 -2
  5. package/dist/focus-ui.js +1779 -1769
  6. package/dist/focus-ui.umd.cjs +21 -21
  7. package/package.json +2 -3
  8. package/src/build-utils/generate-component-meta.ts +0 -80
  9. package/src/build-utils/update-component-list.js +0 -31
  10. package/src/build-utils/update-component-list.ts +0 -32
  11. package/src/components/Accordion/Accordion.vue +0 -20
  12. package/src/components/Accordion/AccordionContent.vue +0 -43
  13. package/src/components/Accordion/AccordionItem.vue +0 -21
  14. package/src/components/Accordion/AccordionTrigger.vue +0 -38
  15. package/src/components/Accordion/README.md +0 -56
  16. package/src/components/Accordion/index.ts +0 -4
  17. package/src/components/ActionList/ActionList.vue +0 -9
  18. package/src/components/ActionList/ActionListBody.vue +0 -11
  19. package/src/components/ActionList/ActionListItem.vue +0 -37
  20. package/src/components/ActionList/ActionListSection.vue +0 -7
  21. package/src/components/ActionList/ActionListTrigger.vue +0 -9
  22. package/src/components/ActionList/README.md +0 -113
  23. package/src/components/ActionList/index.ts +0 -5
  24. package/src/components/Alert/Alert.vue +0 -68
  25. package/src/components/Alert/AlertDescription.vue +0 -20
  26. package/src/components/Alert/AlertTitle.vue +0 -11
  27. package/src/components/Alert/DismissableAlertButton.vue +0 -36
  28. package/src/components/Alert/README.md +0 -150
  29. package/src/components/Alert/index.ts +0 -5
  30. package/src/components/Alert/types.ts +0 -1
  31. package/src/components/AlertDialog/AlertDialog.vue +0 -54
  32. package/src/components/AlertDialog/AlertDialogActionButton.vue +0 -16
  33. package/src/components/AlertDialog/AlertDialogCancelButton.vue +0 -15
  34. package/src/components/AlertDialog/AlertDialogContent.vue +0 -8
  35. package/src/components/AlertDialog/AlertDialogDescription.vue +0 -17
  36. package/src/components/AlertDialog/AlertDialogFooter.vue +0 -11
  37. package/src/components/AlertDialog/AlertDialogHeader.vue +0 -8
  38. package/src/components/AlertDialog/AlertDialogTitle.vue +0 -15
  39. package/src/components/AlertDialog/README.md +0 -84
  40. package/src/components/AlertDialog/index.ts +0 -8
  41. package/src/components/AspectRatio/AspectRatio.vue +0 -19
  42. package/src/components/AspectRatio/README.md +0 -36
  43. package/src/components/AspectRatio/index.ts +0 -1
  44. package/src/components/Avatar/Avatar.vue +0 -122
  45. package/src/components/Avatar/README.md +0 -116
  46. package/src/components/Avatar/index.ts +0 -1
  47. package/src/components/Badge/Badge.vue +0 -51
  48. package/src/components/Badge/BadgeContent.vue +0 -9
  49. package/src/components/Badge/BadgeIcon.vue +0 -7
  50. package/src/components/Badge/README.md +0 -131
  51. package/src/components/Badge/index.ts +0 -3
  52. package/src/components/BarChart/BarChart.vue +0 -80
  53. package/src/components/BarChart/BarChartContainer.vue +0 -7
  54. package/src/components/BarChart/BarChartStacked.vue +0 -93
  55. package/src/components/BarChart/README.md +0 -83
  56. package/src/components/BarChart/index.ts +0 -3
  57. package/src/components/Breadcrumbs/Breadcrumb.vue +0 -7
  58. package/src/components/Breadcrumbs/BreadcrumbEllipsis.vue +0 -12
  59. package/src/components/Breadcrumbs/BreadcrumbItem.vue +0 -8
  60. package/src/components/Breadcrumbs/BreadcrumbLink.vue +0 -13
  61. package/src/components/Breadcrumbs/BreadcrumbList.vue +0 -8
  62. package/src/components/Breadcrumbs/BreadcrumbPage.vue +0 -13
  63. package/src/components/Breadcrumbs/BreadcrumbSeparator.vue +0 -12
  64. package/src/components/Breadcrumbs/README.md +0 -91
  65. package/src/components/Breadcrumbs/index.ts +0 -7
  66. package/src/components/Button/Button.vue +0 -75
  67. package/src/components/Button/ButtonContent.vue +0 -7
  68. package/src/components/Button/ButtonIcon.vue +0 -32
  69. package/src/components/Button/README.md +0 -231
  70. package/src/components/Button/index.ts +0 -5
  71. package/src/components/Button/types.ts +0 -30
  72. package/src/components/ButtonGroup/ButtonGroup.vue +0 -7
  73. package/src/components/ButtonGroup/README.md +0 -42
  74. package/src/components/ButtonGroup/index.ts +0 -1
  75. package/src/components/Card/Card.vue +0 -7
  76. package/src/components/Card/CardDescription.vue +0 -11
  77. package/src/components/Card/CardFooter.vue +0 -7
  78. package/src/components/Card/CardHeader.vue +0 -7
  79. package/src/components/Card/CardHelp.vue +0 -23
  80. package/src/components/Card/CardSection.vue +0 -22
  81. package/src/components/Card/CardTitle.vue +0 -11
  82. package/src/components/Card/README.md +0 -156
  83. package/src/components/Card/index.ts +0 -7
  84. package/src/components/Checkbox/Checkbox.vue +0 -73
  85. package/src/components/Checkbox/README.md +0 -111
  86. package/src/components/Checkbox/index.ts +0 -1
  87. package/src/components/Collapsible/README.md +0 -25
  88. package/src/components/DataTable/README.md +0 -56
  89. package/src/components/DatePicker/DatePicker.vue +0 -120
  90. package/src/components/DatePicker/DatePickerCard.vue +0 -9
  91. package/src/components/DatePicker/README.md +0 -59
  92. package/src/components/DatePicker/index.ts +0 -2
  93. package/src/components/DescriptionList/DescriptionList.vue +0 -18
  94. package/src/components/DescriptionList/DescriptionListDescription.vue +0 -8
  95. package/src/components/DescriptionList/DescriptionListItem.vue +0 -21
  96. package/src/components/DescriptionList/DescriptionListTerm.vue +0 -11
  97. package/src/components/DescriptionList/README.md +0 -159
  98. package/src/components/DescriptionList/index.ts +0 -4
  99. package/src/components/Dialog/README.md +0 -2
  100. package/src/components/Dialog/index.ts +0 -0
  101. package/src/components/DropZone/DropZone.vue +0 -105
  102. package/src/components/DropZone/README.md +0 -48
  103. package/src/components/DropZone/index.ts +0 -1
  104. package/src/components/EmptyState/EmptyState.vue +0 -13
  105. package/src/components/EmptyState/EmptyStateActions.vue +0 -11
  106. package/src/components/EmptyState/EmptyStateContent.vue +0 -7
  107. package/src/components/EmptyState/EmptyStateDescription.vue +0 -11
  108. package/src/components/EmptyState/EmptyStateTitle.vue +0 -7
  109. package/src/components/EmptyState/README.md +0 -102
  110. package/src/components/EmptyState/index.ts +0 -5
  111. package/src/components/Feed/Feed.vue +0 -7
  112. package/src/components/Feed/FeedItem.vue +0 -19
  113. package/src/components/Feed/FeedItemBlock.vue +0 -11
  114. package/src/components/Feed/FeedItemDateIndicator.vue +0 -11
  115. package/src/components/Feed/FeedItemIcon.vue +0 -26
  116. package/src/components/Feed/FeedItemSimple.vue +0 -8
  117. package/src/components/Feed/README.md +0 -115
  118. package/src/components/Feed/index.ts +0 -6
  119. package/src/components/FileUploadButton/FileUploadButton.vue +0 -62
  120. package/src/components/FileUploadButton/index.ts +0 -1
  121. package/src/components/Form/Form.vue +0 -35
  122. package/src/components/Form/README.md +0 -52
  123. package/src/components/Form/index.ts +0 -1
  124. package/src/components/FormLayout/FormLayout.vue +0 -25
  125. package/src/components/FormLayout/README.md +0 -97
  126. package/src/components/FormLayout/index.ts +0 -1
  127. package/src/components/Heading/Heading.vue +0 -32
  128. package/src/components/Heading/index.ts +0 -3
  129. package/src/components/Heading/types.ts +0 -3
  130. package/src/components/Image/Image.vue +0 -30
  131. package/src/components/Image/index.ts +0 -1
  132. package/src/components/InertiaLink/InertiaLink.vue +0 -11
  133. package/src/components/InertiaLink/index.ts +0 -1
  134. package/src/components/InlineError/InlineError.vue +0 -21
  135. package/src/components/InlineError/README.md +0 -63
  136. package/src/components/InlineError/index.ts +0 -1
  137. package/src/components/InputLabel/InputLabel.vue +0 -32
  138. package/src/components/InputLabel/index.ts +0 -1
  139. package/src/components/KPICard/KPICard.vue +0 -28
  140. package/src/components/KPICard/KPICardSection.vue +0 -30
  141. package/src/components/KPICard/README.md +0 -124
  142. package/src/components/KPICard/index.ts +0 -2
  143. package/src/components/Legend/Legend.vue +0 -7
  144. package/src/components/Legend/LegendItem.vue +0 -34
  145. package/src/components/Legend/README.md +0 -32
  146. package/src/components/Legend/index.ts +0 -2
  147. package/src/components/Link/Link.vue +0 -38
  148. package/src/components/Link/README.md +0 -119
  149. package/src/components/Link/index.ts +0 -1
  150. package/src/components/Navigation/Navigation.vue +0 -8
  151. package/src/components/Navigation/NavigationItem.vue +0 -47
  152. package/src/components/Navigation/NavigationSecondarySection.vue +0 -12
  153. package/src/components/Navigation/NavigationSection.vue +0 -27
  154. package/src/components/Navigation/README.md +0 -83
  155. package/src/components/Navigation/index.ts +0 -4
  156. package/src/components/Page/Page.vue +0 -7
  157. package/src/components/Page/PageBody.vue +0 -36
  158. package/src/components/Page/PageDescription.vue +0 -11
  159. package/src/components/Page/PageHeader.vue +0 -34
  160. package/src/components/Page/PageTitle.vue +0 -12
  161. package/src/components/Page/README.md +0 -226
  162. package/src/components/Page/index.ts +0 -5
  163. package/src/components/Pagination/Pagination.vue +0 -8
  164. package/src/components/Pagination/PaginationNextButton.vue +0 -10
  165. package/src/components/Pagination/PaginationPreviousButton.vue +0 -10
  166. package/src/components/Pagination/README.md +0 -45
  167. package/src/components/Pagination/index.ts +0 -3
  168. package/src/components/PinInput/PinInput.vue +0 -169
  169. package/src/components/PinInput/README.md +0 -35
  170. package/src/components/PinInput/index.ts +0 -1
  171. package/src/components/Popover/Popover.vue +0 -18
  172. package/src/components/Popover/PopoverBody.vue +0 -11
  173. package/src/components/Popover/PopoverTrigger.vue +0 -9
  174. package/src/components/Popover/README.md +0 -79
  175. package/src/components/Popover/index.ts +0 -3
  176. package/src/components/Popper/Popper.vue +0 -91
  177. package/src/components/Popper/PopperBody.vue +0 -19
  178. package/src/components/Popper/PopperTrigger.vue +0 -14
  179. package/src/components/Popper/README.md +0 -42
  180. package/src/components/Popper/index.ts +0 -3
  181. package/src/components/ProgressBar/ProgressBar.vue +0 -51
  182. package/src/components/ProgressBar/ProgressBarIndicator.vue +0 -7
  183. package/src/components/ProgressBar/README.md +0 -98
  184. package/src/components/ProgressBar/index.ts +0 -2
  185. package/src/components/RadioButton/README.md +0 -111
  186. package/src/components/RadioButton/RadioButton.vue +0 -49
  187. package/src/components/RadioButton/index.ts +0 -1
  188. package/src/components/ResourceList/README.md +0 -160
  189. package/src/components/ResourceList/ResourceList.vue +0 -7
  190. package/src/components/ResourceList/ResourceListItem.vue +0 -7
  191. package/src/components/ResourceList/ResourceListItemContent.vue +0 -7
  192. package/src/components/ResourceList/index.ts +0 -3
  193. package/src/components/Select/README.md +0 -74
  194. package/src/components/Select/Select.vue +0 -91
  195. package/src/components/Select/SelectGroup.vue +0 -12
  196. package/src/components/Select/SelectOption.vue +0 -12
  197. package/src/components/Select/index.ts +0 -3
  198. package/src/components/Separator/README.md +0 -39
  199. package/src/components/Separator/Separator.vue +0 -24
  200. package/src/components/Separator/index.ts +0 -1
  201. package/src/components/Spinner/README.md +0 -53
  202. package/src/components/Spinner/Spinner.vue +0 -64
  203. package/src/components/Spinner/index.ts +0 -1
  204. package/src/components/StatusIndicator/README.md +0 -51
  205. package/src/components/StatusIndicator/StatusIndicator.vue +0 -44
  206. package/src/components/StatusIndicator/index.ts +0 -1
  207. package/src/components/Stepper/README.md +0 -38
  208. package/src/components/Stepper/Stepper.vue +0 -104
  209. package/src/components/Stepper/index.ts +0 -1
  210. package/src/components/Tabs/README.md +0 -53
  211. package/src/components/Tabs/TabTrigger.vue +0 -44
  212. package/src/components/Tabs/Tabs.vue +0 -16
  213. package/src/components/Tabs/index.ts +0 -2
  214. package/src/components/Tag/README.md +0 -27
  215. package/src/components/Tag/Tag.vue +0 -45
  216. package/src/components/Tag/index.ts +0 -1
  217. package/src/components/TextField/README.md +0 -335
  218. package/src/components/TextField/TextField.vue +0 -135
  219. package/src/components/TextField/TextFieldIcon.vue +0 -19
  220. package/src/components/TextField/TextFieldPasswordIcon.vue +0 -28
  221. package/src/components/TextField/TextFieldSearchIcon.vue +0 -11
  222. package/src/components/TextField/index.ts +0 -1
  223. package/src/components/TextStyle/README.md +0 -39
  224. package/src/components/TextStyle/TextStyle.vue +0 -24
  225. package/src/components/TextStyle/index.ts +0 -1
  226. package/src/components/Toast/DismissToastAction.vue +0 -34
  227. package/src/components/Toast/README.md +0 -167
  228. package/src/components/Toast/Toast.vue +0 -39
  229. package/src/components/Toast/ToastGroup.vue +0 -9
  230. package/src/components/Toast/index.ts +0 -2
  231. package/src/components/Toggle/README.md +0 -66
  232. package/src/components/Toggle/Toggle.vue +0 -89
  233. package/src/components/Toggle/index.ts +0 -1
  234. package/src/components/Tooltip/README.md +0 -51
  235. package/src/components/Tooltip/Tooltip.vue +0 -24
  236. package/src/components/Tooltip/index.ts +0 -1
  237. package/src/components/TopBar/README.md +0 -43
  238. package/src/components/TopBar/TopBar.vue +0 -7
  239. package/src/components/TopBar/TopBarLogo.vue +0 -8
  240. package/src/components/TopBar/TopBarNavigation.vue +0 -7
  241. package/src/components/TopBar/TopBarNavigationItem.vue +0 -13
  242. package/src/components/TopBar/TopBarSearch.vue +0 -15
  243. package/src/components/TopBar/TopBarUserMenu.vue +0 -20
  244. package/src/components/TopBar/index.ts +0 -6
  245. package/src/components/VisuallyHidden/README.md +0 -19
  246. package/src/components/VisuallyHidden/VisuallyHidden.vue +0 -25
  247. package/src/components/VisuallyHidden/index.ts +0 -1
  248. package/src/components/index.ts +0 -197
  249. package/src/components/types.ts +0 -5
  250. package/src/composables/index.ts +0 -7
  251. package/src/composables/useTailwindColor.ts +0 -17
  252. package/src/composables/useTheme.ts +0 -41
  253. package/src/composables/useToastNotifications.ts +0 -55
  254. package/src/composables/useUniqueId.ts +0 -6
  255. package/src/index.css +0 -24
  256. package/src/index.ts +0 -1
  257. package/src/vite-env.d.ts +0 -1
@@ -1,6 +0,0 @@
1
- export { default as TopBar } from './TopBar.vue';
2
- export { default as TopBarLogo } from './TopBarLogo.vue';
3
- export { default as TopBarNavigation } from './TopBarNavigation.vue';
4
- export { default as TopBarNavigationItem } from './TopBarNavigationItem.vue';
5
- export { default as TopBarSearch } from './TopBarSearch.vue';
6
- export { default as TopBarUserMenu } from './TopBarUserMenu.vue';
@@ -1,19 +0,0 @@
1
- # Visually Hidden
2
-
3
- Use when an element needs to be available to assistive technology (for example, a screen reader) but otherwise hidden.
4
-
5
- ## Best practices
6
-
7
- Visually hidden should:
8
-
9
- - Not be used if semantic markup can make content understandable to people using assistive technologies.
10
- - Be used to provide extra context when semantic markup isn't enough.
11
- - Be used on any content that is normally present but is being omitted.
12
- - Make sense in context when used with a screen reader.
13
-
14
- ## Accessibility
15
-
16
- The visually hidden component styles text so that it’s not visible, but it is available to assistive technologies like
17
- screen readers and other text to speech programs.
18
-
19
- The component shouldn’t be used to hide interactive content.
@@ -1,25 +0,0 @@
1
- <script lang="ts" setup></script>
2
-
3
- <template>
4
- <span :class="$style.visuallyHidden">
5
- <slot />
6
- </span>
7
- </template>
8
-
9
- <style lang="css" module>
10
- /**
11
- * styles referenced from GOV.UK design system
12
- * https://github.com/h5bp/main.css/issues/12#issuecomment-451965809
13
- */
14
- .visuallyHidden {
15
- position: absolute !important;
16
- width: 1px !important;
17
- height: 1px !important;
18
- margin: 0 !important;
19
- padding: 0 !important;
20
- overflow: hidden !important;
21
- clip-path: inset(50%) !important;
22
- border: 0 !important;
23
- white-space: nowrap !important;
24
- }
25
- </style>
@@ -1 +0,0 @@
1
- export { default as VisuallyHidden } from './VisuallyHidden.vue';
@@ -1,197 +0,0 @@
1
- export {
2
- Accordion,
3
- AccordionContent,
4
- AccordionItem,
5
- AccordionTrigger,
6
- } from './Accordion';
7
-
8
- export {
9
- ActionList,
10
- ActionListBody,
11
- ActionListItem,
12
- ActionListSection,
13
- ActionListTrigger,
14
- } from './ActionList';
15
-
16
- export { Alert, AlertDescription, AlertTitle } from './Alert';
17
-
18
- export {
19
- AlertDialog,
20
- AlertDialogActionButton,
21
- AlertDialogCancelButton,
22
- AlertDialogContent,
23
- AlertDialogDescription,
24
- AlertDialogFooter,
25
- AlertDialogHeader,
26
- AlertDialogTitle,
27
- } from './AlertDialog';
28
-
29
- export { AspectRatio } from './AspectRatio';
30
-
31
- export { Avatar } from './Avatar';
32
-
33
- export { Badge, BadgeContent, BadgeIcon } from './Badge';
34
-
35
- export { BarChart, BarChartContainer, BarChartStacked } from './BarChart';
36
-
37
- export {
38
- Breadcrumb,
39
- BreadcrumbEllipsis,
40
- BreadcrumbItem,
41
- BreadcrumbLink,
42
- BreadcrumbList,
43
- BreadcrumbPage,
44
- BreadcrumbSeparator,
45
- } from './Breadcrumbs';
46
-
47
- export {
48
- type ButtonVariant,
49
- Button,
50
- ButtonContent,
51
- ButtonIcon,
52
- } from './Button';
53
-
54
- export { ButtonGroup } from './ButtonGroup';
55
-
56
- export {
57
- Card,
58
- CardDescription,
59
- CardFooter,
60
- CardHeader,
61
- CardHelp,
62
- CardSection,
63
- CardTitle,
64
- } from './Card';
65
-
66
- export { Checkbox } from './Checkbox';
67
-
68
- export {
69
- DatePicker,
70
- DatePickerCard,
71
- } from './DatePicker';
72
-
73
- export {
74
- DescriptionList,
75
- DescriptionListDescription,
76
- DescriptionListItem,
77
- DescriptionListTerm,
78
- } from './DescriptionList';
79
-
80
- export { DropZone } from './DropZone';
81
-
82
- export {
83
- EmptyState,
84
- EmptyStateActions,
85
- EmptyStateContent,
86
- EmptyStateDescription,
87
- EmptyStateTitle,
88
- } from './EmptyState';
89
-
90
- export {
91
- Feed,
92
- FeedItem,
93
- FeedItemBlock,
94
- FeedItemDateIndicator,
95
- FeedItemIcon,
96
- FeedItemSimple,
97
- } from './Feed';
98
-
99
- export { FileUploadButton } from './FileUploadButton';
100
-
101
- export { Form } from './Form';
102
-
103
- export { FormLayout } from './FormLayout';
104
-
105
- export {
106
- type HeadingLevel,
107
- type HeadingSize,
108
- Heading,
109
- } from './Heading';
110
-
111
- export { Image } from './Image';
112
-
113
- export { InlineError } from './InlineError';
114
-
115
- export { InputLabel } from './InputLabel';
116
-
117
- export { KPICard, KPICardSection } from './KPICard';
118
-
119
- export { Legend, LegendItem } from './Legend';
120
-
121
- export { Link } from './Link';
122
-
123
- export {
124
- Navigation,
125
- NavigationItem,
126
- NavigationSecondarySection,
127
- NavigationSection,
128
- } from './Navigation';
129
-
130
- export {
131
- Page,
132
- PageBody,
133
- PageDescription,
134
- PageHeader,
135
- PageTitle,
136
- } from './Page';
137
-
138
- export {
139
- Pagination,
140
- PaginationNextButton,
141
- PaginationPreviousButton,
142
- } from './Pagination';
143
-
144
- export { PinInput } from './PinInput';
145
-
146
- export {
147
- Popover,
148
- PopoverBody,
149
- PopoverTrigger,
150
- } from './Popover';
151
-
152
- export {
153
- PopperBody,
154
- Popper,
155
- PopperTrigger,
156
- } from './Popper';
157
-
158
- export { ProgressBar, ProgressBarIndicator } from './ProgressBar';
159
-
160
- export { RadioButton } from './RadioButton';
161
-
162
- export { ResourceList, ResourceListItem, ResourceListItemContent } from './ResourceList';
163
-
164
- export { Select, SelectGroup, SelectOption } from './Select';
165
-
166
- export { Separator } from './Separator';
167
-
168
- export { Spinner } from './Spinner';
169
-
170
- export { StatusIndicator } from './StatusIndicator';
171
-
172
- export { Stepper } from './Stepper';
173
-
174
- export { Tabs, TabTrigger } from './Tabs';
175
-
176
- export { Tag } from './Tag';
177
-
178
- export { TextField } from './TextField';
179
-
180
- export { TextStyle } from './TextStyle';
181
-
182
- export { Toast, ToastGroup } from './Toast';
183
-
184
- export { Toggle } from './Toggle';
185
-
186
- export { Tooltip } from './Tooltip';
187
-
188
- export {
189
- TopBar,
190
- TopBarLogo,
191
- TopBarNavigation,
192
- TopBarNavigationItem,
193
- TopBarSearch,
194
- TopBarUserMenu,
195
- } from './TopBar';
196
-
197
- export { VisuallyHidden } from './VisuallyHidden';
@@ -1,5 +0,0 @@
1
- /**
2
- * Possible types for the file accepts attribute.
3
- * These are mainly used for the FileUploadButton component and the DropZone component.
4
- */
5
- export type FileAccepts = 'image' | 'pdf' | '*';
@@ -1,7 +0,0 @@
1
- export { type TailwindColor, useTailwindColor } from './useTailwindColor';
2
-
3
- export { useTheme } from './useTheme';
4
-
5
- export { useToastNotifications } from './useToastNotifications';
6
-
7
- export { useUniqueId } from './useUniqueId';
@@ -1,17 +0,0 @@
1
- import colors from 'tailwindcss/colors';
2
-
3
- type TailwindColorMap = typeof colors;
4
-
5
- export type TailwindColor = keyof {
6
- [K in keyof TailwindColorMap as TailwindColorMap[K] extends object ? K : never]: TailwindColorMap[K];
7
- };
8
-
9
- type TailwindVariant<T extends TailwindColor> = keyof TailwindColorMap[T];
10
-
11
- export function useTailwindColor<T extends TailwindColor>(color: T, variant: TailwindVariant<T> & string): TailwindColorMap[T][TailwindVariant<T>] {
12
- if (!colors[color]) {
13
- throw new Error(`Color '${color}' does not exist in the Tailwind CSS color palette.`);
14
- }
15
-
16
- return colors[color][variant];
17
- }
@@ -1,41 +0,0 @@
1
- const themeValues = {
2
- focus: {
3
- default: [
4
- 'focus:ring-brand-100',
5
- 'focus:ring-2',
6
- 'focus:outline',
7
- 'focus:outline-1',
8
- 'focus:outline-offset-0',
9
- 'focus:outline-brand-500/50',
10
- ],
11
-
12
- destructive: [
13
- 'focus:ring-red-100',
14
- 'focus:ring-2',
15
- 'focus:outline',
16
- 'focus:outline-1',
17
- 'focus:outline-offset-0',
18
- 'focus:outline-red-500/50',
19
- ],
20
- },
21
-
22
- focusWithin: {
23
- default: [
24
- 'focus-within:border-brand-500',
25
- 'focus-within:ring-brand-100',
26
- 'focus-within:ring-2',
27
- ],
28
- },
29
- };
30
-
31
- type ThemeValues = typeof themeValues;
32
-
33
- export function useTheme<T extends keyof ThemeValues>(value: T | Array<T>, variant: keyof ThemeValues[T] = 'default'): string | string[] {
34
- if (Array.isArray(value)) {
35
- return value
36
- .map((v) => useTheme(v, variant))
37
- .join(' ');
38
- }
39
-
40
- return themeValues[value][variant] as string[];
41
- }
@@ -1,55 +0,0 @@
1
- import { ref } from 'vue';
2
- import { useEventBus } from '@vueuse/core';
3
- import { useUniqueId } from './useUniqueId';
4
-
5
- export interface ToastNotification {
6
- id: string;
7
- message: string;
8
- }
9
-
10
- interface useToastNotification {
11
- toastNotifications: any;
12
- initializeNotificationHandlers: any;
13
- closeToastNotification: any;
14
- emitToastNotificationEvent: any;
15
- emitToastNotificationEvents: any;
16
- }
17
-
18
- export function useToastNotifications(): useToastNotification {
19
- const toastNotifications = ref<ToastNotification[]>([]);
20
- const eventBus = useEventBus<ToastNotification>('toastNotifications');
21
-
22
- function initializeNotificationHandlers(): void {
23
- eventBus.on(function (event: ToastNotification): void {
24
- toastNotifications.value.push(event);
25
- });
26
- }
27
-
28
- function closeToastNotification(toastNotification: ToastNotification): void {
29
- toastNotifications.value = toastNotifications.value.filter((notification: ToastNotification): boolean => {
30
- return notification.id !== toastNotification.id;
31
- });
32
- }
33
-
34
- function emitToastNotificationEvent(toastNotification: Omit<ToastNotification, 'id'>): void {
35
- (toastNotification as ToastNotification).id = useUniqueId('toast-notification');
36
-
37
- eventBus.emit(toastNotification as ToastNotification);
38
- }
39
-
40
- function emitToastNotificationEvents(toastNotifications: Omit<ToastNotification, 'id'>[]): void {
41
- toastNotifications.forEach((toastNotification: Omit<ToastNotification, 'id'>): void => {
42
- (toastNotification as ToastNotification).id = useUniqueId('toast');
43
-
44
- emitToastNotificationEvent(toastNotification);
45
- });
46
- }
47
-
48
- return {
49
- toastNotifications,
50
- initializeNotificationHandlers,
51
- closeToastNotification,
52
- emitToastNotificationEvent,
53
- emitToastNotificationEvents,
54
- };
55
- }
@@ -1,6 +0,0 @@
1
- export function useUniqueId(prefix = 'id'): string {
2
- return Math
3
- .random()
4
- .toString(36)
5
- .replace('0.', `${prefix}-` || '');
6
- }
package/src/index.css DELETED
@@ -1,24 +0,0 @@
1
- @import url('https://rsms.me/inter/inter.css');
2
-
3
- @tailwind base;
4
- @tailwind components;
5
- @tailwind utilities;
6
-
7
- @layer base {
8
- [type="checkbox"]:checked {
9
- background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
10
- }
11
-
12
- [type="radio"]:checked {
13
- background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");
14
- }
15
-
16
- [type="checkbox"]:checked,
17
- [type="radio"]:checked {
18
- background-color: currentColor;
19
- background-position: center;
20
- background-repeat: no-repeat;
21
- background-size: 100% 100%;
22
- border-color: transparent;
23
- }
24
- }
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './components';
package/src/vite-env.d.ts DELETED
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />