@returnless/focus-ui 0.0.1 → 0.0.3

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 (186) hide show
  1. package/dist/focus-ui.js +10851 -0
  2. package/dist/focus-ui.umd.cjs +26 -0
  3. package/dist/style.css +1 -0
  4. package/package.json +13 -8
  5. package/src/build-utils/generate-component-meta.ts +5 -1
  6. package/src/build-utils/update-component-list.ts +1 -1
  7. package/src/components/Accordion/AccordionContent.vue +34 -5
  8. package/src/components/Accordion/AccordionItem.vue +5 -2
  9. package/src/components/Accordion/AccordionTrigger.vue +5 -2
  10. package/src/components/Accordion/README.md +1 -1
  11. package/src/components/ActionList/ActionList.vue +9 -0
  12. package/src/components/ActionList/ActionListBody.vue +11 -0
  13. package/src/components/ActionList/ActionListItem.vue +37 -0
  14. package/src/components/ActionList/ActionListSection.vue +7 -0
  15. package/src/components/ActionList/ActionListTrigger.vue +9 -0
  16. package/src/components/ActionList/README.md +113 -0
  17. package/src/components/ActionList/index.ts +5 -0
  18. package/src/components/Alert/Alert.vue +23 -10
  19. package/src/components/Alert/AlertDescription.vue +13 -1
  20. package/src/components/Alert/AlertTitle.vue +1 -1
  21. package/src/components/Alert/DismissableAlertButton.vue +6 -4
  22. package/src/components/Alert/README.md +31 -2
  23. package/src/components/Alert/index.ts +2 -0
  24. package/src/components/Alert/types.ts +1 -0
  25. package/src/components/AlertDialog/AlertDialog.vue +10 -1
  26. package/src/components/AlertDialog/AlertDialogActionButton.vue +9 -2
  27. package/src/components/AlertDialog/AlertDialogCancelButton.vue +1 -1
  28. package/src/components/AlertDialog/AlertDialogDescription.vue +7 -1
  29. package/src/components/AlertDialog/AlertDialogTitle.vue +11 -3
  30. package/src/components/AlertDialog/README.md +15 -16
  31. package/src/components/AspectRatio/AspectRatio.vue +19 -0
  32. package/src/components/AspectRatio/README.md +36 -0
  33. package/src/components/AspectRatio/index.ts +1 -0
  34. package/src/components/Avatar/Avatar.vue +57 -13
  35. package/src/components/Avatar/README.md +3 -9
  36. package/src/components/Badge/Badge.vue +1 -1
  37. package/src/components/Badge/README.md +9 -9
  38. package/src/components/BarChart/BarChart.vue +80 -0
  39. package/src/components/{MetricCard/MetricCardHeader.vue → BarChart/BarChartContainer.vue} +1 -1
  40. package/src/components/BarChart/BarChartStacked.vue +93 -0
  41. package/src/components/BarChart/README.md +83 -0
  42. package/src/components/BarChart/index.ts +3 -0
  43. package/src/components/Breadcrumbs/Breadcrumb.vue +7 -0
  44. package/src/components/Breadcrumbs/BreadcrumbEllipsis.vue +12 -0
  45. package/src/components/{MetricCard/MetricCardValue.vue → Breadcrumbs/BreadcrumbItem.vue} +2 -2
  46. package/src/components/Breadcrumbs/BreadcrumbLink.vue +13 -0
  47. package/src/components/Breadcrumbs/BreadcrumbList.vue +8 -0
  48. package/src/components/Breadcrumbs/BreadcrumbPage.vue +13 -0
  49. package/src/components/Breadcrumbs/BreadcrumbSeparator.vue +12 -0
  50. package/src/components/Breadcrumbs/README.md +91 -0
  51. package/src/components/Breadcrumbs/index.ts +7 -0
  52. package/src/components/Button/Button.vue +53 -41
  53. package/src/components/Button/ButtonContent.vue +1 -1
  54. package/src/components/Button/ButtonIcon.vue +28 -3
  55. package/src/components/Button/README.md +32 -29
  56. package/src/components/Button/index.ts +2 -0
  57. package/src/components/Button/types.ts +30 -0
  58. package/src/components/ButtonGroup/README.md +1 -1
  59. package/src/components/Card/CardHelp.vue +23 -0
  60. package/src/components/Card/CardSection.vue +17 -2
  61. package/src/components/Card/CardTitle.vue +6 -3
  62. package/src/components/Card/README.md +97 -10
  63. package/src/components/Card/index.ts +2 -1
  64. package/src/components/Checkbox/Checkbox.vue +29 -5
  65. package/src/components/Checkbox/README.md +34 -5
  66. package/src/components/DatePicker/DatePicker.vue +7 -27
  67. package/src/components/DatePicker/README.md +1 -1
  68. package/src/components/DescriptionList/DescriptionList.vue +1 -1
  69. package/src/components/DescriptionList/DescriptionListItem.vue +1 -1
  70. package/src/components/DescriptionList/README.md +2 -2
  71. package/src/components/Dialog/README.md +2 -0
  72. package/src/components/Dialog/index.ts +0 -0
  73. package/src/components/DropZone/DropZone.vue +105 -0
  74. package/src/components/DropZone/README.md +48 -0
  75. package/src/components/DropZone/index.ts +1 -0
  76. package/src/components/EmptyState/README.md +1 -1
  77. package/src/components/Feed/FeedItem.vue +4 -1
  78. package/src/components/Feed/FeedItemBlock.vue +4 -1
  79. package/src/components/Feed/README.md +1 -1
  80. package/src/components/FileUploadButton/FileUploadButton.vue +62 -0
  81. package/src/components/FileUploadButton/index.ts +1 -0
  82. package/src/components/Form/Form.vue +7 -2
  83. package/src/components/Form/README.md +1 -1
  84. package/src/components/FormLayout/FormLayout.vue +20 -2
  85. package/src/components/FormLayout/README.md +39 -1
  86. package/src/components/Heading/Heading.vue +32 -0
  87. package/src/components/Heading/index.ts +3 -0
  88. package/src/components/Heading/types.ts +3 -0
  89. package/src/components/Image/Image.vue +30 -0
  90. package/src/components/Image/index.ts +1 -0
  91. package/src/components/InertiaLink/InertiaLink.vue +11 -0
  92. package/src/components/InertiaLink/index.ts +1 -0
  93. package/src/components/InlineError/InlineError.vue +21 -0
  94. package/src/components/InlineError/README.md +63 -0
  95. package/src/components/InlineError/index.ts +1 -0
  96. package/src/components/KPICard/KPICard.vue +28 -0
  97. package/src/components/KPICard/KPICardSection.vue +30 -0
  98. package/src/components/KPICard/README.md +124 -0
  99. package/src/components/KPICard/index.ts +2 -0
  100. package/src/components/Legend/Legend.vue +7 -0
  101. package/src/components/Legend/LegendItem.vue +34 -0
  102. package/src/components/Legend/README.md +32 -0
  103. package/src/components/Legend/index.ts +2 -0
  104. package/src/components/Link/Link.vue +4 -4
  105. package/src/components/Link/README.md +1 -1
  106. package/src/components/Navigation/Navigation.vue +2 -2
  107. package/src/components/Navigation/NavigationItem.vue +14 -10
  108. package/src/components/Navigation/NavigationSecondarySection.vue +12 -0
  109. package/src/components/Navigation/NavigationSection.vue +1 -1
  110. package/src/components/Navigation/README.md +10 -15
  111. package/src/components/Navigation/index.ts +1 -0
  112. package/src/components/Page/Page.vue +2 -33
  113. package/src/components/Page/PageBody.vue +36 -0
  114. package/src/components/Page/PageTitle.vue +6 -3
  115. package/src/components/Page/README.md +45 -39
  116. package/src/components/Page/index.ts +1 -0
  117. package/src/components/Pagination/README.md +1 -1
  118. package/src/components/PinInput/README.md +1 -1
  119. package/src/components/Popover/Popover.vue +18 -0
  120. package/src/components/Popover/PopoverBody.vue +11 -0
  121. package/src/components/Popover/PopoverTrigger.vue +9 -0
  122. package/src/components/Popover/README.md +34 -6
  123. package/src/components/Popover/index.ts +3 -0
  124. package/src/components/Popper/Popper.vue +91 -0
  125. package/src/components/Popper/PopperBody.vue +19 -0
  126. package/src/components/Popper/PopperTrigger.vue +14 -0
  127. package/src/components/Popper/README.md +42 -0
  128. package/src/components/Popper/index.ts +3 -0
  129. package/src/components/ProgressBar/ProgressBar.vue +24 -6
  130. package/src/components/RadioButton/README.md +1 -1
  131. package/src/components/RadioButton/RadioButton.vue +3 -2
  132. package/src/components/ResourceList/README.md +160 -0
  133. package/src/components/ResourceList/ResourceList.vue +7 -0
  134. package/src/components/ResourceList/ResourceListItem.vue +7 -0
  135. package/src/components/ResourceList/ResourceListItemContent.vue +7 -0
  136. package/src/components/ResourceList/index.ts +3 -0
  137. package/src/components/Select/README.md +1 -1
  138. package/src/components/Select/Select.vue +1 -1
  139. package/src/components/Separator/README.md +5 -1
  140. package/src/components/Separator/Separator.vue +20 -3
  141. package/src/components/Spinner/README.md +1 -1
  142. package/src/components/Spinner/Spinner.vue +10 -4
  143. package/src/components/StatusIndicator/README.md +2 -2
  144. package/src/components/StatusIndicator/StatusIndicator.vue +11 -5
  145. package/src/components/Stepper/README.md +38 -0
  146. package/src/components/Stepper/Stepper.vue +104 -0
  147. package/src/components/Stepper/index.ts +1 -0
  148. package/src/components/Tabs/README.md +1 -1
  149. package/src/components/Tabs/TabTrigger.vue +5 -4
  150. package/src/components/Tabs/Tabs.vue +4 -1
  151. package/src/components/Tag/Tag.vue +45 -0
  152. package/src/components/Tag/index.ts +1 -0
  153. package/src/components/TextField/README.md +24 -6
  154. package/src/components/TextField/TextField.vue +25 -5
  155. package/src/components/TextField/TextFieldIcon.vue +19 -0
  156. package/src/components/TextStyle/README.md +1 -1
  157. package/src/components/TextStyle/TextStyle.vue +1 -1
  158. package/src/components/Toast/DismissToastAction.vue +1 -1
  159. package/src/components/Toast/README.md +1 -1
  160. package/src/components/Toggle/README.md +1 -1
  161. package/src/components/Toggle/Toggle.vue +8 -5
  162. package/src/components/Tooltip/README.md +1 -1
  163. package/src/components/Tooltip/Tooltip.vue +15 -41
  164. package/src/components/TopBar/TopBarSearch.vue +2 -2
  165. package/src/components/index.ts +68 -12
  166. package/src/components/types.ts +5 -0
  167. package/src/composables/useTheme.ts +13 -1
  168. package/src/composables/useToastNotifications.ts +1 -1
  169. package/src/composables/useUniqueId.ts +4 -3
  170. package/src/index.css +17 -13
  171. package/src/index.ts +0 -11
  172. package/dist/focus-ui.es.js +0 -33
  173. package/dist/types/components/Accordion/Accordion.vue.d.ts +0 -32
  174. package/dist/types/components/Accordion/AccordionItem.vue.d.ts +0 -2
  175. package/dist/types/components/Accordion/index.d.ts +0 -2
  176. package/dist/types/components/index.d.ts +0 -1
  177. package/dist/types/index.d.ts +0 -7
  178. package/src/components/CategoryBar/CategoryBar.vue +0 -25
  179. package/src/components/CategoryBar/CategoryBarItem.vue +0 -34
  180. package/src/components/CategoryBar/README.md +0 -17
  181. package/src/components/CategoryBar/index.ts +0 -2
  182. package/src/components/MetricCard/MetricCard.vue +0 -11
  183. package/src/components/MetricCard/MetricCardLabel.vue +0 -9
  184. package/src/components/MetricCard/MetricCardSection.vue +0 -11
  185. package/src/components/MetricCard/README.md +0 -53
  186. package/src/components/MetricCard/index.ts +0 -5
