@birdycom/omniaui-vue 0.12.3 → 0.12.4

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": "@birdycom/omniaui-vue",
3
- "version": "0.12.3",
3
+ "version": "0.12.4",
4
4
  "description": "OmniaUI for Vue 3: one single-file component per OmniaUI component and block, rendering the exact markup of the CSS packages.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,4 +1,4 @@
1
- <!-- File: packages/vue/src/components/OcPriceCard.vue | Map: props -> head -> toggle (radios) -> monthly / yearly price -> features -> cta slot -->
1
+ <!-- File: packages/vue/src/components/OcPriceCard.vue | Map: props -> head -> toggle (radios) -> monthly / yearly / lifetime price -> features -> cta slot -->
2
2
  <script setup lang="ts">
3
3
  /**
4
4
  * Plan card with a CSS-only monthly / yearly switch (radio + :has). Slots: cta, features (replaces the list items).
@@ -24,13 +24,16 @@ withDefaults(
24
24
  discount?: string
25
25
  monthly: PriceCardPrice
26
26
  yearly?: PriceCardPrice
27
- defaultPeriod?: 'monthly' | 'yearly'
27
+ /** Optional third option, e.g. a one-time price. Needs `yearly`. */
28
+ lifetime?: PriceCardPrice
29
+ defaultPeriod?: 'monthly' | 'yearly' | 'lifetime'
28
30
  features?: PriceCardFeature[]
29
31
  featured?: boolean
30
32
  monthlyLabel?: string
31
33
  yearlyLabel?: string
34
+ lifetimeLabel?: string
32
35
  }>(),
33
- { defaultPeriod: 'monthly', features: () => [], monthlyLabel: 'Monthly', yearlyLabel: 'Yearly' },
36
+ { defaultPeriod: 'monthly', features: () => [], monthlyLabel: 'Monthly', yearlyLabel: 'Yearly', lifetimeLabel: 'Lifetime' },
34
37
  )
35
38
  // Every card needs its own radio group name.
36
39
  const group = useUid('oc-price')
@@ -46,6 +49,7 @@ const group = useUid('oc-price')
46
49
  <div v-if="yearly" class="oc-segmented oc-price-card__toggle" role="radiogroup" aria-label="Billing period">
47
50
  <label class="oc-segmented-item"><input type="radio" :name="group" value="monthly" :checked="defaultPeriod === 'monthly'" /> {{ monthlyLabel }}</label>
48
51
  <label class="oc-segmented-item"><input type="radio" :name="group" value="yearly" :checked="defaultPeriod === 'yearly'" /> {{ yearlyLabel }}</label>
52
+ <label v-if="lifetime" class="oc-segmented-item"><input type="radio" :name="group" value="lifetime" :checked="defaultPeriod === 'lifetime'" /> {{ lifetimeLabel }}</label>
49
53
  </div>
50
54
  <p class="oc-price-card__price oc-price-card__price--monthly">
51
55
  <span class="oc-price-card__amount">{{ monthly.amount }}</span>
@@ -59,6 +63,12 @@ const group = useUid('oc-price')
59
63
  <s v-if="yearly.was" class="oc-price-card__was">{{ yearly.was }}</s>
60
64
  <span v-if="yearly.note" class="oc-price-card__note">{{ yearly.note }}</span>
61
65
  </p>
66
+ <p v-if="yearly && lifetime" class="oc-price-card__price oc-price-card__price--lifetime">
67
+ <span class="oc-price-card__amount">{{ lifetime.amount }}</span>
68
+ <span v-if="lifetime.period" class="oc-price-card__period">{{ lifetime.period }}</span>
69
+ <s v-if="lifetime.was" class="oc-price-card__was">{{ lifetime.was }}</s>
70
+ <span v-if="lifetime.note" class="oc-price-card__note">{{ lifetime.note }}</span>
71
+ </p>
62
72
  <ul v-if="features.length || $slots.features" class="oc-price-card__features">
63
73
  <slot name="features">
64
74
  <li v-for="(f, i) in features" :key="i" :class="['oc-price-card__feature', f.excluded && 'oc-price-card__feature--excluded']">{{ f.label }}</li>