Skip to content

Commit e77583f

Browse files
committed
fix: improve outline actions with kebab menu and popover
1 parent ef31c57 commit e77583f

File tree

7 files changed

+76
-51
lines changed

7 files changed

+76
-51
lines changed

packages/nimiq-icons/src/flags/icons.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@
12681268
"body": "<mask id=\"nimiq-flags-zw-hexagon-pbk987\" width=\"32\" height=\"28\" x=\"0\" y=\"2\" maskUnits=\"userSpaceOnUse\" style=\"mask-type:alpha\"><path fill=\"#fff\" d=\"M31.15 14.71 24.707 3.54a2.58 2.58 0 00-2.234-1.29H9.582c-.92 0-1.77.49-2.23 1.29L.907 14.71c-.46.8-.46 1.78 0 2.58l6.445 11.17c.46.8 1.31 1.29 2.23 1.29h12.89c.92 0 1.77-.49 2.23-1.29l6.445-11.17c.464-.8.464-1.78.004-2.58\"/></mask><g fill=\"none\"><g mask=\"url(#nimiq-flags-zw-hexagon-pbk987)\"><path fill=\"#6DA544\" d=\"M1.962 0H32v32H1.962z\"/><path fill=\"#FFDA44\" d=\"M3.613 4.581H32v4.582l-4.069 6.875 4.07 6.875v4.58H3.612z\"/><path fill=\"#D80027\" d=\"M8.25 9.162H32v4.582l-1.687 2.25L32 18.325v4.581H8.25z\"/><path fill=\"#EEE\" d=\"M0 0v32l17.488-16z\"/><path fill=\"#D80027\" d=\"m6.437 11.825 1.032 3.188h3.35l-2.713 1.975 1.038 3.187-2.713-1.969-2.712 1.969 1.037-3.187-2.712-1.976h3.35z\"/><path fill=\"#FFDA44\" d=\"m9.281 16.263-2.7-.957-.212-1.937a1.044 1.044 0 10-2.032.475l-.75.756h1.344c0 1.4-1.044 1.4-1.044 2.794l.575 1.387h3.482l.58-1.387q.086-.198.107-.413c.5-.2.65-.719.65-.719\"/><path fill=\"#333\" d=\"m1.963 0 13.75 13.75H32v4.575H15.638L1.962 32H0l16-16L0 0z\"/><path fill=\"url(#nimiq-flags-zw-hexagon-pbk987)\" d=\"M31.15 14.71 24.707 3.54a2.58 2.58 0 00-2.234-1.29H9.582c-.92 0-1.77.49-2.23 1.29L.907 14.71c-.46.8-.46 1.78 0 2.58l6.445 11.17c.46.8 1.31 1.29 2.23 1.29h12.89c.92 0 1.77-.49 2.23-1.29l6.445-11.17c.464-.8.464-1.78.004-2.58\"/></g><defs><radialGradient id=\"nimiq-flags-zw-hexagon-pbk987\" cx=\"0\" cy=\"0\" r=\"1\" gradientTransform=\"matrix(30.943 0 0 30.9452 23.829 29.395)\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#1D1D1B\" stop-opacity=\".3\"/><stop offset=\"1\" stop-color=\"#E9B213\" stop-opacity=\"0\"/></radialGradient></defs></g>"
12691269
}
12701270
},
1271-
"lastModified": 1759217871,
1271+
"lastModified": 1759218657,
12721272
"width": 32,
12731273
"height": 32
12741274
}

packages/nimiq-icons/src/flags/info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"prefix": "nimiq-flags",
33
"name": "nimiq-flags",
44
"total": 422,
5-
"version": "1.0.0-beta.100",
5+
"version": "1.0.0-beta.102",
66
"author": {
77
"name": "onmax",
88
"url": "https://github.com/onmax"

packages/nimiq-icons/src/flags/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nimiq-flags",
33
"description": "The Nimiq Flags as an iconify icon set.",
44
"version": "1.0.0-beta.102",
5-
"iconSetVersion": "1.0.0-beta.100",
5+
"iconSetVersion": "1.0.0-beta.102",
66
"main": "index.js",
77
"module": "index.mjs",
88
"types": "index.d.ts",

packages/nimiq-icons/src/icons/icons.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,7 @@
15861586
"hidden": true
15871587
}
15881588
},
1589-
"lastModified": 1759217871,
1589+
"lastModified": 1759218657,
15901590
"width": 12,
15911591
"height": 12
15921592
}

