@nightshadeui/components 3.1.1 → 3.2.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.
Files changed (139) hide show
  1. package/README.md +21 -0
  2. package/css.d.ts +2 -0
  3. package/dist/_virtual/_plugin-vue_export-helper.js +7 -0
  4. package/dist/_virtual/_rolldown/runtime.js +10 -0
  5. package/dist/components/BaseMenu.css +1 -0
  6. package/dist/components/BaseMenu.js +108 -0
  7. package/dist/components/BaseMenu.vue.d.ts +21 -8
  8. package/dist/components/BaseMenu.vue.d.ts.map +1 -1
  9. package/dist/components/Btn.css +1 -0
  10. package/dist/components/Btn.js +186 -0
  11. package/dist/components/Btn.vue.d.ts +38 -2
  12. package/dist/components/Btn.vue.d.ts.map +1 -1
  13. package/dist/components/Bubble.css +1 -0
  14. package/dist/components/Bubble.js +37 -0
  15. package/dist/components/Bubble.vue.d.ts +12 -2
  16. package/dist/components/Bubble.vue.d.ts.map +1 -1
  17. package/dist/components/Checkbox.css +1 -0
  18. package/dist/components/Checkbox.js +116 -0
  19. package/dist/components/Checkbox.vue.d.ts +15 -3
  20. package/dist/components/Checkbox.vue.d.ts.map +1 -1
  21. package/dist/components/Chip.css +1 -0
  22. package/dist/components/Chip.js +91 -0
  23. package/dist/components/Chip.vue.d.ts +16 -2
  24. package/dist/components/Chip.vue.d.ts.map +1 -1
  25. package/dist/components/ContextMenu.js +56 -0
  26. package/dist/components/ContextMenu.vue.d.ts +28 -8
  27. package/dist/components/ContextMenu.vue.d.ts.map +1 -1
  28. package/dist/components/ContextPopup.js +166 -0
  29. package/dist/components/ContextPopup.vue.d.ts +23 -2
  30. package/dist/components/ContextPopup.vue.d.ts.map +1 -1
  31. package/dist/components/Filler.css +1 -0
  32. package/dist/components/Filler.js +18 -0
  33. package/dist/components/Filler.vue.d.ts +6 -2
  34. package/dist/components/Filler.vue.d.ts.map +1 -1
  35. package/dist/components/HGroup.css +1 -0
  36. package/dist/components/HGroup.js +44 -0
  37. package/dist/components/HGroup.vue.d.ts +21 -8
  38. package/dist/components/HGroup.vue.d.ts.map +1 -1
  39. package/dist/components/InputBase.css +1 -0
  40. package/dist/components/InputBase.js +115 -0
  41. package/dist/components/InputBase.vue.d.ts +16 -2
  42. package/dist/components/InputBase.vue.d.ts.map +1 -1
  43. package/dist/components/InputGroup.css +1 -0
  44. package/dist/components/InputGroup.js +21 -0
  45. package/dist/components/InputGroup.vue.d.ts +12 -2
  46. package/dist/components/InputGroup.vue.d.ts.map +1 -1
  47. package/dist/components/InputSelect.css +1 -0
  48. package/dist/components/InputSelect.js +110 -0
  49. package/dist/components/InputSelect.vue.d.ts +18 -2
  50. package/dist/components/InputSelect.vue.d.ts.map +1 -1
  51. package/dist/components/InputText.css +1 -0
  52. package/dist/components/InputText.js +77 -0
  53. package/dist/components/InputText.vue.d.ts +18 -2
  54. package/dist/components/InputText.vue.d.ts.map +1 -1
  55. package/dist/components/InputTextarea.css +1 -0
  56. package/dist/components/InputTextarea.js +80 -0
  57. package/dist/components/InputTextarea.vue.d.ts +18 -2
  58. package/dist/components/InputTextarea.vue.d.ts.map +1 -1
  59. package/dist/components/ModalOverlay.css +1 -0
  60. package/dist/components/ModalOverlay.js +45 -0
  61. package/dist/components/ModalOverlay.vue.d.ts +12 -2
  62. package/dist/components/ModalOverlay.vue.d.ts.map +1 -1
  63. package/dist/components/RouterBtn.js +39 -0
  64. package/dist/components/RouterBtn.vue.d.ts +10 -2
  65. package/dist/components/RouterBtn.vue.d.ts.map +1 -1
  66. package/dist/components/Slider.css +1 -0
  67. package/dist/components/Slider.js +326 -0
  68. package/dist/components/Slider.vue.d.ts +10 -2
  69. package/dist/components/Slider.vue.d.ts.map +1 -1
  70. package/dist/components/Tab.css +1 -0
  71. package/dist/components/Tab.js +56 -0
  72. package/dist/components/Tab.vue.d.ts +12 -2
  73. package/dist/components/Tab.vue.d.ts.map +1 -1
  74. package/dist/components/TabCap.css +1 -0
  75. package/dist/components/TabCap.js +28 -0
  76. package/dist/components/TabCap.vue.d.ts +6 -2
  77. package/dist/components/TabCap.vue.d.ts.map +1 -1
  78. package/dist/components/Toggle.css +1 -0
  79. package/dist/components/Toggle.js +102 -0
  80. package/dist/components/Toggle.vue.d.ts +6 -2
  81. package/dist/components/Toggle.vue.d.ts.map +1 -1
  82. package/dist/components/ToolPanel.css +1 -0
  83. package/dist/components/ToolPanel.js +33 -0
  84. package/dist/components/ToolPanel.vue.d.ts +12 -2
  85. package/dist/components/ToolPanel.vue.d.ts.map +1 -1
  86. package/dist/components/Tooltip.css +1 -0
  87. package/dist/components/Tooltip.js +97 -0
  88. package/dist/components/Tooltip.vue.d.ts +225 -0
  89. package/dist/components/Tooltip.vue.d.ts.map +1 -0
  90. package/dist/components/VGroup.css +1 -0
  91. package/dist/components/VGroup.js +36 -0
  92. package/dist/components/VGroup.vue.d.ts +21 -8
  93. package/dist/components/VGroup.vue.d.ts.map +1 -1
  94. package/dist/components/index.d.ts +2 -1
  95. package/dist/components/index.d.ts.map +1 -1
  96. package/dist/components/index.js +51 -0
  97. package/dist/components.css +39 -1
  98. package/dist/directives/index.d.ts +2 -0
  99. package/dist/directives/index.d.ts.map +1 -0
  100. package/dist/directives/tooltip.d.ts +14 -0
  101. package/dist/directives/tooltip.d.ts.map +1 -0
  102. package/dist/directives/tooltip.js +23 -0
  103. package/dist/glyphs/GlyphCheck.js +17 -0
  104. package/dist/glyphs/GlyphCheck.vue.d.ts +2 -1
  105. package/dist/glyphs/GlyphCheck.vue.d.ts.map +1 -1
  106. package/dist/glyphs/GlyphXmark.js +17 -0
  107. package/dist/glyphs/GlyphXmark.vue.d.ts +2 -1
  108. package/dist/glyphs/GlyphXmark.vue.d.ts.map +1 -1
  109. package/dist/helpers/props.js +28 -0
  110. package/dist/index.d.ts +1 -0
  111. package/dist/index.d.ts.map +1 -1
  112. package/dist/index.js +28 -0
  113. package/package.json +14 -8
  114. package/src/components/BaseMenu.vue +36 -29
  115. package/src/components/Btn.vue +197 -191
  116. package/src/components/Bubble.vue +110 -103
  117. package/src/components/Checkbox.vue +93 -86
  118. package/src/components/Chip.vue +109 -102
  119. package/src/components/ContextPopup.vue +9 -1
  120. package/src/components/Filler.vue +21 -14
  121. package/src/components/HGroup.vue +47 -41
  122. package/src/components/InputBase.vue +137 -130
  123. package/src/components/InputGroup.vue +26 -16
  124. package/src/components/InputSelect.vue +28 -21
  125. package/src/components/InputText.vue +24 -17
  126. package/src/components/InputTextarea.vue +31 -24
  127. package/src/components/ModalOverlay.vue +21 -14
  128. package/src/components/Slider.vue +258 -249
  129. package/src/components/Tab.vue +73 -66
  130. package/src/components/TabCap.vue +20 -13
  131. package/src/components/Toggle.vue +102 -95
  132. package/src/components/ToolPanel.vue +36 -35
  133. package/src/components/Tooltip.vue +184 -0
  134. package/src/components/VGroup.vue +43 -37
  135. package/src/components/index.ts +2 -0
  136. package/src/directives/index.ts +1 -0
  137. package/src/directives/tooltip.ts +50 -0
  138. package/src/index.ts +1 -0
  139. package/dist/components.mjs +0 -1719
