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.
@@ -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 menu {array} [optional] - Array of menu items for the sidebar.
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
- {% for key, value in item.attrs %}
90
- {{ key }}="{{ value }}"
91
- {% endfor %}
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
- {% for key, value in item.attrs %}
108
- {% if key != "open" %}{{ key }}="{{ value }}"{% endif %}
109
- {% endfor %}
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
- {% for key, value in item.attrs %}
126
- {% if key != "href" and key != "aria-current" %}{{ key }}="{{ value }}"{% endif %}
127
- {% endfor %}
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=None,
20
- tablist_attrs=None,
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
- {% for key, value in tabset.tab_attrs %}
48
- {{ key }}="{{ value }}"
49
- {% endfor %}
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
- {% for key, value in tabset.panel_attrs %}
66
- {{ key }}="{{ value }}"
67
- {% endfor %}
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=None
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
- {% lucide "circle-check" %}
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
- {% lucide "circle-x" %}
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
- {% lucide "info" %}
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
- {% lucide "triangle-alert" %}
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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "basecoat-cli",
3
- "version": "0.2.0-beta.1",
3
+ "version": "0.2.1",
4
4
  "description": "Add Basecoat components to your project",
5
5
  "author": "hunvreus",
6
6
  "license": "MIT",