@redseed/redseed-ui-vue3 7.2.3 → 7.2.5

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/index.js CHANGED
@@ -30,7 +30,6 @@ export * from './src/components/MetaInfo'
30
30
  export * from './src/components/Modal'
31
31
  export * from './src/components/Pagination'
32
32
  export * from './src/components/Progress'
33
- export * from './src/components/Section'
34
33
  export * from './src/components/Social'
35
34
  export * from './src/components/Sorting'
36
35
  export * from './src/components/Switcher'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redseed/redseed-ui-vue3",
3
- "version": "7.2.3",
3
+ "version": "7.2.5",
4
4
  "description": "RedSeed UI Vue 3 components",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/redseedtraining/redseed-ui",
@@ -5,7 +5,7 @@ const props = defineProps({
5
5
  variant: {
6
6
  type: String,
7
7
  default: 'primary',
8
- validator: (value) => ['primary', 'secondary', 'brand', 'success', 'info', 'warning', 'error'].includes(value)
8
+ validator: (value) => ['primary', 'secondary', 'brand', 'success', 'info', 'warning', 'error', 'ai'].includes(value)
9
9
  }
10
10
  })
11
11
 
@@ -19,18 +19,20 @@ const variantClass = computed(() => [
19
19
  'rsui-section--info': props.variant === 'info',
20
20
  'rsui-section--warning': props.variant === 'warning',
21
21
  'rsui-section--error': props.variant === 'error',
22
+ 'rsui-section--ai': props.variant === 'ai',
22
23
  },
23
24
  ])
24
25
 
25
26
  </script>
26
27
 
27
28
  <template>
28
- <section
29
+ <section
29
30
  :class="variantClass"
30
31
  >
31
32
  <div v-if="$slots.header" class="rsui-section__header">
32
33
  <slot name="header"></slot>
33
34
  </div>
35
+
34
36
  <div v-if="$slots.default" class="rsui-section__content">
35
37
  <slot></slot>
36
38
  </div>
@@ -1,10 +1,10 @@
1
1
  <script setup>
2
- import { ref } from 'vue'
2
+ import { ref, computed, useSlots } from 'vue'
3
3
  import ButtonTertiary from '../Button/ButtonTertiary.vue'
4
4
  import { useResponsiveWidth } from '../../helpers'
5
5
  import { EllipsisVerticalIcon } from '@heroicons/vue/24/outline'
6
6
 
7
- defineProps({
7
+ const props = defineProps({
8
8
  showSubtitle: {
9
9
  type: Boolean,
10
10
  default: true,
@@ -36,6 +36,15 @@ const emit = defineEmits(['click:more-actions'])
36
36
  function handleMoreActionsClick() {
37
37
  emit('click:more-actions')
38
38
  }
39
+
40
+ const slots = useSlots()
41
+
42
+ const showToolbar = computed(() => {
43
+ const showMoreActions = props.showMoreActions && slots['more-actions']
44
+
45
+ return props.showActions
46
+ && (slots.actions || showMoreActions)
47
+ })
39
48
  </script>
40
49
  <template>
41
50
  <div ref="sectionHeaderElement"
@@ -53,7 +62,10 @@ function handleMoreActionsClick() {
53
62
  <slot name="icon"></slot>
54
63
  </div>
55
64
 
56
- <div class="rsui-section-header__text">
65
+ <div :class="{
66
+ 'rsui-section-header__text': true,
67
+ 'rsui-section-header__text--with-toolbar': showToolbar || $slots.icon,
68
+ }">
57
69
 
58
70
  <!-- Title slot, default slot -->
59
71
  <div class="rsui-section-header__title">
@@ -70,7 +82,7 @@ function handleMoreActionsClick() {
70
82
 
71
83
  <!-- Actions slot, optional -->
72
84
  <div class="rsui-section-header__toolbar"
73
- v-if="showActions"
85
+ v-if="showToolbar"
74
86
  >
75
87
  <!-- Desktop actions slot, optional -->
76
88
  <div class="rsui-section-header__actions-desktop"
@@ -1,5 +1,6 @@
1
1
  import HeroSection from './HeroSection.vue'
2
2
  import PageHeader from './PageHeader.vue'
3
+ import Section from './Section.vue'
3
4
  import SectionFooter from './SectionFooter.vue'
4
5
  import SectionHeader from './SectionHeader.vue'
5
6
  import SingleColumnLayout from './SingleColumnLayout.vue'
@@ -8,6 +9,7 @@ import TwoColumnLayout from './TwoColumnLayout.vue'
8
9
  export {
9
10
  HeroSection,
10
11
  PageHeader,
12
+ Section,
11
13
  SectionFooter,
12
14
  SectionHeader,
13
15
  SingleColumnLayout,
@@ -1,5 +0,0 @@
1
- import Section from './Section.vue'
2
-
3
- export {
4
- Section,
5
- }