Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Mar 26, 2024
1 parent 21a0ff5 commit 99e7bd0
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 9 deletions.
2 changes: 1 addition & 1 deletion govuk_frontend_django/components/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class GovUKHeader(govuk_frontend_base.GovUKComponent):
"""

homepageUrl: Optional[str] = None
assetsPath: Optional[str] = None
productName: Optional[str] = None
serviceName: Optional[str] = None
serviceUrl: Optional[str] = None
Expand All @@ -38,6 +37,7 @@ class GovUKHeader(govuk_frontend_base.GovUKComponent):
menuButtonLabel: Optional[str] = None
menuButtonText: Optional[str] = None
containerClasses: Optional[str] = None
useTudorCrown: Optional[bool] = None

_jinja2_template = "govuk_frontend_jinja/components/header/macro.html"
_macro_name = "govukHeader"
Expand Down
8 changes: 8 additions & 0 deletions govuk_frontend_django/components/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
from govuk_frontend_django.components import tag as govuk_frontend_tag


@dataclass(kw_only=True)
class InputInputwrapper:
classes: Optional[str] = None
attributes: Optional[govuk_frontend_base.Attributes] = None


@dataclass(kw_only=True)
class InputSuffix:
text: Optional[str] = None
Expand Down Expand Up @@ -50,6 +56,8 @@ class GovUKInput(govuk_frontend_base.GovUKComponent):
autocomplete: Optional[str] = None
pattern: Optional[str] = None
spellcheck: Optional[bool] = None
autocapitalize: Optional[str] = None
inputWrapper: Optional[InputInputwrapper] = None

_jinja2_template = "govuk_frontend_jinja/components/input/macro.html"
_macro_name = "govukInput"
Expand Down
2 changes: 2 additions & 0 deletions govuk_frontend_django/components/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
@dataclass(kw_only=True)
class PaginationNext:
text: Optional[str] = None
html: Optional[str] = None
labelText: Optional[str] = None
href: str
attributes: Optional[govuk_frontend_base.Attributes] = None
Expand All @@ -22,6 +23,7 @@ class PaginationNext:
@dataclass(kw_only=True)
class PaginationPrevious:
text: Optional[str] = None
html: Optional[str] = None
labelText: Optional[str] = None
href: str
attributes: Optional[govuk_frontend_base.Attributes] = None
Expand Down
2 changes: 1 addition & 1 deletion govuk_frontend_django/components/radios.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@dataclass(kw_only=True)
class RadiosItemsConditional:
html: Optional[str] = None
html: str


@dataclass(kw_only=True)
Expand Down
2 changes: 1 addition & 1 deletion govuk_frontend_django/components/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class GovUKSelect(govuk_frontend_base.GovUKComponent):
value: Optional[str] = None
disabled: Optional[bool] = None
describedBy: Optional[str] = None
label: Optional[govuk_frontend_label.GovUKLabel] = None
label: govuk_frontend_label.GovUKLabel
hint: Optional[govuk_frontend_hint.GovUKHint] = None
errorMessage: Optional[govuk_frontend_error_message.GovUKErrorMessage] = None
formGroup: Optional[govuk_frontend_base.FormGroup] = None
Expand Down
52 changes: 52 additions & 0 deletions govuk_frontend_django/components/task_list.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from dataclasses import dataclass
from typing import Any, 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 TaskListItemsStatus:
tag: Optional[Any] = None
text: Optional[str] = None
html: Optional[str] = None
classes: Optional[str] = None


@dataclass(kw_only=True)
class TaskListItemsTitle:
text: Optional[str] = None
html: Optional[str] = None
classes: Optional[str] = None


@dataclass(kw_only=True)
class TaskListItems:
title: TaskListItemsTitle
hint: Optional[govuk_frontend_hint.GovUKHint] = None
status: TaskListItemsStatus
href: Optional[str] = None
classes: Optional[str] = None


@dataclass(kw_only=True)
class GovUKTaskList(govuk_frontend_base.GovUKComponent):
"""GOV.UK Task List
See: https://design-system.service.gov.uk/components/task-list/
"""

items: List[TaskListItems]
idPrefix: Optional[str] = None

_jinja2_template = "govuk_frontend_jinja/components/task-list/macro.html"
_macro_name = "govukTaskList"


COMPONENT = GovUKTaskList
31 changes: 26 additions & 5 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 = "2.7.0"
govuk-frontend-jinja = "3.0.0"

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

0 comments on commit 99e7bd0

Please sign in to comment.