Skip to content

Commit e56c594

Browse files
authored
Merge pull request #300 from MerginMaps/mm-theme-improvements
Mm theme improvements
2 parents 30889a6 + 3e675f1 commit e56c594

File tree

9 files changed

+71
-68
lines changed

9 files changed

+71
-68
lines changed

web-app/packages/lib/src/assets/sass/themes/mm-theme-light/_extensions.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ h6 {
1212
overflow-wrap: break-word;
1313
min-width: 0;
1414
}
15-
body, p {
15+
body, p, dd, dl {
1616
margin: 0
1717
}
1818
p, span, dl {
1919
overflow-wrap: break-word;
2020
}
21+
dd {
22+
overflow-wrap: anywhere;
23+
}
2124
a {
2225
text-decoration: inherit;
2326
color: inherit;
@@ -27,6 +30,10 @@ input, textarea {
2730
min-width: 0;
2831
}
2932

33+
img {
34+
max-width: 100%;
35+
}
36+
3037
/** Primevue overrides */
3138

3239
// Customization of infinite border of tabs using classes instead pt because, we want to have access to variables

web-app/packages/lib/src/assets/sass/themes/mm-theme-light/variables/_panel.scss

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ $panelContentTextColor: $textColor;
6060

6161
/// Padding for the content section of a panel
6262
/// @group panel
63-
$panelContentPadding: 1rem;
63+
$panelContentPadding: .5rem;
6464

6565
/// Border for the footer section of a panel
6666
/// @group panel
@@ -84,11 +84,11 @@ $accordionSpacing: 0;
8484

8585
/// Border of an accordion panel header
8686
/// @group panel
87-
$accordionHeaderBorder: $panelHeaderBorder;
87+
$accordionHeaderBorder: 1px solid #dee2e6;
8888

8989
/// Background of an accordion panel header
9090
/// @group panel
91-
$accordionHeaderBg: $panelHeaderBg;
91+
$accordionHeaderBg: var(--surface-section);
9292

9393
/// Text color of an accordion panel header
9494
/// @group panel
@@ -100,11 +100,11 @@ $accordionHeaderFontWeight: $panelHeaderFontWeight;
100100

101101
/// Padding of an accordion panel header
102102
/// @group panel
103-
$accordionHeaderPadding: $panelHeaderPadding;
103+
$accordionHeaderPadding: 1rem .5rem;
104104

105105
/// Background of an accordion panel header in hover state
106106
/// @group panel
107-
$accordionHeaderHoverBg: #e9ecef;
107+
$accordionHeaderHoverBg: var(--light-green-500);
108108

109109
/// Border of an accordion panel header in hover state
110110
/// @group panel
@@ -116,7 +116,7 @@ $accordionHeaderTextHoverColor: $textColor;
116116

117117
/// Background of an accordion panel header in expanded state
118118
/// @group panel
119-
$accordionHeaderActiveBg: $panelHeaderBg;
119+
$accordionHeaderActiveBg: var(--surface-section);
120120

121121
/// Border of an accordion panel header in expanded state
122122
/// @group panel
@@ -128,7 +128,7 @@ $accordionHeaderTextActiveColor: $textColor;
128128

129129
/// Hover background of an accordion panel header in expanded state
130130
/// @group panel
131-
$accordionHeaderActiveHoverBg: #e9ecef;
131+
$accordionHeaderActiveHoverBg: var(--light-green-500);
132132

133133
/// Hover border of an accordion panel header in expanded state
134134
/// @group panel
@@ -140,7 +140,7 @@ $accordionHeaderTextActiveHoverColor: $textColor;
140140

141141
/// Border for a content section of an accordion panel
142142
/// @group panel
143-
$accordionContentBorder: $panelContentBorder;
143+
$accordionContentBorder: none;
144144

145145
/// Background for a content section of an accordion panel
146146
/// @group panel
@@ -152,7 +152,7 @@ $accordionContentTextColor: $panelContentTextColor;
152152

153153
/// Padding for a content section of an accordion panel
154154
/// @group panel
155-
$accordionContentPadding: $panelContentPadding;
155+
$accordionContentPadding: .5rem;
156156

157157
/// Border for a parent element containing all the headers of a tabview
158158
/// @group panel
@@ -324,4 +324,4 @@ $splitterGutterBg:#f8f9fa;
324324

325325
/// Background of the splitter gutter handle
326326
/// @group panel
327-
$splitterGutterHandleBg:#dee2e6;
327+
$splitterGutterHandleBg:#dee2e6;

web-app/packages/lib/src/common/components/AppPanelToggleable.vue

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
55
-->
66

77
<template>
8-
<PPanel
9-
v-bind="$props"
10-
toggleable
11-
:collapsed="collapsed"
12-
:pt="{
13-
header(options) {
14-
return {
15-
class: [
16-
'surface-section border-none p-4 cursor-pointer',
17-
// Toggle border radius by open / closed panel
18-
options.state.d_collapsed
19-
? 'border-round-2xl'
20-
: 'border-round-top-2xl'
21-
],
22-
onclick: headerClick
23-
}
24-
},
25-
content: {
26-
class: 'border-none border-round-bottom-2xl p-4 pt-0'
27-
}
28-
}"
29-
>
8+
<PPanel v-bind="$props" toggleable :collapsed="collapsed" :pt="pt">
309
<template v-if="$slots.header" #header>
3110
<slot name="header"></slot>
3211
</template>
@@ -56,11 +35,26 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
5635

5736
<script lang="ts" setup>
5837
import { PanelProps } from 'primevue/panel'
59-
import { ref } from 'vue'
38+
import { ref, computed } from 'vue'
6039
6140
const props = defineProps<PanelProps>()
6241
const collapsed = ref(props.collapsed)
6342
43+
const pt = computed(() => ({
44+
header: {
45+
class: [
46+
'surface-section border-none cursor-pointer',
47+
// Toggle border radius by open / closed panel
48+
collapsed.value ? 'border-round-2xl' : 'border-round-top-2xl',
49+
props.pt?.header?.class ?? 'p-4'
50+
],
51+
onclick: headerClick
52+
},
53+
content: {
54+
class: 'border-none border-round-bottom-2xl p-4 pt-0'
55+
}
56+
}))
57+
6458
function headerClick() {
6559
collapsed.value = !collapsed.value
6660
}

web-app/packages/lib/src/mm-theme.ts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { AccordionPassThroughOptions } from 'primevue/accordion'
12
import { AutoCompletePassThroughOptions } from 'primevue/autocomplete'
23
import { ButtonPassThroughOptions } from 'primevue/button'
34
import { DataViewPassThroughOptions } from 'primevue/dataview'
@@ -115,6 +116,14 @@ export default usePassThrough(
115116
root: 'justify-content-start font-semibold'
116117
} as InlineMessagePassThroughOptions,
117118
dialog: {
119+
root(options) {
120+
const isBottom = ['bottom', 'bottomright', 'bottomleft'].some(
121+
(item) => item === options?.props?.position
122+
)
123+
return {
124+
style: { marginBottom: isBottom ? 0 : null }
125+
}
126+
},
118127
header: {
119128
class: 'border-none border-round-top-2xl',
120129
style: {
@@ -126,8 +135,11 @@ export default usePassThrough(
126135
},
127136
closeButton:
128137
'text-2xl hover:surface-ground text-color-forest hover:text-color',
129-
content: {
130-
class: 'border-round-bottom-2xl'
138+
content(options) {
139+
const isBottom = ['bottom', 'bottomright', 'bottomleft'].some(
140+
(item) => item === options?.props?.position
141+
)
142+
return isBottom ? '' : 'border-round-bottom-2xl'
131143
},
132144
mask: {
133145
style: { zIndex: 7 }
@@ -139,7 +151,14 @@ export default usePassThrough(
139151
tag: {
140152
root: 'title-t5',
141153
value: 'title-t5'
142-
} as TagPassThroughOptions
154+
} as TagPassThroughOptions,
155+
accordion: {
156+
accordiontab: {
157+
headerAction: {
158+
class: 'border-noround border-x-none'
159+
}
160+
}
161+
} as AccordionPassThroughOptions
143162
},
144163
{}
145164
)

web-app/packages/lib/src/modules/project/components/CloneDialogTemplate.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
55
-->
66

77
<template>
8-
<div class="flex flex-column py-4 gap-4">
8+
<div class="flex flex-column gap-4 pb-4">
99
<span class="flex p-float-label w-ful p-input-filled">
1010
<PInputText
1111
autofocus

web-app/packages/lib/src/modules/project/components/FileDetailSidebar.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
6161
v-if="mimetype && file.size < 104857600"
6262
class="flex flex-column align-items-center w-full py-4"
6363
>
64-
<PImage
65-
:src="downloadUrl"
66-
v-if="mimetype.match('image')"
67-
preview
68-
imageClass="w-full"
69-
/>
64+
<PImage :src="downloadUrl" v-if="mimetype.match('image')" preview />
7065
<div
7166
class="file-detail-code border-round-xl p-4 paragraph-p4 w-full"
7267
v-else-if="mimetype.match('text')"

web-app/packages/lib/src/modules/project/components/UploadPanel.vue

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
88
<PDialog
99
v-model:visible="visible"
1010
:position="isUnderOverlayBreakpoint ? 'topleft' : 'bottomright'"
11-
class="upload-panel w-8 lg:w-3 mr-4 mb-4"
11+
class="upload-panel w-8 lg:w-3"
12+
:draggable="false"
1213
>
1314
<template #header>
1415
<p class="font-semibold">
@@ -30,16 +31,13 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
3031
<span class="paragraph-p5 opacity-80 capitalize">{{ key }}</span>
3132
<app-circle class="ml-auto">{{ upload.diff[key].length }}</app-circle>
3233
</div>
33-
<div class="py-4 w-full">
34-
<PButton
35-
id="update-files-btn"
36-
@click="confirmUpload"
37-
:disabled="upload.running || remainingAnalyzingFiles > 0"
38-
class="flex justify-content-center w-full text-center"
39-
>
40-
Update Changes
41-
</PButton>
42-
</div>
34+
<PButton
35+
id="update-files-btn"
36+
@click="confirmUpload"
37+
:disabled="upload.running || remainingAnalyzingFiles > 0"
38+
class="mt-2 w-full my-4"
39+
label="Update Changes"
40+
/>
4341
</div>
4442
</PDialog>
4543
</template>

web-app/packages/lib/src/modules/project/components/VersionDetailSidebar.vue

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,6 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
6060
collapse-icon="ti ti-chevron-right"
6161
expand-icon="ti ti-chevron-down"
6262
:active-index="activeAccordionItems"
63-
:pt="{
64-
accordiontab: {
65-
headerAction: {
66-
class: 'surface-section border-x-none border-noround p-2'
67-
},
68-
content: {
69-
class: 'border-none'
70-
}
71-
}
72-
}"
7363
>
7464
<PAccordionTab
7565
v-for="item in changeTabs"
@@ -88,9 +78,9 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
8878
<div
8979
v-for="change in changes[item.key]"
9080
:key="change.path"
91-
class="py-2 paragraph-p6"
81+
class="paragraph-p6"
9282
>
93-
<div class="flex align-items-center justify-content-between mb-2">
83+
<div class="flex align-items-center justify-content-between mb-1">
9484
<span class="w-10 font-semibold">{{ change.path }}</span>
9585
<span class="flex-shrink-0">{{
9686
$filters.filesize(

web-app/packages/lib/src/modules/project/views/ProjectViewTemplate.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
110110
</app-section>
111111
</app-container>
112112
<div slot="right">
113-
<upload-panel v-if="upload" :namespace="namespace" class="my-1 mr-1" />
113+
<upload-panel v-if="upload" :namespace="namespace" />
114114
</div>
115115
</div>
116116
</template>

0 commit comments

Comments
 (0)