Skip to content

Commit

Permalink
feat(actions): m3 styles, rename bold -> strong button
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Oct 5, 2022
1 parent e80fbb2 commit d6a4718
Show file tree
Hide file tree
Showing 21 changed files with 140 additions and 94 deletions.
4 changes: 2 additions & 2 deletions kitchen-sink/core/pages/action-sheet.html
Expand Up @@ -60,7 +60,7 @@
},
{
text: 'Button 1',
bold: true
strong: true
},
{
text: 'Button 2',
Expand All @@ -81,7 +81,7 @@
},
{
text: 'Button 1',
bold: true
strong: true
},
{
text: 'Button 2',
Expand Down
2 changes: 1 addition & 1 deletion kitchen-sink/core/pages/swipeout.html
Expand Up @@ -367,7 +367,7 @@
[
{
text: 'Cancel',
bold: true,
strong: true,
}
]
],
Expand Down
6 changes: 3 additions & 3 deletions kitchen-sink/react/src/pages/action-sheet.jsx
Expand Up @@ -36,7 +36,7 @@ export default () => {
},
{
text: 'Button 1',
bold: true,
strong: true,
},
{
text: 'Button 2',
Expand Down Expand Up @@ -99,7 +99,7 @@ export default () => {
>
<ActionsGroup>
<ActionsLabel>Do something</ActionsLabel>
<ActionsButton bold>Button 1</ActionsButton>
<ActionsButton strong>Button 1</ActionsButton>
<ActionsButton>Button 2</ActionsButton>
<ActionsButton color="red">Cancel</ActionsButton>
</ActionsGroup>
Expand All @@ -109,7 +109,7 @@ export default () => {
<Actions id="actions-two-groups">
<ActionsGroup>
<ActionsLabel>Do something</ActionsLabel>
<ActionsButton bold>Button 1</ActionsButton>
<ActionsButton strong>Button 1</ActionsButton>
<ActionsButton>Button 2</ActionsButton>
</ActionsGroup>
<ActionsGroup>
Expand Down
2 changes: 1 addition & 1 deletion kitchen-sink/react/src/pages/swipeout.jsx
Expand Up @@ -50,7 +50,7 @@ export default () => {
[
{
text: 'Cancel',
bold: true,
strong: true,
},
],
],
Expand Down
30 changes: 19 additions & 11 deletions kitchen-sink/svelte/src/pages/action-sheet.svelte
Expand Up @@ -29,7 +29,7 @@
},
{
text: 'Button 1',
bold: true,
strong: true,
},
{
text: 'Button 2',
Expand Down Expand Up @@ -66,7 +66,8 @@
fill
onClick={() => {
actionsOneGroupOpened = true;
}}>
}}
>
One group
</Button>
<!-- Two groups, open by "actionsOpen" attribute -->
Expand All @@ -78,7 +79,8 @@
fill
onClick={() => {
actionGridOpened = true;
}}>
}}
>
Action Grid
</Button>
</p>
Expand All @@ -99,7 +101,7 @@
<Actions bind:opened={actionsOneGroupOpened}>
<ActionsGroup>
<ActionsLabel>Do something</ActionsLabel>
<ActionsButton bold>Button 1</ActionsButton>
<ActionsButton strong>Button 1</ActionsButton>
<ActionsButton>Button 2</ActionsButton>
<ActionsButton color="red">Cancel</ActionsButton>
</ActionsGroup>
Expand All @@ -109,7 +111,7 @@
<Actions id="actions-two-groups">
<ActionsGroup>
<ActionsLabel>Do something</ActionsLabel>
<ActionsButton bold>Button 1</ActionsButton>
<ActionsButton strong>Button 1</ActionsButton>
<ActionsButton>Button 2</ActionsButton>
</ActionsGroup>
<ActionsGroup>
Expand All @@ -125,23 +127,26 @@
slot="media"
src="https://cdn.framework7.io/placeholder/people-96x96-1.jpg"
width="48"
style="max-width: 100%" />
style="max-width: 100%"
/>
<span>Button 1</span>
</ActionsButton>
<ActionsButton>
<img
slot="media"
src="https://cdn.framework7.io/placeholder/people-96x96-2.jpg"
width="48"
style="max-width: 100%" />
style="max-width: 100%"
/>
<span>Button 2</span>
</ActionsButton>
<ActionsButton>
<img
slot="media"
src="https://cdn.framework7.io/placeholder/people-96x96-3.jpg"
width="48"
style="max-width: 100%" />
style="max-width: 100%"
/>
<span>Button 3</span>
</ActionsButton>
</ActionsGroup>
Expand All @@ -151,23 +156,26 @@
slot="media"
src="https://cdn.framework7.io/placeholder/fashion-96x96-4.jpg"
width="48"
style="max-width: 100%" />
style="max-width: 100%"
/>
<span>Button 4</span>
</ActionsButton>
<ActionsButton>
<img
slot="media"
src="https://cdn.framework7.io/placeholder/fashion-96x96-5.jpg"
width="48"
style="max-width: 100%" />
style="max-width: 100%"
/>
<span>Button 5</span>
</ActionsButton>
<ActionsButton>
<img
slot="media"
src="https://cdn.framework7.io/placeholder/fashion-96x96-6.jpg"
width="48"
style="max-width: 100%" />
style="max-width: 100%"
/>
<span>Button 6</span>
</ActionsButton>
</ActionsGroup>
Expand Down
14 changes: 9 additions & 5 deletions kitchen-sink/svelte/src/pages/swipeout.svelte
Expand Up @@ -49,7 +49,7 @@
[
{
text: 'Cancel',
bold: true,
strong: true,
},
],
],
Expand Down Expand Up @@ -172,7 +172,8 @@
title="Facebook"
after="17:14"
subtitle="New messages from John Doe"
text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus.">
text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."
>
<SwipeoutActions left>
<SwipeoutButton overswipe color="green" onClick={reply}>Reply</SwipeoutButton>
<SwipeoutButton color="blue" onClick={forward}>Forward</SwipeoutButton>
Expand All @@ -190,7 +191,8 @@
title="John Doe (via Twitter)"
after="17:11"
subtitle="John Doe (@_johndoe) mentioned you on Twitter!"
text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus.">
text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."
>
<SwipeoutActions left>
<SwipeoutButton overswipe color="green" onClick={reply}>Reply</SwipeoutButton>
<SwipeoutButton color="blue" onClick={forward}>Forward</SwipeoutButton>
Expand All @@ -208,7 +210,8 @@
title="Facebook"
after="16:48"
subtitle="New messages from John Doe"
text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus.">
text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."
>
<SwipeoutActions left>
<SwipeoutButton overswipe color="green" onClick={reply}>Reply</SwipeoutButton>
<SwipeoutButton color="blue" onClick={forward}>Forward</SwipeoutButton>
Expand All @@ -226,7 +229,8 @@
title="John Doe (via Twitter)"
after="15:32"
subtitle="John Doe (@_johndoe) mentioned you on Twitter!"
text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus.">
text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."
>
<SwipeoutActions left>
<SwipeoutButton overswipe color="green" onClick={reply}>Reply</SwipeoutButton>
<SwipeoutButton color="blue" onClick={forward}>Forward</SwipeoutButton>
Expand Down
6 changes: 3 additions & 3 deletions kitchen-sink/vue/src/pages/action-sheet.vue
Expand Up @@ -32,7 +32,7 @@
<f7-actions id="actions-one-group">
<f7-actions-group>
<f7-actions-label>Do something</f7-actions-label>
<f7-actions-button bold>Button 1</f7-actions-button>
<f7-actions-button strong>Button 1</f7-actions-button>
<f7-actions-button>Button 2</f7-actions-button>
<f7-actions-button color="red">Cancel</f7-actions-button>
</f7-actions-group>
Expand All @@ -42,7 +42,7 @@
<f7-actions id="actions-two-groups">
<f7-actions-group>
<f7-actions-label>Do something</f7-actions-label>
<f7-actions-button bold>Button 1</f7-actions-button>
<f7-actions-button strong>Button 1</f7-actions-button>
<f7-actions-button>Button 2</f7-actions-button>
</f7-actions-group>
<f7-actions-group>
Expand Down Expand Up @@ -165,7 +165,7 @@ export default {
},
{
text: 'Button 1',
bold: true,
strong: true,
},
{
text: 'Button 2',
Expand Down
2 changes: 1 addition & 1 deletion kitchen-sink/vue/src/pages/swipeout.vue
Expand Up @@ -300,7 +300,7 @@ export default {
[
{
text: 'Cancel',
bold: true,
strong: true,
},
],
],
Expand Down
8 changes: 4 additions & 4 deletions src/core/components/actions/actions-class.js
Expand Up @@ -272,10 +272,10 @@ class Actions extends Modal {
<div class="actions-group">
{group.map((button) => {
const buttonClasses = [`actions-${button.label ? 'label' : 'button'}`];
const { color, bg, bold, disabled, label, text, icon } = button;
const { color, bg, strong, disabled, label, text, icon } = button;
if (color) buttonClasses.push(`color-${color}`);
if (bg) buttonClasses.push(`bg-color-${bg}`);
if (bold) buttonClasses.push('actions-button-bold');
if (strong) buttonClasses.push('actions-button-strong');
if (disabled) buttonClasses.push('disabled');
if (label) {
return <div class={buttonClasses.join(' ')}>{text}</div>;
Expand Down Expand Up @@ -306,10 +306,10 @@ class Actions extends Modal {
<ul>
{group.map((button) => {
const itemClasses = [];
const { color, bg, bold, disabled, label, text, icon } = button;
const { color, bg, strong, disabled, label, text, icon } = button;
if (color) itemClasses.push(`color-${color}`);
if (bg) itemClasses.push(`bg-color-${bg}`);
if (bold) itemClasses.push('popover-from-actions-bold');
if (strong) itemClasses.push('popover-from-actions-strong');
if (disabled) itemClasses.push('disabled');
if (label) {
itemClasses.push('popover-from-actions-label');
Expand Down
42 changes: 42 additions & 0 deletions src/core/components/actions/actions-ios.less
@@ -1,4 +1,46 @@
.ios {
.actions-group {
border-radius: var(--f7-actions-border-radius);
}
.actions-button,
.actions-label {
background: var(--f7-actions-bg-color);
.ios-translucent-modals(var(--f7-actions-bg-color-rgb));
&:first-child {
border-radius: var(--f7-actions-border-radius) var(--f7-actions-border-radius) 0 0;
}
&:last-child {
.hairline-remove(bottom);
border-radius: 0 0 var(--f7-actions-border-radius) var(--f7-actions-border-radius);
}
&:first-child:last-child {
border-radius: var(--f7-actions-border-radius);
}
b,
&.actions-button-strong {
font-weight: 600;
}
}
.actions-grid {
.actions-group {
border-radius: 0;
background: var(--f7-actions-bg-color);
.ios-translucent-modals(var(--f7-actions-bg-color-rgb));
&:first-child {
border-radius: var(--f7-actions-border-radius) var(--f7-actions-border-radius) 0 0;
}
&:last-child {
border-radius: 0 0 var(--f7-actions-border-radius) var(--f7-actions-border-radius);
}
&:first-child:last-child {
border-radius: var(--f7-actions-border-radius);
}
}
.actions-button,
.actions-label {
border-radius: 0 !important;
}
}
.actions-button-media {
margin-left: 16px;
+ .actions-button-text {
Expand Down
12 changes: 12 additions & 0 deletions src/core/components/actions/actions-md.less
@@ -1,7 +1,19 @@
.md {
.actions-modal {
background-color: var(--f7-actions-bg-color);
border-radius: var(--f7-actions-border-radius) var(--f7-actions-border-radius) 0 0;
}
.actions-button {
transition-duration: 300ms;
}
.actions-button,
.actions-label {
b,
&.actions-button-strong {
font-weight: 500;
}
}

.actions-button-media {
min-width: 40px;
+ .actions-button-text {
Expand Down

0 comments on commit d6a4718

Please sign in to comment.