@angular-bootstrap/ngbootstrap 2.1.1 → 2.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/CHANGELOG.md +38 -0
- package/README.md +9 -0
- package/RELEASE_NOTES.md +41 -23
- package/THEMING.md +271 -0
- package/fesm2022/angular-bootstrap-ngbootstrap.mjs +605 -90
- package/fesm2022/angular-bootstrap-ngbootstrap.mjs.map +1 -1
- package/package.json +15 -5
- package/src/ai/README.md +134 -0
- package/src/styles/_controls.scss +86 -0
- package/src/styles/_drag-drop.scss +3 -0
- package/src/styles/_tokens.scss +6 -0
- package/src/styles/integrations/tailwind.css +37 -0
- package/src/styles/styles.css +12 -19
- package/src/styles/themes/_bootstrap.scss +48 -0
- package/src/styles/themes/_material.scss +44 -0
- package/src/styles/themes/_presets.scss +344 -0
- package/src/styles/themes/_tailwind.scss +32 -0
- package/src/styles/themes.scss +3 -0
- package/types/angular-bootstrap-ngbootstrap.d.ts +155 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.2.0 - 2026-09-16
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Five standalone, provider-independent AI controls: Prompt Box, AI Chat, Inline AI Prompt, AI Prompt workspace, and Smart Paste. Exported from the package root.
|
|
8
|
+
- Typed request, response, feedback, and reviewed-field events; application-owned streaming, cancellation, errors, and persistence.
|
|
9
|
+
- Shared `--ngb-*` theme tokens, Bootstrap defaults, optional Material/Tailwind variable mappings, and named palettes.
|
|
10
|
+
- Optional Tailwind v4 utility preset and token/theme integration documentation.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- DataGrid consumes shared tokens and preserves theme values in portaled filter panels.
|
|
15
|
+
- Shared theme coverage for pagination/pager, stepper, splitter, tree, typeahead, chips, and drag/drop styles and JSON preview.
|
|
16
|
+
- AI controls provide keyboard instructions, busy-state focus continuity, expanded-panel relationships, live status announcements, and keyboard-focusable review regions.
|
|
17
|
+
- Release validation checks AI exports, theme assets, and optional Tailwind integration packaging.
|
|
18
|
+
- Patched vulnerable transitive build/test dependencies and synchronized the optional Tailwind peer in the lockfile.
|
|
19
|
+
|
|
20
|
+
### Compatibility
|
|
21
|
+
|
|
22
|
+
- Bootstrap remains the default; existing DataGrid theme selection remains supported.
|
|
23
|
+
- Angular peer range remains `>=21.0.0 <23.0.0`. No AI provider or Angular Material dependency.
|
|
24
|
+
- Tailwind is an optional peer, required only when compiling the utility integration.
|
|
25
|
+
- AI output is plain text. Attachments, voice, Markdown rendering, AI Grid features, and WebMCP are outside this release.
|
|
26
|
+
|
|
27
|
+
## 2.1.2 - 2026-07-27
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- Removed an unused standalone directive import that created a circular DataGrid dependency and caused the published FESM bundle to throw `Cannot access 'Datagrid' before initialization` in Jest and other direct bundle-loading environments.
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- Extended release package verification to import the built FESM bundle and confirm that `Datagrid` and `NgbGridHighlightDirective` initialize and remain publicly exported.
|
|
36
|
+
|
|
37
|
+
### Compatibility
|
|
38
|
+
|
|
39
|
+
- No public component APIs, selectors, inputs, outputs, or Angular peer ranges changed.
|
|
40
|
+
|
|
3
41
|
## 2.1.1 - 2026-07-27
|
|
4
42
|
|
|
5
43
|
### Security
|
package/README.md
CHANGED
|
@@ -12,6 +12,7 @@ Angular UI for data-heavy apps, with a focus on DataGrid depth, Angular-native F
|
|
|
12
12
|
- Splitter
|
|
13
13
|
- Stepper
|
|
14
14
|
- Chips
|
|
15
|
+
- AI UI: Prompt Box, Chat, draft workspace, inline edits, and reviewed Smart Paste
|
|
15
16
|
- Drag and drop
|
|
16
17
|
- Angular-native Form Builder workflows
|
|
17
18
|
|
|
@@ -23,6 +24,9 @@ Those projects focus mainly on Bootstrap components for Angular. `@angular-boots
|
|
|
23
24
|
|
|
24
25
|
## Requirements
|
|
25
26
|
|
|
27
|
+
For shared Bootstrap, Material, and Tailwind themes, palette swatches,
|
|
28
|
+
installation, the optional Tailwind v4 utility preset, and CSS overrides, see the [theme reference and audit](THEMING.md).
|
|
29
|
+
|
|
26
30
|
- Angular `>=21.0.0 <23.0.0`
|
|
27
31
|
- RxJS `^7.8.0`
|
|
28
32
|
- Bootstrap CSS in the consuming app
|
|
@@ -102,8 +106,13 @@ export class UsersGridComponent {
|
|
|
102
106
|
|
|
103
107
|
```bash
|
|
104
108
|
pnpm install
|
|
109
|
+
pnpm lint
|
|
105
110
|
pnpm test
|
|
106
111
|
pnpm build
|
|
112
|
+
pnpm release:verify
|
|
113
|
+
pnpm security:audit
|
|
107
114
|
```
|
|
108
115
|
|
|
109
116
|
Build output is written to `dist/`.
|
|
117
|
+
|
|
118
|
+
For provider-independent assistant controls and request lifecycle guidance, see the [AI UI reference](src/ai/README.md).
|
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,26 +1,44 @@
|
|
|
1
|
-
# @angular-bootstrap/ngbootstrap 2.
|
|
2
|
-
|
|
3
|
-
This
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
1
|
+
# @angular-bootstrap/ngbootstrap 2.2.0
|
|
2
|
+
|
|
3
|
+
This minor release adds provider-independent AI UI components and a shared
|
|
4
|
+
CSS-token theme layer for Angular applications using Bootstrap 5.
|
|
5
|
+
|
|
6
|
+
## Added
|
|
7
|
+
|
|
8
|
+
- Prompt Box, AI Chat, Inline AI Prompt, AI Prompt workspace, and Smart Paste,
|
|
9
|
+
exported from the package root with typed messages and events.
|
|
10
|
+
- Original task, conversation, contextual editing, draft-review, and field-review
|
|
11
|
+
workflows. Applications own model requests, streaming, cancellation, and storage.
|
|
12
|
+
- Shared `--ngb-*` tokens, Bootstrap defaults, Material/Tailwind variable bridges,
|
|
13
|
+
palette presets, and optional Tailwind v4 utility integration.
|
|
14
|
+
|
|
15
|
+
## Improved
|
|
16
|
+
|
|
17
|
+
- DataGrid theme selection, token consumption, swatches, and portaled filter menus.
|
|
18
|
+
- Shared theming across pager/pagination, stepper, splitter, tree, typeahead,
|
|
19
|
+
chips, drag/drop styling, and JSON preview.
|
|
20
|
+
- AI keyboard instructions, stable Send/Stop controls, read-only busy inputs,
|
|
21
|
+
expanded-panel relationships, focus restoration, live announcements, and
|
|
22
|
+
keyboard-focusable draft review.
|
|
23
|
+
- Package validation for AI exports and theme assets; patched transitive tooling
|
|
24
|
+
dependencies and synchronized optional-peer lockfile metadata.
|
|
25
|
+
|
|
26
|
+
## Validation and limits
|
|
27
|
+
|
|
28
|
+
- 414 library tests, including 42 AI tests; lint, package build, and package checks.
|
|
29
|
+
- Tarball consumer template compilation on Angular 21 and Angular 22.
|
|
30
|
+
- Browser keyboard checks and desktop/mobile theme checks.
|
|
31
|
+
- Audit passes the high-severity threshold. Three moderate advisories remain in
|
|
32
|
+
the Angular 22.0.8 development dependencies; Angular is a consumer peer, not
|
|
33
|
+
bundled into the library runtime.
|
|
34
|
+
- Manual VoiceOver/NVDA testing has not been performed. Accessibility support is
|
|
35
|
+
not a WCAG certification.
|
|
22
36
|
|
|
23
37
|
## Compatibility
|
|
24
38
|
|
|
25
|
-
|
|
26
|
-
|
|
39
|
+
Bootstrap remains the default. Angular peers remain `>=21.0.0 <23.0.0`.
|
|
40
|
+
Angular Material and AI provider SDKs are not dependencies. Tailwind is optional.
|
|
41
|
+
AI responses render plain text; Markdown, attachments, voice, AI Grid features,
|
|
42
|
+
and WebMCP are not included.
|
|
43
|
+
|
|
44
|
+
See `THEMING.md` and `src/ai/README.md` for setup and behavior details.
|
package/THEMING.md
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# Shared component themes
|
|
2
|
+
|
|
3
|
+
## Audit and compatibility
|
|
4
|
+
|
|
5
|
+
DataGrid already had a real token layer before scoped themes were added:
|
|
6
|
+
82 distinct `--dg-*` names across its styles, covering surfaces, text, borders,
|
|
7
|
+
status colors, selection, hover, focus, shadows, radii, cell/header padding,
|
|
8
|
+
control sizing, typography, and pagination. `_datagrid-tokens.scss` supplied
|
|
9
|
+
Bootstrap mappings and named Bootstrap, Material, and Tailwind palettes.
|
|
10
|
+
The `theme` input defaults to `bootstrap` and writes `data-theme` on the grid.
|
|
11
|
+
|
|
12
|
+
The gap was not a missing design system. There were no shared `--ngb-*` visual
|
|
13
|
+
tokens, no `data-ngb-theme` wrapper support, and the Material palettes were
|
|
14
|
+
fixed values rather than Angular Material system-variable mappings. Floating
|
|
15
|
+
filter menus copied only the named theme when moving to `document.body`, so
|
|
16
|
+
ancestor-scoped values would have been lost.
|
|
17
|
+
|
|
18
|
+
| Audit area | Finding before this change |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| `--ngb-*` in SCSS/CSS | Only the stepper animation-duration hook; no shared visual token layer |
|
|
21
|
+
| Direct `--bs-*` use in DataGrid | 68 references, almost all in the Bootstrap token mixin; one overlay control-radius rule |
|
|
22
|
+
| Hardcoded colors and shadows | Primarily fallback values and named palettes; a grouping error tint also mixed with hardcoded white |
|
|
23
|
+
| Radius | Most uses tokenized; some filter controls used `0.375rem`; pill/handle shapes intentionally use fixed radii |
|
|
24
|
+
| Spacing and fonts | Cell/header padding and font sizes tokenized; many local gaps, button paddings, and small labels remain fixed; font family inherited |
|
|
25
|
+
| Other components | Stepper, drag-drop CSS, pagination inline styles, and JSON preview still reference Bootstrap directly |
|
|
26
|
+
|
|
27
|
+
This change adds a small public layer above `--dg-*`; it does not replace the
|
|
28
|
+
existing DataGrid palettes. Shared tokens now also cover Stepper, Splitter, Tree, Typeahead, Chips, Pager, pagination, drag/drop feedback, and JSON preview. Bootstrap markup and base CSS
|
|
29
|
+
remain part of the library's styling requirements. Material theming is a token
|
|
30
|
+
bridge, not an implementation of Angular Material components.
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
Keep Bootstrap 5 CSS installed. Load the shared theme entry once in application
|
|
35
|
+
global styles, after Bootstrap, including when using individual component entry points:
|
|
36
|
+
|
|
37
|
+
```scss
|
|
38
|
+
@use 'sass:meta';
|
|
39
|
+
@import 'bootstrap/dist/css/bootstrap.min.css';
|
|
40
|
+
@include meta.load-css('@angular-bootstrap/ngbootstrap/src/styles/themes');
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`src/styles/themes.scss` is shipped as a package asset. DataGrid also includes
|
|
44
|
+
the Bootstrap and Material mappings for compatibility with existing grid-only consumers. No Angular
|
|
45
|
+
Material or Tailwind dependency is required.
|
|
46
|
+
|
|
47
|
+
```html
|
|
48
|
+
<!-- Bootstrap remains the default. -->
|
|
49
|
+
<ngb-datagrid [columns]="columns" [data]="rows" />
|
|
50
|
+
|
|
51
|
+
<!-- Multiple themes can coexist on the same page. -->
|
|
52
|
+
<div data-ngb-theme="material">
|
|
53
|
+
<ngb-datagrid [columns]="columns" [data]="rows" />
|
|
54
|
+
|
|
55
|
+
<div data-ngb-theme="bootstrap">
|
|
56
|
+
<ngb-datagrid [columns]="columns" [data]="rows" />
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
For scoped themes, leave the grid's `theme` input at `bootstrap` (its default).
|
|
62
|
+
Existing explicit named palettes, including `[theme]="'material'"`, remain
|
|
63
|
+
compatible and retain their palette overrides; that input is not the new
|
|
64
|
+
Angular Material bridge. Prefer the wrapper for Material system-variable use.
|
|
65
|
+
|
|
66
|
+
The nearest theme wrapper wins. Set `--ngb-*` overrides on that wrapper or on
|
|
67
|
+
the grid host. Existing `--dg-*` overrides directly on `.ngb-grid` remain valid.
|
|
68
|
+
|
|
69
|
+
```css
|
|
70
|
+
.orders[data-ngb-theme="material"] {
|
|
71
|
+
--ngb-density-row-height: 52px;
|
|
72
|
+
--ngb-radius-md: 8px;
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Bootstrap defaults are fallback chains evaluated on the grid, not aliases
|
|
77
|
+
installed globally on `:root`. This preserves local `--bs-*` overrides,
|
|
78
|
+
`data-bs-theme` scopes, and existing inherited fonts. An explicit Bootstrap
|
|
79
|
+
wrapper defines the same public token names so it can reset a nested Material
|
|
80
|
+
scope. For a scoped dark Bootstrap theme, put `data-bs-theme="dark"` on that
|
|
81
|
+
wrapper (or above it).
|
|
82
|
+
|
|
83
|
+
## Public token reference
|
|
84
|
+
|
|
85
|
+
| `--ngb-` suffix | Bootstrap mapping / fallback | Material mapping / fallback |
|
|
86
|
+
| --- | --- | --- |
|
|
87
|
+
| `primary` | `--bs-primary` / `#0d6efd` | `--mat-sys-primary` / `#6750a4` |
|
|
88
|
+
| `on-primary` | White | `--mat-sys-on-primary` / white |
|
|
89
|
+
| `surface` | `--bs-body-bg` / white | `--mat-sys-surface` / `#fffbfe` |
|
|
90
|
+
| `surface-container` | `--bs-tertiary-bg` / `#f8f9fa` | `--mat-sys-surface-container` / `#f3edf7` |
|
|
91
|
+
| `surface-variant` | `--bs-secondary-bg` / `#e9ecef` | `--mat-sys-surface-container-high` / `#ece6f0` |
|
|
92
|
+
| `on-surface` | `--bs-body-color` / `#212529` | `--mat-sys-on-surface` / `#1d1b20` |
|
|
93
|
+
| `on-surface-variant` | `--bs-secondary-color` / `#6c757d` | `--mat-sys-on-surface-variant` / `#49454f` |
|
|
94
|
+
| `border-color` | `--bs-border-color` / `#dee2e6` | `--mat-sys-outline-variant` / `#cac4d0` |
|
|
95
|
+
| `primary-hover` | `--bs-link-hover-color` / `#0a58ca` | Primary mixed with 12% on-surface |
|
|
96
|
+
| `primary-container` | `--bs-primary-bg-subtle` / `#cfe2ff` | `--mat-sys-primary-container` / `#eaddff` |
|
|
97
|
+
| `focus-ring` | `--bs-focus-ring-color` / translucent blue | `--mat-sys-primary` / `#6750a4` |
|
|
98
|
+
| `radius-sm`, `radius-md`, `radius-lg` | Bootstrap radius variables / `0.25`, `0.375`, `0.5rem` | `4`, `12`, `16px` |
|
|
99
|
+
| `font-family` | `--bs-body-font-family` / system sans-serif | `--mat-sys-body-medium-font` / Roboto, Arial, sans-serif |
|
|
100
|
+
| `font-size-sm` | Existing grid cell size `0.84rem` | `--mat-sys-body-medium-size` / `0.875rem` |
|
|
101
|
+
| `density-row-height` | Explicit wrapper: `40px`; unscoped: existing automatic height | `48px` |
|
|
102
|
+
| `elevation-1`, `elevation-2` | Bootstrap small/regular shadows | `--mat-sys-level1`, `--mat-sys-level2` / small menu/card shadows |
|
|
103
|
+
| `disabled-opacity` | Existing `0.45` | `0.38` |
|
|
104
|
+
| `hover-bg` | `--bs-tertiary-bg` / `#f8f9fa` | Surface mixed with 8% on-surface |
|
|
105
|
+
| `selected-bg` | `--bs-primary-bg-subtle` / `#cfe2ff` | `--mat-sys-secondary-container` / `#e8def8` |
|
|
106
|
+
|
|
107
|
+
Row height is a minimum requested table-cell height; content and padding can
|
|
108
|
+
make rows taller. Existing compact-density options still control padding.
|
|
109
|
+
|
|
110
|
+
Angular Material system variables must be available on the wrapper or an
|
|
111
|
+
ancestor. If absent, all mappings have standalone light-theme fallbacks. No
|
|
112
|
+
font is downloaded. For Material dark mode, supply a dark set of system
|
|
113
|
+
variables; Bootstrap dark mode alone does not create a Material dark palette.
|
|
114
|
+
See Angular Material's [custom component theming guide](https://github.com/angular/components/blob/main/guides/theming-your-components.md)
|
|
115
|
+
for the supported system color, typography, and elevation variables.
|
|
116
|
+
|
|
117
|
+
## DataGrid integration
|
|
118
|
+
|
|
119
|
+
`--dg-*` remains the component-specific layer. Its Bootstrap mixin now resolves
|
|
120
|
+
shared colors, surfaces, borders, radii, shadows, focus, hover, selection, and
|
|
121
|
+
pager styling through `--ngb-*` before existing Bootstrap fallbacks. DataGrid
|
|
122
|
+
also consumes shared font, row-height, disabled-opacity, and control-radius
|
|
123
|
+
tokens. Portaled filter menus snapshot resolved grid tokens when opened, so
|
|
124
|
+
their styling survives moving outside the theme wrapper. Close and reopen an
|
|
125
|
+
open filter menu after changing its ancestor theme.
|
|
126
|
+
|
|
127
|
+
Existing named palettes and component-specific semantic tokens remain available
|
|
128
|
+
through `--dg-*`. Shared success and danger colors feed the Bootstrap mapping;
|
|
129
|
+
other specialized grid status surfaces remain component tokens. Fixed layout
|
|
130
|
+
gaps, icons, and pill shapes remain component details.
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
## Families and swatches
|
|
134
|
+
|
|
135
|
+
Every value below works on `data-ngb-theme` for all participating components:
|
|
136
|
+
|
|
137
|
+
| Family | Wrapper value | Palette |
|
|
138
|
+
| --- | --- | --- |
|
|
139
|
+
| Bootstrap | `bootstrap` | Classic, maps local Bootstrap variables |
|
|
140
|
+
| Bootstrap | `bootstrap-main` | Ocean |
|
|
141
|
+
| Bootstrap | `bootstrap-main-dark` | Midnight, dark |
|
|
142
|
+
| Bootstrap | `bootstrap-nordic` | Aqua Rose |
|
|
143
|
+
| Bootstrap | `bootstrap-urban` | Clay |
|
|
144
|
+
| Bootstrap | `bootstrap-vintage` | Sage |
|
|
145
|
+
| Material | `material` | Angular Material system-variable mapping |
|
|
146
|
+
| Material | `material-main` | Orchid |
|
|
147
|
+
| Material | `material-indigo` | Indigo |
|
|
148
|
+
| Material | `material-deep-purple` | Plum |
|
|
149
|
+
| Tailwind | `tailwind` | Tailwind v4 system-variable mapping |
|
|
150
|
+
| Tailwind | `tailwind-main` | Sky |
|
|
151
|
+
| Tailwind | `tailwind-slate` | Graphite |
|
|
152
|
+
| Tailwind | `tailwind-emerald` | Mint |
|
|
153
|
+
|
|
154
|
+
Named swatches have fixed palettes and reset every shared token for nested
|
|
155
|
+
scopes. They share the grid presets' primary and surface colors; grid-only
|
|
156
|
+
striping, density, and detailed pager settings remain with the grid's `theme`
|
|
157
|
+
input. Material and Tailwind family mappings read external system variables;
|
|
158
|
+
their named swatches do not.
|
|
159
|
+
|
|
160
|
+
Additional shared tokens:
|
|
161
|
+
|
|
162
|
+
| Token | Purpose |
|
|
163
|
+
| --- | --- |
|
|
164
|
+
| `--ngb-success`, `--ngb-on-success` | Completion fill and text; Bootstrap success, Material fallback green, Tailwind green-700 |
|
|
165
|
+
| `--ngb-danger`, `--ngb-on-danger` | Error fill and text; Bootstrap danger, Material error, Tailwind red-700 |
|
|
166
|
+
| `--ngb-select-icon` | Select arrow CSS image; Midnight and Bootstrap dark use a light arrow. Override for custom dark Material/Tailwind surfaces. |
|
|
167
|
+
| `--ngb-space-1` through `--ngb-space-4` | Selected gaps and padding; 0.25, 0.5, 0.75, 1rem; Tailwind maps spacing multiples |
|
|
168
|
+
|
|
169
|
+
The Tailwind mapping reads `--color-blue-*`, `--color-slate-*`, `--color-white`,
|
|
170
|
+
`--font-sans`, `--text-sm`, `--radius-*`, `--shadow-*`, and `--spacing` with safe
|
|
171
|
+
fallbacks. It does not install Tailwind or remove the Bootstrap requirement.
|
|
172
|
+
For Tailwind v4, use a separate CSS pipeline; omit Preflight when Bootstrap
|
|
173
|
+
supplies base styles and prefix utilities to avoid class collisions. Prefixed
|
|
174
|
+
variables need explicit mappings, such as
|
|
175
|
+
`--ngb-primary: var(--tw-color-indigo-600, #4f46e5)` on the wrapper.
|
|
176
|
+
Tailwind v3 applications can define CSS variables manually. See the official
|
|
177
|
+
[Tailwind Preflight](https://tailwindcss.com/docs/preflight) and
|
|
178
|
+
[Sass compatibility](https://tailwindcss.com/docs/compatibility) guides.
|
|
179
|
+
|
|
180
|
+
## Component boundaries
|
|
181
|
+
|
|
182
|
+
The AI UI entry point (Prompt Box, Chat, AI Prompt, Inline AI Prompt, and
|
|
183
|
+
Smart Paste) also consumes the shared tokens for controls, text, surfaces,
|
|
184
|
+
focus, error states, spacing, and corners. Load the global theme stylesheet
|
|
185
|
+
when using this entry point independently.
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
- Stepper: indicators, action buttons, error text, focus and selected spacing.
|
|
189
|
+
Its explicit `material` and `tailwind` theme inputs create a local mapping;
|
|
190
|
+
the default input inherits the nearest wrapper.
|
|
191
|
+
- Splitter: separator, handle and keyboard focus. Explicit color inputs win.
|
|
192
|
+
- Tree: text, buttons, checkboxes and focus. Projected/application content is unchanged.
|
|
193
|
+
- Typeahead: controls, suggestions, selection, focus, disabled state, menu elevation.
|
|
194
|
+
- Chips: fill, text, removal button and disabled opacity; pill shape is retained.
|
|
195
|
+
- Pager/pagination: controls and labels; nested DataGrid `--dg-*` overrides retain priority.
|
|
196
|
+
- Drag/drop: global list, compatible/denied hover and placeholder feedback.
|
|
197
|
+
JSON preview uses shared surfaces and spacing, with its monospace font retained.
|
|
198
|
+
|
|
199
|
+
No theme selector targets arbitrary application buttons. The old optional
|
|
200
|
+
`styles.css` drag/drop entry no longer contains a global `table button.btn` rule.
|
|
201
|
+
Projected templates, chart series, and the application-built Form Builder
|
|
202
|
+
canvas are application-owned. They can use the same shared variables explicitly.
|
|
203
|
+
The shared themes do not alter component event contracts or keyboard behavior.
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
## Optional Tailwind v4 utility preset
|
|
207
|
+
|
|
208
|
+
There are two integration directions:
|
|
209
|
+
|
|
210
|
+
- **ngbootstrap → Tailwind:** the optional preset exposes shared tokens through
|
|
211
|
+
utilities for application layouts and projected content.
|
|
212
|
+
- **Tailwind → ngbootstrap:** the `tailwind` wrapper or explicit `--ngb-*`
|
|
213
|
+
overrides read an application's existing Tailwind design variables.
|
|
214
|
+
|
|
215
|
+
To generate utilities, install and configure Tailwind v4 in the consuming app.
|
|
216
|
+
Tailwind is an optional peer dependency; using built-in palettes does not require
|
|
217
|
+
it. The preset is a packaged CSS asset, not a JavaScript plugin. Keep Bootstrap
|
|
218
|
+
CSS and the global library `themes.scss` entry loaded separately.
|
|
219
|
+
|
|
220
|
+
```css
|
|
221
|
+
/* Separate CSS entry processed by Tailwind, not Sass. */
|
|
222
|
+
@layer theme, base, components, utilities;
|
|
223
|
+
@import 'tailwindcss/theme.css' layer(theme) prefix(tw);
|
|
224
|
+
@import 'tailwindcss/utilities.css' layer(utilities) prefix(tw);
|
|
225
|
+
@import '@angular-bootstrap/ngbootstrap/styles/tailwind.css';
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
This setup omits Preflight because Bootstrap supplies base styles. Example:
|
|
229
|
+
|
|
230
|
+
```html
|
|
231
|
+
<section data-ngb-theme="material-main"
|
|
232
|
+
class="tw:bg-ngb-surface tw:text-ngb-on-surface tw:rounded-ngb-md tw:p-ngb-4">
|
|
233
|
+
<ngb-tree [nodes]="folders" />
|
|
234
|
+
</section>
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Without `prefix(tw)`, omit `tw:` from class names. With the prefix, variants
|
|
238
|
+
come after it, for example `tw:hover:bg-ngb-hover`. Keep literal utility names
|
|
239
|
+
in source files scanned by the consuming Tailwind build.
|
|
240
|
+
|
|
241
|
+
| Category | Unprefixed examples |
|
|
242
|
+
| --- | --- |
|
|
243
|
+
| Colors | `bg-ngb-primary`, `text-ngb-on-primary`, `bg-ngb-surface`, `text-ngb-on-surface`, `border-ngb-border` |
|
|
244
|
+
| Interaction | `hover:bg-ngb-hover`, `bg-ngb-selected`, `focus:outline-ngb-focus` |
|
|
245
|
+
| Status | `bg-ngb-success`, `text-ngb-on-success`, `bg-ngb-danger`, `text-ngb-on-danger` |
|
|
246
|
+
| Radius | `rounded-ngb-sm`, `rounded-ngb-md`, `rounded-ngb-lg` |
|
|
247
|
+
| Typography | `font-ngb`, `text-ngb-sm` |
|
|
248
|
+
| Spacing | `p-ngb-1` through `p-ngb-4`, `gap-ngb-2`, `min-h-ngb-row` |
|
|
249
|
+
| Elevation | `shadow-ngb-1`, `shadow-ngb-2` |
|
|
250
|
+
|
|
251
|
+
Use a theme wrapper with this preset, including for Bootstrap defaults; unscoped
|
|
252
|
+
components can use fallback colors without defining inherited shared tokens.
|
|
253
|
+
`@theme inline` makes generated utilities reference `--ngb-*` directly at the
|
|
254
|
+
styled element, preserving nested theme scopes and live token overrides.
|
|
255
|
+
The preset defines only namespaced aliases. It does not replace Tailwind's
|
|
256
|
+
standard variables, preventing cycles with the reverse Tailwind mapping.
|
|
257
|
+
Do not combine conflicting Bootstrap and Tailwind utility classes on an element.
|
|
258
|
+
|
|
259
|
+
Verify the optional integration with an independently installed Tailwind v4:
|
|
260
|
+
|
|
261
|
+
```sh
|
|
262
|
+
node scripts/verify-tailwind-preset.mjs /path/to/tailwind-project
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## Naming and scope
|
|
266
|
+
|
|
267
|
+
Built-in palettes supply predefined shared visual values. Framework integrations
|
|
268
|
+
connect those values to external variables or utility classes. Full component
|
|
269
|
+
themes would additionally implement an entire design system's component metrics,
|
|
270
|
+
structure, and effects. The current library retains Bootstrap-based structures;
|
|
271
|
+
its Material palettes and variable mapping are not a full Material 3 implementation.
|