pull/5756/head
tugcekucukoglu 2024-05-13 13:51:10 +03:00
commit da913642aa
3 changed files with 280 additions and 171 deletions

View File

@ -1,6 +1,14 @@
import BaseStyle from 'primevue/base/style'; import BaseStyle from 'primevue/base/style';
const theme = ({ dt }) => ` const theme = ({ dt }) => `
.p-galleria {
overflow: hidden;
border-style: solid;
border-width: ${dt('galleria.border.width')};
border-color: ${dt('galleria.border.color')};
border-radius: ${dt('galleria.border.radius')};
}
.p-galleria-content { .p-galleria-content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -21,40 +29,48 @@ const theme = ({ dt }) => `
.p-galleria-nav-button { .p-galleria-nav-button {
position: absolute; position: absolute;
top: 50%; top: 50%;
margin-top: -0.5rem;
display: inline-flex; display: inline-flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
overflow: hidden; overflow: hidden;
background: transparent; background: ${dt('galleria.nav.button.background')};
color: ${dt('galleria.nav.button.color')}; color: ${dt('galleria.nav.button.color')};
width: 3rem; width: ${dt('galleria.nav.button.size')};
height: 3rem; height: ${dt('galleria.nav.button.size')};
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, outline-color ${dt('transition.duration')}; transition: background ${dt('transition.duration')}, color ${dt('transition.duration')}, outline-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')};
border-radius: 50%; margin: calc(-1 * calc(${dt('galleria.nav.button.size')}) / 2) ${dt('galleria.nav.button.gutter')} 0 ${dt('galleria.nav.button.gutter')};
margin: 0 0.5rem;
padding: 0; padding: 0;
user-select: none; user-select: none;
border: none; border: 0 none;
cursor: pointer; cursor: pointer;
outline-color: transparent;
} }
.p-galleria-nav-button:not(.p-disabled):hover { .p-galleria-nav-button:not(.p-disabled):hover {
background: ${dt('galleria.nav.button.hover.background')}; background: ${dt('galleria.nav.button.hover.background')};
color: ${dt('galleria.nav.button.hover.color')};
}
.p-galleria-nav-button:not(.p-disabled):focus-visible {
box-shadow: ${dt('galleria.nav.button.focus.ring.shadow')};
outline: ${dt('galleria.nav.button.focus.ring.width')} ${dt('galleria.nav.button.focus.ring.style')} ${dt('galleria.nav.button.focus.ring.color')};
outline-offset: ${dt('galleria.nav.button.focus.ring.offset')};
} }
.p-galleria-next-icon, .p-galleria-next-icon,
.p-galleria-prev-icon { .p-galleria-prev-icon {
font-size: 1.5rem; font-size: ${dt('galleria.nav.icon.size')};
width: 1.5rem; width: ${dt('galleria.nav.icon.size')};
height: 1.5rem; height: ${dt('galleria.nav.icon.size')};
} }
.p-galleria-prev-button { .p-galleria-prev-button {
border-radius: ${dt('galleria.nav.button.prev.border.radius')};
left: 0; left: 0;
} }
.p-galleria-next-button { .p-galleria-next-button {
border-radius: ${dt('galleria.nav.button.next.border.radius')};
right: 0; right: 0;
} }
@ -88,7 +104,7 @@ const theme = ({ dt }) => `
width: 100%; width: 100%;
background: ${dt('galleria.caption.background')}; background: ${dt('galleria.caption.background')};
color: ${dt('galleria.caption.color')}; color: ${dt('galleria.caption.color')};
padding: 1rem; padding: ${dt('galleria.caption.padding')};
} }
.p-galleria-thumbnails { .p-galleria-thumbnails {
@ -106,18 +122,18 @@ const theme = ({ dt }) => `
align-items: center; align-items: center;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
margin: 0.5rem; margin: 0 ${dt('galleria.thumbnail.nav.button.gutter')};
padding: 0; padding: 0;
border: none; border: none;
user-select: none; user-select: none;
cursor: pointer; cursor: pointer;
background: transparent; background: transparent;
color: ${dt('galleria.thumbnail.nav.button.color')}; color: ${dt('galleria.thumbnail.nav.button.color')};
width: 2rem; width: ${dt('galleria.thumbnail.nav.button.size')};
height: 2rem; height: ${dt('galleria.thumbnail.nav.button.size')};
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, outline-color ${dt('transition.duration')}; transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
outline-color: transparent; outline-color: transparent;
border-radius: 50%; border-radius: ${dt('galleria.thumbnail.nav.button.border.radius')};
} }
.p-galleria-thumbnail-nav-button:hover { .p-galleria-thumbnail-nav-button:hover {
@ -126,21 +142,23 @@ const theme = ({ dt }) => `
} }
.p-galleria-thumbnail-nav-button:focus-visible { .p-galleria-thumbnail-nav-button:focus-visible {
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')}; box-shadow: ${dt('galleria.thumbnail.nav.button.focus.ring.shadow')};
outline-offset: ${dt('focus.ring.offset')}; outline: ${dt('galleria.thumbnail.nav.button.focus.ring.width')} ${dt('galleria.thumbnail.nav.button.focus.ring.style')} ${dt('galleria.thumbnail.nav.button.focus.ring.color')};
outline-offset: ${dt('galleria.thumbnail.nav.button.focus.ring.offset')};
} }
.p-galleria-thumbnail-nav-button span { .p-galleria-thumbnail-nav-button .p-galleria-thumbnail-next-icon,
display: flex; .p-galleria-thumbnail-nav-button .p-galleria-thumbnail-prev-icon {
justify-content: center; font-size: ${dt('galleria.thumbnail.nav.button.icon.size')};
align-items: center; width: ${dt('galleria.thumbnail.nav.button.icon.size')};
height: ${dt('galleria.thumbnail.nav.button.icon.size')};
} }
.p-galleria-thumbnails-content { .p-galleria-thumbnails-content {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
background: ${dt('galleria.thumbnails.content.background')}; background: ${dt('galleria.thumbnails.content.background')};
padding: 1rem 0.25rem; padding: ${dt('galleria.thumbnails.content.padding')};
} }
.p-galleria-thumbnails-viewport { .p-galleria-thumbnails-viewport {
@ -165,11 +183,6 @@ const theme = ({ dt }) => `
outline-color: transparent; outline-color: transparent;
} }
.p-galleria-thumbnail:focus-visible {
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')};
outline-offset: ${dt('focus.ring.offset')};
}
.p-galleria-thumbnail-item:hover { .p-galleria-thumbnail-item:hover {
opacity: 1; opacity: 1;
transition: opacity 0.3s; transition: opacity 0.3s;
@ -215,8 +228,8 @@ const theme = ({ dt }) => `
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 1rem; padding: ${dt('galleria.indicator.list.padding')};
gap: 0.5rem; gap: ${dt('galleria.indicator.list.gap')};
margin: 0; margin: 0;
list-style: none; list-style: none;
} }
@ -225,11 +238,11 @@ const theme = ({ dt }) => `
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
background: ${dt('galleria.indicator.button.background')}; background: ${dt('galleria.indicator.button.background')};
width: 1rem; width: ${dt('galleria.indicator.button.width')};
height: 1rem; height: ${dt('galleria.indicator.button.height')};
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, outline-color ${dt('transition.duration')}; transition: background ${dt('transition.duration')}, color ${dt('transition.duration')}, outline-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')};
outline-color: transparent; outline-color: transparent;
border-radius: 50%; border-radius: ${dt('galleria.indicator.button.border.radius')};
margin: 0; margin: 0;
padding: 0; padding: 0;
border: none; border: none;
@ -242,8 +255,9 @@ const theme = ({ dt }) => `
} }
.p-galleria-indicator-button:focus-visible { .p-galleria-indicator-button:focus-visible {
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')}; box-shadow: ${dt('galleria.indicator.button.focus.ring.shadow')};
outline-offset: ${dt('focus.ring.offset')}; outline: ${dt('galleria.indicator.button.focus.ring.width')} ${dt('galleria.indicator.button.focus.ring.style')} ${dt('galleria.indicator.button.focus.ring.color')};
outline-offset: ${dt('galleria.indicator.button.focus.ring.offset')};
} }
.p-galleria-indicator-active .p-galleria-indicator-button { .p-galleria-indicator-active .p-galleria-indicator-button {
@ -338,24 +352,24 @@ const theme = ({ dt }) => `
justify-content: center; justify-content: center;
align-items: center; align-items: center;
overflow: hidden; overflow: hidden;
margin: 0.5rem; margin: ${dt('galleria.close.button.gutter')};
background: transparent; background: ${dt('galleria.close.button.background')};
color: ${dt('galleria.close.button.color')}; color: ${dt('galleria.close.button.color')};
width: 3rem; width: ${dt('galleria.close.button.size')};
height: 3rem; height: ${dt('galleria.close.button.size')};
padding: 0; padding: 0;
border: none; border: none;
user-select: none; user-select: none;
cursor: pointer; cursor: pointer;
border-radius: 50%; border-radius: ${dt('galleria.close.button.border.radius')};
outline-color: transparent; outline-color: transparent;
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, outline-color ${dt('transition.duration')}; transition: background ${dt('transition.duration')}, color ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
} }
.p-galleria-close-icon { .p-galleria-close-icon {
font-size: 1.5rem; font-size: ${dt('galleria.close.button.icon.size')};
width: 1.5rem; width: ${dt('galleria.close.button.icon.size')};
height: 1.5rem; height: ${dt('galleria.close.button.icon.size')};
} }
.p-galleria-close-button:hover { .p-galleria-close-button:hover {
@ -364,14 +378,14 @@ const theme = ({ dt }) => `
} }
.p-galleria-close-button:focus-visible { .p-galleria-close-button:focus-visible {
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')}; box-shadow: ${dt('galleria.close.button.focus.ring.shadow')};
outline-offset: ${dt('focus.ring.offset')}; outline: ${dt('galleria.close.button.focus.ring.width')} ${dt('galleria.close.button.focus.ring.style')} ${dt('galleria.close.button.focus.ring.color')};
outline-offset: ${dt('galleria.close.button.focus.ring.offset')};
} }
.p-galleria-mask .p-galleria-nav-button { .p-galleria-mask .p-galleria-nav-button {
position: fixed; position: fixed;
top: 50%; top: 50%;
margin-top: -0.5rem;
} }
.p-galleria-enter-active { .p-galleria-enter-active {

View File

@ -1,81 +1,126 @@
export default { export default {
root: {
borderWidth: '1px',
borderColor: '{content.border.color}',
borderRadius: '{content.border.radius}'
},
navButton: {
background: 'rgba(255, 255, 255, 0.1)',
hoverBackground: 'rgba(255, 255, 255, 0.2)',
color: '{surface.100}',
hoverColor: '{surface.0}',
size: '3rem',
gutter: '0.5rem',
prev: {
borderRadius: '50%'
},
next: {
borderRadius: '50%'
},
focusRing: {
width: '{focus.ring.width}',
style: '{focus.ring.style}',
color: '{focus.ring.color}',
offset: '{focus.ring.offset}',
shadow: '{focus.ring.shadow}'
}
},
navIcon: {
size: '1.5rem'
},
thumbnailsContent: {
background: '{content.background}',
padding: '1rem 0.25rem'
},
thumbnailNavButton: {
size: '2rem',
borderRadius: '{content.border.radius}',
gutter: '0.5rem',
focusRing: {
width: '{focus.ring.width}',
style: '{focus.ring.style}',
color: '{focus.ring.color}',
offset: '{focus.ring.offset}',
shadow: '{focus.ring.shadow}'
}
},
thumbnailNavButtonIcon: {
size: '1rem'
},
caption: {
background: 'rgba(0, 0, 0, 0.5)',
color: '{surface.100}',
padding: '1rem'
},
indicatorList: {
gap: '0.5rem',
padding: '1rem'
},
indicatorButton: {
width: '1rem',
height: '1rem',
activeBackground: '{primary.color}',
borderRadius: '50%',
focusRing: {
width: '{focus.ring.width}',
style: '{focus.ring.style}',
color: '{focus.ring.color}',
offset: '{focus.ring.offset}',
shadow: '{focus.ring.shadow}'
}
},
insetIndicatorList: {
background: 'rgba(0, 0, 0, 0.5)'
},
insetIndicatorButton: {
background: 'rgba(255, 255, 255, 0.4)',
hoverBackground: 'rgba(255, 255, 255, 0.6)',
activeBackground: 'rgba(255, 255, 255, 0.9)'
},
mask: {
background: '{mask.background}',
color: '{mask.color}'
},
closeButton: {
size: '3rem',
gutter: '0.5rem',
background: 'rgba(255, 255, 255, 0.1)',
hoverBackground: 'rgba(255, 255, 255, 0.2)',
color: '{surface.50}',
hoverColor: '{surface.0}',
borderRadius: '50%',
focusRing: {
width: '{focus.ring.width}',
style: '{focus.ring.style}',
color: '{focus.ring.color}',
offset: '{focus.ring.offset}',
shadow: '{focus.ring.shadow}'
}
},
closeButtonIcon: {
size: '1.5rem'
},
colorScheme: { colorScheme: {
light: { light: {
navButton: {
hoverBackground: 'rgba(255, 255, 255, 0.1)',
color: '{surface.100}'
},
thumbnailNavButton: { thumbnailNavButton: {
hoverBackground: '{surface.200}', hoverBackground: '{surface.100}',
color: '{surface.600}', color: '{surface.600}',
hoverColor: '{surface.700}' hoverColor: '{surface.700}'
}, },
thumbnailsContent: {
background: '{surface.50}'
},
caption: {
background: 'rgba(0, 0, 0, 0.5)',
color: '{surface.100}'
},
indicatorButton: { indicatorButton: {
background: '{surface.200}', background: '{surface.200}',
hoverBackground: '{surface.300}', hoverBackground: '{surface.300}'
activeBackground: '{primary.color}'
},
insetIndicatorList: {
background: 'rgba(0, 0, 0, 0.5)'
},
insetIndicatorButton: {
background: 'rgba(255, 255, 255, 0.4)',
hoverBackground: 'rgba(255, 255, 255, 0.6)',
activeBackground: 'rgba(255, 255, 255, 0.9)'
},
mask: {
background: 'rgba(0,0,0,0.9)'
},
closeButton: {
hoverBackground: 'rgba(255,255,255,0.1)',
color: '{surface.50}',
hoverColor: '{surface.0}'
} }
}, },
dark: { dark: {
navButton: {
hoverBackground: 'rgba(255, 255, 255, 0.1)',
color: '{surface.400}'
},
thumbnailNavButton: { thumbnailNavButton: {
hoverBackground: '{surface.800}', hoverBackground: '{surface.700}',
color: '{surface.400}', color: '{surface.400}',
hoverColor: '{surface.300}' hoverColor: '{surface.0}'
},
thumbnailsContent: {
background: '{surface.950}'
},
caption: {
background: 'rgba(0, 0, 0, 0.5)',
color: '{surface.100}'
}, },
indicatorButton: { indicatorButton: {
background: '{surface.200}', background: '{surface.700}',
hoverBackground: '{surface.300}', hoverBackground: '{surface.600}'
activeBackground: '{primary.color}'
},
insetIndicatorList: {
background: 'rgba(0, 0, 0, 0.5)'
},
insetIndicatorButton: {
background: 'rgba(255, 255, 255, 0.4)',
hoverBackground: 'rgba(255, 255, 255, 0.6)',
activeBackground: 'rgba(255, 255, 255, 0.9)'
},
mask: {
background: 'rgba(0,0,0,0.9)'
},
closeButton: {
hoverBackground: 'rgba(255,255,255,0.1)',
color: '{surface.50}',
hoverColor: '{surface.0}'
} }
} }
} }

View File

@ -1,81 +1,131 @@
export default { export default {
root: {
borderWidth: '1px',
borderColor: '{content.border.color}',
borderRadius: '{content.border.radius}'
},
navButton: {
background: 'rgba(255, 255, 255, 0.1)',
hoverBackground: 'rgba(255, 255, 255, 0.2)',
color: '{surface.100}',
hoverColor: '{surface.0}',
size: '3rem',
gutter: '0',
prev: {
borderRadius: '0 12px 12px 0'
},
next: {
borderRadius: '12px 0 0 12px'
},
focusRing: {
width: '{focus.ring.width}',
style: '{focus.ring.style}',
color: '{focus.ring.color}',
offset: '{focus.ring.offset}',
shadow: '{focus.ring.shadow}'
}
},
navIcon: {
size: '1.5rem'
},
thumbnailsContent: {
padding: '1rem 0.25rem'
},
thumbnailNavButton: {
size: '2rem',
borderRadius: '{content.border.radius}',
gutter: '0.5rem',
focusRing: {
width: '{focus.ring.width}',
style: '{focus.ring.style}',
color: '{focus.ring.color}',
offset: '{focus.ring.offset}',
shadow: '{focus.ring.shadow}'
}
},
thumbnailNavButtonIcon: {
size: '1rem'
},
caption: {
background: 'rgba(0, 0, 0, 0.5)',
color: '{surface.100}',
padding: '1rem'
},
indicatorList: {
gap: '0.5rem',
padding: '1rem'
},
indicatorButton: {
width: '1rem',
height: '1rem',
activeBackground: '{primary.color}',
borderRadius: '50%',
focusRing: {
width: '{focus.ring.width}',
style: '{focus.ring.style}',
color: '{focus.ring.color}',
offset: '{focus.ring.offset}',
shadow: '{focus.ring.shadow}'
}
},
insetIndicatorList: {
background: 'rgba(0, 0, 0, 0.5)'
},
insetIndicatorButton: {
background: 'rgba(255, 255, 255, 0.4)',
hoverBackground: 'rgba(255, 255, 255, 0.6)',
activeBackground: 'rgba(255, 255, 255, 0.9)'
},
mask: {
background: '{mask.background}',
color: '{mask.color}'
},
closeButton: {
size: '3rem',
gutter: '0.5rem',
background: 'rgba(255, 255, 255, 0.1)',
hoverBackground: 'rgba(255, 255, 255, 0.2)',
color: '{surface.50}',
hoverColor: '{surface.0}',
borderRadius: '50%',
focusRing: {
width: '{focus.ring.width}',
style: '{focus.ring.style}',
color: '{focus.ring.color}',
offset: '{focus.ring.offset}',
shadow: '{focus.ring.shadow}'
}
},
closeButtonIcon: {
size: '1.5rem'
},
colorScheme: { colorScheme: {
light: { light: {
navButton: {
hoverBackground: 'rgba(255, 255, 255, 0.1)',
color: '{surface.100}'
},
thumbnailNavButton: {
hoverBackground: '{surface.200}',
color: '{surface.600}',
hoverColor: '{surface.700}'
},
thumbnailsContent: { thumbnailsContent: {
background: '{surface.50}' background: '{surface.50}'
}, },
caption: { thumbnailNavButton: {
background: 'rgba(0, 0, 0, 0.5)', hoverBackground: '{surface.100}',
color: '{surface.100}' color: '{surface.600}',
hoverColor: '{surface.700}'
}, },
indicatorButton: { indicatorButton: {
background: '{surface.200}', background: '{surface.200}',
hoverBackground: '{surface.300}', hoverBackground: '{surface.300}'
activeBackground: '{primary.color}'
},
insetIndicatorList: {
background: 'rgba(0, 0, 0, 0.5)'
},
insetIndicatorButton: {
background: 'rgba(255, 255, 255, 0.4)',
hoverBackground: 'rgba(255, 255, 255, 0.6)',
activeBackground: 'rgba(255, 255, 255, 0.9)'
},
mask: {
background: 'rgba(0,0,0,0.9)'
},
closeButton: {
hoverBackground: 'rgba(255,255,255,0.1)',
color: '{surface.50}',
hoverColor: '{surface.0}'
} }
}, },
dark: { dark: {
navButton: { thumbnailsContent: {
hoverBackground: 'rgba(255, 255, 255, 0.1)', background: '{surface.800}'
color: '{surface.400}'
}, },
thumbnailNavButton: { thumbnailNavButton: {
hoverBackground: '{surface.800}', hoverBackground: '{surface.700}',
color: '{surface.400}', color: '{surface.400}',
hoverColor: '{surface.300}' hoverColor: '{surface.0}'
},
thumbnailsContent: {
background: '{surface.950}'
},
caption: {
background: 'rgba(0, 0, 0, 0.5)',
color: '{surface.100}'
}, },
indicatorButton: { indicatorButton: {
background: '{surface.200}', background: '{surface.700}',
hoverBackground: '{surface.300}', hoverBackground: '{surface.600}'
activeBackground: '{primary.color}'
},
insetIndicatorList: {
background: 'rgba(0, 0, 0, 0.5)'
},
insetIndicatorButton: {
background: 'rgba(255, 255, 255, 0.4)',
hoverBackground: 'rgba(255, 255, 255, 0.6)',
activeBackground: 'rgba(255, 255, 255, 0.9)'
},
mask: {
background: 'rgba(0,0,0,0.9)'
},
closeButton: {
hoverBackground: 'rgba(255,255,255,0.1)',
color: '{surface.50}',
hoverColor: '{surface.0}'
} }
} }
} }