@redseed/redseed-ui-vue3 6.3.3 → 6.4.0
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/docs/02-button-components.md +0 -18
- package/package.json +1 -1
- package/src/components/Badge/Badge.vue +17 -6
- package/src/components/Button/ButtonSlot.vue +2 -5
- package/src/components/Button/index.js +0 -4
- package/src/components/FormField/FormFieldCombobox.vue +17 -6
- package/src/components/Section/Section.vue +19 -8
- package/src/components/Button/ButtonSecondaryBrand.vue +0 -23
- package/src/components/Button/ButtonSecondaryBrandFull.vue +0 -10
|
@@ -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
|
@@ -14,6 +14,10 @@ const props = defineProps({
|
|
|
14
14
|
type: Boolean,
|
|
15
15
|
default: false,
|
|
16
16
|
},
|
|
17
|
+
secondary: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false,
|
|
20
|
+
},
|
|
17
21
|
success: {
|
|
18
22
|
type: Boolean,
|
|
19
23
|
default: false,
|
|
@@ -22,6 +26,10 @@ const props = defineProps({
|
|
|
22
26
|
type: Boolean,
|
|
23
27
|
default: false,
|
|
24
28
|
},
|
|
29
|
+
error: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false,
|
|
32
|
+
},
|
|
25
33
|
})
|
|
26
34
|
|
|
27
35
|
const defaultSize = computed(() => !props.sm && !props.md)
|
|
@@ -31,9 +39,10 @@ const badgeClass = computed(() => [
|
|
|
31
39
|
{
|
|
32
40
|
'rsui-badge--sm': props.sm || defaultSize.value,
|
|
33
41
|
'rsui-badge--md': props.md,
|
|
34
|
-
'rsui-badge--
|
|
42
|
+
'rsui-badge--secondary': props.neutral || props.secondary,
|
|
35
43
|
'rsui-badge--success': props.success,
|
|
36
44
|
'rsui-badge--warning': props.warning,
|
|
45
|
+
'rsui-badge--error': props.error,
|
|
37
46
|
},
|
|
38
47
|
])
|
|
39
48
|
|
|
@@ -61,16 +70,18 @@ defineExpose({
|
|
|
61
70
|
&--md {
|
|
62
71
|
@apply px-2 py-2;
|
|
63
72
|
}
|
|
64
|
-
&--
|
|
65
|
-
@apply text-
|
|
73
|
+
&--secondary {
|
|
74
|
+
@apply text-text-secondary bg-background-secondary border border-border-secondary;
|
|
66
75
|
}
|
|
67
76
|
&--success {
|
|
68
|
-
@apply text-
|
|
77
|
+
@apply text-text-success bg-background-success border border-border-success;
|
|
69
78
|
}
|
|
70
79
|
&--warning {
|
|
71
|
-
@apply text-
|
|
80
|
+
@apply text-text-warning bg-background-warning border border-border-warning;
|
|
81
|
+
}
|
|
82
|
+
&--error {
|
|
83
|
+
@apply text-text-error bg-background-error border border-border-error;
|
|
72
84
|
}
|
|
73
|
-
|
|
74
85
|
:deep(svg) {
|
|
75
86
|
@apply size-4;
|
|
76
87
|
}
|
|
@@ -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
|
|
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-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
144
|
-
|
|
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: '
|
|
6
|
-
validator: (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
|
-
&--
|
|
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>
|