move vendored uk components to templates

This commit is contained in:
stvnrlly
2022-12-14 11:50:51 -05:00
parent d45c0f6251
commit ac1d5f0983
217 changed files with 4041 additions and 330 deletions

View File

@@ -0,0 +1,15 @@
# Inset text
## Installation
See the [main README quick start guide](https://github.com/alphagov/govuk-frontend#quick-start) for how to install this component.
## Guidance and Examples
Find out when to use the inset text component in your service in the [GOV.UK Design System](https://design-system.service.gov.uk/components/inset-text).
## Component options
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
See [options table](https://design-system.service.gov.uk/components/inset-text/#options-example-default) for details.

View File

@@ -0,0 +1,28 @@
@import "../../settings/all";
@import "../../tools/all";
@import "../../helpers/all";
@include govuk-exports("govuk/component/inset-text") {
.govuk-inset-text {
@include govuk-font($size: 19);
@include govuk-text-colour;
padding: govuk-spacing(3);
// Margin top intended to collapse
// This adds an additional 10px to the paragraph above
@include govuk-responsive-margin(6, "top");
@include govuk-responsive-margin(6, "bottom");
clear: both;
border-left: $govuk-border-width-wide solid $govuk-border-colour;
> :first-child {
margin-top: 0;
}
> :only-child,
> :last-child {
margin-bottom: 0;
}
}
}

View File

@@ -0,0 +1,32 @@
[
{
"name": "text",
"type": "string",
"required": true,
"description": "If `html` is set, this is not required. Text to use within the back link component. If `html` is provided, the `text` argument will be ignored."
},
{
"name": "html",
"type": "string",
"required": true,
"description": "If `text` is set, this is not required. HTML to use within the back link component. If `html` is provided, the `text` argument will be ignored."
},
{
"name": "id",
"type": "string",
"required": false,
"description": "Id attribute to add to the inset text container."
},
{
"name": "classes",
"type": "string",
"required": false,
"description": "Classes to add to the inset text container."
},
{
"name": "attributes",
"type": "object",
"required": false,
"description": "HTML attributes (for example data attributes) to add to the inset text container."
}
]

View File

@@ -0,0 +1,3 @@
{% macro govukInsetText(params) %}
{%- include './template.njk' -%}
{% endmacro %}

View File

@@ -0,0 +1,4 @@
<div {%- if params.id %} id="{{ params.id }}"{% endif %} class="govuk-inset-text {%- if params.classes %} {{ params.classes }}{% endif %}"
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
{{ params.html | safe if params.html else params.text }}
</div>