@@ -21,7 +21,7 @@ multiline options.
21
21
 
22
22
  ```js-vue
23
23
  <script lang="ts" setup>
24
- import { TextField } from 'focus-ui';
24
+ import { TextField } from '@returnless/focus-ui';
25
25
  </script>
26
26
 
27
27
  <template>
@@ -40,7 +40,7 @@ important information.
40
40
 
41
41
  ```js-vue
42
42
  <script lang="ts" setup>
43
- import { TextField } from 'focus-ui';
43
+ import { TextField } from '@returnless/focus-ui';
44
44
  </script>
45
45
 
46
46
  <template>
@@ -59,7 +59,7 @@ it for important information.
59
59
 
60
60
  ```js-vue
61
61
  <script lang="ts" setup>
62
- import { TextField } from 'focus-ui';
62
+ import { TextField } from '@returnless/focus-ui';
63
63
  </script>
64
64
 
65
65
  <template>
@@ -78,7 +78,7 @@ application.
78
78
 
79
79
  ```js-vue
80
80
  <script lang="ts" setup>
81
- import { TextField } from 'focus-ui';
81
+ import { TextField } from '@returnless/focus-ui';
82
82
  </script>
83
83
 
84
84
  <template>
@@ -94,7 +94,7 @@ import { TextField } from 'focus-ui';
94
94
 