packages/nimiq-icons/src/icons/info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"prefix": "nimiq",
33
"name": "nimiq-icons",
44
"total": 84,
5-
"version": "1.0.0-beta.100",
5+
"version": "1.0.0-beta.102",
66
"author": {
77
"name": "onmax",
88
"url": "https://github.com/onmax"

packages/nimiq-icons/src/icons/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nimiq-icons",
33
"description": "The Nimiq Icons as an iconify icon set.",
44
"version": "1.0.0-beta.102",
5-
"iconSetVersion": "1.0.0-beta.100",
5+
"iconSetVersion": "1.0.0-beta.102",
66
"main": "index.js",
77
"module": "index.mjs",
88
"types": "index.d.ts",

packages/nimiq-vitepress-theme/src/layout/OutlineActions.vue

Lines changed: 70 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const {
1010
copyMarkdownLink,
1111
chatGPTUrl,
1212
claudeUrl,
13-
viewAsMarkdown,
1413
copyOptionsConfig,
1514
showCopyMarkdown,
1615
} = useSourceCode()
@@ -50,7 +49,13 @@ const dropdownOptions = computed(() => {
5049
options.push({
5150
icon: 'i-tabler:eye',
5251
label: 'View as markdown',
53-
onClick: viewAsMarkdown,
52+
onClick: () => {
53+
if (typeof window !== 'undefined') {
54+
const currentPath = window.location.pathname
55+
const markdownPath = currentPath.replace(/\.html$/, '.md').replace(/\/$/, '/index.md')
56+
window.open(markdownPath, '_blank', 'noopener,noreferrer')
57+
}
58+
},
5459
})
5560
}
5661
@@ -68,7 +73,7 @@ const dropdownOptions = computed(() => {
6873
6974
if (copyOptionsConfig.value.claude) {
7075
options.push({
71-
icon: 'i-tabler:sparkles',
76+
icon: 'i-tabler:brand-openai',
7277
label: 'Open in Claude',
7378
onClick: () => {
7479
if (typeof window !== 'undefined') {
@@ -97,58 +102,78 @@ function toggleExpanded() {
97102
v-for="(action, index) in allActions"
98103
:key="index"
99104
flex="~ items-center justify-between"
100-
p-4
101-
cursor-pointer
102-
hover:bg-neutral-100
103-
rounded-6
104-
transition-colors
105-
@click="action.onClick"
105+
relative
106106
>
107-
<div flex="~ items-center gap-8" f-text-xs text-neutral-800>
108-
<div :class="action.icon" />
109-
<span>{{ action.label }}</span>
110-
</div>
111-
112-
<button
113-
v-if="index === 0 && hasDropdown"
114-
type="button"
107+
<div
108+
flex="~ items-center gap-8"
109+
flex-1
115110
p-4
116-
hover:bg-neutral-200
117-
rounded-4
111+
cursor-pointer
112+
hover:bg-neutral-100
113+
rounded-6
118114
transition-colors
119-
@click.stop="toggleExpanded"
115+
f-text-xs
116+
text-neutral-800
117+
@click="action.onClick"
120118
>
121-
<div :class="isExpanded ? 'i-tabler:chevron-up' : 'i-tabler:chevron-down'" />
122-
</button>
123-
</div>
119+
<div :class="action.icon" />
120+
<span>{{ action.label }}</span>
121+
</div>
124122

125-
<Transition
126-
enter-active-class="transition-all duration-200"
127-
enter-from-class="opacity-0 -translate-y-8"
128-
enter-to-class="opacity-100 translate-y-0"
129-
leave-active-class="transition-all duration-200"
130-
leave-from-class="opacity-100 translate-y-0"
131-
leave-to-class="opacity-0 -translate-y-8"
132-
>
133-
<div v-if="isExpanded && hasDropdown" flex="~ col gap-4" pl-16>
134-
<div
135-
v-for="(option, idx) in dropdownOptions"
136-
:key="idx"
137-
flex="~ items-center gap-8"
138-
p-4
139-
cursor-pointer
123+
<div v-if="index === 0 && hasDropdown" relative>
124+
<button
125+
type="button"
126+
p-6
140127
hover:bg-neutral-100
141128
rounded-6
142129
transition-colors
143-
f-text-xs
144-
text-neutral-700
145-
@click="option.onClick"
130+
@click.stop="toggleExpanded"
146131
>
147-
<div :class="option.icon" />
148-
<span>{{ option.label }}</span>
149-
</div>
132+
<div i-tabler:dots />
133+
</button>
134+
135+
<Transition
136+
enter-active-class="transition-all duration-200"
137+
enter-from-class="opacity-0 scale-95"
138+
enter-to-class="opacity-100 scale-100"
139+
leave-active-class="transition-all duration-150"
140+
leave-from-class="opacity-100 scale-100"
141+
leave-to-class="opacity-0 scale-95"
142+
>
143+
<div
144+
v-if="isExpanded"
145+
absolute
146+
right-0
147+
top="[calc(100%+4px)]"
148+
min-w-200
149+
bg-white
150+
rounded-8
151+
shadow-lg
152+
border="1 neutral-200"
153+
z-50
154+
py-4
155+
@click="isExpanded = false"
156+
>
157+
<div
158+
v-for="(option, idx) in dropdownOptions"
159+
:key="idx"
160+
flex="~ items-center gap-8"
161+
px-12
162+
py-8
163+
cursor-pointer
164+
hover:bg-neutral-100
165+
transition-colors
166+
f-text-xs
167+
text-neutral-700
168+
@click="option.onClick"
169+
>
170+
<div :class="option.icon" />
171+
<span>{{ option.label }}</span>
172+
</div>
173+
</div>
174+
</Transition>
150175
</div>
151-
</Transition>
176+
</div>
152177
</div>
153178
</div>
154179
</template>

0 commit comments

Comments
 (0)