srcdev-nuxt-components 6.1.26 → 6.1.28
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.
|
@@ -28,70 +28,50 @@ const props = defineProps({
|
|
|
28
28
|
|
|
29
29
|
const chipConfig = defineModel<{
|
|
30
30
|
size: string
|
|
31
|
-
|
|
31
|
+
maskWidth: string
|
|
32
32
|
offset: string
|
|
33
33
|
angle: string
|
|
34
34
|
}>({
|
|
35
35
|
type: Object as PropType<{
|
|
36
36
|
size: string
|
|
37
|
-
|
|
37
|
+
maskWidth: string
|
|
38
38
|
offset: string
|
|
39
39
|
angle: string
|
|
40
40
|
}>,
|
|
41
41
|
default: () => ({
|
|
42
42
|
size: "12px",
|
|
43
|
-
|
|
43
|
+
maskWidth: "4px",
|
|
44
44
|
offset: "0px",
|
|
45
45
|
angle: "90deg",
|
|
46
46
|
}),
|
|
47
47
|
required: false,
|
|
48
48
|
})
|
|
49
49
|
|
|
50
|
-
const { elementClasses
|
|
50
|
+
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
51
51
|
|
|
52
|
-
// Compute the CSS custom properties based on chipConfig
|
|
53
52
|
const chipStyles = computed(() => ({
|
|
54
|
-
"--
|
|
55
|
-
"--
|
|
56
|
-
"--
|
|
57
|
-
"--
|
|
53
|
+
"--chip-size": chipConfig.value.size,
|
|
54
|
+
"--chip-mask-width": chipConfig.value.maskWidth,
|
|
55
|
+
"--chip-offset": chipConfig.value.offset,
|
|
56
|
+
"--chip-angle": chipConfig.value.angle,
|
|
58
57
|
}))
|
|
59
58
|
</script>
|
|
60
59
|
|
|
61
60
|
<style lang="css">
|
|
62
61
|
.display-chip-core {
|
|
62
|
+
--computed-mask-diameter: calc(var(--chip-size) + (var(--chip-mask-width) * 2));
|
|
63
|
+
|
|
63
64
|
&.circle {
|
|
64
|
-
--
|
|
65
|
-
--
|
|
66
|
-
--
|
|
67
|
-
--y: calc(var(--r) * sin(var(--status-angle) - 90deg) + (100% / 2)); /* y coord of status/mask */
|
|
65
|
+
--computed-chip-offset: calc((100% / 2) + var(--chip-offset));
|
|
66
|
+
--computed-position-x: calc(var(--computed-chip-offset) * cos(var(--chip-angle) - 90deg) + (100% / 2));
|
|
67
|
+
--computed-position-y: calc(var(--computed-chip-offset) * sin(var(--chip-angle) - 90deg) + (100% / 2));
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
&.square {
|
|
71
|
-
|
|
72
|
-
--
|
|
73
|
-
--
|
|
74
|
-
--
|
|
75
|
-
|
|
76
|
-
--edge-distance: min(var(--half-size), var(--half-size) / var(--abs-tan));
|
|
77
|
-
--base-x: calc(var(--half-size) + var(--edge-distance) * cos(var(--normalized-angle)));
|
|
78
|
-
--base-y: calc(var(--half-size) + var(--edge-distance) * sin(var(--normalized-angle)));
|
|
79
|
-
|
|
80
|
-
--x: calc(var(--base-x) + var(--status-offset) * cos(var(--normalized-angle)));
|
|
81
|
-
--y: calc(var(--base-y) + var(--status-offset) * sin(var(--normalized-angle)));
|
|
82
|
-
|
|
83
|
-
--d: calc(var(--status-size) + (var(--status-gap) * 2));
|
|
84
|
-
*/
|
|
85
|
-
|
|
86
|
-
/* Simple square positioning - clamp the circular calculation to square bounds */
|
|
87
|
-
--circle-x: calc(50% + (50% + var(--status-offset) + (var(--status-size) / 2)) * cos(var(--status-angle) - 90deg));
|
|
88
|
-
--circle-y: calc(50% + (50% + var(--status-offset) + (var(--status-size) / 2)) * sin(var(--status-angle) - 90deg));
|
|
89
|
-
|
|
90
|
-
/* Clamp to square bounds (0% to 100% with some padding) */
|
|
91
|
-
--x: clamp(calc(var(--status-offset) * -1), var(--circle-x), calc(100% + var(--status-offset)));
|
|
92
|
-
--y: clamp(calc(var(--status-offset) * -1), var(--circle-y), calc(100% + var(--status-offset)));
|
|
93
|
-
|
|
94
|
-
--d: calc(var(--status-size) + (var(--status-gap) * 2)); /* diameter of the mask (same as circle) */
|
|
71
|
+
--circle-x: calc(50% + (50% + var(--chip-offset) + (var(--chip-size) / 2)) * cos(var(--chip-angle) - 90deg));
|
|
72
|
+
--circle-y: calc(50% + (50% + var(--chip-offset) + (var(--chip-size) / 2)) * sin(var(--chip-angle) - 90deg));
|
|
73
|
+
--computed-position-x: clamp(calc(var(--chip-offset) * -1), var(--circle-x), calc(100% + var(--chip-offset)));
|
|
74
|
+
--computed-position-y: clamp(calc(var(--chip-offset) * -1), var(--circle-y), calc(100% + var(--chip-offset)));
|
|
95
75
|
}
|
|
96
76
|
|
|
97
77
|
/* colors */
|
|
@@ -109,7 +89,7 @@ const chipStyles = computed(() => ({
|
|
|
109
89
|
aspect-ratio: 1;
|
|
110
90
|
background: var(--color-offline);
|
|
111
91
|
position: absolute;
|
|
112
|
-
width: var(--
|
|
92
|
+
width: var(--chip-size);
|
|
113
93
|
border-radius: 100%;
|
|
114
94
|
}
|
|
115
95
|
|
|
@@ -121,7 +101,8 @@ const chipStyles = computed(() => ({
|
|
|
121
101
|
*/
|
|
122
102
|
|
|
123
103
|
mask-image: radial-gradient(
|
|
124
|
-
var(--
|
|
104
|
+
var(--computed-mask-diameter) var(--computed-mask-diameter) at var(--computed-position-x)
|
|
105
|
+
var(--computed-position-y),
|
|
125
106
|
transparent calc(50% - 0.5px),
|
|
126
107
|
black calc(50% + 0.5px)
|
|
127
108
|
);
|
|
@@ -129,15 +110,15 @@ const chipStyles = computed(() => ({
|
|
|
129
110
|
|
|
130
111
|
&.circle {
|
|
131
112
|
&::after {
|
|
132
|
-
top: calc(var(--y) - (var(--
|
|
133
|
-
left: calc(var(--x) - (var(--
|
|
113
|
+
top: calc(var(--computed-position-y) - (var(--chip-size) / 2));
|
|
114
|
+
left: calc(var(--computed-position-x) - (var(--chip-size) / 2));
|
|
134
115
|
}
|
|
135
116
|
}
|
|
136
117
|
|
|
137
118
|
&.square {
|
|
138
119
|
&::after {
|
|
139
|
-
top: calc(var(--y) - (var(--
|
|
140
|
-
left: calc(var(--x) - (var(--
|
|
120
|
+
top: calc(var(--computed-position-y) - (var(--chip-size) / 2));
|
|
121
|
+
left: calc(var(--computed-position-x) - (var(--chip-size) / 2));
|
|
141
122
|
}
|
|
142
123
|
}
|
|
143
124
|
|
|
@@ -47,7 +47,7 @@ const props = defineProps({
|
|
|
47
47
|
type: String,
|
|
48
48
|
default: "error",
|
|
49
49
|
validator(value: string) {
|
|
50
|
-
return ["
|
|
50
|
+
return ["success", "secondary", "info", "error", "warning"].includes(value)
|
|
51
51
|
},
|
|
52
52
|
},
|
|
53
53
|
styleClassPassthrough: {
|
|
@@ -102,16 +102,33 @@ const updateComponentState = () => {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
.display-prompt-wrapper {
|
|
105
|
-
background-color: var(--colour-theme-
|
|
106
|
-
border:
|
|
105
|
+
background-color: var(--colour-theme-8);
|
|
106
|
+
border: 0px solid transparent;
|
|
107
107
|
border-radius: 4px;
|
|
108
|
-
|
|
109
|
-
border-inline-start: 8px solid var(--colour-theme-8);
|
|
110
108
|
border-start-start-radius: 8px;
|
|
111
109
|
border-end-start-radius: 8px;
|
|
110
|
+
padding-inline-start: 8px;
|
|
112
111
|
|
|
113
112
|
overflow: hidden;
|
|
114
113
|
|
|
114
|
+
&:not(.dark) {
|
|
115
|
+
&.outlined {
|
|
116
|
+
border: 1px solid var(--colour-theme-8);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&.dark {
|
|
121
|
+
border-width: 0;
|
|
122
|
+
|
|
123
|
+
.display-prompt-inner {
|
|
124
|
+
background-color: var(--gray-12);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&.outlined {
|
|
128
|
+
border: 1px solid var(--colour-theme-8);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
115
132
|
.display-prompt-inner {
|
|
116
133
|
align-items: center;
|
|
117
134
|
display: flex;
|
|
@@ -120,6 +137,10 @@ const updateComponentState = () => {
|
|
|
120
137
|
padding-block: 1rem;
|
|
121
138
|
padding-inline: 1.5rem;
|
|
122
139
|
|
|
140
|
+
border-start-start-radius: 8px;
|
|
141
|
+
border-end-start-radius: 8px;
|
|
142
|
+
background-color: var(--colour-theme-10);
|
|
143
|
+
|
|
123
144
|
.display-prompt-icon {
|
|
124
145
|
display: inline-flex;
|
|
125
146
|
.icon {
|
package/package.json
CHANGED