Skip to content

Commit

Permalink
Toniq Carousel Offset Arrows (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
ponnexcodev authored May 3, 2024
1 parent 344e627 commit 6a5d890
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 11 deletions.
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toniq-labs/design-system-root",
"version": "16.9.2",
"version": "16.9.3",
"private": true,
"description": "Root design system mono-repo package.",
"homepage": "https://github.com/Toniq-Labs/toniq-labs-design-system",
Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toniq-labs/design-system",
"version": "16.9.2",
"version": "16.9.3",
"private": false,
"description": "Design system elements for Toniq Labs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,55 @@ export const toniqCarouselBookPage = defineBookPage({
`;
},
});

defineExample({
title: 'offset arrows',
styles: exampleStyles,
renderCallback() {
const wrapperDivStyles = css`
/* make sure this width matches the ToniqCarousel width */
width: 800px;
max-width: 100%;
display: flex;
justify-content: center;
align-items: center;
padding: 100px 0;
box-sizing: border-box;
border: 1px solid ${toniqColors.pageInteraction.foregroundColor};
border-radius: 12px;
`;

return html`
<${ToniqCarousel.assign({
enableAutomaticCycling: false,
offsetArrows: true,
cycleIntervalMs: 1000,
templates: allIconsByCategory['core-24'].map((icon) => {
const styles = css`
padding: 24px;
border: 1px solid ${toniqColors.pageInteraction.foregroundColor};
border-radius: 12px;
`;
return html`
<${ToniqIcon.assign({icon})} style=${styles}></${ToniqIcon}>
`;
}),
})}></${ToniqCarousel}>
<${ToniqCarousel.assign({
enableAutomaticCycling: false,
offsetArrows: true,
variant: ToniqCarouselVariantEnum.Banner,
templates: allIconsByCategory['core-24'].map((icon) => {
return html`
<div style=${wrapperDivStyles}>
<${ToniqIcon.assign({icon})}></${ToniqIcon}>
</div>
`;
}),
})}></${ToniqCarousel}>
`;
},
});
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ export const ToniqCarousel = defineToniqElement<{
/** Number of milliseconds between each automatic cycling. Defaults to 4000. */
cycleIntervalMs?: number;
variant?: ToniqCarouselVariantEnum | undefined;
offsetArrows?: boolean | undefined;
}>()({
tagName: 'toniq-carousel',
hostClasses: {
'toniq-carousel-banner-variant': ({inputs}) =>
inputs.variant === ToniqCarouselVariantEnum.Banner,
'toniq-carousel-offset-arrows': ({inputs}) => !!inputs.offsetArrows,
},
stateInitStatic: {
currentScrollPosition: {
Expand Down Expand Up @@ -106,6 +108,15 @@ export const ToniqCarousel = defineToniqElement<{
background: none;
}
${hostClasses['toniq-carousel-offset-arrows'].selector} {
overflow-y: unset;
overflow: visible;
}
${hostClasses['toniq-carousel-offset-arrows'].selector} .arrow ${ToniqIcon} {
margin: 0 -20px;
}
.arrow.right {
justify-content: flex-end;
--background-degrees: -90deg;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ export const ToniqListTable = defineToniqElement<ListTableInputs>()({
}
.table-list {
min-height: 40px;
width: 100%;
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -224,7 +223,7 @@ export const ToniqListTable = defineToniqElement<ListTableInputs>()({
}
.loading-wrapper {
min-height: 300px;
min-height: 40px;
transition: ${toniqDurations.pretty};
opacity: 1;
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion packages/native-elements-test/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toniq-labs/design-system-native-elements-test",
"version": "16.9.2",
"version": "16.9.3",
"private": true,
"scripts": {
"compile": "virmator compile",
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toniq-labs/design-system-scripts",
"version": "16.9.2",
"version": "16.9.3",
"private": true,
"scripts": {
"compile": "virmator compile",
Expand Down

0 comments on commit 6a5d890

Please sign in to comment.