@redseed/redseed-ui-vue3 6.3.3 → 6.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.
@@ -40,24 +40,6 @@ Button components provide interactive elements for user actions. They come in va
40
40
  </template>
41
41
  ```
42
42
 
43
- ### ButtonSecondaryBrand
44
- **When to use:** For brand-specific secondary actions that need to stand out while still being secondary to the primary action.
45
- **Implementation:**
46
- ```vue
47
- <template>
48
- <ButtonSecondaryBrand @click="handleBrandAction">Brand Action</ButtonSecondaryBrand>
49
- </template>
50
- ```
51
-
52
- ### ButtonSecondaryBrandFull
53
- **When to use:** Same as ButtonSecondaryBrand but spans the full width of its container.
54
- **Implementation:**
55
- ```vue
56
- <template>
57
- <ButtonSecondaryBrandFull @click="handleBrandAction">Brand Action</ButtonSecondaryBrandFull>
58
- </template>
59
- ```
60
-
61
43
  ### ButtonTertiary
62
44
  **When to use:** For less prominent actions, such as "Learn More", "View Details", or utility actions.
63
45
  **Implementation:**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redseed/redseed-ui-vue3",
3
- "version": "6.3.3",
3
+ "version": "6.3.7",
4
4
  "description": "RedSeed UI Vue 3 components",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/redseedtraining/redseed-ui",
@@ -94,7 +94,7 @@ const buttonSlotClass = computed(() => [
94
94
  // default control
95
95
  @apply w-fit h-fit inline-flex shrink-0 items-center justify-center select-none outline-none whitespace-nowrap will-change-transform;
96
96
  // default shape
97
- @apply gap-1.5 border rounded-lg transition;
97
+ @apply border rounded-lg transition gap-1.5;
98
98
  // default font
99
99
  @apply font-semibold text-sm;
100
100
  // default colors
@@ -121,10 +121,7 @@ const buttonSlotClass = computed(() => [
121
121
 
122
122
  // modifier sm size
123
123
  &--sm {
124
- @apply text-sm px-3 py-2;
125
- &-icon {
126
- @apply p-2;
127
- }
124
+ @apply text-sm px-spacing-lg py-spacing-md gap-spacing-xs;
128
125
  }
129
126
 
130
127
  // modifier md size
@@ -2,8 +2,6 @@ import ButtonPrimary from './ButtonPrimary.vue'
2
2
  import ButtonPrimaryFull from './ButtonPrimaryFull.vue'
3
3
  import ButtonSecondary from './ButtonSecondary.vue'
4
4
  import ButtonSecondaryFull from './ButtonSecondaryFull.vue'
5
- import ButtonSecondaryBrand from './ButtonSecondaryBrand.vue'
6
- import ButtonSecondaryBrandFull from './ButtonSecondaryBrandFull.vue'
7
5
  import ButtonTertiary from './ButtonTertiary.vue'
8
6
  import ButtonTertiaryFull from './ButtonTertiaryFull.vue'
9
7
 
@@ -12,8 +10,6 @@ export {
12
10
  ButtonPrimaryFull,
13
11
  ButtonSecondary,
14
12
  ButtonSecondaryFull,
15
- ButtonSecondaryBrand,
16
- ButtonSecondaryBrandFull,
17
13
  ButtonTertiary,
18
14
  ButtonTertiaryFull,
19
15
  }
@@ -101,11 +101,15 @@ const dropdownContent = computed(() => {
101
101
 
102
102
  // Get display text for the input
103
103
  const displayText = computed(() => {
104
- if (isOpen.value) return searchText.value
105
-
106
- // When closed, show the label of the selected option or the model value
104
+ // Always show the selected option label if there is one, regardless of dropdown state
107
105
  const selectedOption = props.options.find(option => option.value === model.value)
108
- return selectedOption ? selectedOption.label : model.value
106
+ if (selectedOption) {
107
+ return selectedOption.label
108
+ }
109
+
110
+ // If no option is selected, show search text when open or model value when closed
111
+ if (isOpen.value) return searchText.value
112
+ return model.value
109
113
  })
110
114
 
111
115
  function toggleDropdown() {
@@ -140,8 +144,15 @@ function close() {
140
144
  }
141
145
 
142
146
  function choose(option) {
143
- model.value = option.value
144
- emit('change', option.value)
147
+ // If clicking on the currently selected option, deselect it
148
+ if (option.value === model.value) {
149
+ model.value = ''
150
+ emit('change', '')
151
+ } else {
152
+ // Otherwise, select the new option
153
+ model.value = option.value
154
+ emit('change', option.value)
155
+ }
145
156
  close()
146
157
  }
147
158
 
@@ -1,20 +1,31 @@
1
1
  <script setup>
2
+ import { computed } from 'vue'
3
+
2
4
  const props = defineProps({
3
5
  variant: {
4
6
  type: String,
5
- default: 'default',
6
- validator: (value) => ['default', 'secondary', 'brand', 'success', 'warning', 'error'].includes(value)
7
+ default: 'primary',
8
+ validator: (value) => ['primary', 'secondary', 'brand', 'success', 'warning', 'error'].includes(value)
7
9
  }
8
10
  })
11
+
12
+ const variantClass = computed(() => [
13
+ 'rsui-section',
14
+ {
15
+ 'rsui-section--primary': props.variant === 'primary',
16
+ 'rsui-section--secondary': props.variant === 'secondary',
17
+ 'rsui-section--brand': props.variant === 'brand',
18
+ 'rsui-section--success': props.variant === 'success',
19
+ 'rsui-section--warning': props.variant === 'warning',
20
+ 'rsui-section--error': props.variant === 'error',
21
+ },
22
+ ])
23
+
9
24
  </script>
10
25
 
11
26
  <template>
12
27
  <section
13
- :class="[
14
- 'rsui-section',
15
- `rsui-section--${variant}`
16
- ]"
17
-
28
+ :class="variantClass"
18
29
  >
19
30
  <div v-if="$slots.header" class="rsui-section__header">
20
31
  <slot name="header"></slot>
@@ -29,7 +40,7 @@ const props = defineProps({
29
40
  .rsui-section {
30
41
  @apply border border-solid rounded-xl p-6;
31
42
 
32
- &--default {
43
+ &--primary {
33
44
  @apply bg-background-primary border-border-primary text-text-primary;
34
45
  }
35
46
 
@@ -1,23 +0,0 @@
1
- <script setup>
2
- import ButtonSlot from './ButtonSlot.vue'
3
- </script>
4
- <template>
5
- <ButtonSlot class="rsui-button-secondary-brand">
6
- <slot></slot>
7
- </ButtonSlot>
8
- </template>
9
- <style lang="scss" scoped>
10
- .rsui-button-secondary-brand {
11
- // default colors
12
- @apply text-primary-background bg-white border-primary-background;
13
- // default hover state
14
- @apply hover:text-primary-background-hover hover:bg-white hover:border-primary-background-hover;
15
- // default focus state
16
- @apply focus-visible:ring-primary-background focus-visible:border-primary-background;
17
- // default active state
18
- @apply active:bg-white active:border-primary-background;
19
- // default disabled state
20
- @apply disabled:bg-white disabled:border-rsui-grey-100 disabled:text-rsui-grey-400;
21
- @apply disabled:active:bg-white disabled:active:border-rsui-grey-100;
22
- }
23
- </style>
@@ -1,10 +0,0 @@
1
- <script setup>
2
- import ButtonSecondaryBrand from './ButtonSecondaryBrand.vue'
3
- </script>
4
- <template>
5
- <ButtonSecondaryBrand full>
6
- <slot></slot>
7
- </ButtonSecondaryBrand>
8
- </template>
9
- <style lang="scss" scoped>
10
- </style>