pimelon-ui 0.1.115 → 0.1.117

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pimelon-ui",
3
- "version": "0.1.115",
3
+ "version": "0.1.117",
4
4
  "description": "A set of components and utilities for rapid UI development",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -83,7 +83,7 @@
83
83
  class="absolute right-0 inline-flex h-7 w-7 items-center justify-center"
84
84
  >
85
85
  <LoadingIndicator
86
- v-if="!props.loading"
86
+ v-if="props.loading"
87
87
  class="h-4 w-4 text-ink-gray-5"
88
88
  />
89
89
  <button v-else @click="clearAll">
package/src/index.js CHANGED
@@ -68,9 +68,6 @@ export { default as NestedPopover } from './components/ListFilter/NestedPopover.
68
68
  export { default as CircularProgressBar } from './components/CircularProgressBar.vue'
69
69
  export { default as Tree } from './components/Tree/Tree.vue'
70
70
 
71
- // billing components
72
- export { default as TrialBanner } from './components/Billing/TrialBanner.vue'
73
-
74
71
  // directives
75
72
  export { default as onOutsideClickDirective } from './directives/onOutsideClick.js'
76
73
  export { default as visibilityDirective } from './directives/visibility.js'
@@ -1,16 +0,0 @@
1
- <template>
2
- <svg
3
- width="17"
4
- height="16"
5
- viewBox="0 0 17 16"
6
- fill="none"
7
- xmlns="http://www.w3.org/2000/svg"
8
- >
9
- <path
10
- fill-rule="evenodd"
11
- clip-rule="evenodd"
12
- d="M6.2641 1C5.5758 1 4.97583 1.46845 4.80889 2.1362L3.57555 7.06953C3.33887 8.01625 4.05491 8.93333 5.03077 8.93333H7.50682L6.72168 14.4293C6.68838 14.6624 6.82229 14.8872 7.04319 14.9689C7.26408 15.0507 7.51204 14.9671 7.63849 14.7684L13.2161 6.00354C13.6398 5.33782 13.1616 4.46667 12.3725 4.46667H9.59038L10.3017 1.62127C10.3391 1.4719 10.3055 1.31365 10.2108 1.19229C10.116 1.07094 9.97063 1 9.81666 1H6.2641ZM5.77903 2.37873C5.83468 2.15615 6.03467 2 6.2641 2H9.17627L8.46492 4.8454C8.42758 4.99477 8.46114 5.15302 8.55589 5.27437C8.65064 5.39573 8.79602 5.46667 8.94999 5.46667H12.3725L8.0395 12.2757L8.5783 8.50404C8.5988 8.36056 8.55602 8.21523 8.46105 8.10573C8.36608 7.99623 8.22827 7.93333 8.08332 7.93333H5.03077C4.70548 7.93333 4.4668 7.62764 4.5457 7.31207L5.77903 2.37873Z"
13
- fill="currentColor"
14
- />
15
- </svg>
16
- </template>
@@ -1,78 +0,0 @@
1
- <template>
2
- <div
3
- v-if="!isSidebarCollapsed && showBanner"
4
- class="m-2 flex flex-col gap-3 shadow-sm rounded-lg py-2.5 px-3 bg-surface-white text-base"
5
- >
6
- <div class="flex flex-col gap-1">
7
- <div class="inline-flex gap-1 items-center font-medium">
8
- <FeatherIcon class="h-4" name="info" />
9
- {{ trialTitle }}
10
- </div>
11
- <div class="text-ink-gray-7 text-p-sm">
12
- {{ trialMessage }}
13
- </div>
14
- </div>
15
- <Button :label="'Upgrade plan'" theme="blue" @click="upgradePlan">
16
- <template #prefix>
17
- <LightningIcon class="size-4" />
18
- </template>
19
- </Button>
20
- </div>
21
- </template>
22
- <script setup>
23
- import LightningIcon from './LightningIcon.vue'
24
- import FeatherIcon from '../FeatherIcon.vue'
25
- import { Button } from '../Button'
26
- import { createResource } from '../../resources'
27
- import { ref, computed } from 'vue'
28
-
29
- const props = defineProps({
30
- isSidebarCollapsed: {
31
- type: Boolean,
32
- default: false,
33
- },
34
- })
35
-
36
- const trialEndDays = ref(0)
37
- const showBanner = ref(false)
38
- const baseEndpoint = ref('https://meloncloud.com')
39
- const siteName = ref('')
40
-
41
- const trialTitle = computed(() => {
42
- return trialEndDays.value > 1
43
- ? 'Trial ends in ' + trialEndDays.value + ' days'
44
- : 'Trial ends tomorrow'
45
- })
46
-
47
- const trialMessage = 'Upgrade to a paid plan for uninterrupted services'
48
-
49
- createResource({
50
- url: 'melon.integrations.melon_providers.meloncloud_billing.current_site_info',
51
- cache: 'current_site_info_data',
52
- auto: true,
53
- onSuccess: (data) => {
54
- trialEndDays.value = calculateTrialEndDays(data.trial_end_date)
55
- baseEndpoint.value = data.base_url
56
- siteName.value = data.site_name
57
- showBanner.value =
58
- data.setup_complete && data.plan.is_trial_plan && trialEndDays.value > 0
59
- },
60
- })
61
-
62
- function calculateTrialEndDays(trialEndDate) {
63
- if (!trialEndDate) return 0
64
-
65
- trialEndDate = new Date(trialEndDate)
66
- const today = new Date()
67
- const diffTime = trialEndDate - today
68
- const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24))
69
- return diffDays
70
- }
71
-
72
- function upgradePlan() {
73
- window.open(
74
- `${baseEndpoint.value}/dashboard/sites/${siteName.value}`,
75
- '_blank',
76
- )
77
- }
78
- </script>