@alvaromarinho/ui-bootstrap 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +10 -2
- package/package.json +38 -4
- package/ui-bootstrap.css +138 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alvaro Marinho
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @alvaromarinho/ui-bootstrap
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Bootstrap 5.3 skin for [`@alvaromarinho/ui-core`](../ui-core). CSS only: it maps the `--am-*` tokens to Bootstrap variables (`--bs-body-bg`, `--bs-border-radius`, `--bs-box-shadow`, theme colors), so dialogs, menus and toasts follow the project's Bootstrap theme, including `data-bs-theme="dark"`.
|
|
4
|
+
|
|
5
|
+
```css
|
|
6
|
+
@import 'bootstrap/dist/css/bootstrap.css';
|
|
7
|
+
@import '@alvaromarinho/ui-core/ui-core.css';
|
|
8
|
+
@import '@alvaromarinho/ui-bootstrap/ui-bootstrap.css';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Toasts use the same colors as `.text-bg-{style}`. Nothing structural lives here: layout and behavior come from `ui-core.css`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alvaromarinho/ui-bootstrap",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Bootstrap 5 skin for @alvaromarinho/ui-core: maps the --am-* tokens to Bootstrap variables",
|
|
5
|
+
"author": "Alvaro Marinho",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"bootstrap",
|
|
9
|
+
"bootstrap5",
|
|
10
|
+
"dialog",
|
|
11
|
+
"toast",
|
|
12
|
+
"ui"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/alvaromarinho/libs/tree/master/projects/ui-bootstrap#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/alvaromarinho/libs/issues"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/alvaromarinho/libs.git",
|
|
21
|
+
"directory": "projects/ui-bootstrap"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"exports": {
|
|
27
|
+
"./ui-bootstrap.css": "./ui-bootstrap.css"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"ui-bootstrap.css",
|
|
31
|
+
"README.md"
|
|
32
|
+
],
|
|
33
|
+
"sideEffects": [
|
|
34
|
+
"*.css"
|
|
35
|
+
],
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"@alvaromarinho/ui-core": "^0.1.0",
|
|
38
|
+
"bootstrap": "^5.3.0"
|
|
39
|
+
}
|
|
40
|
+
}
|
package/ui-bootstrap.css
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/* =====================================================================
|
|
2
|
+
@alvaromarinho/ui-bootstrap: ui-core skin on top of Bootstrap 5.3
|
|
3
|
+
Only maps the --am-* tokens to --bs-* variables. Nothing structural here.
|
|
4
|
+
===================================================================== */
|
|
5
|
+
|
|
6
|
+
:where(:root, [data-bs-theme]) {
|
|
7
|
+
--am-bg: var(--bs-body-bg);
|
|
8
|
+
--am-fg: var(--bs-body-color);
|
|
9
|
+
--am-border-color: var(--bs-border-color-translucent);
|
|
10
|
+
--am-border-width: var(--bs-border-width);
|
|
11
|
+
--am-radius: var(--bs-border-radius);
|
|
12
|
+
--am-radius-lg: var(--bs-border-radius-lg);
|
|
13
|
+
--am-shadow: var(--bs-box-shadow);
|
|
14
|
+
--am-shadow-lg: var(--bs-box-shadow-lg);
|
|
15
|
+
--am-primary: var(--bs-primary);
|
|
16
|
+
--am-success: var(--bs-success);
|
|
17
|
+
--am-danger: var(--bs-danger);
|
|
18
|
+
--am-warning: var(--bs-warning);
|
|
19
|
+
--am-info: var(--bs-info);
|
|
20
|
+
--am-primary-fg: var(--bs-white);
|
|
21
|
+
--am-muted: var(--bs-secondary-color);
|
|
22
|
+
--am-hover: var(--bs-tertiary-bg);
|
|
23
|
+
--am-focus: rgba(var(--bs-primary-rgb), 0.5);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* =====================================================================
|
|
27
|
+
Toast: same colors as .text-bg-* (solid background, contrast text)
|
|
28
|
+
===================================================================== */
|
|
29
|
+
|
|
30
|
+
.am-toast {
|
|
31
|
+
--am-toast-border: transparent;
|
|
32
|
+
--am-toast-icon-color: currentColor;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.am-toast:where([data-am-style="primary"]) { --am-toast-bg: var(--bs-primary); --am-toast-fg: #fff; }
|
|
36
|
+
.am-toast:where([data-am-style="secondary"]) { --am-toast-bg: var(--bs-secondary); --am-toast-fg: #fff; }
|
|
37
|
+
.am-toast:where([data-am-style="success"]) { --am-toast-bg: var(--bs-success); --am-toast-fg: #fff; }
|
|
38
|
+
.am-toast:where([data-am-style="danger"]) { --am-toast-bg: var(--bs-danger); --am-toast-fg: #fff; }
|
|
39
|
+
.am-toast:where([data-am-style="warning"]) { --am-toast-bg: var(--bs-warning); --am-toast-fg: #000; }
|
|
40
|
+
.am-toast:where([data-am-style="info"]) { --am-toast-bg: var(--bs-info); --am-toast-fg: #000; }
|
|
41
|
+
.am-toast:where([data-am-style="light"]) { --am-toast-bg: var(--bs-light); --am-toast-fg: #000; }
|
|
42
|
+
.am-toast:where([data-am-style="dark"]) { --am-toast-bg: var(--bs-dark); --am-toast-fg: #fff; }
|
|
43
|
+
|
|
44
|
+
/* =====================================================================
|
|
45
|
+
Menu: .dropdown-item, -divider and -header read variables Bootstrap only sets on .dropdown-menu
|
|
46
|
+
===================================================================== */
|
|
47
|
+
|
|
48
|
+
.am-menu {
|
|
49
|
+
--bs-dropdown-item-padding-x: 1rem;
|
|
50
|
+
--bs-dropdown-item-padding-y: 0.25rem;
|
|
51
|
+
--bs-dropdown-item-border-radius: 0;
|
|
52
|
+
--bs-dropdown-link-color: var(--bs-body-color);
|
|
53
|
+
--bs-dropdown-link-hover-color: var(--bs-body-color);
|
|
54
|
+
--bs-dropdown-link-hover-bg: var(--bs-tertiary-bg);
|
|
55
|
+
--bs-dropdown-link-active-color: #fff;
|
|
56
|
+
--bs-dropdown-link-active-bg: var(--bs-primary);
|
|
57
|
+
--bs-dropdown-link-disabled-color: var(--bs-tertiary-color);
|
|
58
|
+
--bs-dropdown-divider-bg: var(--bs-border-color-translucent);
|
|
59
|
+
--bs-dropdown-divider-margin-y: 0.5rem;
|
|
60
|
+
--bs-dropdown-header-color: var(--bs-secondary-color);
|
|
61
|
+
--bs-dropdown-header-padding-x: 1rem;
|
|
62
|
+
--bs-dropdown-header-padding-y: 0.5rem;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* =====================================================================
|
|
66
|
+
Dialog: showModal() focuses the close button; Bootstrap paints the ring on :focus,
|
|
67
|
+
so it showed on every open by mouse or touch. Keyboard keeps the ring.
|
|
68
|
+
===================================================================== */
|
|
69
|
+
|
|
70
|
+
.am-dialog .btn-close:not(:focus-visible),
|
|
71
|
+
.am-sheet .btn-close:not(:focus-visible),
|
|
72
|
+
.am-drawer .btn-close:not(:focus-visible) {
|
|
73
|
+
--bs-btn-close-focus-shadow: none;
|
|
74
|
+
--bs-btn-close-focus-opacity: var(--bs-btn-close-opacity);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* =====================================================================
|
|
78
|
+
Table: card mode drops the row borders of .table (they beat one class)
|
|
79
|
+
===================================================================== */
|
|
80
|
+
|
|
81
|
+
@container am-table (width < 36rem) {
|
|
82
|
+
.am-table-cards .table > :where(.am-table-body) > tr > td {
|
|
83
|
+
padding-inline: 0;
|
|
84
|
+
border-block-end: 0;
|
|
85
|
+
box-shadow: none;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.am-table-cards .table > :where(.am-table-body) > tr {
|
|
89
|
+
box-shadow: var(--bs-box-shadow-sm);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* =====================================================================
|
|
94
|
+
Pagination: <nav class="am-pagination"> around Bootstrap's .pagination
|
|
95
|
+
===================================================================== */
|
|
96
|
+
|
|
97
|
+
.am-pagination :where(.page-link[aria-current="page"]) {
|
|
98
|
+
z-index: 3;
|
|
99
|
+
border-color: var(--bs-pagination-active-border-color);
|
|
100
|
+
background-color: var(--bs-pagination-active-bg);
|
|
101
|
+
color: var(--bs-pagination-active-color);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.am-pagination :where(.page-link:disabled) {
|
|
105
|
+
border-color: var(--bs-pagination-disabled-border-color);
|
|
106
|
+
background-color: var(--bs-pagination-disabled-bg);
|
|
107
|
+
color: var(--bs-pagination-disabled-color);
|
|
108
|
+
opacity: 1;
|
|
109
|
+
pointer-events: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* =====================================================================
|
|
113
|
+
Combobox: the wrapper looks like .form-control
|
|
114
|
+
===================================================================== */
|
|
115
|
+
|
|
116
|
+
.am-combobox {
|
|
117
|
+
--am-field-padding: 0.375rem 0.75rem;
|
|
118
|
+
--am-field-border-color: var(--bs-border-color);
|
|
119
|
+
--am-disabled-bg: var(--bs-secondary-bg);
|
|
120
|
+
min-block-size: calc(1.5em + 0.75rem + calc(var(--bs-border-width) * 2));
|
|
121
|
+
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.am-combobox:focus-within {
|
|
125
|
+
border-color: rgba(var(--bs-primary-rgb), 0.5);
|
|
126
|
+
outline: 0;
|
|
127
|
+
box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.am-combobox:where(.is-invalid, :has(> input[aria-invalid="true"])) {
|
|
131
|
+
border-color: var(--bs-form-invalid-border-color);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@media (prefers-reduced-motion: reduce) {
|
|
135
|
+
.am-combobox {
|
|
136
|
+
transition: none;
|
|
137
|
+
}
|
|
138
|
+
}
|