@rijkshuisstijl-community/components-twig 1.1.2 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,41 @@
1
+ {%- set role = 'status' -%}
2
+ {%- set icon = 'info-circle' -%}
3
+ {%- if type == 'error' -%}
4
+ {%- set icon = 'alert-circle' -%}
5
+ {%- endif -%}
6
+ {%- if type == 'ok' -%}
7
+ {%- set icon = 'circle-check' -%}
8
+ {%- endif -%}
9
+ {%- if type == 'warning' -%}
10
+ {%- set icon = 'alert-triangle' -%}
11
+ {%- endif -%}
12
+ {%- if type not 'info' -%}
13
+ {%- set role = 'alert' -%}
14
+ {%- endif -%}
15
+ {%- set attributes = attributes.setAttribute('role', role) -%}
16
+ {%- set attributes = attributes.addClass('utrecht-alert__message') -%}
17
+ <div class="utrecht-alert utrecht-alert--{{ type }} rhc-alert">
18
+ <div class="utrecht-alert__content">
19
+ <div {{ attributes }}>
20
+ <div class="rhc-alert__icon-container rhc-alert__icon-container--{{ type }}">
21
+ {% include '@rhc/Icon.twig' with {
22
+ attributes: create_attribute(),
23
+ icon: icon
24
+ } %}
25
+ </div>
26
+ <div>
27
+ {% include '@rhc/Heading.twig' with {
28
+ attributes: create_attribute(),
29
+ level: 3,
30
+ appearance: 5,
31
+ children: heading
32
+ } %}
33
+
34
+ {% include '@rhc/Paragraph.twig' with {
35
+ attributes: create_attribute(),
36
+ children: textContent
37
+ } %}
38
+ </div>
39
+ </div>
40
+ </div>
41
+ </div>
package/dist/Heading.twig CHANGED
@@ -1,7 +1,7 @@
1
1
  {%- if level is empty -%}
2
2
  {%- set level = 1 -%}
3
3
  {%- endif -%}
4
- {%- set classes = ['nl-heading'] -%}
4
+ {%- set classes = ['nl-heading', 'rhc-heading'] -%}
5
5
  {%- if appearance is not empty -%}
6
6
  {%- set classes = classes|merge(['nl-heading--level-' ~ appearance]) -%}
7
7
  {%- else -%}
package/dist/Icon.twig CHANGED
@@ -1,7 +1,22 @@
1
1
  {%- set attributes = attributes.addClass('utrecht-icon') -%}
2
2
  {%- set attributes = attributes.setAttribute('role', 'presentation') -%}
3
3
  {%- set attributes = attributes.setAttribute('aria-hidden', 'true') -%}
4
- {%- set svg_attributes = svg_attributes.addClass('icon-tabler-' ~ icon) -%}
4
+ {% set svg_properties = {
5
+ 'class': ['icon', 'icon-tabler', 'icon-tabler-' ~ icon],
6
+ 'xmlns': 'http://www.w3.org/2000/svg',
7
+ 'width': 24,
8
+ 'height': 24,
9
+ 'viewBox': '0 0 24 24',
10
+ 'fill': 'none',
11
+ 'stroke': 'currentColor',
12
+ 'stroke-width': 2,
13
+ 'stroke-linecap': 'round',
14
+ 'stroke-linejoin': 'round',
15
+ }
16
+ %}
17
+ {% for key,property in svg_properties %}
18
+ {% set svg_attributes = svg_attributes.setAttribute(key, property) %}
19
+ {% endfor %}
5
20
  <span{{ attributes }}>
6
21
  <svg{{ svg_attributes }}>
7
22
  <use xlink:href="node_modules/@tabler/icons-sprite/dist/tabler-sprite.svg#tabler-{{ icon }}" />
@@ -0,0 +1,5 @@
1
+ {%- if src is defined -%}{%- set attributes = attributes.setAttribute('src', src) -%}{%- endif -%}
2
+ {%- if alt is defined -%}{%- set attributes = attributes.setAttribute('alt', alt) -%}{%- else -%}{%- set attributes = attributes.setAttribute('alt', '') -%}{%- endif -%}
3
+ {%- if width is defined -%}{%- set attributes = attributes.setAttribute('width', width) -%}{%- endif -%}
4
+ {%- if height is defined -%}{%- set attributes = attributes.setAttribute('height', height) -%}{%- endif -%}
5
+ <img {{ attributes.addClass(['utrecht-img', 'utrecht-img--photo']) }} />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rijkshuisstijl-community/components-twig",
3
- "version": "1.1.2",
3
+ "version": "1.3.0",
4
4
  "author": "Community for NL Design System",
5
5
  "description": "Twig component library for the Rijkshuisstijl Community repository, based on the NL Design System architecture",
6
6
  "license": "EUPL-1.2",