basecoat-css 1.1.0 → 1.2.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.
- package/README.md +1 -1
- package/dist/base/base.css +1 -0
- package/dist/base/scroll-fade.css +41 -0
- package/dist/base/transition-details.css +12 -0
- package/dist/basecoat-base.bundle.css +767 -119
- package/dist/basecoat-base.cdn.css +1924 -673
- package/dist/basecoat-base.cdn.min.css +1 -1
- package/dist/basecoat-compat.cdn.css +250 -75
- package/dist/basecoat-compat.cdn.min.css +1 -1
- package/dist/basecoat-components.css +10 -0
- package/dist/basecoat-luma.bundle.css +1115 -125
- package/dist/basecoat-luma.cdn.css +4649 -2558
- package/dist/basecoat-luma.cdn.min.css +1 -1
- package/dist/basecoat-lyra.bundle.css +1110 -125
- package/dist/basecoat-lyra.cdn.css +5118 -3079
- package/dist/basecoat-lyra.cdn.min.css +1 -1
- package/dist/basecoat-maia.bundle.css +1113 -125
- package/dist/basecoat-maia.cdn.css +5244 -3202
- package/dist/basecoat-maia.cdn.min.css +1 -1
- package/dist/basecoat-mira.bundle.css +1113 -125
- package/dist/basecoat-mira.cdn.css +3623 -1583
- package/dist/basecoat-mira.cdn.min.css +1 -1
- package/dist/basecoat-nova.bundle.css +1115 -129
- package/dist/basecoat-nova.cdn.css +5271 -3229
- package/dist/basecoat-nova.cdn.min.css +1 -1
- package/dist/basecoat-rhea.bundle.css +1117 -127
- package/dist/basecoat-rhea.cdn.css +5286 -3192
- package/dist/basecoat-rhea.cdn.min.css +1 -1
- package/dist/basecoat-sera.bundle.css +1111 -128
- package/dist/basecoat-sera.cdn.css +3280 -1254
- package/dist/basecoat-sera.cdn.min.css +1 -1
- package/dist/basecoat-vega.bundle.css +1113 -125
- package/dist/basecoat-vega.cdn.css +5225 -3180
- package/dist/basecoat-vega.cdn.min.css +1 -1
- package/dist/basecoat.bundle.css +1113 -125
- package/dist/basecoat.cdn.css +5225 -3180
- package/dist/basecoat.cdn.min.css +1 -1
- package/dist/compat/legacy.css +3 -18
- package/dist/components/accordion.css +15 -1
- package/dist/components/alert.css +4 -0
- package/dist/components/attachment.css +66 -0
- package/dist/components/bubble.css +28 -0
- package/dist/components/button-group.css +2 -1
- package/dist/components/button.css +23 -0
- package/dist/components/carousel.css +30 -0
- package/dist/components/checkbox.css +5 -1
- package/dist/components/code-block.css +80 -0
- package/dist/components/collapsible.css +0 -9
- package/dist/components/command.css +13 -0
- package/dist/components/dialog.css +2 -4
- package/dist/components/drawer.css +48 -14
- package/dist/components/input-otp.css +49 -0
- package/dist/components/item.css +6 -0
- package/dist/components/marker.css +20 -0
- package/dist/components/message.css +24 -0
- package/dist/components/range.css +7 -0
- package/dist/components/scrollbar.css +20 -42
- package/dist/components/sheet.css +123 -0
- package/dist/components/shimmer.css +49 -0
- package/dist/components/sidebar.css +9 -1
- package/dist/components/toast.css +59 -44
- package/dist/components/trace.css +34 -0
- package/dist/js/all.js +488 -112
- package/dist/js/all.min.js +1 -1
- package/dist/js/carousel.js +105 -0
- package/dist/js/carousel.min.js +1 -0
- package/dist/js/code-block.js +47 -0
- package/dist/js/code-block.min.js +1 -0
- package/dist/js/drawer.js +6 -2
- package/dist/js/drawer.min.js +1 -1
- package/dist/js/input-otp.js +76 -0
- package/dist/js/input-otp.min.js +1 -0
- package/dist/js/tabs.js +31 -58
- package/dist/js/tabs.min.js +1 -1
- package/dist/js/toast.js +221 -53
- package/dist/js/toast.min.js +1 -1
- package/dist/styles/luma.css +348 -6
- package/dist/styles/lyra.css +343 -6
- package/dist/styles/maia.css +346 -6
- package/dist/styles/mira.css +346 -6
- package/dist/styles/nova.css +348 -10
- package/dist/styles/rhea.css +350 -8
- package/dist/styles/sera.css +344 -9
- package/dist/styles/vega.css +346 -6
- package/dist/typeset.cdn.css +381 -0
- package/dist/typeset.cdn.min.css +1 -0
- package/dist/typeset.css +435 -0
- package/package.json +16 -7
- package/templates/jinja/tabs.html.jinja +0 -1
- package/templates/jinja/toast.html.jinja +29 -26
- package/templates/nunjucks/tabs.njk +1 -1
- package/templates/nunjucks/toast.njk +30 -27
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Renders a toaster container and individual toast messages.
|
|
3
3
|
Can render the initial container or be used with htmx OOB swaps to add toasts dynamically.
|
|
4
4
|
|
|
5
|
-
@param id {string} [optional] [default="toaster"] - Unique identifier for the toaster
|
|
5
|
+
@param id {string} [optional] [default="toaster"] - Unique identifier for the toaster list.
|
|
6
6
|
@param toasts {array} [optional] - An array of toast objects to render initially. See the <code>toast()</code> macro for more details.
|
|
7
|
-
@param attrs {object} [optional] - Additional HTML attributes for the main toaster
|
|
7
|
+
@param attrs {object} [optional] - Additional HTML attributes for the main toaster list.
|
|
8
8
|
|
|
9
9
|
Supports caller() for custom toast markup.
|
|
10
10
|
#}
|
|
@@ -13,11 +13,13 @@
|
|
|
13
13
|
toasts=[],
|
|
14
14
|
attrs={}
|
|
15
15
|
) %}
|
|
16
|
-
<
|
|
16
|
+
<ol
|
|
17
17
|
id="{{ id }}"
|
|
18
18
|
class="toaster {{ attrs.class }}"
|
|
19
|
+
role="list"
|
|
20
|
+
aria-label="{{ attrs['aria-label'] or 'Notifications' }}"
|
|
19
21
|
{% for key, value in attrs %}
|
|
20
|
-
{% if key != 'class' %}{{ key }}="{{ value }}"{% endif %}
|
|
22
|
+
{% if key != 'class' and key != 'role' and key != 'aria-label' %}{{ key }}="{{ value }}"{% endif %}
|
|
21
23
|
{% endfor %}
|
|
22
24
|
>
|
|
23
25
|
{% for item in toasts %}
|
|
@@ -29,17 +31,18 @@
|
|
|
29
31
|
cancel=item.cancel,
|
|
30
32
|
duration=item.duration,
|
|
31
33
|
icon=item.icon,
|
|
34
|
+
close_button=item.close_button | default(true),
|
|
32
35
|
attrs=item.attrs or {}
|
|
33
36
|
) }}
|
|
34
37
|
{% endfor %}
|
|
35
38
|
{{ caller() if caller }}
|
|
36
|
-
</
|
|
39
|
+
</ol>
|
|
37
40
|
{% endmacro %}
|
|
38
41
|
|
|
39
42
|
{#
|
|
40
43
|
Renders a single toast message.
|
|
41
44
|
|
|
42
|
-
@param category {string} [optional] [default="success"] - Type of toast ('success', 'error', 'info', 'warning'). Determines icon and ARIA role.
|
|
45
|
+
@param category {string} [optional] [default="success"] - Type of toast ('success', 'error', 'info', 'warning', 'loading'). Determines icon and ARIA role.
|
|
43
46
|
@param title {string} [optional] - The main title text of the toast.
|
|
44
47
|
@param description {string} [optional] - The secondary description text.
|
|
45
48
|
@param duration {number} [optional] - Timeout in milliseconds. Use -1 to keep the toast open.
|
|
@@ -52,7 +55,8 @@
|
|
|
52
55
|
- label {string}: Button text.
|
|
53
56
|
- onclick {string}: JavaScript code to execute on click.
|
|
54
57
|
- href {string}: URL for an anchor link button.
|
|
55
|
-
@param attrs {object} [optional] - Additional HTML attributes for the toast
|
|
58
|
+
@param attrs {object} [optional] - Additional HTML attributes for the toast list item.
|
|
59
|
+
@param close_button {boolean} [optional] [default=true] - Render the close icon button.
|
|
56
60
|
#}
|
|
57
61
|
{% macro toast(
|
|
58
62
|
category="success",
|
|
@@ -62,31 +66,31 @@
|
|
|
62
66
|
cancel=None,
|
|
63
67
|
duration=None,
|
|
64
68
|
icon=None,
|
|
65
|
-
attrs={}
|
|
69
|
+
attrs={},
|
|
70
|
+
close_button=true
|
|
66
71
|
) %}
|
|
67
72
|
{% set action_href = action.href if action and action.href else (action.url if action and action.url else None) %}
|
|
68
73
|
{% set cancel_href = cancel.href if cancel and cancel.href else (cancel.url if cancel and cancel.url else None) %}
|
|
69
|
-
<
|
|
74
|
+
<li
|
|
70
75
|
class="toast {{ attrs.class }}"
|
|
71
|
-
role="{{ 'alert' if category == 'error' else 'status' }}"
|
|
72
|
-
aria-atomic="true"
|
|
73
|
-
aria-hidden="false"
|
|
74
76
|
{% if category %}data-category="{{ category }}"{% endif %}
|
|
75
|
-
{% if duration is
|
|
77
|
+
{% if duration is number %}data-duration="{{ duration }}"{% endif %}
|
|
76
78
|
{% for key, value in attrs %}
|
|
77
79
|
{% if key != 'class' %}{{ key }}="{{ value }}"{% endif %}
|
|
78
80
|
{% endfor %}
|
|
79
81
|
>
|
|
80
|
-
<div class="toast-content">
|
|
82
|
+
<div class="toast-content" role="{{ 'alert' if category == 'error' else 'status' }}" aria-atomic="true">
|
|
81
83
|
{% if icon %}
|
|
82
84
|
{{ icon | safe }}
|
|
83
|
-
{% elif category in ["error", "success", "info", "warning"] %}
|
|
85
|
+
{% elif category in ["error", "success", "info", "warning", "loading"] %}
|
|
84
86
|
{% if category == "success" %}
|
|
85
87
|
<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>
|
|
86
88
|
{% elif category == "error" %}
|
|
87
|
-
<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"><
|
|
89
|
+
<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="M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z"/><path d="m15 9-6 6"/><path d="m9 9 6 6"/></svg>
|
|
88
90
|
{% elif category == "info" %}
|
|
89
91
|
<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>
|
|
92
|
+
{% elif category == "loading" %}
|
|
93
|
+
<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 12a9 9 0 1 1-6.219-8.56"/></svg>
|
|
90
94
|
{% elif category == "warning" %}
|
|
91
95
|
<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>
|
|
92
96
|
{% endif %}
|
|
@@ -95,21 +99,19 @@
|
|
|
95
99
|
{% if title %}<h2>{{ title }}</h2>{% endif %}
|
|
96
100
|
{% if description %}<p>{{ description }}</p>{% endif %}
|
|
97
101
|
</section>
|
|
98
|
-
{% if action or cancel %}
|
|
102
|
+
{% if action or cancel or close_button %}
|
|
99
103
|
<footer>
|
|
100
104
|
{% if action %}
|
|
101
105
|
{% if action_href %}
|
|
102
106
|
<a
|
|
103
107
|
href="{{ action_href }}"
|
|
104
|
-
class="btn" data-size="sm"
|
|
105
|
-
data-toast-action
|
|
108
|
+
class="btn" data-variant="outline" data-size="sm" data-toast-action
|
|
106
109
|
>{{ action.label }}</a>
|
|
107
110
|
{% else %}
|
|
108
111
|
<button
|
|
109
112
|
type="button"
|
|
110
|
-
class="btn"
|
|
111
|
-
data-size="sm"
|
|
112
|
-
data-toast-action
|
|
113
|
+
class="btn" data-variant="outline"
|
|
114
|
+
data-size="sm" data-toast-action
|
|
113
115
|
{% if action.onclick %}onclick="{{ action.onclick }}"{% endif %}
|
|
114
116
|
>{{ action.label }}</button>
|
|
115
117
|
{% endif %}
|
|
@@ -118,20 +120,21 @@
|
|
|
118
120
|
{% if cancel_href %}
|
|
119
121
|
<a
|
|
120
122
|
href="{{ cancel_href }}"
|
|
121
|
-
class="btn" data-variant="outline" data-size="sm"
|
|
122
|
-
data-toast-cancel
|
|
123
|
+
class="btn" data-variant="outline" data-size="sm" data-toast-cancel
|
|
123
124
|
>{{ cancel.label }}</a>
|
|
124
125
|
{% else %}
|
|
125
126
|
<button
|
|
126
127
|
type="button"
|
|
127
|
-
class="btn" data-variant="outline" data-size="sm"
|
|
128
|
-
data-toast-cancel
|
|
128
|
+
class="btn" data-variant="outline" data-size="sm" data-toast-cancel
|
|
129
129
|
{% if cancel.onclick %}onclick="{{ cancel.onclick }}"{% endif %}
|
|
130
130
|
>{{ cancel.label }}</button>
|
|
131
131
|
{% endif %}
|
|
132
132
|
{% endif %}
|
|
133
|
+
{% if close_button %}
|
|
134
|
+
<button type="button" class="btn" data-variant="ghost" data-size="icon-sm" aria-label="Close toast"><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="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>
|
|
135
|
+
{% endif %}
|
|
133
136
|
</footer>
|
|
134
137
|
{% endif %}
|
|
135
138
|
</div>
|
|
136
|
-
</
|
|
139
|
+
</li>
|
|
137
140
|
{% endmacro %}
|