95
95
  ```js-vue
96
96
  <script lang="ts" setup>
97
- import { TextField } from 'focus-ui';
97
+ import { TextField } from '@returnless/focus-ui';
98
98
  </script>
99
99
 
100
100
  <template>
@@ -110,7 +110,25 @@ import { TextField } from 'focus-ui';
110
110
 
111
111
  ```js-vue
112
112
  <script lang="ts" setup>
113
- import { TextField } from 'focus-ui';
113
+ import { TextField } from '@returnless/focus-ui';
114
+ </script>
115
+
116
+ <template>
117
+ <TextField multiline name="textarea" label="Textarea" rows="5" />
118
+ </template>
119
+ ```
120
+
121
+ ### With error
122
+
123
+ Use to indicate that there is a problem with the input. Error messages should be concise and helpful.
124
+
125
+ <ComponentWrapper>
126
+ <TextField name="element_with_error" label="Store name" error="Store name is required" />
127
+ </ComponentWrapper>
128
+
129
+ ```js-vue
130
+ <script lang="ts" setup>
131
+ import { TextField } from '@returnless/focus-ui';
114
132
  </script>
115
133
 
116
134
  <template>
@@ -1,7 +1,9 @@
1
1
  <script lang="ts" setup>
2
2
  import { computed, provide, ref } from 'vue';
