fluency-v8-components 1.3.5 → 1.3.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 (178) hide show
  1. package/dist/fluency-v8-components.es.js +1 -1
  2. package/dist/fluency-v8-components.umd.js +99 -99
  3. package/dist/{index-q2NbjdVo.mjs → index-ChEFiXF5.mjs} +12 -11
  4. package/dist/{index.es-PAPL4E6Y.mjs → index.es-CjjN70eV.mjs} +1 -1
  5. package/package.json +3 -2
  6. package/src/assets/images/ai.svg +1 -0
  7. package/src/assets/images/github-dark.svg +1 -0
  8. package/src/assets/images/github.svg +1 -0
  9. package/src/assets/images/high-priority.svg +1 -0
  10. package/src/assets/images/power-off.svg +1 -0
  11. package/src/assets/images/save.svg +1 -0
  12. package/src/assets/index.ts +15 -0
  13. package/src/assets/main.css +495 -0
  14. package/src/assets/prism-theme.css +290 -0
  15. package/src/components/buttons/ActionButtons.vue +374 -0
  16. package/src/components/buttons/DropdownButton.vue +104 -0
  17. package/src/components/buttons/IconButton.vue +63 -0
  18. package/src/components/buttons/ImageButton.vue +16 -0
  19. package/src/components/buttons/MenuButton.vue +138 -0
  20. package/src/components/buttons/SubmitButtons.vue +51 -0
  21. package/src/components/buttons/TextButton.vue +40 -0
  22. package/src/components/charts/AlertChart.vue +376 -0
  23. package/src/components/charts/BarChart.vue +212 -0
  24. package/src/components/charts/BarChartHorizontal.vue +243 -0
  25. package/src/components/charts/CronChart.vue +146 -0
  26. package/src/components/charts/EmptyChart.vue +76 -0
  27. package/src/components/charts/GradientChart.vue +310 -0
  28. package/src/components/charts/LineChart.test.js +59 -0
  29. package/src/components/charts/LineChart.vue +434 -0
  30. package/src/components/charts/PieChart.vue +293 -0
  31. package/src/components/charts/ProgressChart.vue +106 -0
  32. package/src/components/charts/StackedChart.vue +364 -0
  33. package/src/components/charts/StackedChartClustered.vue +395 -0
  34. package/src/components/charts/TimelineChart.vue +215 -0
  35. package/src/components/charts/WorkflowChart.vue +520 -0
  36. package/src/components/common/AutoCompleteSearchBar.vue +100 -0
  37. package/src/components/common/AutoRefreshButton.vue +53 -0
  38. package/src/components/common/Breadcrumb.vue +45 -0
  39. package/src/components/common/ButtonToggle.vue +24 -0
  40. package/src/components/common/Card.vue +116 -0
  41. package/src/components/common/Carousel.vue +66 -0
  42. package/src/components/common/CategoryCard.vue +28 -0
  43. package/src/components/common/CodeEditor.vue +59 -0
  44. package/src/components/common/DatePicker.vue +21 -0
  45. package/src/components/common/DatePickerInput.vue +109 -0
  46. package/src/components/common/Dialog.vue +103 -0
  47. package/src/components/common/EditorHeading.vue +10 -0
  48. package/src/components/common/EventList.vue +41 -0
  49. package/src/components/common/Facet.vue +206 -0
  50. package/src/components/common/Feed.vue +58 -0
  51. package/src/components/common/Flag.vue +27 -0
  52. package/src/components/common/HomeCard.vue +20 -0
  53. package/src/components/common/ItemBox.vue +49 -0
  54. package/src/components/common/Loading.vue +19 -0
  55. package/src/components/common/LoadingDots.vue +12 -0
  56. package/src/components/common/PageHeading.vue +30 -0
  57. package/src/components/common/Pagination.vue +105 -0
  58. package/src/components/common/Popover.vue +24 -0
  59. package/src/components/common/PowerToggle.vue +130 -0
  60. package/src/components/common/ProgressBar.vue +33 -0
  61. package/src/components/common/RadioButtons.vue +52 -0
  62. package/src/components/common/Schedule.vue +79 -0
  63. package/src/components/common/SearchBar.vue +30 -0
  64. package/src/components/common/Separator.vue +3 -0
  65. package/src/components/common/Slideout.vue +95 -0
  66. package/src/components/common/Sort.vue +83 -0
  67. package/src/components/common/Table.vue +48 -0
  68. package/src/components/common/Tabs.vue +129 -0
  69. package/src/components/common/Tag.vue +53 -0
  70. package/src/components/common/Tooltip.vue +49 -0
  71. package/src/components/common/VerticalTabs.vue +34 -0
  72. package/src/components/common/card/CardItem.vue +27 -0
  73. package/src/components/common/card/CardItemGroup.vue +45 -0
  74. package/src/components/common/facet/Leaf.vue +97 -0
  75. package/src/components/common/facet/TriState.vue +37 -0
  76. package/src/components/common/table/TableData.vue +48 -0
  77. package/src/components/common/table/TableHeader.vue +21 -0
  78. package/src/components/dialogs/ChooseValueDialog.vue +97 -0
  79. package/src/components/dialogs/ConfirmDialog.vue +73 -0
  80. package/src/components/dialogs/CopyDialog.vue +51 -0
  81. package/src/components/dialogs/DownloadDialog.vue +48 -0
  82. package/src/components/dialogs/NameDescDialog.vue +74 -0
  83. package/src/components/dialogs/NameDialog.vue +56 -0
  84. package/src/components/dialogs/PopupEditor.vue +113 -0
  85. package/src/components/dialogs/ProgressDialog.vue +58 -0
  86. package/src/components/dialogs/ResetPasswordDialog.vue +58 -0
  87. package/src/components/dialogs/Wizard.vue +99 -0
  88. package/src/components/dialogs/wizard/Stepper.vue +31 -0
  89. package/src/components/form/CheckBox.vue +26 -0
  90. package/src/components/form/Editor.vue +93 -0
  91. package/src/components/form/FormCol.vue +19 -0
  92. package/src/components/form/FormRow.vue +19 -0
  93. package/src/components/form/FormSection.vue +21 -0
  94. package/src/components/form/GreyForm.vue +7 -0
  95. package/src/components/form/GreyInput.vue +51 -0
  96. package/src/components/form/GreyInputAutocomplete.vue +100 -0
  97. package/src/components/form/GreyInputCopy.vue +66 -0
  98. package/src/components/form/GreyInputGrow.vue +42 -0
  99. package/src/components/form/GreyInputToken.vue +78 -0
  100. package/src/components/form/GreyPassword.vue +36 -0
  101. package/src/components/form/GreySelect.vue +154 -0
  102. package/src/components/form/GreySelectInput.vue +123 -0
  103. package/src/components/form/GreySelectInputMultiple.vue +218 -0
  104. package/src/components/form/GreyTel.vue +58 -0
  105. package/src/components/form/HamburgerItem.vue +95 -0
  106. package/src/components/form/KeyValueEntry.vue +74 -0
  107. package/src/components/form/RadioInput.vue +38 -0
  108. package/src/components/form/UploadFile.vue +99 -0
  109. package/src/components/icons/AiIcon.vue +6 -0
  110. package/src/components/icons/GithubIcon.vue +18 -0
  111. package/src/components/icons/HighPriorityIcon.vue +6 -0
  112. package/src/components/icons/PowerOffIcon.vue +6 -0
  113. package/src/components/icons/SaveIcon.vue +6 -0
  114. package/src/components/index.js +134 -0
  115. package/src/components/menu/DialogMenu.vue +142 -0
  116. package/src/components/menu/GrandChild.vue +39 -0
  117. package/src/components/menu/GridMenu.vue +88 -0
  118. package/src/components/menu/MenuAvatar.vue +66 -0
  119. package/src/components/menu/MenuDesktop.vue +90 -0
  120. package/src/components/notifications/Notify.vue +123 -0
  121. package/src/components/notifications/NotifyList.vue +130 -0
  122. package/src/components/page-structure/FacetPage.vue +77 -0
  123. package/src/components/query/Child.vue +63 -0
  124. package/src/components/query/LVDBQuery.vue +38 -0
  125. package/src/components/status/Active.vue +44 -0
  126. package/src/components/status/ScoreLevel.vue +43 -0
  127. package/src/components/status/Status.vue +51 -0
  128. package/src/components/status/TaskDot.vue +25 -0
  129. package/src/components/status/TaskStatus.vue +26 -0
  130. package/src/components/status/TicketStatus.vue +201 -0
  131. package/src/components/status/Trend.vue +20 -0
  132. package/src/components/tables/ArgumentRunTable.vue +96 -0
  133. package/src/components/tables/ArgumentTable.vue +67 -0
  134. package/src/components/tables/CloudFormationParameters.vue +25 -0
  135. package/src/constants/colors.js +248 -0
  136. package/src/constants/font-map.js +128 -0
  137. package/src/constants/fpl2.js +162 -0
  138. package/src/constants/icon-svg.js +405 -0
  139. package/src/constants/schedule.js +52 -0
  140. package/src/fpl/AddPanel.vue +237 -0
  141. package/src/fpl/Configs/Alert.vue +16 -0
  142. package/src/fpl/Configs/AlertSprite.vue +2 -0
  143. package/src/fpl/Configs/Chart.vue +63 -0
  144. package/src/fpl/Configs/Config.js +154 -0
  145. package/src/fpl/Configs/Counter.vue +35 -0
  146. package/src/fpl/Configs/Histogram.vue +70 -0
  147. package/src/fpl/Configs/IPMap.vue +37 -0
  148. package/src/fpl/Configs/Image.vue +163 -0
  149. package/src/fpl/Configs/MetricChart.vue +20 -0
  150. package/src/fpl/Configs/PieChart.vue +37 -0
  151. package/src/fpl/Configs/SparkChart.vue +41 -0
  152. package/src/fpl/Configs/StackedBarChart.vue +49 -0
  153. package/src/fpl/Configs/Table.vue +211 -0
  154. package/src/fpl/Configs/Text.vue +14 -0
  155. package/src/fpl/Configs/TopNChart.vue +37 -0
  156. package/src/fpl/Outputs/FPLAlert.vue +64 -0
  157. package/src/fpl/Outputs/FPLStream.vue +41 -0
  158. package/src/fpl/Outputs/FPLTable.vue +77 -0
  159. package/src/fpl/Panel.vue +202 -0
  160. package/src/fpl/Panels/Alert.vue +85 -0
  161. package/src/fpl/Panels/AlertSprite.vue +9 -0
  162. package/src/fpl/Panels/Chart.vue +98 -0
  163. package/src/fpl/Panels/Counter.vue +43 -0
  164. package/src/fpl/Panels/Histogram.vue +138 -0
  165. package/src/fpl/Panels/IPMap.vue +48 -0
  166. package/src/fpl/Panels/Image.vue +35 -0
  167. package/src/fpl/Panels/MetricChart.vue +97 -0
  168. package/src/fpl/Panels/PieChart.vue +54 -0
  169. package/src/fpl/Panels/SparkChart.vue +166 -0
  170. package/src/fpl/Panels/StackedBarChart.vue +74 -0
  171. package/src/fpl/Panels/Table.vue +103 -0
  172. package/src/fpl/Panels/Text.vue +24 -0
  173. package/src/fpl/Panels/TopNChart.vue +69 -0
  174. package/src/fpl/index.js +39 -0
  175. package/src/utils/download.js +220 -0
  176. package/src/utils/formatOutput.js +156 -0
  177. package/src/utils/random.js +32 -0
  178. package/src/utils/timeUtils.js +138 -0
