Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for GOV.UK Frontend v5.7.0 and GOV.UK Frontend Jinja 3.3.0 #69

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions example_project/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 example_project/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"govuk-frontend": "^5.4.1",
"govuk-frontend": "^5.7.0",
"sass": "^1.63.6"
},
"scripts": {
Expand Down
139 changes: 70 additions & 69 deletions example_project/poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example_project/static/css/styles.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example_project/static/css/styles.css.map

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions govuk_frontend_django/components/service_navigation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
from dataclasses import dataclass
from typing import List, Optional

from govuk_frontend_django.components import base as govuk_frontend_base
from govuk_frontend_django.components import (
error_message as govuk_frontend_error_message,
)
from govuk_frontend_django.components import fieldset as govuk_frontend_fieldset
from govuk_frontend_django.components import hint as govuk_frontend_hint
from govuk_frontend_django.components import label as govuk_frontend_label
from govuk_frontend_django.components import tag as govuk_frontend_tag


@dataclass(kw_only=True)
class ServiceNavigationSlots:
start: Optional[str] = None
end: Optional[str] = None
navigationStart: Optional[str] = None
navigationEnd: Optional[str] = None


@dataclass(kw_only=True)
class ServiceNavigationNavigation:
current: Optional[bool] = None
active: Optional[bool] = None
html: Optional[str] = None
text: Optional[str] = None
href: Optional[str] = None
attributes: Optional[govuk_frontend_base.Attributes] = None


@dataclass(kw_only=True)
class GovUKServiceNavigation(govuk_frontend_base.GovUKComponent):
"""GOV.UK Service Navigation

See: https://design-system.service.gov.uk/components/service-navigation/
"""

ariaLabel: Optional[str] = None
menuButtonText: Optional[str] = None
menuButtonLabel: Optional[str] = None
navigationLabel: Optional[str] = None
navigationId: Optional[str] = None
navigationClasses: Optional[str] = None
serviceName: Optional[str] = None
serviceUrl: Optional[str] = None
navigation: List[ServiceNavigationNavigation]
slots: Optional[ServiceNavigationSlots] = None

_jinja2_template = "govuk_frontend_jinja/components/service-navigation/macro.html"
_macro_name = "govukServiceNavigation"


COMPONENT = GovUKServiceNavigation
9 changes: 5 additions & 4 deletions poetry.lock

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

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ packages = [
python = "^3.8"
Django = "^4.1.9"
jinja2 = "^3.1.2"
govuk-frontend-jinja = "3.1.0"
govuk-frontend-jinja = "3.3.0"

[tool.poetry.group.testing]
optional = true
Expand Down