@redseed/redseed-ui-vue3 6.4.2 → 6.4.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.
@@ -9,13 +9,15 @@ Text components provide consistent typography and text formatting across the app
9
9
  **Implementation:**
10
10
  ```vue
11
11
  <template>
12
- <BodyText>
12
+ <BodyText :lines="3">
13
13
  This is the main content text that will be displayed with consistent styling,
14
14
  proper line height, and appropriate spacing for readability.
15
15
  </BodyText>
16
16
  </template>
17
17
  ```
18
18
 
19
+ `lines` determines how many lines of text are visible before the content is clamped using Tailwind's `line-clamp-{n}` utility. Values from **1** to **6** are supported.
20
+
19
21
  ### ReadMore
20
22
  **When to use:** For long text content that should be truncated with a "read more" expand/collapse functionality.
21
23
  **Implementation:**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redseed/redseed-ui-vue3",
3
- "version": "6.4.2",
3
+ "version": "6.4.3",
4
4
  "description": "RedSeed UI Vue 3 components",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/redseedtraining/redseed-ui",
@@ -1,13 +1,32 @@
1
1
  <script setup>
2
+ import { computed } from 'vue'
3
+
4
+ const props = defineProps({
5
+ lines: {
6
+ type: Number,
7
+ default: null,
8
+ },
9
+ })
10
+
11
+ const clampClasses = {
12
+ 1: 'line-clamp-1',
13
+ 2: 'line-clamp-2',
14
+ 3: 'line-clamp-3',
15
+ 4: 'line-clamp-4',
16
+ 5: 'line-clamp-5',
17
+ 6: 'line-clamp-6',
18
+ }
19
+
20
+ const clampClass = computed(() => clampClasses[props.lines] || null)
2
21
  </script>
3
22
  <template>
4
- <div class="rsui-body-text">
5
- <slot></slot>
6
- </div>
23
+ <div class="rsui-body-text" :class="clampClass">
24
+ <slot></slot>
25
+ </div>
7
26
  </template>
8
27
  <style lang="scss" scoped>
9
28
  .rsui-body-text {
10
- @apply text-base text-rsui-grey-900;
11
- @apply *:text-base *:text-rsui-grey-900;
29
+ @apply text-base text-text-primary;
30
+ @apply *:text-base *:text-text-primary;
12
31
  }
13
- </style>
32
+ </style>
@@ -6,6 +6,10 @@ defineOptions({
6
6
  })
7
7
 
8
8
  const props = defineProps({
9
+ sm: {
10
+ type: Boolean,
11
+ default: false,
12
+ },
9
13
  md: {
10
14
  type: Boolean,
11
15
  default: false,
@@ -22,12 +26,13 @@ const props = defineProps({
22
26
 
23
27
  defineEmits(['click'])
24
28
 
25
- const defaultSize = computed(() => !props.md && !props.lg)
29
+ const defaultSize = computed(() => !props.sm && !props.md && !props.lg)
26
30
 
27
31
  const linkSlotClass = computed(() => [
28
32
  'rsui-link-slot',
29
33
  {
30
34
  // link sizes
35
+ 'rsui-link-slot--sm': props.sm,
31
36
  'rsui-link-slot--md': props.md,
32
37
  'rsui-link-slot--lg': props.lg || defaultSize.value,
33
38
  // link disabled state
@@ -67,6 +72,13 @@ const linkLabelClass = computed(() => [
67
72
  &--disabled {
68
73
  @apply opacity-30 cursor-default pointer-events-none;
69
74
  }
75
+ // modifier sm size
76
+ &--sm {
77
+ @apply text-sm leading-5;
78
+ :deep(svg) {
79
+ @apply size-5;
80
+ }
81
+ }
70
82
  // modifier md size
71
83
  &--md {
72
84
  @apply text-base leading-6;
@@ -18,7 +18,7 @@ const props = defineProps({
18
18
  default: () => [],
19
19
  validator: value => {
20
20
  if (value.length === 0) return true
21
- return value.every(row => typeof row === 'object' && row.id)
21
+ return value.every(row => typeof row === 'object' && row.id && (row.clickable === undefined || typeof row.clickable === 'boolean'))
22
22
  },
23
23
  },
24
24
  clickableRows: {
@@ -93,7 +93,7 @@ const props = defineProps({
93
93
  <tbody>
94
94
  <Tr v-for="row in rows"
95
95
  :key="row.id"
96
- :clickable="clickableRows"
96
+ :clickable="row.clickable ?? clickableRows"
97
97
  @click="$emit('click:row', row)"
98
98
  >
99
99
  <Td v-for="column in columns"