@rancher/shell 0.2.2 → 0.2.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.
- package/package.json +1 -1
- package/rancher-components/BadgeState/BadgeState.spec.ts +12 -0
- package/rancher-components/BadgeState/BadgeState.vue +107 -0
- package/rancher-components/BadgeState/index.ts +1 -0
- package/rancher-components/Banner/Banner.test.ts +13 -0
- package/rancher-components/Banner/Banner.vue +163 -0
- package/rancher-components/Banner/index.ts +1 -0
- package/rancher-components/Card/Card.vue +150 -0
- package/rancher-components/Card/index.ts +1 -0
- package/rancher-components/Form/Checkbox/Checkbox.test.ts +77 -0
- package/rancher-components/Form/Checkbox/Checkbox.vue +395 -0
- package/rancher-components/Form/Checkbox/index.ts +1 -0
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +29 -0
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +343 -0
- package/rancher-components/Form/LabeledInput/index.ts +1 -0
- package/rancher-components/Form/Radio/RadioButton.vue +270 -0
- package/rancher-components/Form/Radio/RadioGroup.vue +235 -0
- package/rancher-components/Form/Radio/index.ts +2 -0
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +168 -0
- package/rancher-components/Form/TextArea/index.ts +1 -0
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.test.ts +107 -0
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +137 -0
- package/rancher-components/Form/ToggleSwitch/index.ts +1 -0
- package/rancher-components/Form/index.ts +5 -0
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +137 -0
- package/rancher-components/LabeledTooltip/index.ts +1 -0
- package/scripts/publish-shell.sh +1 -1
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Vue from 'vue';
|
|
3
|
+
|
|
4
|
+
export default Vue.extend({
|
|
5
|
+
props: {
|
|
6
|
+
/**
|
|
7
|
+
* The Labeled Tooltip value.
|
|
8
|
+
*/
|
|
9
|
+
value: {
|
|
10
|
+
type: [String, Object],
|
|
11
|
+
default: null
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The status for the Labeled Tooltip. Controls the Labeled Tooltip class.
|
|
16
|
+
* @values info, success, warning, error
|
|
17
|
+
*/
|
|
18
|
+
status: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: 'error'
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Displays the Labeled Tooltip on mouse hover.
|
|
25
|
+
*/
|
|
26
|
+
hover: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: true
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
computed: {
|
|
32
|
+
iconClass() {
|
|
33
|
+
return this.status === 'error' ? 'icon-warning' : 'icon-info';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template>
|
|
40
|
+
<div ref="container" class="labeled-tooltip" :class="{[status]: true, hoverable: hover}">
|
|
41
|
+
<template v-if="hover">
|
|
42
|
+
<i v-tooltip="value.content ? { ...{content: value.content, classes: [`tooltip-${status}`]}, ...value } : value" :class="{'hover':!value, [iconClass]: true}" class="icon status-icon" />
|
|
43
|
+
</template>
|
|
44
|
+
<template v-else>
|
|
45
|
+
<i :class="{'hover':!value}" class="icon status-icon" />
|
|
46
|
+
<div v-if="value" class="tooltip" x-placement="bottom">
|
|
47
|
+
<div class="tooltip-arrow" />
|
|
48
|
+
<div class="tooltip-inner">
|
|
49
|
+
{{ value }}
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
</div>
|
|
54
|
+
</template>
|
|
55
|
+
|
|
56
|
+
<style lang='scss'>
|
|
57
|
+
.labeled-tooltip {
|
|
58
|
+
position: absolute;
|
|
59
|
+
width: 100%;
|
|
60
|
+
height: 100%;
|
|
61
|
+
left: 0;
|
|
62
|
+
top: 0;
|
|
63
|
+
|
|
64
|
+
&.hoverable {
|
|
65
|
+
height: 0%;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.status-icon {
|
|
69
|
+
position: absolute;
|
|
70
|
+
right: 30px;
|
|
71
|
+
top: $input-padding-lg;
|
|
72
|
+
font-size: 20px;
|
|
73
|
+
z-index: z-index(hoverOverContent);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.tooltip {
|
|
77
|
+
position: absolute;
|
|
78
|
+
width: calc(100% + 2px);
|
|
79
|
+
top: calc(100% + 6px);
|
|
80
|
+
|
|
81
|
+
.tooltip-arrow {
|
|
82
|
+
right: 30px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.tooltip-inner {
|
|
86
|
+
padding: 10px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@mixin tooltipColors($color) {
|
|
91
|
+
.status-icon {
|
|
92
|
+
color: $color;
|
|
93
|
+
}
|
|
94
|
+
.tooltip {
|
|
95
|
+
.tooltip-inner {
|
|
96
|
+
color: var(--input-bg);
|
|
97
|
+
background: $color;
|
|
98
|
+
border-color: $color;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.tooltip-arrow {
|
|
102
|
+
border-bottom-color: $color;
|
|
103
|
+
&:after {
|
|
104
|
+
border: none;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&.error {
|
|
111
|
+
@include tooltipColors(var(--error));
|
|
112
|
+
|
|
113
|
+
.status-icon {
|
|
114
|
+
top: 7px;
|
|
115
|
+
right: 5px;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&.warning {
|
|
120
|
+
@include tooltipColors(var(--warning));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&.success {
|
|
124
|
+
@include tooltipColors(var(--success));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Ensure code blocks inside tootips don't look awful
|
|
129
|
+
.tooltip {
|
|
130
|
+
.tooltip-inner {
|
|
131
|
+
> pre {
|
|
132
|
+
padding: 2px;
|
|
133
|
+
vertical-align: middle;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as LabeledTooltip } from './LabeledTooltip.vue';
|
package/scripts/publish-shell.sh
CHANGED
|
@@ -55,7 +55,7 @@ function publish() {
|
|
|
55
55
|
pushd ${FOLDER} >/dev/null
|
|
56
56
|
|
|
57
57
|
# For now, copy the rancher components into the shell and ship them with it
|
|
58
|
-
if [ "$NAME" == "
|
|
58
|
+
if [ "$NAME" == "Shell" ]; then
|
|
59
59
|
echo "Adding Rancher Components"
|
|
60
60
|
cp -R ${BASE_DIR}/pkg/rancher-components/src/components ./rancher-components/
|
|
61
61
|
fi
|