@@ -0,0 +1,33 @@
1
+ <template>
2
+ <div
3
+ class="bg-gray-200 dark:bg-gray-500 rounded-xl shadow-xs overflow-hidden p-1"
4
+ >
5
+ <div
6
+ :class="[
7
+ 'relative flex items-center justify-center',
8
+ { 'h-2': hideProgress },
9
+ { 'h-6': !hideProgress },
10
+ ]"
11
+ >
12
+ <div
13
+ class="absolute top-0 bottom-0 left-0 rounded-lg bg-green-500"
14
+ :style="{ width: `${props.progress}%` }"
15
+ />
16
+ <div
17
+ v-if="!hideProgress"
18
+ class="relative text-green-900 font-medium text-sm"
19
+ >
20
+ {{ props.progress }}%
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </template>
25
+ <script setup>
26
+ const props = defineProps({
27
+ progress: Number,
28
+ hideProgress: {
29
+ type: Boolean,
30
+ default: false,
31
+ },
32
+ });
33
+ </script>
@@ -0,0 +1,52 @@
1
+ <template>
2
+ <RadioGroup v-bind="$attrs" class="row ">
3
+ <RadioGroupOption
4
+ as="template"
5
+ v-for="(option, i) in options"
6
+ :value="option.value"
7
+ v-slot="{ active, checked }"
8
+ >
9
+ <div
10
+ :class="[
11
+ { 'py-1 px-2': size === 'sm' },
12
+ { 'py-2 px-3': size === 'md' },
13
+ { 'py-3 px-4': size === 'lg' },
14
+ { 'rounded-l-lg': i === 0},
15
+ { 'rounded-r-lg': i === options.length - 1},
16
+ { 'bg-gray-200': active },
17
+ checked ? 'white-bg-hover text-black dark:text-white dark:bg-slate-800' : 'white-bg dark:bg-slate-600 dark:text-white',
18
+ 'cursor-pointer'
19
+ ]"
20
+ class="relative flex shadow-md focus:outline-hidden"
21
+ >
22
+ <RadioGroupLabel as="template">
23
+ <span v-if="useValue" class="block text-sm font-medium">{{ option.value }}</span>
24
+ <div v-else><slot :name="`option-${i}`" /></div>
25
+ </RadioGroupLabel>
26
+ </div>
27
+ </RadioGroupOption>
28
+ </RadioGroup>
29
+ </template>
30
+
31
+ <script setup>
32
+ import {
33
+ RadioGroup,
34
+ RadioGroupLabel,
35
+ RadioGroupOption,
36
+ } from '@headlessui/vue'
37
+
38
+ const props = defineProps({
39
+ size: {
40
+ type: String,
41
+ default: 'md',
42
+ },
43
+ options: {
44
+ type: Array,
45
+ default: () => [],
46
+ },
47
+ useValue: {
48
+ type: Boolean,
49
+ default: true,
50
+ },
51
+ })
52
+ </script>
@@ -0,0 +1,79 @@
1
+ <template>
2
+ <FormSection sectionName="Schedule Details">
3
+ <div class="px-2">
4
+ <FormCol fieldName="Interval">
5
+ <GreySelect v-model="local.interval" :options="intervalOptions" />
6
+ </FormCol>
7
+ <div class="flex gap-x-3">
8
+ <FormCol v-if="local.interval === 'monthly'" fieldName="Day" class="w-44">
9
+ <GreySelect v-model="local.day" :options="dayOptions" />
10
+ </FormCol>
11
+ <FormCol
12
+ v-if="local.interval === 'weekly'"
13
+ fieldName="Weekday"
14
+ class="w-44"
15
+ >
16
+ <GreySelect v-model="local.weekday" :options="weekdayOptions" />
17
+ </FormCol>
18
+ <FormCol
19
+ v-if="local.interval !== 'minute' && local.interval !== 'hourly'"
20
+ fieldName="Hour"
21
+ class="w-44"
22
+ >
23
+ <GreySelect v-model="local.hour" :options="hourOptions" />
24
+ </FormCol>
25
+ <FormCol
26
+ v-if="
27
+ local.interval === 'minute' ||
28
+ local.interval === 'hourly' ||
29
+ local.interval === 'daily'
30
+ "
31
+ fieldName="Minute"
32
+ class="w-44"
33
+ >
34
+ <GreySelect v-model="local.minute" :options="minuteOptions" />
35
+ </FormCol>
36
+ </div>
37
+ <FormCol
38
+ v-if="local.interval !== 'minute' && local.interval !== 'hourly'"
39
+ fieldName="Timezone"
40
+ >
41
+ <GreySelect v-model="local.timezone" :options="timezoneOptions" />
42
+ </FormCol>
43
+ </div>
44
+ </FormSection>
45
+ </template>
46
+ <script setup>
47
+ import { FormSection, FormCol, GreySelect } from "@/components";
48
+ import {
49
+ timezoneOptions,
50
+ weekdayOptions,
51
+ intervalOptions,
52
+ hourOptions,
53
+ dayOptions,
54
+ } from "@/constants/schedule";
55
+ import { ref, computed } from "vue";
56
+
57
+ const props = defineProps({
58
+ schedule: Object,
59
+ });
60
+ const local = ref(props.schedule);
61
+
62
+ const minuteOptions = computed(() => {
63
+ if (local.value.interval === "minute") {
64
+ return Array.from({ length: 60 }, (_, i) => {
65
+ const val = i + 1;
66
+ return { label: val.toString(), value: val };
67
+ });
68
+ } else if (
69
+ local.value.interval === "hourly" ||
70
+ local.value.interval === "daily"
71
+ ) {
72
+ return Array.from({ length: 12 }, (_, i) => {
73
+ const val = i * 5;
74
+ return { label: val.toString(), value: val };
75
+ });
76
+ }
77
+ return [];
78
+ });
79
+ </script>
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <div class="relative">
3
+ <span
4
+ class="cursor-pointer absolute flex items-center right-2 inset-y-0"
5
+ @click="emits('search')"
6
+ >
7
+ <MagnifyingGlassIcon class="icon-md" />
8
+ </span>
9
+ <input
10
+ type="text"
11
+ class="pl-3 input-block pr-8"
12
+ v-model.trim="local"
13
+ placeholder="Search"
14
+ @keyup.enter="emits('search')"
15
+ />
16
+ </div>
17
+ </template>
18
+ <script setup>
19
+ import { ref, watch } from "vue";
20
+ import { MagnifyingGlassIcon } from "@heroicons/vue/20/solid";
21
+
22
+ const props = defineProps({
23
+ str: String,
24
+ });
25
+ const emits = defineEmits(["search", "update"]);
26
+ const local = ref(props.str);
27
+ watch(local, (val) => {
28
+ emits("update", val);
29
+ });
30
+ </script>
@@ -0,0 +1,3 @@
1
+ <template>
2
+ <div class="w-full h-0.5 bg-gray-300 my-2"></div>
3
+ </template>
@@ -0,0 +1,95 @@
1
+ <template>
2
+ <TransitionRoot as="template" :show="open">
3
+ <Dialog as="div" class="relative z-40" @close="emits('hide')">
4
+ <!--div class="fixed inset-0" /-->
5
+ <TransitionChild
6
+ as="template"
7
+ enter="duration-500 sm:duration-700 ease-out"
8
+ enter-from="opacity-0"
9
+ enter-to="opacity-100"
10
+ leave="duration-500 sm:duration-700 ease-in"
11
+ leave-from="opacity-100"
12
+ leave-to="opacity-0"
13
+ >
14
+ <div
15
+ class="fixed inset-0 bg-gray-500/50 transition-opacity"
16
+ />
17
+ </TransitionChild>
18
+ <div class="fixed inset-0 overflow-hidden">
19
+ <div class="absolute inset-0 overflow-hidden">
20
+ <div
21
+ class="pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10 sm:pl-16"
22
+ >
23
+ <TransitionChild
24
+ as="template"
25
+ enter="transform transition ease-in-out duration-500 sm:duration-700"
26
+ enter-from="translate-x-full"
27
+ enter-to="translate-x-0"
28
+ leave="transform transition ease-in-out duration-500 sm:duration-700"
29
+ leave-from="translate-x-0"
30
+ leave-to="translate-x-full"
31
+ >
32
+ <DialogPanel class="pointer-events-auto w-screen max-w-2xl">
33
+ <div
34
+ class="flex h-full flex-col bg-white shadow-xl dark:bg-black"
35
+ >
36
+ <div class="bg-sky-700 px-4 py-6 sm:px-6">
37
+ <div class="flex items-center justify-between">
38
+ <DialogTitle
39
+ class="text-base font-semibold leading-6 text-white"
40
+ >{{ adjustText(title, titleWidth) }}</DialogTitle
41
+ >
42
+ <div class="ml-3 flex h-7 items-center">
43
+ <button
44
+ type="button"
45
+ class="relative rounded-md bg-sky-700 text-sky-200 hover:text-white focus:outline-hidden focus:ring-2 focus:ring-white"
46
+ @click="emits('close')"
47
+ >
48
+ <span class="absolute -inset-2.5" />
49
+ <span class="sr-only">Close panel</span>
50
+ <XMarkIcon class="icon-lg" aria-hidden="true" />
51
+ </button>
52
+ </div>
53
+ </div>
54
+ </div>
55
+ <div class="h-0 flex-1 overflow-y-auto">
56
+ <div class="flex flex-1 flex-col justify-between">
57
+ <div class="px-4 sm:px-6">
58
+ <div class="space-y-6 pb-5 pt-6">
59
+ <slot name="content" />
60
+ </div>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ <div class="flex flex-shrink-0 justify-end px-4 py-4">
65
+ <slot name="footer" />
66
+ </div>
67
+ </div>
68
+ </DialogPanel>
69
+ </TransitionChild>
70
+ </div>
71
+ </div>
72
+ </div>
73
+ </Dialog>
74
+ </TransitionRoot>
75
+ </template>
76
+
77
+ <script setup>
78
+ import {
79
+ Dialog,
80
+ DialogPanel,
81
+ DialogTitle,
82
+ TransitionChild,
83
+ TransitionRoot,
84
+ } from "@headlessui/vue";
85
+ import { XMarkIcon } from "@heroicons/vue/24/outline";
86
+ import { adjustText } from "@/constants/font-map";
87
+
88
+ const props = defineProps({
89
+ open: Boolean,
90
+ title: String,
91
+ });
92
+ const emits = defineEmits(["close", "hide"]);
93
+
94
+ const titleWidth = 2800;
95
+ </script>
@@ -0,0 +1,83 @@
1
+ <template>
2
+ <Menu as="div" class="relative inline-block text-left">
3
+ <MenuButton
4
+ :class="`group inline-flex justify-center text-${size} font-medium`"
5
+ >
6
+ <Bars3BottomLeftIcon :class="`${iconSize} mr-2`" />
7
+ Sort By
8
+ <ChevronDownIcon :class="`${iconSize} ml-2`" />
9
+ </MenuButton>
10
+
11
+ <transition
12
+ enter-active-class="transition ease-out duration-100"
13
+ enter-from-class="transform opacity-0 scale-95"
14
+ enter-to-class="transform opacity-100 scale-100"
15
+ leave-active-class="transition ease-in duration-75"
16
+ leave-from-class="transform opacity-100 scale-100"
17
+ leave-to-class="transform opacity-0 scale-95"
18
+ >
19
+ <MenuItems
20
+ :class="[
21
+ 'z-50 absolute z-50 mt-0.5 w-40 origin-top-right rounded-md py-2 shadow-lg max-h-96 overflow-y-auto break-all white-bg text-gray-700 dark:bg-black dark:text-gray-300',
22
+ direction === 'right' ? 'left-0 ' : 'right-0',
23
+ ]"
24
+ >
25
+ <div class="py-1">
26
+ <MenuItem v-for="option in options" :key="option" v-slot="{ active }">
27
+ <span
28
+ :class="[
29
+ active ? 'outline-hidden white-bg-hover dark:dark-bg-hover' : '',
30
+ {
31
+ 'bg-gray-400 dark:bg-slate-800':
32
+ current.label === option.label,
33
+ },
34
+ `group flex w-full items-center rounded-md px-2 py-2 text-${size} cursor-pointer`,
35
+ ]"
36
+ @click.stop="emits('sort', option)"
37
+ >
38
+ {{ option.label }}
39
+ </span>
40
+ </MenuItem>
41
+ </div>
42
+ </MenuItems>
43
+ </transition>
44
+ </Menu>
45
+ </template>
46
+ <script setup>
47
+ import { computed } from "vue";
48
+ import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/vue";
49
+ import {
50
+ Bars3BottomLeftIcon,
51
+ ChevronDownIcon,
52
+ } from "@heroicons/vue/24/outline";
53
+
54
+ // props and emits
55
+ const props = defineProps({
56
+ options: {
57
+ type: Array,
58
+ required: true,
59
+ },
60
+ direction: {
61
+ type: String,
62
+ default: "left",
63
+ },
64
+ current: {
65
+ type: Object,
66
+ default: () => ({}),
67
+ },
68
+ size: {
69
+ type: String,
70
+ default: "xs",
71
+ },
72
+ });
73
+ const emits = defineEmits(["sort"]);
74
+
75
+ // computed
76
+ const iconSize = computed(() => {
77
+ if (props.size === "xs") return "icon";
78
+ if (props.size === "sm") return "icon-md";
79
+ if (props.size === "md") return "icon-lg";
80
+ if (props.size === "lg") return "icon-xl";
81
+ return "icon";
82
+ });
83
+ </script>
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <div class="w-full">
3
+ <div :class="dense ? '' : 'table-frame1'">
4
+ <div :class="dense ? '' : overflow ? 'overflow-x-auto' : ''">
5
+ <div class="table-frame3">
6
+ <div :class="['table-shadow', { 'overflow-hidden': overflow }]">
7
+ <table class="std-table">
8
+ <thead
9
+ :class="
10
+ hideHeader
11
+ ? 'sr-only'
12
+ : 'text-left bg-neutral-200 dark:dark-bg'
13
+ "
14
+ >
15
+ <slot name="header" />
16
+ </thead>
17
+ <tbody v-if="!data || data.length === 0">
18
+ <tr>
19
+ <td colspan="100%" class="h-24 text-center">
20
+ No data available
21
+ </td>
22
+ </tr>
23
+ </tbody>
24
+ <tbody v-else class="std-table-body">
25
+ <slot name="rows" />
26
+ </tbody>
27
+ </table>
28
+ <slot name="pagination" />
29
+ </div>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ </template>
35
+ <script setup>
36
+ const props = defineProps({
37
+ data: Array,
38
+ hideHeader: Boolean,
39
+ dense: {
40
+ type: Boolean,
41
+ default: false,
42
+ },
43
+ overflow: {
44
+ type: Boolean,
45
+ default: true,
46
+ },
47
+ });
48
+ </script>
@@ -0,0 +1,129 @@
1
+ <template>
2
+ <div>
3
+ <div class="relative hidden md:block overflow-auto">
4
+ <nav class="flex space-x-2" aria-label="Tabs">
5
+ <a
6
+ v-for="tab in tabs"
7
+ :key="tab.name"
8
+ :class="[
9
+ tab.current
10
+ ? 'bg-sky-100 dark:bg-slate-700 text-sky-700 dark:text-sky-100'
11
+ : 'text-slate-500 dark:text-slate-200 opacity-50',
12
+ 'cursor-pointer rounded-md px-4 py-2 hover:bg-sky-100 dark:hover:bg-slate-800',
13
+ ]"
14
+ @click="switchTab(tab[props.tabField])"
15
+ >
16
+ <span
17
+ :class="[
18
+ 'row',
19
+ { 'text-sm': props.size === 'small' },
20
+ { 'text-lg': props.size === 'large' },
21
+ ]"
22
+ >
23
+ <img
24
+ v-if="tab.icon"
25
+ :src="tab.icon"
26
+ :alt="tab.name"
27
+ :width="iconWidth"
28
+ class="mr-2"
29
+ />
30
+ {{ tab.name }}
31
+ </span>
32
+ </a>
33
+ </nav>
34
+ </div>
35
+ <!-- Mobile mode dropdown -->
36
+ <div class="md:hidden">
37
+ <Menu as="div" class="relative inline-block text-left py-3 mx-2">
38
+ <div>
39
+ <MenuButton
40
+ :class="[
41
+ 'inline-flex w-full justify-center cursor-pointer rounded-md px-4 py-2 hover:bg-sky-100 dark:hover:bg-slate-800 px-4 py-2 font-medium bg-sky-100 dark:bg-slate-700 text-sky-700 dark:text-sky-100',
42
+ { 'text-sm': props.size === 'small' },
43
+ { 'text-lg': props.size === 'large' },
44
+ ]"
45
+ >
46
+ {{ current }}
47
+ <ChevronDownIcon
48
+ :class="[
49
+ { 'icon-md': props.size === 'small' },
50
+ { 'icon-lg': props.size !== 'small' },
51
+ ]"
52
+ aria-hidden="true"
53
+ />
54
+ </MenuButton>
55
+ </div>
56
+
57
+ <transition
58
+ enter-active-class="transition duration-100 ease-out"
59
+ enter-from-class="transform scale-95 opacity-0"
60
+ enter-to-class="transform scale-100 opacity-100"
61
+ leave-active-class="transition duration-75 ease-in"
62
+ leave-from-class="transform scale-100 opacity-100"
63
+ leave-to-class="transform scale-95 opacity-0"
64
+ >
65
+ <MenuItems
66
+ class="z-50 min-w-full absolute left-0 mt-2 origin-top-left rounded-md bg-white dark:bg-black"
67
+ >
68
+ <MenuItem v-for="tab in tabs" @click="switchTab(tab.name)">
69
+ <button
70
+ :class="[
71
+ 'group flex w-full items-center rounded-md px-2 py-2 text-sm hover:bg-sky-100 dark:hover:bg-slate-800',
72
+ tab.current
73
+ ? 'bg-sky-100 dark:bg-slate-700 text-sky-700 dark:text-sky-100'
74
+ : 'text-slate-500 dark:text-slate-200',
75
+ ]"
76
+ >
77
+ {{ tab.name }}
78
+ </button>
79
+ </MenuItem>
80
+ </MenuItems>
81
+ </transition>
82
+ </Menu>
83
+ </div>
84
+ </div>
85
+ </template>
86
+
87
+ <script setup>
88
+ import { computed } from "vue";
89
+ import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/vue";
90
+ import { ChevronDownIcon } from "@heroicons/vue/20/solid";
91
+
92
+ // props and emits
93
+ const props = defineProps({
94
+ tabs: Array,
95
+ current: [String, Number, Boolean],
96
+ size: {
97
+ type: String,
98
+ default: "medium",
99
+ },
100
+ tabField: {
101
+ type: String,
102
+ default: "name",
103
+ },
104
+ });
105
+ const emits = defineEmits(["switch"]);
106
+ // states
107
+ const tabs = props.tabs;
108
+ // computed
109
+ const iconWidth = computed(() => {
110
+ if (props.size === "small") {
111
+ return "16";
112
+ } else if (props.size === "large") {
113
+ return "32";
114
+ }
115
+ return "24";
116
+ });
117
+ // functions
118
+ function switchTab(newTab) {
119
+ tabs.forEach((tab) => {
120
+ if (tab[props.tabField] === props.current) {
121
+ tab.current = false;
122
+ }
123
+ if (tab[props.tabField] === newTab) {
124
+ tab.current = true;
125
+ }
126
+ });
127
+ emits("switch", newTab);
128
+ }
129
+ </script>
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <span
3
+ :class="[
4
+ 'relative chip',
5
+ { 'yellow-chip': color === 'yellow' },
6
+ { 'blue-chip': color === 'blue' },
7
+ { 'red-chip': color === 'red' },
8
+ { 'green-chip': color === 'green' },
9
+ { 'text-xs': size === 'xsmall' },
10
+ { 'text-sm': size === 'small' },
11
+ { 'text-lg': size === 'large' },
12
+ ]"
13
+ @mouseover="showTooltip"
14
+ @mouseout="hideTooltip"
15
+ >
16
+ <slot name="icon" />
17
+ {{ text }}
18
+ <Tooltip
19
+ :tooltip="tooltip"
20
+ :showingTooltip="showingTooltip"
21
+ direction="top"
22
+ style="transform: translateY(-20%)"
23
+ />
24
+ </span>
25
+ </template>
26
+ <script setup>
27
+ import { ref } from "vue";
28
+ import { Tooltip } from "@/components";
29
+
30
+ const props = defineProps({
31
+ text: String,
32
+ size: {
33
+ type: String,
34
+ default: "medium",
35
+ },
36
+ color: {
37
+ type: String,
38
+ default: "blue",
39
+ },
40
+ tooltip: {
41
+ type: String,
42
+ default: "",
43
+ },
44
+ });
45
+ const showingTooltip = ref(false);
46
+
47
+ function showTooltip() {
48
+ if (props.tooltip) showingTooltip.value = true;
49
+ }
50
+ function hideTooltip() {
51
+ showingTooltip.value = false;
52
+ }
53
+ </script>
@@ -0,0 +1,49 @@
1
+ <template>
2
+ <span
3
+ :id="props.id"
4
+ role="tooltip"
5
+ :class="[
6
+ 'mt-2 tooltip opacity-100 whitespace-nowrap',
7
+ { hidden: !props.showingTooltip },
8
+ { 'bottom-5 x-center': props.direction === 'top' },
9
+ { 'top-5 x-center': props.direction === 'bottom' },
10
+ { 'bottom-0 left-tooltip': props.direction === 'left' },
11
+ { 'bottom-0 right-tooltip': props.direction === 'right' },
12
+ ]"
13
+ >
14
+ {{ props.tooltip }}
15
+ </span>
16
+ </template>
17
+ <script setup lang="ts">
18
+ const props = defineProps({
19
+ tooltip: {
20
+ type: String,
21
+ default: "",
22
+ },
23
+ showingTooltip: {
24
+ type: Boolean,
25
+ default: false,
26
+ },
27
+ id: {
28
+ type: String,
29
+ default: "tooltip",
30
+ },
31
+ direction: {
32
+ type: String,
33
+ default: "bottom",
34
+ },
35
+ });
36
+ </script>
37
+ <style scoped>
38
+ .x-center {
39
+ transform: translateX(-50%);
40
+ }
41
+
42
+ .left-tooltip {
43
+ transform: translateX(-120%);
44
+ }
45
+
46
+ .right-tooltip {
47
+ transform: translateX(20%);
48
+ }
49
+ </style>