- {% include "@bolt-components-button/button.twig" with {
- "text": "Close search filter"|t,
- "url": "#" ~ panelId,
- "size": "xsmall",
- "style": "primary",
- "border_radius": "full",
- "iconOnly": true,
- "icon": {
- "name": "more",
- "size": "medium"
+ {% set _more_icon %}
+ {% include '@bolt-components-icon/icon.twig' with {
+ name: 'more',
+ size: 'medium'
+ } only %}
+ {% endset %}
+ {% include '@bolt-elements-button/button.twig' with {
+ content: 'Close search filter'|t,
+ border_radius: 'full',
+ size: 'xsmall',
+ icon_only: _more_icon,
+ attributes: {
+ href: "#" ~ panelId,
}
} only %}
@@ -67,16 +70,20 @@
- {% include "@bolt-components-button/button.twig" with {
- "text": "Close search filter"|t,
- "url": "#!",
- "size": "xsmall",
- "style": "text",
- "border_radius": "full",
- "iconOnly": true,
- "icon": {
- "name": "close",
- "size": "medium"
+ {% set _close_icon %}
+ {% include '@bolt-components-icon/icon.twig' with {
+ name: 'more',
+ size: 'medium'
+ } only %}
+ {% endset %}
+ {% include '@bolt-elements-button/button.twig' with {
+ content: 'Close search filter'|t,
+ border_radius: 'full',
+ size: 'xsmall',
+ hierarchy: 'transparent',
+ icon_only: _close_icon,
+ attributes: {
+ href: "#!",
}
} only %}
diff --git a/packages/components/bolt-tooltip/src/tooltip.twig b/packages/components/bolt-tooltip/src/tooltip.twig
index 85ed68caf2..3faa6bee14 100644
--- a/packages/components/bolt-tooltip/src/tooltip.twig
+++ b/packages/components/bolt-tooltip/src/tooltip.twig
@@ -74,14 +74,20 @@
{{ trigger.text }}
{% endif %}
{% elseif trigger.type == "button" %}
- {% include "@bolt-components-button/button.twig" with {
- text: trigger.text,
- icon: {
- name: trigger.icon.name,
+ {% set trigger_icon %}
+ {% include "@bolt-components-icon/icon.twig" with {
+ name:trigger.icon.name,
size: trigger.icon.size,
- position: "before",
- },
- style: "secondary",
+ } only %}
+ {% endset %}
+
+ {% include '@bolt-elements-button/button.twig' with {
+ content: trigger.text,
+ hierarchy: 'secondary',
+ icon_before: trigger_icon,
+ attributes: {
+ type: 'button'
+ }
} only %}
{# End adapter for old trigger data #}
diff --git a/packages/global/styles/05-objects/objects-flag/src/flag.twig b/packages/global/styles/05-objects/objects-flag/src/flag.twig
index 8ddad4347f..4d63fb6c7d 100644
--- a/packages/global/styles/05-objects/objects-flag/src/flag.twig
+++ b/packages/global/styles/05-objects/objects-flag/src/flag.twig
@@ -60,10 +60,11 @@
{% endset %}
{% if url %}
- {% include "@bolt-components-link/link.twig" with {
- display: "block",
- url: url,
- text: figureContent
+ {% include "@bolt-elements-text-link/text-link.twig" with {
+ content: figureContent,
+ attributes: {
+ href: url,
+ }
} only %}
{% else %}
{{ figureContent }}
diff --git a/packages/twig-integration/twig-renderer-endpoint/__snapshots__/index.test.js.snap b/packages/twig-integration/twig-renderer-endpoint/__snapshots__/index.test.js.snap
index 2beb2d122b..bf950eab97 100644
--- a/packages/twig-integration/twig-renderer-endpoint/__snapshots__/index.test.js.snap
+++ b/packages/twig-integration/twig-renderer-endpoint/__snapshots__/index.test.js.snap
@@ -1,37 +1,25 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Test the Bolt Twig Renderer API renders attributes on the button component correctly 1`] = `
-
-
-
+
`;
exports[`Test the Bolt Twig Renderer API renders the button component correctly 1`] = `
-
-
-
+
`;
exports[`Test the Bolt Twig Renderer API renders the secondary button correctly 1`] = `
-
-
-
+
`;
diff --git a/packages/twig-integration/twig-renderer-endpoint/index.test.js b/packages/twig-integration/twig-renderer-endpoint/index.test.js
index c235bf243e..2f8579e11f 100644
--- a/packages/twig-integration/twig-renderer-endpoint/index.test.js
+++ b/packages/twig-integration/twig-renderer-endpoint/index.test.js
@@ -1,10 +1,13 @@
const { render } = require('@bolt/twig-renderer');
-const buttonTemplate = '@bolt-components-button/button.twig';
+const buttonTemplate = '@bolt-elements-button/button.twig';
describe('Test the Bolt Twig Renderer API', () => {
test('renders a basic button', async () => {
const buttonData = {
- text: 'Hello world!',
+ content: 'Hello world!',
+ attributes: {
+ type: 'button',
+ },
};
const result = await render(buttonTemplate, buttonData);
@@ -18,8 +21,11 @@ describe('Test the Bolt Twig Renderer API', () => {
});
test('handles non-existent template path', async () => {
- const result = await render('@bolt-components-button/button2.twig', {
- text: 'Hello world 2!',
+ const result = await render('@bolt-elements-button/button2.twig', {
+ content: 'Hello world 2!',
+ attributes: {
+ type: 'button',
+ },
});
expect(result.ok).toEqual(false);
@@ -27,7 +33,10 @@ describe('Test the Bolt Twig Renderer API', () => {
test('renders the button component correctly', async () => {
const result = await render(buttonTemplate, {
- text: 'Hello world!2',
+ content: 'Hello world!2',
+ attributes: {
+ type: 'button',
+ },
});
expect(result.html).toMatchSnapshot();
@@ -35,9 +44,10 @@ describe('Test the Bolt Twig Renderer API', () => {
test('renders attributes on the button component correctly', async () => {
const result = await render(buttonTemplate, {
- text: 'Hello world!',
+ content: 'Hello world!',
attributes: {
class: ['u-bolt-margin-bottom-large'],
+ type: 'button',
},
});
@@ -46,8 +56,11 @@ describe('Test the Bolt Twig Renderer API', () => {
test('renders the secondary button correctly', async () => {
const result = await render(buttonTemplate, {
- text: 'Secondary Button!',
- style: 'secondary',
+ content: 'Secondary Button!',
+ hierarchy: 'secondary',
+ attributes: {
+ type: 'button',
+ },
});
expect(result.html).toMatchSnapshot();