Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{% set initially_expanded = initially_expanded|default(false) %}

{% set classes = html_classes('ids-accordion', {
'ids-accordion--is-expanded': initially_expanded
}) %}
{% set classes =
html_classes(
'ids-accordion',
{
'ids-accordion--is-expanded': initially_expanded
}
)
%}

<div class="{{ classes }}">
<div class="ids-accordion__header">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,43 @@
{% set attr = attr|default({}) %}
{% set classes = attr.class|default('') %}

{% set button_classes = html_cva(
base: 'ids-btn',
variants: {
type: {
'primary': 'ids-btn--primary',
'secondary': 'ids-btn--secondary',
'tertiary': 'ids-btn--tertiary',
'black-secondary': 'ids-btn--black-secondary',
'black-tertiary': 'ids-btn--black-tertiary',
},
size: {
'large': 'ids-btn--large',
'small': 'ids-btn--small',
'extra-small': 'ids-btn--extra-small',
},
disabled: {
true: 'ids-btn--disabled',
},
}
) %}
{# prettier-ignore-start #}
{% set button_classes =
html_cva(
base: 'ids-btn',
variants: {
type: {
primary: 'ids-btn--primary',
secondary: 'ids-btn--secondary',
tertiary: 'ids-btn--tertiary',
'black-secondary': 'ids-btn--black-secondary',
'black-tertiary': 'ids-btn--black-tertiary'
},
size: {
large: 'ids-btn--large',
small: 'ids-btn--small',
'extra-small': 'ids-btn--extra-small'
},
disabled: {
'true': 'ids-btn--disabled'
}
}
)
%}
{# prettier-ignore-end #}

{% set attr =
attr|merge({
class: button_classes.apply({ type, size, disabled }, classes),
class: button_classes.apply(
{
type,
size,
disabled
},
classes
),
disabled,
type: 'button',
type: 'button'
})
%}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@
{% set expand_label = expand_label|default('') %}

{% set label = is_expanded ? collapse_label : expand_label %}
{% set classes = html_classes('ids-expander', 'ids-expander--has-label', {
'ids-expander--has-icon': has_icon,
'ids-expander--is-expanded': is_expanded
}) %}
{% set classes =
html_classes(
'ids-expander',
'ids-expander--has-label',
{
'ids-expander--has-icon': has_icon,
'ids-expander--is-expanded': is_expanded
}
)
%}

{% include ids_get('button') with {
type: 'black-tertiary',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{% import ids_get('macros/html') as html %}

{% set type = type|default('default') %}
{% set title = title|default('') %}
{% set attr = attr|default({}) %}
{% set classes = attr.class|default('') %}

{% set ICONS_TYPE_MAP = {
default: 'info-circle',
error: 'alert-error'
} %}

{% set helper_text_classes =
html_cva(
base: 'ids-helper-text',
variants: {
type: {
default: 'ids-helper-text--default',
error: 'ids-helper-text--error'
}
}
)
%}
{% set attr =
attr|merge({
class: helper_text_classes.apply(
{
type
},
classes
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to have here direct reference as this will be less confusing and less error prone.

Suggested change
classes
attr.class|default('')

),
title: title
})
%}

<div {{ html.attributes(attr) }}>
{% block icon_wrapper %}
<div class="ids-helper-text__icon-wrapper">
{% block icon_content %}
{{
include(
ids_get('icon'),
{
attr: {
class: 'ids-icon ids-helper-text__icon'
},
name: ICONS_TYPE_MAP[type],
size: 'small'
}
)
}}
{% endblock %}
</div>
{% endblock %}
{% block content_wrapper %}
<div class="ids-helper-text__content-wrapper">
{{ content|raw }}
</div>
{% endblock %}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,32 @@
{% set link_href = ibexa_icon_path(name) %}
{% endif %}

{% set icon_classes = html_cva(
base: 'ids-icon',
variants: {
size: {
'tiny': 'ids-icon--tiny',
'tiny-small': 'ids-icon--tiny-small',
'small': 'ids-icon--small',
'small-medium': 'ids-icon--small-medium',
'medium': 'ids-icon--medium',
'medium-large': 'ids-icon--medium-large',
'large': 'ids-icon--large',
'extra-large': 'ids-icon--extra-large',
{% set icon_classes =
html_cva(
base: 'ids-icon',
variants: {
size: {
tiny: 'ids-icon--tiny',
'tiny-small': 'ids-icon--tiny-small',
small: 'ids-icon--small',
'small-medium': 'ids-icon--small-medium',
medium: 'ids-icon--medium',
'medium-large': 'ids-icon--medium-large',
large: 'ids-icon--large',
'extra-large': 'ids-icon--extra-large'
}
}
}
) %}
)
%}

{% set attr =
attr|merge({
class: icon_classes.apply({ size }, classes),
class: icon_classes.apply(
{
size
},
classes
)
})
%}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{% import ids_get('macros/html') as html %}

{% set disabled = disabled|default(false) %}
{% set error = error|default(false) %}
{% set placeholder = placeholder|default('') %}
{% set readonly = readonly|default(false) %}
{% set required = required|default(false) %}
{% set size = size|default('medium') %}
{% set title = title|default('') %}
{% set type = type|default('text') %}
{% set value = value|default('') %}
{% set attr = attr|default({}) %}
{% set classes = attr.class|default('') %}

{# prettier-ignore-start #}
{% set input_classes =
html_cva(
base: 'ids-input',
variants: {
type: {
text: 'ids-input--text',
password: 'ids-input--password',
email: 'ids-input--email',
number: 'ids-input--number',
tel: 'ids-input--tel',
search: 'ids-input--search',
url: 'ids-input--url'
},
size: {
medium: 'ids-input--medium',
small: 'ids-input--small'
},
disabled: {
'true': 'ids-input--disabled'
},
error: {
'true': 'ids-input--error'
},
required: {
'true': 'ids-input--required'
}
}
)
%}
{# prettier-ignore-end #}

{% set attr =
attr|merge({
class: input_classes.apply(
{
type,
size,
disabled,
error,
required
},
classes
),
disabled,
placeholder,
readonly,
title,
type,
value
})
%}

<input {{ html.attributes(attr) }} />
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{% import ids_get('macros/html') as html %}

{% set error = error|default(false) %}
{% set required = required|default(false) %}
{% set title = title|default('') %}
{% set attr = attr|default({}) %}

{% set classes =
html_classes(
'ids-label',
attr.classes|default(''),
{
'ids-label--error': error,
'ids-label--required': required
}
)
%}
{% set attr =
attr|merge({
class: classes,
for,
title,
})
%}

<label {{ html.attributes(attr) }}>{{ content|raw }}</label>
Loading