django-cotton-bs5 0.2.1__py3-none-any.whl
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.
- cotton_bs5/__init__.py +0 -0
- cotton_bs5/apps.py +5 -0
- cotton_bs5/static/_variables.scss +61 -0
- cotton_bs5/static/bs5/_accordion.scss +158 -0
- cotton_bs5/static/bs5/_alert.scss +68 -0
- cotton_bs5/static/bs5/_badge.scss +38 -0
- cotton_bs5/static/bs5/_breadcrumb.scss +40 -0
- cotton_bs5/static/bs5/_button-group.scss +142 -0
- cotton_bs5/static/bs5/_buttons.scss +216 -0
- cotton_bs5/static/bs5/_card.scss +239 -0
- cotton_bs5/static/bs5/_carousel.scss +236 -0
- cotton_bs5/static/bs5/_close.scss +63 -0
- cotton_bs5/static/bs5/_containers.scss +41 -0
- cotton_bs5/static/bs5/_dropdown.scss +250 -0
- cotton_bs5/static/bs5/_forms.scss +9 -0
- cotton_bs5/static/bs5/_functions.scss +302 -0
- cotton_bs5/static/bs5/_grid.scss +39 -0
- cotton_bs5/static/bs5/_helpers.scss +12 -0
- cotton_bs5/static/bs5/_images.scss +42 -0
- cotton_bs5/static/bs5/_list-group.scss +197 -0
- cotton_bs5/static/bs5/_maps.scss +174 -0
- cotton_bs5/static/bs5/_mixins.scss +42 -0
- cotton_bs5/static/bs5/_modal.scss +236 -0
- cotton_bs5/static/bs5/_nav.scss +197 -0
- cotton_bs5/static/bs5/_navbar.scss +289 -0
- cotton_bs5/static/bs5/_offcanvas.scss +143 -0
- cotton_bs5/static/bs5/_pagination.scss +109 -0
- cotton_bs5/static/bs5/_placeholders.scss +51 -0
- cotton_bs5/static/bs5/_popover.scss +196 -0
- cotton_bs5/static/bs5/_progress.scss +68 -0
- cotton_bs5/static/bs5/_reboot.scss +611 -0
- cotton_bs5/static/bs5/_root.scss +187 -0
- cotton_bs5/static/bs5/_spinners.scss +85 -0
- cotton_bs5/static/bs5/_tables.scss +171 -0
- cotton_bs5/static/bs5/_toasts.scss +73 -0
- cotton_bs5/static/bs5/_tooltip.scss +119 -0
- cotton_bs5/static/bs5/_transitions.scss +27 -0
- cotton_bs5/static/bs5/_type.scss +106 -0
- cotton_bs5/static/bs5/_utilities.scss +806 -0
- cotton_bs5/static/bs5/_variables-dark.scss +87 -0
- cotton_bs5/static/bs5/_variables.scss +1751 -0
- cotton_bs5/static/bs5/bootstrap-grid.scss +62 -0
- cotton_bs5/static/bs5/bootstrap-reboot.scss +10 -0
- cotton_bs5/static/bs5/bootstrap-utilities.scss +19 -0
- cotton_bs5/static/bs5/bootstrap.scss +52 -0
- cotton_bs5/static/bs5/forms/_floating-labels.scss +95 -0
- cotton_bs5/static/bs5/forms/_form-check.scss +189 -0
- cotton_bs5/static/bs5/forms/_form-control.scss +214 -0
- cotton_bs5/static/bs5/forms/_form-range.scss +91 -0
- cotton_bs5/static/bs5/forms/_form-select.scss +80 -0
- cotton_bs5/static/bs5/forms/_form-text.scss +11 -0
- cotton_bs5/static/bs5/forms/_input-group.scss +132 -0
- cotton_bs5/static/bs5/forms/_labels.scss +36 -0
- cotton_bs5/static/bs5/forms/_validation.scss +12 -0
- cotton_bs5/static/bs5/helpers/_clearfix.scss +3 -0
- cotton_bs5/static/bs5/helpers/_color-bg.scss +7 -0
- cotton_bs5/static/bs5/helpers/_colored-links.scss +30 -0
- cotton_bs5/static/bs5/helpers/_focus-ring.scss +5 -0
- cotton_bs5/static/bs5/helpers/_icon-link.scss +25 -0
- cotton_bs5/static/bs5/helpers/_position.scss +36 -0
- cotton_bs5/static/bs5/helpers/_ratio.scss +26 -0
- cotton_bs5/static/bs5/helpers/_stacks.scss +15 -0
- cotton_bs5/static/bs5/helpers/_stretched-link.scss +15 -0
- cotton_bs5/static/bs5/helpers/_text-truncation.scss +7 -0
- cotton_bs5/static/bs5/helpers/_visually-hidden.scss +8 -0
- cotton_bs5/static/bs5/helpers/_vr.scss +8 -0
- cotton_bs5/static/bs5/mixins/_alert.scss +18 -0
- cotton_bs5/static/bs5/mixins/_backdrop.scss +14 -0
- cotton_bs5/static/bs5/mixins/_banner.scss +7 -0
- cotton_bs5/static/bs5/mixins/_border-radius.scss +78 -0
- cotton_bs5/static/bs5/mixins/_box-shadow.scss +18 -0
- cotton_bs5/static/bs5/mixins/_breakpoints.scss +127 -0
- cotton_bs5/static/bs5/mixins/_buttons.scss +70 -0
- cotton_bs5/static/bs5/mixins/_caret.scss +69 -0
- cotton_bs5/static/bs5/mixins/_clearfix.scss +9 -0
- cotton_bs5/static/bs5/mixins/_color-mode.scss +21 -0
- cotton_bs5/static/bs5/mixins/_color-scheme.scss +7 -0
- cotton_bs5/static/bs5/mixins/_container.scss +11 -0
- cotton_bs5/static/bs5/mixins/_deprecate.scss +10 -0
- cotton_bs5/static/bs5/mixins/_forms.scss +163 -0
- cotton_bs5/static/bs5/mixins/_gradients.scss +47 -0
- cotton_bs5/static/bs5/mixins/_grid.scss +151 -0
- cotton_bs5/static/bs5/mixins/_image.scss +16 -0
- cotton_bs5/static/bs5/mixins/_list-group.scss +26 -0
- cotton_bs5/static/bs5/mixins/_lists.scss +7 -0
- cotton_bs5/static/bs5/mixins/_pagination.scss +10 -0
- cotton_bs5/static/bs5/mixins/_reset-text.scss +17 -0
- cotton_bs5/static/bs5/mixins/_resize.scss +6 -0
- cotton_bs5/static/bs5/mixins/_table-variants.scss +24 -0
- cotton_bs5/static/bs5/mixins/_text-truncate.scss +8 -0
- cotton_bs5/static/bs5/mixins/_transition.scss +26 -0
- cotton_bs5/static/bs5/mixins/_utilities.scss +97 -0
- cotton_bs5/static/bs5/mixins/_visually-hidden.scss +33 -0
- cotton_bs5/static/bs5/utilities/_api.scss +47 -0
- cotton_bs5/static/bs5/vendor/_rfs.scss +348 -0
- cotton_bs5/static/stylesheet.scss +120 -0
- cotton_bs5/templates/cotton/accordion/body.html +6 -0
- cotton_bs5/templates/cotton/accordion/header.html +12 -0
- cotton_bs5/templates/cotton/accordion/index.html +6 -0
- cotton_bs5/templates/cotton/accordion/item.html +8 -0
- cotton_bs5/templates/cotton/alert.html +11 -0
- cotton_bs5/templates/cotton/badge.html +6 -0
- cotton_bs5/templates/cotton/breadcrumbs/index.html +9 -0
- cotton_bs5/templates/cotton/breadcrumbs/item.html +13 -0
- cotton_bs5/templates/cotton/button/dismiss.html +9 -0
- cotton_bs5/templates/cotton/button/index.html +15 -0
- cotton_bs5/templates/cotton/button_group.html +9 -0
- cotton_bs5/templates/cotton/card/body.html +4 -0
- cotton_bs5/templates/cotton/card/footer.html +4 -0
- cotton_bs5/templates/cotton/card/header.html +4 -0
- cotton_bs5/templates/cotton/card/index.html +13 -0
- cotton_bs5/templates/cotton/card/subtitle.html +2 -0
- cotton_bs5/templates/cotton/card/title.html +2 -0
- cotton_bs5/templates/cotton/carousel/button.html +9 -0
- cotton_bs5/templates/cotton/carousel/caption.html +4 -0
- cotton_bs5/templates/cotton/carousel/index.html +12 -0
- cotton_bs5/templates/cotton/carousel/item.html +5 -0
- cotton_bs5/templates/cotton/collapse.html +11 -0
- cotton_bs5/templates/cotton/dropdown/divider.html +1 -0
- cotton_bs5/templates/cotton/dropdown/header.html +4 -0
- cotton_bs5/templates/cotton/dropdown/index.html +11 -0
- cotton_bs5/templates/cotton/dropdown/item.html +15 -0
- cotton_bs5/templates/cotton/dropdown/toggle.html +15 -0
- cotton_bs5/templates/cotton/grid/col.html +5 -0
- cotton_bs5/templates/cotton/grid/index.html +5 -0
- cotton_bs5/templates/cotton/list_group/index.html +11 -0
- cotton_bs5/templates/cotton/list_group/item.html +9 -0
- cotton_bs5/templates/cotton/modal/body.html +1 -0
- cotton_bs5/templates/cotton/modal/footer.html +3 -0
- cotton_bs5/templates/cotton/modal/header.html +8 -0
- cotton_bs5/templates/cotton/modal/index.html +23 -0
- cotton_bs5/templates/cotton/modal/title.html +3 -0
- cotton_bs5/templates/cotton/nav/index.html +5 -0
- cotton_bs5/templates/cotton/nav/link.html +4 -0
- cotton_bs5/templates/cotton/navbar/index.html +26 -0
- cotton_bs5/templates/cotton/navbar/link.html +9 -0
- cotton_bs5/templates/cotton/navbar/links.html +4 -0
- cotton_bs5/templates/cotton/offcanvas/body.html +2 -0
- cotton_bs5/templates/cotton/offcanvas/footer.html +6 -0
- cotton_bs5/templates/cotton/offcanvas/header.html +5 -0
- cotton_bs5/templates/cotton/offcanvas/index.html +7 -0
- cotton_bs5/templates/cotton/offcanvas/title.html +2 -0
- cotton_bs5/templates/cotton/pagination/index.html +6 -0
- cotton_bs5/templates/cotton/pagination/link.html +14 -0
- cotton_bs5/templates/cotton/placeholder.html +4 -0
- cotton_bs5/templates/cotton/progress.html +24 -0
- cotton_bs5/templates/cotton/ratio.html +5 -0
- cotton_bs5/templates/cotton/spinner.html +9 -0
- cotton_bs5/templates/cotton/table.html +15 -0
- cotton_bs5/templates/cotton/tabs/content.html +4 -0
- cotton_bs5/templates/cotton/tabs/index.html +13 -0
- cotton_bs5/templates/cotton/tabs/item.html +18 -0
- cotton_bs5/templates/cotton/tabs/pane.html +11 -0
- cotton_bs5/templates/cotton/toast/activate.html +17 -0
- cotton_bs5/templates/cotton/toast/body.html +3 -0
- cotton_bs5/templates/cotton/toast/header.html +5 -0
- cotton_bs5/templates/cotton/toast/index.html +9 -0
- django_cotton_bs5-0.2.1.dist-info/LICENSE +21 -0
- django_cotton_bs5-0.2.1.dist-info/METADATA +78 -0
- django_cotton_bs5-0.2.1.dist-info/RECORD +161 -0
- django_cotton_bs5-0.2.1.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{% load cotton %}
|
|
2
|
+
<c-vars direction="down"
|
|
3
|
+
:dir_dict="{'up': 'dropup', 'down': 'dropdown', 'left': 'dropstart', 'right':'dropend'}"
|
|
4
|
+
class />
|
|
5
|
+
<div class="{{ dir_dict|get_item:direction }} {{ class }}"
|
|
6
|
+
{{ attrs }}>
|
|
7
|
+
{{ button }}
|
|
8
|
+
<ul class="dropdown-menu">
|
|
9
|
+
{{ slot }}
|
|
10
|
+
</ul>
|
|
11
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<c-vars href text active disabled class />
|
|
2
|
+
{% if href %}
|
|
3
|
+
<a class="dropdown-item{% if active %} active{% endif %}{% if disabled %} disabled{% endif %} {{ class }}"
|
|
4
|
+
{% if disabled %}tabindex="-1" aria-disabled="true"{% endif %}
|
|
5
|
+
{{ attrs }}>
|
|
6
|
+
{{ text }} {{ slot }}
|
|
7
|
+
</a>
|
|
8
|
+
{% else %}
|
|
9
|
+
<button class="dropdown-item{% if active %} active{% endif %}{% if disabled %} disabled{% endif %} {{ class }}"
|
|
10
|
+
type="button"
|
|
11
|
+
{% if disabled %}disabled{% endif %}
|
|
12
|
+
{{ attrs }}>
|
|
13
|
+
{{ text }} {{ slot }}
|
|
14
|
+
</button>
|
|
15
|
+
{% endif %}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<c-vars variant="primary"
|
|
2
|
+
size=""
|
|
3
|
+
:caret="True"
|
|
4
|
+
split
|
|
5
|
+
disabled
|
|
6
|
+
text
|
|
7
|
+
class />
|
|
8
|
+
<button type="button"
|
|
9
|
+
class="btn{% if caret %} dropdown-toggle{% endif %} btn-{{ variant }}{% if size %} btn-{{ size }}{% endif %} {{ class }}"
|
|
10
|
+
data-bs-toggle="dropdown"
|
|
11
|
+
aria-expanded="false"
|
|
12
|
+
{% if disabled %}disabled{% endif %}
|
|
13
|
+
{{ attrs }}>
|
|
14
|
+
{{ text }} {{ slot }}
|
|
15
|
+
</button>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<c-vars cols="" gap="1" :responsive="{}" class />
|
|
2
|
+
<div class="row{% if cols %} row-cols-{{ cols }}{% endif %}{% if gap %} g-{{ gap }}{% endif %}{% for bp,cols in responsive.items %} row-cols-{{ bp }}-{{ cols }}{% endfor %} {{ class }}"
|
|
3
|
+
{{ attrs }}>
|
|
4
|
+
{{ slot }}
|
|
5
|
+
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<c-vars :flush="False"
|
|
2
|
+
:numbered="False"
|
|
3
|
+
:horizontal="False"
|
|
4
|
+
class />
|
|
5
|
+
{# djlint:off #}
|
|
6
|
+
<{% if numbered %}ol{% else %}ul{% endif %}
|
|
7
|
+
class="list-group{% if flush %} list-group-flush{% endif %}{% if horizontal %} list-group-horizontal{% if horizontal != True %}-{{ horizontal }}{% endif %}{% endif %}{{ class }}"
|
|
8
|
+
{{ attrs }}>
|
|
9
|
+
{{ slot }}
|
|
10
|
+
</{% if numbered %}ol{% else %}ul{% endif %}>
|
|
11
|
+
{# djlint:on #}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<c-vars text active disabled variant href tag="li" class />
|
|
2
|
+
{# djlint:off #}
|
|
3
|
+
<{% if href %}a href="{{ href }}"{% else %}{{ tag }}{% endif %}
|
|
4
|
+
class="list-group-item{% if href %} list-group-item-action{% endif %}{% if active %} active{% elif disabled %} disabled{% endif %}{% if variant %} list-group-item-{{ variant }}{% endif %} {{ class }}"
|
|
5
|
+
{% if active %}aria-current="true"{% elif disabled %}aria-disabled="true"{% endif %}
|
|
6
|
+
{{ attrs }}>
|
|
7
|
+
{{ text }} {{ slot }}
|
|
8
|
+
</{% if href %}a{% else %}{{ tag }}{% endif %}>
|
|
9
|
+
{# djlint:on #}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<div class="modal-body">{{ slot }}</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<c-vars id
|
|
2
|
+
fade
|
|
3
|
+
centered
|
|
4
|
+
scrollable
|
|
5
|
+
backdrop
|
|
6
|
+
size
|
|
7
|
+
class
|
|
8
|
+
dialog_attrs
|
|
9
|
+
content_class
|
|
10
|
+
content_attrs />
|
|
11
|
+
<div id="{{ id }}"
|
|
12
|
+
class="modal {% if fade %}fade{% endif %} {{ class }}"
|
|
13
|
+
tabindex="-1"
|
|
14
|
+
aria-labelledby="{{ id }}Label"
|
|
15
|
+
aria-hidden="true"
|
|
16
|
+
{{ attrs }}>
|
|
17
|
+
<div class="modal-dialog {% if centered %}modal-dialog-centered{% endif %}{% if scrollable %}modal-dialog-scrollable{% endif %}"
|
|
18
|
+
{{ dialog_attrs }}>
|
|
19
|
+
<div class="modal-content {{ content_class }}"
|
|
20
|
+
{{ content_attrs }}>{{ slot }}
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{% load i18n %}
|
|
2
|
+
<c-vars expand="lg" brand brand_href="/" class />
|
|
3
|
+
<nav class="navbar{% if expand %} navbar-expand-{{ expand }}{% endif %} {{ class }}"
|
|
4
|
+
{{ attrs }}>
|
|
5
|
+
<div class="container-fluid">
|
|
6
|
+
{% if brand %}<a class="navbar-brand" href="{{ brand_href }}">{{ brand }}</a>{% endif %}
|
|
7
|
+
{% if expand %}
|
|
8
|
+
<button class="navbar-toggler"
|
|
9
|
+
type="button"
|
|
10
|
+
data-bs-toggle="collapse"
|
|
11
|
+
data-bs-target="#navbarNav"
|
|
12
|
+
aria-controls="navbarNav"
|
|
13
|
+
aria-expanded="false"
|
|
14
|
+
aria-label="{% trans "Toggle navigation" %}">
|
|
15
|
+
<span class="navbar-toggler-icon"></span>
|
|
16
|
+
</button>
|
|
17
|
+
<div class="collapse navbar-collapse" id="navbarNav">
|
|
18
|
+
<c-navbar.links>
|
|
19
|
+
{{ slot }}
|
|
20
|
+
</c-navbar.links>
|
|
21
|
+
</div>
|
|
22
|
+
{% else %}
|
|
23
|
+
{{ slot }}
|
|
24
|
+
{% endif %}
|
|
25
|
+
</div>
|
|
26
|
+
</nav>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<c-vars text active disabled li_class class />
|
|
2
|
+
<li class="nav-item {{ li_class }}">
|
|
3
|
+
<a class="nav-link{% if active %} active{% endif %}{% if disabled %} disabled{% endif %} {{ class }}"
|
|
4
|
+
{% if active %}aria-current="page"{% endif %}
|
|
5
|
+
{% if disabled %}tabindex="-1" aria-disabled="true"{% endif %}
|
|
6
|
+
{{ attrs }}>
|
|
7
|
+
{{ text }} {{ slot }}
|
|
8
|
+
</a>
|
|
9
|
+
</li>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<c-vars placement="start" breakpoint class />
|
|
2
|
+
<div class="{% if breakpoint %}offcanvas-{{ breakpoint }} {% else %}offcanvas{% endif %} offcanvas-{{ placement }} {{ class }}"
|
|
3
|
+
tabindex="-1"
|
|
4
|
+
aria-labelledby="{{ id }}Label"
|
|
5
|
+
aria-hidden="true"
|
|
6
|
+
{{ attrs }}>{{ slot }}
|
|
7
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<c-vars page text active disabled class />
|
|
2
|
+
<li class="page-item{% if active %} active{% endif %}{% if disabled %} disabled{% endif %}">
|
|
3
|
+
{% if disabled %}
|
|
4
|
+
<span class="page-link {{ class }}" {{ attrs }}>{{ text }} {{ slot }}</span>
|
|
5
|
+
{% else %}
|
|
6
|
+
<a class="page-link {{ class }}"
|
|
7
|
+
href="?page={{ page }}"
|
|
8
|
+
{% if active %}aria-current="page"{% endif %}
|
|
9
|
+
{% if disabled %}tabindex="-1" aria-disabled="true"{% endif %}
|
|
10
|
+
{{ attrs }}>
|
|
11
|
+
{{ text }} {{ slot }}
|
|
12
|
+
</a>
|
|
13
|
+
{% endif %}
|
|
14
|
+
</li>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<c-vars width="12" size="" glow wave />
|
|
2
|
+
<div class="{% if glow or wave %}placeholder-{% if glow %}glow{% elif wave %}wave{% endif %} {% endif %}">
|
|
3
|
+
<span class="placeholder col-{{ width }}{% if size %} placeholder-{{ size }}{% endif %} {{ class }} {% if variant %}bg-{{ variant }}{% endif %}"></span>
|
|
4
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{% load i18n %}
|
|
2
|
+
<c-vars value
|
|
3
|
+
:min="0"
|
|
4
|
+
:max="100"
|
|
5
|
+
text
|
|
6
|
+
label
|
|
7
|
+
variant="primary"
|
|
8
|
+
striped
|
|
9
|
+
animated
|
|
10
|
+
class />
|
|
11
|
+
{% trans "Progress" as default_label %}
|
|
12
|
+
<div class="progress {{ class }}"
|
|
13
|
+
role="progressbar"
|
|
14
|
+
aria-label="{% firstof label default_label %}"
|
|
15
|
+
aria-valuenow="{{ value }}"
|
|
16
|
+
aria-valuemin="{{ min }}"
|
|
17
|
+
aria-valuemax="{{ max }}"
|
|
18
|
+
{{ attrs }}>
|
|
19
|
+
<div class="progress-bar bg-{{ variant }}{% if striped %} progress-bar-striped{% endif %}{% if animated %} progress-bar-animated{% endif %}"
|
|
20
|
+
style="width: calc(({{ value }} - {{ min }}) / ({{ max }} - {{ min }}) * 100%)">
|
|
21
|
+
{{ text }}
|
|
22
|
+
{{ slot }}
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{% load i18n %}
|
|
2
|
+
<c-vars type="border" size variant label class />
|
|
3
|
+
{% trans "Loading..." as default_label %}
|
|
4
|
+
<div class="spinner-{{ type }}{% if size %} spinner-{{ type }}-{{ size }}{% endif %}{% if variant %} text-{{ variant }}{% endif %} {{ class }}"
|
|
5
|
+
role="status"
|
|
6
|
+
{{ attrs }}>
|
|
7
|
+
<span class="visually-hidden">{% firstof label default_label %}</span>
|
|
8
|
+
{{ slot }}
|
|
9
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<c-vars striped
|
|
2
|
+
bordered
|
|
3
|
+
hover
|
|
4
|
+
responsive
|
|
5
|
+
small
|
|
6
|
+
variant
|
|
7
|
+
caption
|
|
8
|
+
class />
|
|
9
|
+
<div class="table-responsive{% if responsive %}-{{ responsive }}{% endif %}">
|
|
10
|
+
<table class="table{% if small %} table-sm{% endif %}{% if striped %} table-striped{% endif %}{% if bordered %} table-bordered{% endif %}{% if hover %} table-hover{% endif %}{% if variant %} table-{{ variant }}{% endif %} {{ class }}"
|
|
11
|
+
{{ attrs }}>
|
|
12
|
+
{% if caption %}<caption>{{ caption }}</caption>{% endif %}
|
|
13
|
+
{{ slot }}
|
|
14
|
+
</table>
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<c-vars type vertical fill justify class />
|
|
2
|
+
{# djlint:off #}
|
|
3
|
+
<ul class="nav {% if type %}nav-{{ type }}{% endif %}
|
|
4
|
+
{% if fill %}nav-fill{% endif %}
|
|
5
|
+
{% if justify %} nav-justify{% endif %}
|
|
6
|
+
{% if vertical %} flex-column{% endif %}
|
|
7
|
+
{{ class }}"
|
|
8
|
+
role="tablist"
|
|
9
|
+
{% if vertical %} aria-orientation="vertical"{% endif %}
|
|
10
|
+
{{ attrs }}>
|
|
11
|
+
{{ slot }}
|
|
12
|
+
</ul>
|
|
13
|
+
{# djlint:on #}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<c-vars target active disabled text class />
|
|
2
|
+
{# djlint:off #}
|
|
3
|
+
<li class="nav-item" role="presentation">
|
|
4
|
+
<button class="nav-link{% if active %} active{% endif %} {{ class }}"
|
|
5
|
+
id="{{ target }}-tab"
|
|
6
|
+
data-bs-toggle="tab"
|
|
7
|
+
data-bs-target="#{{ target }}"
|
|
8
|
+
aria-controls="{{ target }}"
|
|
9
|
+
aria-selected="{% if active %}true{% else %}false{% endif %}"
|
|
10
|
+
tabindex="{% if active %}0{% else %}-1{% endif %}"
|
|
11
|
+
{% if disabled %}disabled aria-disabled="true"{% endif %}
|
|
12
|
+
type="button"
|
|
13
|
+
role="tab"
|
|
14
|
+
{{ attrs }}>
|
|
15
|
+
{{ text }} {{ slot }}
|
|
16
|
+
</button>
|
|
17
|
+
</li>
|
|
18
|
+
{# djlint:on #}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<c-vars id active show class />
|
|
2
|
+
{# djlint:off #}
|
|
3
|
+
<div id="{{ id }}"
|
|
4
|
+
class="tab-pane{% if active %} active{% endif %}{% if show %} show{% endif %} {{ class }}"
|
|
5
|
+
role="tabpanel"
|
|
6
|
+
aria-labelledby="{{ id }}-tab"
|
|
7
|
+
tabindex="{% if active %}0{% else %}-1{% endif %}"
|
|
8
|
+
{{ attrs }}>
|
|
9
|
+
{{ slot }}
|
|
10
|
+
</div>
|
|
11
|
+
{# djlint:on #}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
// Initialize all toasts
|
|
3
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
4
|
+
var toastElList = [].slice.call(document.querySelectorAll('.toast'));
|
|
5
|
+
var toastList = toastElList.map(function(toastEl) {
|
|
6
|
+
return new bootstrap.Toast(toastEl);
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
// Auto-show toasts that don't have autohide disabled
|
|
10
|
+
toastList.forEach(function(toast) {
|
|
11
|
+
var toastEl = toast._element;
|
|
12
|
+
if (toastEl.dataset.bsAutohide !== 'false') {
|
|
13
|
+
toast.show();
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
</script>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<c-vars :autohide="True" delay="5000" class />
|
|
2
|
+
<div class="toast {{ class }}"
|
|
3
|
+
role="alert"
|
|
4
|
+
aria-live="assertive"
|
|
5
|
+
aria-atomic="true"
|
|
6
|
+
{% if autohide %}data-bs-autohide="true" data-bs-delay="{{ delay }}"{% else %}data-bs-autohide="false"{% endif %}
|
|
7
|
+
{{ attrs }}>
|
|
8
|
+
{{ slot }}
|
|
9
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Samuel Jennings
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: django-cotton-bs5
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Bootstrap 5 components for use with Django Cotton.
|
|
5
|
+
License: MIT
|
|
6
|
+
Author: Sam
|
|
7
|
+
Author-email: samuel.scott.jennings@gmail.com
|
|
8
|
+
Requires-Python: >=3.10,<4.0
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Provides-Extra: django-compressor
|
|
15
|
+
Requires-Dist: django-compressor (>=4.5.1,<5.0.0) ; extra == "django-compressor"
|
|
16
|
+
Requires-Dist: django-cotton (>2.1)
|
|
17
|
+
Requires-Dist: django-libsass (>=0.9,<0.10)
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# Django Cotton BS5
|
|
21
|
+
|
|
22
|
+
Bootstrap 5 components for Django Cotton - A comprehensive library of reusable, modular components.
|
|
23
|
+
|
|
24
|
+
**Note:** This project is currently a work in progress. Users are encouraged to request new components or features via the [issue tracker](https://github.com/SamuelJennings/cotton-bs5/issues).
|
|
25
|
+
|
|
26
|
+
[View demo](https://samueljennings.github.io/cotton-bs5/)
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install cotton-bs5
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Add `cotton_bs5` to your `INSTALLED_APPS` in `settings.py`:
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
INSTALLED_APPS = [
|
|
38
|
+
...
|
|
39
|
+
"django_cotton",
|
|
40
|
+
"cotton_bs5",
|
|
41
|
+
...
|
|
42
|
+
]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Available Components
|
|
46
|
+
|
|
47
|
+
The following Bootstrap 5 components are currently available as Django Cotton components:
|
|
48
|
+
|
|
49
|
+
- **Alert** (`<c-alert>`) — Bootstrap alerts with variants, dismissible, slot/text support
|
|
50
|
+
- **Accordion** (`<c-accordion>`, `<c-accordion.item>`, `<c-accordion.header>`) — Collapsible accordion panels
|
|
51
|
+
- **Breadcrumbs** (`<c-breadcrumbs>`, `<c-breadcrumbs.item>`) — Navigation breadcrumbs
|
|
52
|
+
- **Button** (`<c-button>`) — Button/link with variants, outline, icon, slot/text
|
|
53
|
+
- **Button Group** (`<c-button_group>`) — Grouped buttons, vertical/size/label support
|
|
54
|
+
- **Card** (`<c-card>`, `<c-card.body>`, `<c-card.title>`) — Card container, body, and title
|
|
55
|
+
- **List Group** (`<c-list_group>`, `<c-list_group.item>`) — List group and items, horizontal/numbered/active/disabled
|
|
56
|
+
- **Modal** (`<c-modal>`, `<c-modal.title>`, `<c-modal.body>`) — Modal dialog, title, and body
|
|
57
|
+
- **Navbar** (`<c-navbar>`) — Responsive navigation bar with brand, expand, toggler
|
|
58
|
+
- **Progress** (`<c-progress>`) — Progress bar with value, min/max, variant, striped, animated, label
|
|
59
|
+
- **Spinner** (`<c-spinner>`) — Loading spinner, border/grow, size, variant, label
|
|
60
|
+
- **Table** (`<c-table>`) — Responsive table, striped, bordered, hover, small, variant, caption
|
|
61
|
+
- **Tabs** (`<c-tabs>`, `<c-tabs.item>`, `<c-tabs.pane>`) — Tab navigation and tab panes
|
|
62
|
+
|
|
63
|
+
More components are planned. Please request additional Bootstrap 5 components or features via the [issue tracker](https://github.com/SamuelJennings/cotton-bs5/issues).
|
|
64
|
+
|
|
65
|
+
## Contributing
|
|
66
|
+
|
|
67
|
+
This library follows django-cotton conventions and Bootstrap 5 standards. When adding new components:
|
|
68
|
+
|
|
69
|
+
1. Use `<c-vars />` for default values
|
|
70
|
+
2. Include proper accessibility attributes
|
|
71
|
+
3. Support all relevant Bootstrap 5 options
|
|
72
|
+
4. Maintain consistent naming conventions
|
|
73
|
+
5. Test with various configurations
|
|
74
|
+
|
|
75
|
+
## License
|
|
76
|
+
|
|
77
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
78
|
+
|