basecoat-cli 0.2.0-beta.1 → 0.2.1
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.
- package/dist/assets/jinja/dialog.html.jinja +69 -85
- package/dist/assets/jinja/dropdown-menu.html.jinja +46 -38
- package/dist/assets/jinja/popover.html.jinja +11 -19
- package/dist/assets/jinja/select.html.jinja +67 -46
- package/dist/assets/jinja/sidebar.html.jinja +28 -22
- package/dist/assets/jinja/tabs.html.jinja +21 -18
- package/dist/assets/jinja/toast.html.jinja +46 -135
- package/dist/assets/js/all.js +188 -93
- package/dist/assets/js/all.min.js +1 -1
- package/dist/assets/js/dropdown-menu.js +60 -45
- package/dist/assets/js/dropdown-menu.min.js +1 -1
- package/dist/assets/js/popover.js +69 -0
- package/dist/assets/js/popover.min.js +1 -0
- package/dist/assets/js/select.js +59 -49
- package/dist/assets/js/select.min.js +1 -1
- package/dist/assets/nunjucks/dialog.njk +4 -4
- package/dist/assets/nunjucks/dropdown-menu.njk +35 -23
- package/dist/assets/nunjucks/popover.njk +28 -20
- package/dist/assets/nunjucks/select.njk +44 -32
- package/dist/assets/nunjucks/sidebar.njk +21 -12
- package/dist/assets/nunjucks/tabs.njk +12 -8
- package/dist/assets/nunjucks/toast.njk +7 -7
- package/package.json +1 -1
- package/dist/assets/js/css-anchor-positioning.js +0 -6340
- package/dist/assets/js/css-anchor-positioning.min.js +0 -1
|
@@ -7,7 +7,11 @@
|
|
|
7
7
|
@param side {string} [optional] - Side of the sidebar to display.
|
|
8
8
|
@param header {string} [optional] - Header content for the sidebar.
|
|
9
9
|
@param footer {string} [optional] - Footer content for the sidebar.
|
|
10
|
-
@param
|
|
10
|
+
@param items {array} [optional] - Array of menu items for the sidebar.
|
|
11
|
+
@param main_attrs {object} [optional] - Additional HTML attributes for the main container div.
|
|
12
|
+
@param header_attrs {object} [optional] - Additional HTML attributes for the header element.
|
|
13
|
+
@param content_attrs {object} [optional] - Additional HTML attributes for the content section.
|
|
14
|
+
@param footer_attrs {object} [optional] - Additional HTML attributes for the footer element.
|
|
11
15
|
#}
|
|
12
16
|
{% macro sidebar(
|
|
13
17
|
id=None,
|
|
@@ -20,8 +24,7 @@
|
|
|
20
24
|
main_attrs={},
|
|
21
25
|
header_attrs={},
|
|
22
26
|
content_attrs={},
|
|
23
|
-
footer_attrs={}
|
|
24
|
-
content_wrapper_attrs=None
|
|
27
|
+
footer_attrs={}
|
|
25
28
|
) %}
|
|
26
29
|
<aside
|
|
27
30
|
{% if id %}id="{{ id }}"{% endif %}
|
|
@@ -86,9 +89,11 @@
|
|
|
86
89
|
<div
|
|
87
90
|
role="group"
|
|
88
91
|
{% if item.label %}aria-labelledby="{{ group_label_id }}"{% endif %}
|
|
89
|
-
{%
|
|
90
|
-
{
|
|
91
|
-
|
|
92
|
+
{% if item.attrs %}
|
|
93
|
+
{% for key, value in item.attrs %}
|
|
94
|
+
{{ key }}="{{ value }}"
|
|
95
|
+
{% endfor %}
|
|
96
|
+
{% endif %}
|
|
92
97
|
>
|
|
93
98
|
{% if item.label %}
|
|
94
99
|
<h3 id="{{ group_label_id }}">{{ item.label }}</h3>
|
|
@@ -104,9 +109,11 @@
|
|
|
104
109
|
<details
|
|
105
110
|
id="submenu-{{ item_id }}"
|
|
106
111
|
{{ "open" if item.open }}
|
|
107
|
-
{%
|
|
108
|
-
{%
|
|
109
|
-
|
|
112
|
+
{% if item.attrs %}
|
|
113
|
+
{% for key, value in item.attrs %}
|
|
114
|
+
{% if key != "open" %}{{ key }}="{{ value }}"{% endif %}
|
|
115
|
+
{% endfor %}
|
|
116
|
+
{% endif %}
|
|
110
117
|
>
|
|
111
118
|
<summary aria-controls="submenu-{{ item_id }}-content">
|
|
112
119
|
{% if item.icon %}{{ item.icon | safe }}{% endif %}
|
|
@@ -122,9 +129,11 @@
|
|
|
122
129
|
<a
|
|
123
130
|
href="{{ item.url }}"
|
|
124
131
|
{{ 'aria-current="page"' if item.current }}
|
|
125
|
-
{%
|
|
126
|
-
{%
|
|
127
|
-
|
|
132
|
+
{% if item.attrs %}
|
|
133
|
+
{% for key, value in item.attrs %}
|
|
134
|
+
{% if key != "href" and key != "aria-current" %}{{ key }}="{{ value }}"{% endif %}
|
|
135
|
+
{% endfor %}
|
|
136
|
+
{% endif %}
|
|
128
137
|
>
|
|
129
138
|
{% if item.icon %}{{ item.icon | safe }}{% endif %}
|
|
130
139
|
<span>{{ item.label }}</span>
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
{% macro tabs(
|
|
17
17
|
id=None,
|
|
18
18
|
tabsets=[],
|
|
19
|
-
main_attrs=
|
|
20
|
-
tablist_attrs=
|
|
19
|
+
main_attrs={},
|
|
20
|
+
tablist_attrs={},
|
|
21
21
|
default_tab_index=1
|
|
22
22
|
)
|
|
23
23
|
%}
|
|
@@ -44,9 +44,11 @@
|
|
|
44
44
|
aria-controls="{{ id }}-panel-{{ loop.index }}"
|
|
45
45
|
aria-selected="{{ 'true' if loop.index == default_tab_index else 'false' }}"
|
|
46
46
|
tabindex="0"
|
|
47
|
-
{%
|
|
48
|
-
{
|
|
49
|
-
|
|
47
|
+
{% if tabset.tab_attrs %}
|
|
48
|
+
{% for key, value in tabset.tab_attrs %}
|
|
49
|
+
{{ key }}="{{ value }}"
|
|
50
|
+
{% endfor %}
|
|
51
|
+
{% endif %}
|
|
50
52
|
>
|
|
51
53
|
{{ tabset.tab | safe }}
|
|
52
54
|
</button>
|
|
@@ -62,9 +64,11 @@
|
|
|
62
64
|
tabindex="-1"
|
|
63
65
|
aria-selected="{{ 'true' if loop.index == default_tab_index else 'false' }}"
|
|
64
66
|
{% if loop.index != default_tab_index %}hidden{% endif %}
|
|
65
|
-
{%
|
|
66
|
-
{
|
|
67
|
-
|
|
67
|
+
{% if tabset.panel_attrs %}
|
|
68
|
+
{% for key, value in tabset.panel_attrs %}
|
|
69
|
+
{{ key }}="{{ value }}"
|
|
70
|
+
{% endfor %}
|
|
71
|
+
{% endif %}
|
|
68
72
|
>
|
|
69
73
|
{{ tabset.panel | safe }}
|
|
70
74
|
</div>
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
{% macro toaster(
|
|
11
11
|
id="toaster",
|
|
12
12
|
toasts=[],
|
|
13
|
-
attrs=
|
|
13
|
+
attrs={}
|
|
14
14
|
) %}
|
|
15
15
|
<div
|
|
16
16
|
id="{{ id }}"
|
|
17
|
-
class="toaster"
|
|
17
|
+
class="toaster {{ attrs.class }}"
|
|
18
18
|
{% for key, value in attrs %}
|
|
19
|
-
{{ key }}="{{ value }}"
|
|
19
|
+
{% if key != 'class' %}{{ key }}="{{ value }}"{% endif %}
|
|
20
20
|
{% endfor %}
|
|
21
21
|
>
|
|
22
22
|
{% for item in toasts %}
|
|
@@ -63,13 +63,13 @@
|
|
|
63
63
|
<div class="toast-content">
|
|
64
64
|
{% if category in ["error", "success", "info", "warning"] %}
|
|
65
65
|
{% if category == "success" %}
|
|
66
|
-
|
|
66
|
+
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/></svg>
|
|
67
67
|
{% elif category == "error" %}
|
|
68
|
-
|
|
68
|
+
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m15 9-6 6"/><path d="m9 9 6 6"/></svg>
|
|
69
69
|
{% elif category == "info" %}
|
|
70
|
-
|
|
70
|
+
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>
|
|
71
71
|
{% elif category == "warning" %}
|
|
72
|
-
|
|
72
|
+
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>
|
|
73
73
|
{% endif %}
|
|
74
74
|
{% endif %}
|
|
75
75
|
<section>
|