@@ -139,118 +139,125 @@ export default {
139
139
  </script>
140
140
 
141
141
  <style scoped>
142
- .Checkbox {
143
- --Checkbox-size: var(--input-minor-height);
142
+ /* The order, stated wherever these styles load first: the styles, then the components */
143
+ @layer nightshade, nightshade-components;
144
144
 
145
- --Checkbox-outline: transparent;
145
+ @layer nightshade-components {
146
146
 
147
- --Checkbox-background: var(--surface-deep);
147
+ .Checkbox {
148
+ --Checkbox-size: var(--input-minor-height);
148
149
 
149
- --Checkbox-border-size: 0px;
150
- --Checkbox-border: transparent;
151
- --Checkbox-radius: var(--radius-m);
150
+ --Checkbox-outline: transparent;
152
151
 
153
- --Checkbox-box-shadow: 0 1px 3px var(--Checkbox-shadow) inset, 0 0 5px -1px var(--Checkbox-shadow) inset;
154
- --Checkbox-shadow: var(--shadow-light);
155
- --Checkbox-mark-text-shadow: 0 1px 1px var(--text-shadow-auto);
152
+ --Checkbox-background: var(--surface-deep);
156
153
 
157
- display: inline-flex;
158
- align-items: center;
159
- justify-content: center;
160
- position: relative;
161
- width: var(--Checkbox-size);
162
- height: var(--Checkbox-size);
163
- overflow: hidden;
154
+ --Checkbox-border-size: 0px;
155
+ --Checkbox-border: transparent;
156
+ --Checkbox-radius: var(--radius-m);
164
157
 
165
- border: var(--Checkbox-border-size) solid var(--Checkbox-border);
166
- border-radius: var(--Checkbox-radius);
158
+ --Checkbox-box-shadow: 0 1px 3px var(--Checkbox-shadow) inset, 0 0 5px -1px var(--Checkbox-shadow) inset;
159
+ --Checkbox-shadow: var(--shadow-light);
160
+ --Checkbox-mark-text-shadow: 0 1px 1px var(--text-shadow-auto);
167
161
 
168
- background: var(--Checkbox-background);
169
- outline: var(--input-outline-size) solid var(--Checkbox-outline);
170
- outline-offset: var(--input-outline-offset);
171
- background-clip: border-box;
162
+ display: inline-flex;
163
+ align-items: center;
164
+ justify-content: center;
165
+ position: relative;
166
+ width: var(--Checkbox-size);
167
+ height: var(--Checkbox-size);
168
+ overflow: hidden;
172
169
 
173
- font-size: var(--Checkbox-size);
174
- color: var(--tone-fill-text);
175
- text-shadow: var(--Checkbox-mark-text-shadow);
176
- box-shadow: var(--Checkbox-box-shadow);
170
+ border: var(--Checkbox-border-size) solid var(--Checkbox-border);
171
+ border-radius: var(--Checkbox-radius);
177
172
 
178
- cursor: pointer;
179
- user-select: none;
173
+ background: var(--Checkbox-background);
174
+ outline: var(--input-outline-size) solid var(--Checkbox-outline);
175
+ outline-offset: var(--input-outline-offset);
176
+ background-clip: border-box;
180
177
 
181
- transition: background-color .3s, border-radius .3s;
182
- }
178
+ font-size: var(--Checkbox-size);
179
+ color: var(--tone-fill-text);
180
+ text-shadow: var(--Checkbox-mark-text-shadow);
181
+ box-shadow: var(--Checkbox-box-shadow);
183
182
 
184
- .Checkbox input {
185
- display: none;
186
- }
183
+ cursor: pointer;
184
+ user-select: none;
187
185
 
188
- .Mark {
189
- opacity: 0;
186
+ transition: background-color .3s, border-radius .3s;
187
+ }
190
188
 
191
- transition: opacity .1s, border-radius .3s;
192
- }
189
+ .Checkbox input {
190
+ display: none;
191
+ }
193
192
 
194
- .MarkGlyph {
195
- width: 1em;
196
- height: 1em;
197
- }
193
+ .Mark {
194
+ opacity: 0;
198
195
 
199
- .Checkbox-active .Mark {
200
- opacity: 1;
201
- }
196
+ transition: opacity .1s, border-radius .3s;
197
+ }
202
198
 
203
- /* Marks */
199
+ .MarkGlyph {
200
+ width: 1em;
201
+ height: 1em;
202
+ }
204
203
 
205
- .Checkbox-mark-dot .Mark::after {
206
- content: '●';
207
- }
204
+ .Checkbox-active .Mark {
205
+ opacity: 1;
206
+ }
208
207
 
209
- .Checkbox-mark-knob .Mark {
210
- content: '';
211
- width: calc(var(--Checkbox-size) - var(--sp));
212
- height: calc(var(--Checkbox-size) - var(--sp));
213
- border-radius: calc(var(--Checkbox-radius) - 2px);
214
- background: var(--tone-fill-text);
215
- box-shadow: 0 1px 2px var(--Checkbox-shadow);
216
- }
208
+ /* Marks */
217
209
 
218
- /* States */
210
+ .Checkbox-mark-dot .Mark::after {
211
+ content: '●';
212
+ }
219
213
 
220
- .Checkbox-disabled {
221
- cursor: not-allowed;
222
- opacity: var(--input-disabled-opacity);
223
- filter: var(--input-disabled-filter);
224
- }
214
+ .Checkbox-mark-knob .Mark {
215
+ content: '';
216
+ width: calc(var(--Checkbox-size) - var(--sp));
217
+ height: calc(var(--Checkbox-size) - var(--sp));
218
+ border-radius: calc(var(--Checkbox-radius) - 2px);
219
+ background: var(--tone-fill-text);
220
+ box-shadow: 0 1px 2px var(--Checkbox-shadow);
221
+ }
225
222
 
226
- .Checkbox:not(.Checkbox-disabled):hover, .Checkbox.Checkbox-forceHover {
227
- filter: var(--input-hover-filter);
228
- }
223
+ /* States */
229
224
 
230
- .Checkbox:not(.Checkbox-disabled):focus-visible, .Checkbox.Checkbox-forceFocus {
231
- z-index: 10;
232
- --Checkbox-outline: var(--tone-focus-outline);
233
- --Checkbox-border: var(--tone-focus-border);
234
- }
225
+ .Checkbox-disabled {
226
+ cursor: not-allowed;
227
+ opacity: var(--input-disabled-opacity);
228
+ filter: var(--input-disabled-filter);
229
+ }
235
230
 
236
- .Checkbox-active {
237
- --Checkbox-background: var(--tone-fill);
238
- }
231
+ .Checkbox:not(.Checkbox-disabled):hover, .Checkbox.Checkbox-forceHover {
232
+ filter: var(--input-hover-filter);
233
+ }
239
234
 
240
- /* Styles */
235
+ .Checkbox:not(.Checkbox-disabled):focus-visible, .Checkbox.Checkbox-forceFocus {
236
+ z-index: 10;
237
+ --Checkbox-outline: var(--tone-focus-outline);
238
+ --Checkbox-border: var(--tone-focus-border);
239
+ }
241
240
 
242
- .Checkbox-round {
243
- --Checkbox-radius: calc(.5 * var(--Checkbox-size));
244
- }
241
+ .Checkbox-active {
242
+ --Checkbox-background: var(--tone-fill);
243
+ }
245
244
 
246
- .Checkbox-outline {
247
- --Checkbox-border: var(--tone-border);
248
- --Checkbox-border-size: var(--input-border-size);
249
- }
245
+ /* Styles */
246
+
247
+ .Checkbox-round {
248
+ --Checkbox-radius: calc(.5 * var(--Checkbox-size));
249
+ }
250
+
251
+ .Checkbox-outline {
252
+ --Checkbox-border: var(--tone-border);
253
+ --Checkbox-border-size: var(--input-border-size);
254
+ }
255
+
256
+ .Checkbox-flat {
257
+ --Checkbox-box-shadow: none;
258
+ --Checkbox-shadow: transparent;
259
+ --Checkbox-mark-text-shadow: none;
260
+ }
250
261
 
251
- .Checkbox-flat {
252
- --Checkbox-box-shadow: none;
253
- --Checkbox-shadow: transparent;
254
- --Checkbox-mark-text-shadow: none;
255
262
  }
256
263
  </style>
@@ -82,108 +82,115 @@ export default {
82
82
  </script>
83
83
 
84
84
  <style scoped>
85
- .Chip {
86
- --Chip-size: var(--input-major-height);
87
- --Chip-padding: var(--input-major-padding);
88
- --Chip-gap: var(--input-gap);
89
- --Chip-font-size: var(--input-font-size);
90
-
91
- --Chip-background: var(--tone-tint);
92
- --Chip-text: var(--tone-tint-text);
93
- --Chip-icon: var(--tone-tint-text);
94
-
95
- --Chip-border-size: 0px;
96
- --Chip-border: transparent;
97
- --Chip-outline: transparent;
98
- --Chip-radius: var(--radius-m);
99
-
100
- --Chip-box-shadow: 0 1px 1px var(--shadow-light);
101
-
102
- -webkit-appearance: none;
103
- appearance: none;
104
-
105
- position: relative;
106
- display: inline-flex;
107
- align-items: center;
108
- flex-shrink: 0;
109
- gap: var(--Chip-gap);
110
- box-sizing: border-box;
111
- height: var(--Chip-size);
112
- margin: 0;
113
- padding: 0 calc(var(--Chip-padding) - var(--Chip-border-size));
114
-
115
- border: var(--Chip-border-size) solid var(--Chip-border);
116
- border-radius: var(--Chip-radius);
117
- outline: var(--input-outline-size) solid var(--Chip-outline);
118
- outline-offset: var(--input-outline-offset);
119
-
120
- background: var(--Chip-background);
121
- box-shadow: var(--Chip-box-shadow);
122
- color: var(--Chip-text);
123
-
124
- font-family: inherit;
125
- font-size: var(--Chip-font-size);
126
- line-height: 1;
127
- white-space: nowrap;
128
- cursor: pointer;
129
- user-select: none;
130
-
131
- transition: background-color .2s, color .2s, border-color .2s, border-radius .3s;
132
- }
133
-
134
- .Chip::after {
135
- content: '';
136
- position: absolute;
137
- inset: 0;
138
- border-radius: inherit;
139
- background: var(--input-hover-overlay);
140
- mix-blend-mode: color-dodge;
141
- pointer-events: none;
142
- opacity: 0;
143
- }
144
-
145
- .Icon {
146
- color: var(--Chip-icon);
147
- }
148
-
149
- /* States */
150
-
151
- .Chip:not(:disabled):hover::after,
152
- .Chip-forceHover::after {
153
- opacity: 1;
154
- }
155
-
156
- .Chip:not(:disabled):focus-visible,
157
- .Chip-forceFocus {
158
- z-index: 10;
159
- --Chip-outline: var(--tone-focus-outline);
160
- --Chip-border: var(--tone-focus-border);
161
- }
162
-
163
- .Chip-disabled {
164
- opacity: var(--input-disabled-opacity);
165
- filter: var(--input-disabled-filter);
166
- cursor: not-allowed;
167
- }
168
-
169
- /* Styles */
170
-
171
- .Chip-round {
172
- --Chip-radius: calc(.5 * var(--Chip-size));
173
- }
174
-
175
- .Chip-outline {
176
- --Chip-border-size: var(--input-border-size);
177
- --Chip-border: var(--tone-border);
178
- }
179
-
180
- .Chip-flat {
181
- --Chip-box-shadow: none;
182
- }
85
+ /* The order, stated wherever these styles load first: the styles, then the components */
86
+ @layer nightshade, nightshade-components;
87
+
88
+ @layer nightshade-components {
89
+
90
+ .Chip {
91
+ --Chip-size: var(--input-major-height);
92
+ --Chip-padding: var(--input-major-padding);
93
+ --Chip-gap: var(--input-gap);
94
+ --Chip-font-size: var(--input-font-size);
95
+
96
+ --Chip-background: var(--tone-tint);
97
+ --Chip-text: var(--tone-tint-text);
98
+ --Chip-icon: var(--tone-tint-text);
99
+
100
+ --Chip-border-size: 0px;
101
+ --Chip-border: transparent;
102
+ --Chip-outline: transparent;
103
+ --Chip-radius: var(--radius-m);
104
+
105
+ --Chip-box-shadow: 0 1px 1px var(--shadow-light);
106
+
107
+ -webkit-appearance: none;
108
+ appearance: none;
109
+
110
+ position: relative;
111
+ display: inline-flex;
112
+ align-items: center;
113
+ flex-shrink: 0;
114
+ gap: var(--Chip-gap);
115
+ box-sizing: border-box;
116
+ height: var(--Chip-size);
117
+ margin: 0;
118
+ padding: 0 calc(var(--Chip-padding) - var(--Chip-border-size));
119
+
120
+ border: var(--Chip-border-size) solid var(--Chip-border);
121
+ border-radius: var(--Chip-radius);
122
+ outline: var(--input-outline-size) solid var(--Chip-outline);
123
+ outline-offset: var(--input-outline-offset);
124
+
125
+ background: var(--Chip-background);
126
+ box-shadow: var(--Chip-box-shadow);
127
+ color: var(--Chip-text);
128
+
129
+ font-family: inherit;
130
+ font-size: var(--Chip-font-size);
131
+ line-height: 1;
132
+ white-space: nowrap;
133
+ cursor: pointer;
134
+ user-select: none;
135
+
136
+ transition: background-color .2s, color .2s, border-color .2s, border-radius .3s;
137
+ }
138
+
139
+ .Chip::after {
140
+ content: '';
141
+ position: absolute;
142
+ inset: 0;
143
+ border-radius: inherit;
144
+ background: var(--input-hover-overlay);
145
+ mix-blend-mode: color-dodge;
146
+ pointer-events: none;
147
+ opacity: 0;
148
+ }
149
+
150
+ .Icon {
151
+ color: var(--Chip-icon);
152
+ }
153
+
154
+ /* States */
155
+
156
+ .Chip:not(.Chip-disabled):hover::after,
157
+ .Chip-forceHover::after {
158
+ opacity: 1;
159
+ }
160
+
161
+ .Chip:not(.Chip-disabled):focus-visible,
162
+ .Chip-forceFocus {
163
+ z-index: 10;
164
+ --Chip-outline: var(--tone-focus-outline);
165
+ --Chip-border: var(--tone-focus-border);
166
+ }
167
+
168
+ .Chip-disabled {
169
+ opacity: var(--input-disabled-opacity);
170
+ filter: var(--input-disabled-filter);
171
+ cursor: not-allowed;
172
+ }
173
+
174
+ /* Styles */
175
+
176
+ .Chip-round {
177
+ --Chip-radius: calc(.5 * var(--Chip-size));
178
+ }
179
+
180
+ .Chip-outline {
181
+ --Chip-border-size: var(--input-border-size);
182
+ --Chip-border: var(--tone-border);
183
+ }
184
+
185
+ .Chip-flat {
186
+ --Chip-box-shadow: none;
187
+ }
188
+
189
+ .Chip-translucent {
190
+ --Chip-background: color-mix(in srgb, var(--tone-tint), transparent var(--translucency-mix-medium));
191
+ --Chip-box-shadow: 0 0 3px var(--translucency-highlight) inset;
192
+ backdrop-filter: blur(var(--translucency-blur));
193
+ }
183
194
 
184
- .Chip-translucent {
185
- --Chip-background: color-mix(in srgb, var(--tone-tint), transparent var(--translucency-mix-medium));
186
- --Chip-box-shadow: 0 0 3px var(--translucency-highlight) inset;
187
- backdrop-filter: blur(var(--translucency-blur));
188
195
  }
189
196
  </style>
@@ -33,6 +33,7 @@ export default {
33
33
  dir: { type: String, default: 'v' },
34
34
  align: { type: String, default: 'auto' },
35
35
  anchorRef: { type: String },
36
+ anchorEl: { default: null },
36
37
  anchorDir: { type: String, default: 'middle' },
37
38
  overlayEnabled: { type: Boolean, default: true },
38
39
  overlayShown: { type: Boolean, default: true },
@@ -83,8 +84,12 @@ export default {
83
84
  if (!anchorEl) {
84
85
  return;
85
86
  }
86
- this.pos = this.getAnchorPoint(anchorEl, this.resolvedProps.anchorDir);
87
+ const { anchorDir } = this.resolvedProps;
88
+ this.pos = this.getAnchorPoint(anchorEl, anchorDir === 'auto' ? 'middle' : anchorDir);
87
89
  this.calcDirAlign();
90
+ if (anchorDir === 'auto') {
91
+ this.pos = this.getAnchorPoint(anchorEl, this.actualDir);
92
+ }
88
93
  this.ready = true;
89
94
  this.$nextTick(() => this.$emit('ready'));
90
95
  },
@@ -113,6 +118,9 @@ export default {
113
118
  },
114
119
 
115
120
  getAnchorEl() {
121
+ if (this.resolvedProps.anchorEl) {
122
+ return this.resolvedProps.anchorEl;
123
+ }
116
124
  if (this.resolvedProps.anchorRef) {
117
125
  const ref = this.findRef(this.$parent, this.resolvedProps.anchorRef);
118
126
  if (ref) {
@@ -21,23 +21,30 @@ export default {
21
21
  </script>
22
22
 
23
23
  <style scoped>
24
- .Filler {
25
- --Filler-border: var(--border-base);
24
+ /* The order, stated wherever these styles load first: the styles, then the components */
25
+ @layer nightshade, nightshade-components;
26
26
 
27
- flex: 1;
28
- min-width: 0;
29
- min-height: 0;
30
- }
27
+ @layer nightshade-components {
31
28
 
32
- .Filler-dotted {
33
- border-bottom: 2px dotted var(--Filler-border);
34
- }
29
+ .Filler {
30
+ --Filler-border: var(--border-base);
35
31
 
36
- .Filler-dashed {
37
- border-bottom: 2px dashed var(--Filler-border);
38
- }
32
+ flex: 1;
33
+ min-width: 0;
34
+ min-height: 0;
35
+ }
36
+
37
+ .Filler-dotted {
38
+ border-bottom: 2px dotted var(--Filler-border);
39
+ }
40
+
41
+ .Filler-dashed {
42
+ border-bottom: 2px dashed var(--Filler-border);
43
+ }
44
+
45
+ .Filler-solid {
46
+ border-bottom: 2px solid var(--Filler-border);
47
+ }
39
48
 
40
- .Filler-solid {
41
- border-bottom: 2px solid var(--Filler-border);
42
49
  }
43
50
  </style>
@@ -2,10 +2,10 @@
2
2
  <component
3
3
  :is="resolvedProps.tagName"
4
4
  class="HGroup"
5
+ :style="gapStyle"
5
6
  :class="[
6
7
  `HGroup-align-${resolvedProps.align}`,
7
- `HGroup-justify-${resolvedProps.justify}`,
8
- `HGroup-gap-${resolvedProps.gap}`,
8
+ resolvedProps.justify && `HGroup-justify-${resolvedProps.justify}`,
9
9
  {
10
10
  'HGroup-wrap': resolvedProps.wrap,
11
11
  }
@@ -25,50 +25,56 @@ export default {
25
25
  tagName: { type: String, default: 'div' },
26
26
  align: { type: String, default: 'center' },
27
27
  justify: { type: String },
28
- gap: { type: String, default: '1' },
28
+ gap: { type: [String, Number] },
29
29
  wrap: { type: Boolean, default: false },
30
- }
30
+ },
31
+
32
+ computed: {
33
+
34
+ // `gap` names a step of the spacing scale: `1` is `--sp1`, `0-5` is `--sp0-5`.
35
+ gapStyle() {
36
+ const { gap } = this.resolvedProps;
37
+ if (gap == null) {
38
+ return {};
39
+ }
40
+ return {
41
+ '--HGroup-gap': String(gap) === '0' ? '0px' : `var(--sp${gap})`,
42
+ };
43
+ },
44
+
45
+ },
31
46
 
32
47
  };
33
48
  </script>
34
49
 
35
50
  <style scoped>
36
- .HGroup {
37
- display: flex;
38
- flex-flow: row nowrap;
39
- }
51
+ /* The order, stated wherever these styles load first: the styles, then the components */
52
+ @layer nightshade, nightshade-components;
53
+
54
+ @layer nightshade-components {
40
55
 
41
- .HGroup-align-stretch { align-items: stretch; }
42
- .HGroup-align-baseline { align-items: baseline; }
43
- .HGroup-align-center { align-items: center; }
44
- .HGroup-align-start { align-items: flex-start; }
45
- .HGroup-align-end { align-items: flex-end; }
46
-
47
- .HGroup-justify-center { justify-content: center; }
48
- .HGroup-justify-start { justify-content: flex-start; }
49
- .HGroup-justify-end { justify-content: flex-end; }
50
- .HGroup-justify-space-around { justify-content: space-around; }
51
- .HGroup-justify-space-between { justify-content: space-between; }
52
-
53
- .HGroup-gap-0 { gap: 0 }
54
- .HGroup-gap-0-25 { gap: var(--sp0-25) }
55
- .HGroup-gap-0-5 { gap: var(--sp0-5) }
56
- .HGroup-gap-1 { gap: var(--sp1) }
57
- .HGroup-gap-1-5 { gap: var(--sp1-5) }
58
- .HGroup-gap-2 { gap: var(--sp2) }
59
- .HGroup-gap-2-5 { gap: var(--sp2-5) }
60
- .HGroup-gap-3 { gap: var(--sp3) }
61
- .HGroup-gap-4 { gap: var(--sp4) }
62
- .HGroup-gap-5 { gap: var(--sp5) }
63
- .HGroup-gap-6 { gap: var(--sp6) }
64
- .HGroup-gap-7 { gap: var(--sp7) }
65
- .HGroup-gap-8 { gap: var(--sp8) }
66
- .HGroup-gap-9 { gap: var(--sp9) }
67
- .HGroup-gap-10 { gap: var(--sp10) }
68
- .HGroup-gap-12 { gap: var(--sp12) }
69
- .HGroup-gap-16 { gap: var(--sp16) }
70
- .HGroup-gap-24 { gap: var(--sp24) }
71
- .HGroup-gap-32 { gap: var(--sp32) }
72
-
73
- .HGroup-wrap { flex-wrap: wrap; }
56
+ .HGroup {
57
+ --HGroup-gap: var(--sp1);
58
+
59
+ display: flex;
60
+ gap: var(--HGroup-gap);
61
+ flex-flow: row nowrap;
62
+ }
63
+
64
+ .HGroup-align-stretch { align-items: stretch; }
65
+ .HGroup-align-baseline { align-items: baseline; }
66
+ .HGroup-align-center { align-items: center; }
67
+ .HGroup-align-start { align-items: flex-start; }
68
+ .HGroup-align-end { align-items: flex-end; }
69
+
70
+ .HGroup-justify-center { justify-content: center; }
71
+ .HGroup-justify-start { justify-content: flex-start; }
72
+ .HGroup-justify-end { justify-content: flex-end; }
73
+ .HGroup-justify-space-around { justify-content: space-around; }
74
+ .HGroup-justify-space-between { justify-content: space-between; }
75
+ .HGroup-justify-space-evenly { justify-content: space-evenly; }
76
+
77
+ .HGroup-wrap { flex-wrap: wrap; }
78
+
79
+ }
74
80
  </style>