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
- gap: string
31
+ maskWidth: string
32
32
  offset: string
33
33
  angle: string
34
34
  }>({
35
35
  type: Object as PropType<{
36
36
  size: string
37
- gap: string
37
+ maskWidth: string
38
38
  offset: string
39
39
  angle: string
40
40
  }>,
41
41
  default: () => ({
42
42
  size: "12px",
43
- gap: "4px",
43
+ maskWidth: "4px",
44
44
  offset: "0px",
45
45
  angle: "90deg",
46
46
  }),
47
47
  required: false,
48
48
  })
49
49
 
50
- const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
50
+ const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
51
51
 
52
- // Compute the CSS custom properties based on chipConfig
53
52
  const chipStyles = computed(() => ({
54
- "--status-size": chipConfig.value.size,
55
- "--status-gap": chipConfig.value.gap,
56
- "--status-offset": chipConfig.value.offset,
57
- "--status-angle": chipConfig.value.angle,
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
- --d: calc(var(--status-size) + (var(--status-gap) * 2)); /* diameter of the mask */
65
- --r: calc((100% / 2) + var(--status-offset)); /* distance from edge of avatar */
66
- --x: calc(var(--r) * cos(var(--status-angle) - 90deg) + (100% / 2)); /* x coord of status/mask */
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
- --normalized-angle: calc(var(--status-angle) - 90deg);
73
- --abs-tan: abs(tan(var(--normalized-angle)));
74
- --half-size: 50%;
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(--status-size);
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(--d) var(--d) at var(--x) var(--y),
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(--status-size) / 2));
133
- left: calc(var(--x) - (var(--status-size) / 2));
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(--status-size) / 2));
140
- left: calc(var(--x) - (var(--status-size) / 2));
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 ["primary", "secondary", "tertiary", "ghost", "error", "info", "success", "warning"].includes(value)
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-0);
106
- border: 1px solid var(--colour-theme-8);
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srcdev-nuxt-components",
3
3
  "type": "module",
4
- "version": "6.1.26",
4
+ "version": "6.1.28",
5
5
  "main": "nuxt.config.ts",
6
6
  "scripts": {
7
7
  "clean": "rm -rf .nuxt && rm -rf .output && rm -rf .playground/.nuxt && rm -rf .playground/.output",