3
3
  import { InputLabel } from '../InputLabel';
4
+ import { InlineError } from '../InlineError';
4
5
  import { useTheme, useUniqueId } from '../../composables';
6
+ import TextFieldIcon from './TextFieldIcon.vue';
5
7
  import TextFieldPasswordIcon from './TextFieldPasswordIcon.vue';
6
8
  import TextFieldSearchIcon from './TextFieldSearchIcon.vue';
7
9
 
@@ -12,9 +14,15 @@ const props = withDefaults(defineProps<{
12
14
  /** Whether the input is disabled. */
13
15
  disabled?: boolean;
14
16
 
17
+ /** The error to display below the input. */
18
+ error?: string | null;
19
+
15
20
  /** The help text to display below the input. */
16
21
  helpText?: string | null;
17
22
 
23
+ /** The icon to display inside the input. */
24
+ icon?: (() => void) | string | undefined;
25
+
18
26
  /** The ID of the input the label is associated with. */
19
27
  id?: string | null;
20
28
 
@@ -44,7 +52,9 @@ const props = withDefaults(defineProps<{
44
52
  }>(), {
45
53
  autoComplete: null,
46
54
  disabled: false,
55
+ error: null,
47
56
  helpText: null,
57
+ icon: undefined,
48
58
  id: null,
49
59
  labelHidden: false,
50
60
  multiline: false,
@@ -60,13 +70,13 @@ const internalInputType = ref(props.type);
60
70
 
61
71
  const elementId = props.id || useUniqueId('textField');
62
72
 
63
- const classList = computed(() => {
73
+ const classList = computed((): Record<string, boolean>[] => {
64
74
  return [
65
- { 'pl-10': props.type === 'search' },
75
+ { 'pl-10': props.type === 'search' || props.icon !== undefined },
66
76
  ];
67
77
  });
68
78
 
69
- const componentType = computed(() => {
79
+ const componentType = computed((): string => {
70
80
  return props.multiline ? 'textarea' : 'input';
71
81
  });
72
82
 
@@ -74,7 +84,7 @@ provide('internalInputType', internalInputType);
74
84
  </script>
75
85
 
76
86
  <template>
77
- <div class="w-full space-y-2">
87
+ <div class="w-full space-y-1">
78
88
  <InputLabel
79
89
  :id="`${elementId}-label`"
80
90
  :label="label"
@@ -83,7 +93,7 @@ provide('internalInputType', internalInputType);
83
93
  />
84
94
 
85
95
  <div
86
- :class="useTheme('focusWithin')"
96
+ :class="[useTheme('focusWithin'), { 'border-red-500': error }]"
87
97
  class="relative flex w-full items-center overflow-hidden rounded border bg-white shadow-sm"
88
98
  >
89
99
  <component
@@ -104,10 +114,20 @@ provide('internalInputType', internalInputType);
104
114
  v-bind="$attrs"
105
115
  @input="model = $event.target.value"
106
116
  />
117
+ <TextFieldIcon
118
+ v-if="icon"
119
+ :icon="icon"
120
+ />
107
121
  <TextFieldSearchIcon v-if="type === 'search'" />
108
122
  <TextFieldPasswordIcon v-if="type === 'password' && model" />
109
123
  </div>
110
124
 
125
+ <InlineError
126
+ v-if="error"
127
+ id="test"
128
+ :message="error"
129
+ />
130
+
111
131
  <p class="text-sm text-slate-500">
112
132
  {{ helpText }}
113
133
  </p>
@@ -0,0 +1,19 @@
1
+ <script lang="ts" setup>
2
+ defineProps<{
3
+ icon: (() => void) | string;
4
+ }>();
5
+ </script>
6
+
7
+ <template>
8
+ <span
9
+ v-if="icon"
10
+ class="w-4 h-4 absolute left-4 text-slate-500 leading-4"
11
+ >
12
+ <component
13
+ :is="icon"
14
+ v-if="icon && typeof icon === 'function'"
15
+ class=""
16
+ />
17
+ <span v-if="icon && typeof icon === 'string'">{{ icon }}</span>
18
+ </span>
19
+ </template>
@@ -21,7 +21,7 @@ surrounding text.
21
21
 
22
22
  ```js-vue
23
23
  <script lang="ts" setup>
24
- import { TextStyle } from 'focus-ui';
24
+ import { TextStyle } from '@returnless/focus-ui';
25
25
  </script>
26
26
 
27
27
  <template>
@@ -6,7 +6,7 @@ const props = defineProps<{
6
6
  variant: 'subdued' | 'strong';
7
7
  }>();
8
8
 
9
- const classList = computed(() => {
9
+ const classList = computed((): Record<string, boolean>[] => {
10
10
  return [
11
11
  { 'text-slate-500': props.variant === 'subdued' },
12
12
  { 'font-medium': props.variant === 'strong' },
@@ -13,7 +13,7 @@ defineEmits<{
13
13
  dismiss: [];
14
14
  }>();
15
15
 
16
- const classList = computed(() => {
16
+ const classList = computed((): Record<string, boolean> => {
17
17
  return {
18
18
  'hover:bg-red-200': props.variant === 'destructive',
19
19
  'hover:bg-slate-200': props.variant === 'default',
@@ -68,7 +68,7 @@ successfully or to inform users of a change in state.
68
68
 
69
69
  ```js-vue
70
70
  <script lang="ts" setup>
71
- import { useToastNotifications } from 'focus-ui';
71
+ import { useToastNotifications } from '@returnless/focus-ui';
72
72
 
73
73
  const {
74
74
  initializeNotificationHandlers,
@@ -25,7 +25,7 @@ features.
25
25
 
26
26
  ```js-vue
27
27
  <script lang="ts" setup>
28
- import { Toggle } from 'focus-ui';
28
+ import { Toggle } from '@returnless/focus-ui';
29
29
  </script>
30
30
 
31
31
  <template>
@@ -28,20 +28,20 @@ const internalValue = ref<boolean>(false);
28
28
  const $input = ref<HTMLInputElement | null>(null);
29
29
  const elementId = props.id || useUniqueId('toggle');
30
30
 
31
- onMounted(() => {
32
- watch(model, () => {
31
+ onMounted((): void => {
32
+ watch(model, (): void => {
33
33
  internalValue.value = $input.value!.checked;
34
34
  }, { immediate: true });
35
35
  });
36
36
 
37
- const classList = computed(() => {
37
+ const classList = computed((): Record<string, boolean>[] => {
38
38
  return [
39
39
  { 'bg-brand-500 border-brand-700': internalValue.value },
40
40
  { 'bg-slate-200 border-slate-300': !internalValue.value },
41
41
  ];
42
42
  });
43
43
 
44
- const toggleClass = computed(() => {
44
+ const toggleClass = computed((): Record<string, boolean>[] => {
45
45
  return [
46
46
  { 'translate-x-4 border-brand-600': internalValue.value },
47
47
  { 'translate-x-0 border-slate-300': !internalValue.value },
@@ -78,7 +78,10 @@ const toggleClass = computed(() => {
78
78
  :label-for="elementId"
79
79
  />
80
80
 
81
- <TextStyle variant="subdued">
81
+ <TextStyle
82
+ v-if="helpText"
83
+ variant="subdued"
84
+ >
82
85
  {{ helpText }}
83
86
  </TextStyle>
84
87
  </span>
@@ -20,7 +20,7 @@ users hover, focus, tap, or click.
20
20
 
21
21
  ```js-vue
22
22
  <script lang="ts" setup>
23
- import { Button, Tooltip } from 'focus-ui';
23
+ import { Button, Tooltip } from '@returnless/focus-ui';
24
24
  </script>
25
25
 
26
26
  <template>
@@ -1,50 +1,24 @@
1
1
  <script lang="ts" setup>
2
- import { ref } from 'vue';
3
- import { autoUpdate, flip, offset, Placement, shift, useFloating } from '@floating-ui/vue';
4
-
5
- const props = withDefaults(defineProps<{
6
- /** The placement of the tooltip. */
7
- placement?: Placement;
2
+ import { PopperBody, Popper, PopperTrigger } from '../Popper';
8
3
 
4
+ defineProps<{
9
5
  /** The content of the tooltip. */
10
6
  content: string;
11
- }>(), {
12
- placement: 'top',
13
- });
14
-
15
- const reference = ref<HTMLElement | null>(null);
16
- const floating = ref<HTMLElement | null>(null);
17
- const tooltipOpen = ref(false);
18
-
19
- const { floatingStyles, middlewareData } = useFloating(reference, floating, {
20
- middleware: [
21
- flip(),
22
- shift({ padding: 5 }),
23
- offset(5),
24
- ],
25
- placement: props.placement,
26
- whileElementsMounted: autoUpdate,
27
- });
7
+ }>();
28
8
  </script>
29
9
 
30
10
  <template>
31
- <span
32
- ref="reference"
33
- class="inline-block"
34
- @mouseenter="tooltipOpen = true"
35
- @mouseleave="tooltipOpen = false"
36
- >
37
- <slot />
38
- </span>
39
-
40
- {{ middlewareData.arrow }}
41
-
42
- <div
43
- v-if="tooltipOpen"
44
- ref="floating"
45
- class="bg-black text-white rounded px-2 py-1"
46
- :style="floatingStyles"
11
+ <Popper
12
+ trigger="hover"
13
+ placement="top"
47
14
  >
48
- {{ content }}
49
- </div>
15
+ <PopperTrigger>
16
+ <slot />
17
+ </PopperTrigger>
18
+ <PopperBody>
19
+ <div class="rounded bg-black px-2 py-1 text-sm text-white">
20
+ {{ content }}
21
+ </div>
22
+ </PopperBody>
23
+ </Popper>
50
24
  </template>
@@ -3,7 +3,7 @@ import { TextField } from '../TextField';
3
3
  </script>
4
4
 
5
5
  <template>
6
- <div>
6
+ <form role="search">
7
7
  <TextField
8
8
  label="Search"
9
9
  label-hidden
@@ -11,5 +11,5 @@ import { TextField } from '../TextField';
11
11
  type="search"
12
12
  placeholder="Search"
13
13
  />
14
- </div>
14
+ </form>
15
15
  </template>
@@ -5,6 +5,14 @@ export {
5
5
  AccordionTrigger,
6
6
  } from './Accordion';
7
7
 
8
+ export {
9
+ ActionList,
10
+ ActionListBody,
11
+ ActionListItem,
12
+ ActionListSection,
13
+ ActionListTrigger,
14
+ } from './ActionList';
15
+
8
16
  export { Alert, AlertDescription, AlertTitle } from './Alert';
9
17
 
10
18
  export {
@@ -18,25 +26,43 @@ export {
18
26
  AlertDialogTitle,
19
27
  } from './AlertDialog';
20
28
 
29
+ export { AspectRatio } from './AspectRatio';
30
+
21
31
  export { Avatar } from './Avatar';
22
32
 
23
33
  export { Badge, BadgeContent, BadgeIcon } from './Badge';
24
34
 
25
- export { Button, ButtonContent, ButtonIcon } from './Button';
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';
26
53
 
27
54
  export { ButtonGroup } from './ButtonGroup';
28
55
 
29
56
  export {
30
57
  Card,
31
- CardSection,
32
58
  CardDescription,
33
59
  CardFooter,
34
60
  CardHeader,
61
+ CardHelp,
62
+ CardSection,
35
63
  CardTitle,
36
64
  } from './Card';
37
65
 
38
- export { CategoryBar, CategoryBarItem } from './CategoryBar';
39
-
40
66
  export { Checkbox } from './Checkbox';
41
67
 
42
68
  export {
@@ -51,6 +77,8 @@ export {
51
77
  DescriptionListTerm,
52
78
  } from './DescriptionList';
53
79
 
80
+ export { DropZone } from './DropZone';
81
+
54
82
  export {
55
83
  EmptyState,
56
84
  EmptyStateActions,
@@ -68,30 +96,40 @@ export {
68
96
  FeedItemSimple,
69
97
  } from './Feed';
70
98
 
99
+ export { FileUploadButton } from './FileUploadButton';
100
+
71
101
  export { Form } from './Form';
72
102
 
73
103
  export { FormLayout } from './FormLayout';
74
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
+
75
115
  export { InputLabel } from './InputLabel';
76
116
 
77
- export { Link } from './Link';
117
+ export { KPICard, KPICardSection } from './KPICard';
78
118
 
79
- export {
80
- MetricCard,
81
- MetricCardHeader,
82
- MetricCardLabel,
83
- MetricCardSection,
84
- MetricCardValue,
85
- } from './MetricCard';
119
+ export { Legend, LegendItem } from './Legend';
120
+
121
+ export { Link } from './Link';
86
122
 
87
123
  export {
88
124
  Navigation,
89
125
  NavigationItem,
126
+ NavigationSecondarySection,
90
127
  NavigationSection,
91
128
  } from './Navigation';
92
129
 
93
130
  export {
94
131
  Page,
132
+ PageBody,
95
133
  PageDescription,
96
134
  PageHeader,
97
135
  PageTitle,
@@ -105,10 +143,24 @@ export {
105
143
 
106
144
  export { PinInput } from './PinInput';
107
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
+
108
158
  export { ProgressBar, ProgressBarIndicator } from './ProgressBar';
109
159
 
110
160
  export { RadioButton } from './RadioButton';
111
161
 
162
+ export { ResourceList, ResourceListItem, ResourceListItemContent } from './ResourceList';
163
+
112
164
  export { Select, SelectGroup, SelectOption } from './Select';
113
165
 
114
166
  export { Separator } from './Separator';
@@ -117,8 +169,12 @@ export { Spinner } from './Spinner';
117
169
 
118
170
  export { StatusIndicator } from './StatusIndicator';
119
171
 
172
+ export { Stepper } from './Stepper';
173
+
120
174
  export { Tabs, TabTrigger } from './Tabs';
121
175
 
176
+ export { Tag } from './Tag';
177
+
122
178
  export { TextField } from './TextField';
123
179
 
124
180
  export { TextStyle } from './TextStyle';
@@ -0,0 +1,5 @@
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,9 +1,21 @@
1
1
  const themeValues = {
2
2
  focus: {
3
3
  default: [
4
- 'focus:border-brand-500',
5
4
  'focus:ring-brand-100',
6
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',
7
19
  ],
8
20
  },
9
21
 
@@ -38,7 +38,7 @@ export function useToastNotifications(): useToastNotification {
38
38
  }
39
39
 
40
40
  function emitToastNotificationEvents(toastNotifications: Omit<ToastNotification, 'id'>[]): void {
41
- toastNotifications.forEach((toastNotification: ToastNotification): void => {
41
+ toastNotifications.forEach((toastNotification: Omit<ToastNotification, 'id'>): void => {
42
42
  (toastNotification as ToastNotification).id = useUniqueId('toast');
43
43
 
44
44
  emitToastNotificationEvent(toastNotification);
@@ -1,5 +1,6 @@
1
- let id = 0;
2
-
3
1
  export function useUniqueId(prefix = 'id'): string {
4
- return `${prefix}-${++id}`;
2
+ return Math
3
+ .random()
4
+ .toString(36)
5
+ .replace('0.', `${prefix}-` || '');
5
6
  }
package/src/index.css CHANGED
@@ -1,20 +1,24 @@
1
+ @import url('https://rsms.me/inter/inter.css');
2
+
1
3
  @tailwind base;
2
4
  @tailwind components;
3
5
  @tailwind utilities;
4
6
 
5
- [type="checkbox"]:checked {
6
- 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");
7
- }
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
+ }
8
11
 
9
- [type="radio"]:checked {
10
- 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");
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
+ }
12
15
 
13
- [type="checkbox"]:checked,
14
- [type="radio"]:checked {
15
- background-color: currentColor;
16
- background-position: center;
17
- background-repeat: no-repeat;
18
- background-size: 100% 100%;
19
- border-color: transparent;
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
+ }
20
24
  }
package/src/index.ts CHANGED
@@ -1,12 +1 @@
1
- import { App } from 'vue';
2
- import * as components from './components';
3
-
4
- function install(app: App) {
5
- for (const key in components) {
6
- app.component(key, components[key]);
7
- }
8
- }
9
-
10
- export default { install };
11
-
12
1
  export * from './components';
@@ -1,33 +0,0 @@
1
- import { defineComponent as i, openBlock as c, createElementBlock as r } from "vue";
2
- const a = { class: "bg-red-500" }, l = /* @__PURE__ */ i({
3
- __name: "Accordion",
4
- props: {
5
- orientation: { default: "vertical" }
6
- },
7
- setup(t) {
8
- return (e, o) => (c(), r("div", a, " testgaaf "));
9
- }
10
- }), d = (t, e) => {
11
- const o = t.__vccOpts || t;
12
- for (const [s, _] of e)
13
- o[s] = _;
14
- return o;
15
- }, f = {};
16
- function p(t, e) {
17
- return c(), r("div", null, " test ");
18
- }
19
- const u = /* @__PURE__ */ d(f, [["render", p]]), n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
20
- __proto__: null,
21
- Accordion: l,
22
- AccordionItem: u
23
- }, Symbol.toStringTag, { value: "Module" }));
24
- function m(t) {
25
- for (const e in n)
26
- t.component(e, n[e]);
27
- }
28
- const g = { install: m };
29
- export {
30
- l as Accordion,
31
- u as AccordionItem,
32
- g as default
33
- };