@incursa/ui-kit 1.0.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/AI-AGENT-INSTRUCTIONS.md +42 -28
- package/LLMS.txt +56 -40
- package/README.md +190 -73
- package/dist/inc-design-language.css +430 -247
- package/dist/inc-design-language.css.map +1 -1
- package/dist/inc-design-language.js +520 -0
- package/dist/inc-design-language.min.css +1 -1
- package/dist/inc-design-language.min.css.map +1 -1
- package/dist/web-components/README.md +92 -0
- package/dist/web-components/RUNTIME-NOTES.md +40 -0
- package/dist/web-components/base-element.js +193 -0
- package/dist/web-components/components/feedback.js +1074 -0
- package/dist/web-components/components/forms.js +979 -0
- package/dist/web-components/components/layout.js +408 -0
- package/dist/web-components/components/navigation.js +854 -0
- package/dist/web-components/components/overlays.js +634 -0
- package/dist/web-components/controllers/focus.js +101 -0
- package/dist/web-components/controllers/overlay.js +128 -0
- package/dist/web-components/controllers/selection.js +145 -0
- package/dist/web-components/controllers/theme.js +173 -0
- package/dist/web-components/index.js +886 -0
- package/dist/web-components/package.json +3 -0
- package/dist/web-components/registry.js +74 -0
- package/dist/web-components/shared.js +186 -0
- package/dist/web-components/style.css +6 -0
- package/package.json +16 -4
- package/src/inc-design-language.js +520 -0
- package/src/inc-design-language.scss +456 -257
- package/src/web-components/README.md +92 -0
- package/src/web-components/RUNTIME-NOTES.md +40 -0
- package/src/web-components/base-element.js +193 -0
- package/src/web-components/components/feedback.js +1074 -0
- package/src/web-components/components/forms.js +979 -0
- package/src/web-components/components/layout.js +408 -0
- package/src/web-components/components/navigation.js +854 -0
- package/src/web-components/components/overlays.js +634 -0
- package/src/web-components/controllers/focus.js +101 -0
- package/src/web-components/controllers/overlay.js +128 -0
- package/src/web-components/controllers/selection.js +145 -0
- package/src/web-components/controllers/theme.js +173 -0
- package/src/web-components/index.js +886 -0
- package/src/web-components/package.json +3 -0
- package/src/web-components/registry.js +74 -0
- package/src/web-components/shared.js +186 -0
- package/src/web-components/style.css +6 -0
package/README.md
CHANGED
|
@@ -8,12 +8,41 @@
|
|
|
8
8
|
[](https://github.com/incursa/ui-kit/actions/workflows/pages.yml)
|
|
9
9
|
[](https://github.com/incursa/ui-kit/actions/workflows/npm-publish.yml)
|
|
10
10
|
|
|
11
|
-
This folder contains a distilled, reusable UI kit for data-heavy business applications. The goal is to keep the recurring visual patterns that define the UI language and expose them consistently through the `inc-*` class surface.
|
|
11
|
+
This folder contains a distilled, reusable UI kit for data-heavy business applications. The goal is to keep the recurring visual patterns that define the UI language and expose them consistently through the [`inc-*`](reference.html) class surface. The CSS classes remain the canonical public API; the optional Web Component layer adds a browser-native entrypoint without replacing the existing class-based usage model. The Web Component layer also ships a companion stylesheet entrypoint so the default look is one import away.
|
|
12
12
|
|
|
13
13
|
## Live Examples
|
|
14
14
|
|
|
15
15
|
> Open the hosted examples and component reference: [https://incursa.github.io/ui-kit](https://incursa.github.io/ui-kit)
|
|
16
16
|
|
|
17
|
+
For the plain HTML baseline, open [`demo.html`](demo.html). For the paired Web Component view, open [`web-components.html`](web-components.html). The two pages are meant to be compared side by side.
|
|
18
|
+
|
|
19
|
+
## Optional Web Components
|
|
20
|
+
|
|
21
|
+
Use the CSS classes by default. Use Web Components when you want the same design language from plain HTML, JavaScript, and slots rather than hand-wired class markup. Use native HTML primitives first when `<button>`, `<input>`, `<details>`, or `<dialog>` already satisfy the interaction and accessibility contract.
|
|
22
|
+
|
|
23
|
+
Load the optional layered entrypoints from the same package:
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<link rel="stylesheet" href="/node_modules/@incursa/ui-kit/web-components/style.css">
|
|
27
|
+
<script type="module">
|
|
28
|
+
import "@incursa/ui-kit/web-components";
|
|
29
|
+
</script>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The module auto-defines the shipped elements on load. If you prefer explicit registration control, import the same entrypoint in your module graph and call the exported registration helper from your own bootstrap code.
|
|
33
|
+
|
|
34
|
+
The v1 Web Component scope covers:
|
|
35
|
+
|
|
36
|
+
- layouts and shells: [`inc-app-shell`](reference.html), [`inc-page`](reference.html), [`inc-page-header`](reference.html), [`inc-section`](reference.html), [`inc-card`](reference.html), [`inc-summary-overview`](reference.html), [`inc-summary-block`](reference.html), [`inc-footer-bar`](reference.html)
|
|
37
|
+
- navigation: [`inc-navbar`](reference.html), [`inc-tabs`](reference.html), [`inc-user-menu`](reference.html)
|
|
38
|
+
- forms and inputs: [`inc-field`](reference.html), [`inc-input-group`](reference.html), [`inc-choice-group`](reference.html), [`inc-readonly-field`](reference.html), [`inc-validation-summary`](reference.html)
|
|
39
|
+
- feedback and status: [`inc-state-panel`](reference.html), [`inc-live-region`](reference.html), [`inc-auto-refresh`](reference.html), [`inc-theme-switcher`](reference.html)
|
|
40
|
+
- overlays and disclosures: [`inc-disclosure`](reference.html), [`inc-dialog`](reference.html), [`inc-drawer`](reference.html)
|
|
41
|
+
|
|
42
|
+
The intentionally deferred surfaces stay CSS-first in v1, including tables and data presentation, filter and bulk toolbars, file workflows, permission banners, toasts, utility helpers, and the remaining compatibility overlay shells.
|
|
43
|
+
|
|
44
|
+
For maintainers, treat the Web Component layer as an additive wrapper over the same design language: one package, one token system, one naming vocabulary, and the same helper behavior where it already exists.
|
|
45
|
+
|
|
17
46
|
Licensed under Apache 2.0.
|
|
18
47
|
|
|
19
48
|
## What was kept
|
|
@@ -21,15 +50,17 @@ Licensed under Apache 2.0.
|
|
|
21
50
|
- Bootstrap theming overrides for colors, typography, spacing, borders, inputs, cards, tabs, and tables.
|
|
22
51
|
- Dense but readable table styling with strong teal headers and mono-friendly numeric cells.
|
|
23
52
|
- Compact action buttons and inline forms that work well inside grids and table rows.
|
|
24
|
-
- Card, section-shell, summary-block, vertical-list, and layout primitives used across admin screens.
|
|
53
|
+
- Card, section-shell, summary-block, page-frame, vertical-list, and layout primitives used across admin screens.
|
|
25
54
|
- Status-oriented badges and alerts with soft backgrounds and stronger foreground/border cues.
|
|
26
55
|
- Validation states, error summaries, fieldset/legend groups, filter chips, and dense toolbar patterns for search-heavy screens.
|
|
27
56
|
- Operational states such as empty, no-results, loading, error, permission, lock, toast, live-region, auto-refresh, and activity timeline surfaces.
|
|
28
57
|
- Bulk-action, sticky-header, and row-state table patterns for operator-facing grids.
|
|
29
58
|
- File/document dropzones, file rows, read-only description-list grids, progress/meter surfaces, and drawer-style side panels.
|
|
59
|
+
- Contextual floating content for tooltip and popover shells anchored to a trigger.
|
|
30
60
|
- A small overlay/navigation layer for tabs, pagination, dropdown actions, native details/dialog patterns, and compatibility modals/offcanvas panels.
|
|
31
|
-
- Opinionated app-shell pieces for navbar/topbar, breadcrumb/nav-triad, sticky footer, user menu, and common two/three-column page layouts.
|
|
32
|
-
- A public-surface standards layer for `inc-` prefixing, BEM naming, and accessible interactive behavior.
|
|
61
|
+
- Opinionated app-shell pieces for navbar/topbar, breadcrumb/nav-triad, page-frame wrappers, footer-bar action clusters, sticky footer, user menu, and common two/three-column page layouts.
|
|
62
|
+
- A public-surface standards layer for [`inc-`](reference.html) prefixing, BEM naming, and accessible interactive behavior.
|
|
63
|
+
- An additive optional Web Component layer that keeps the CSS-first surface intact instead of creating a second design system.
|
|
33
64
|
|
|
34
65
|
## What was intentionally left out
|
|
35
66
|
|
|
@@ -39,73 +70,78 @@ Licensed under Apache 2.0.
|
|
|
39
70
|
|
|
40
71
|
## Specification Baseline
|
|
41
72
|
|
|
42
|
-
- First-pass Spec Trace suite: [specs/requirements/ui-kit/_index.md](./specs/requirements/ui-kit/_index.md)
|
|
43
|
-
- Open requirement gaps and follow-up questions: [specs/requirements/ui-kit/REQUIREMENT-GAPS.md](./specs/requirements/ui-kit/REQUIREMENT-GAPS.md)
|
|
44
|
-
-
|
|
73
|
+
- First-pass Spec Trace suite: [`specs/requirements/ui-kit/_index.md`](./specs/requirements/ui-kit/_index.md)
|
|
74
|
+
- Open requirement gaps and follow-up questions: [`specs/requirements/ui-kit/REQUIREMENT-GAPS.md`](./specs/requirements/ui-kit/REQUIREMENT-GAPS.md)
|
|
75
|
+
- Architecture / design-rationale layer: [`specs/architecture/_index.md`](./specs/architecture/_index.md)
|
|
76
|
+
- Verification baseline and smoke gate: [`specs/verification/ui-kit/_index.md`](./specs/verification/ui-kit/_index.md)
|
|
45
77
|
|
|
46
78
|
## Files
|
|
47
79
|
|
|
48
|
-
- `assets/brand/`
|
|
80
|
+
- [`assets/brand/`](assets/brand)
|
|
49
81
|
Repository brand assets for GitHub, docs, and future package-site usage.
|
|
50
|
-
- `src/_inc-tokens.scss`
|
|
82
|
+
- [`src/_inc-tokens.scss`](src/_inc-tokens.scss)
|
|
51
83
|
Bootstrap-facing theme tokens and override variables.
|
|
52
|
-
- `src/_inc-theme.scss`
|
|
84
|
+
- [`src/_inc-theme.scss`](src/_inc-theme.scss)
|
|
53
85
|
Dedicated brand-facing variables for fonts, palette, semantic surfaces, and text colors.
|
|
54
|
-
- `src/inc-design-language.scss`
|
|
55
|
-
Main source entrypoint for the `inc-*` class surface.
|
|
56
|
-
- `dist/inc-design-language.css`
|
|
86
|
+
- [`src/inc-design-language.scss`](src/inc-design-language.scss)
|
|
87
|
+
Main source entrypoint for the [`inc-*`](reference.html) class surface.
|
|
88
|
+
- [`dist/inc-design-language.css`](dist/inc-design-language.css)
|
|
57
89
|
Compiled standalone CSS output.
|
|
58
|
-
- `dist/inc-design-language.js`
|
|
59
|
-
Optional vanilla-JS helper for menus, tabs, collapsible sections,
|
|
60
|
-
- `
|
|
90
|
+
- [`dist/inc-design-language.js`](dist/inc-design-language.js)
|
|
91
|
+
Optional vanilla-JS helper for menus, tabs, collapsible sections, modal/offcanvas shells, native dialog launch hooks, auto-refresh widgets with pause/resume controls, and light/dark/system theme switching with pluggable controls.
|
|
92
|
+
- [`dist/web-components/`](dist/web-components)
|
|
93
|
+
Optional browser-native component runtime built from the same package and exposed through the `./web-components` entrypoint.
|
|
94
|
+
- [`index.html`](index.html)
|
|
61
95
|
Showcase hub for the included example pages.
|
|
62
|
-
- `demo.html`
|
|
96
|
+
- [`demo.html`](demo.html)
|
|
63
97
|
Dashboard-style preview of the extracted patterns.
|
|
64
|
-
- `work-queue.html`
|
|
98
|
+
- [`work-queue.html`](work-queue.html)
|
|
65
99
|
Sidebar and table-heavy queue example.
|
|
66
|
-
- `record-detail.html`
|
|
100
|
+
- [`record-detail.html`](record-detail.html)
|
|
67
101
|
Three-column detail example with action rail.
|
|
68
|
-
- `native-patterns.html`
|
|
102
|
+
- [`native-patterns.html`](native-patterns.html)
|
|
69
103
|
Native-first details/menu/dialog example.
|
|
70
|
-
- `overlay-workflows.html`
|
|
104
|
+
- [`overlay-workflows.html`](overlay-workflows.html)
|
|
71
105
|
Modal and offcanvas workflow example with validation and assignment flows.
|
|
72
|
-
- `reference.html`
|
|
73
|
-
Copy/paste catalog for the standard controls and markup patterns.
|
|
74
|
-
- `
|
|
106
|
+
- [`reference.html`](reference.html)
|
|
107
|
+
Copy/paste catalog for the standard controls, page framing, metrics, lists, overlays, and markup patterns.
|
|
108
|
+
- [`web-components.html`](web-components.html)
|
|
109
|
+
Public landing page for the optional Web Component entrypoint and the CSS-first versus Web Component usage split.
|
|
110
|
+
- [`specs/requirements/ui-kit/`](specs/requirements/ui-kit)
|
|
75
111
|
First-pass Spec Trace specification suite for the UI kit, including the gap log for unresolved questions.
|
|
76
|
-
- `specs/verification/ui-kit/`
|
|
77
|
-
Auditable verification baseline for the current UI kit public surface.
|
|
78
|
-
- `states.html`
|
|
112
|
+
- [`specs/verification/ui-kit/`](specs/verification/ui-kit)
|
|
113
|
+
Auditable verification baseline for the current UI kit public surface, including the repo-local smoke gate.
|
|
114
|
+
- [`states.html`](states.html)
|
|
79
115
|
Empty, no-results, loading, error, permission, timeline, file, and notification patterns.
|
|
80
|
-
- `forms-and-validation.html`
|
|
116
|
+
- [`forms-and-validation.html`](forms-and-validation.html)
|
|
81
117
|
Validation, error-summary, filter-bar, chip, and read-only/edit form patterns.
|
|
82
|
-
- `data-grid-advanced.html`
|
|
118
|
+
- [`data-grid-advanced.html`](data-grid-advanced.html)
|
|
83
119
|
Sticky-header table, bulk selection, row states, busy buttons, and side drawer pattern.
|
|
84
|
-
- `showcase.css`
|
|
120
|
+
- [`showcase.css`](showcase.css)
|
|
85
121
|
Small demo-only helper stylesheet for the static examples.
|
|
86
|
-
- `LLMS.txt`
|
|
87
|
-
Plain-text agent guidance in the emerging `llms.txt
|
|
88
|
-
- `AI-AGENT-INSTRUCTIONS.md`
|
|
122
|
+
- [`LLMS.txt`](LLMS.txt)
|
|
123
|
+
Plain-text agent guidance in the emerging [`llms.txt`](llms.txt)-style format for packaged consumers and tooling.
|
|
124
|
+
- [`AI-AGENT-INSTRUCTIONS.md`](AI-AGENT-INSTRUCTIONS.md)
|
|
89
125
|
Short operational guidance for an AI agent or another engineer.
|
|
90
126
|
|
|
91
127
|
## Naming
|
|
92
128
|
|
|
93
|
-
The reusable public class surface uses the `inc-*` prefix.
|
|
129
|
+
The reusable public class surface uses the [`inc-*`](reference.html) prefix.
|
|
94
130
|
|
|
95
131
|
Examples:
|
|
96
132
|
|
|
97
|
-
- `inc-table`
|
|
98
|
-
- `inc-btn`
|
|
99
|
-
- `inc-text`
|
|
100
|
-
- `inc-heading`
|
|
101
|
-
- `inc-data`
|
|
102
|
-
- `inc-card`
|
|
103
|
-
- `inc-header-body`
|
|
104
|
-
- `inc-summary-block`
|
|
133
|
+
- [`inc-table`](reference.html)
|
|
134
|
+
- [`inc-btn`](reference.html)
|
|
135
|
+
- [`inc-text`](reference.html)
|
|
136
|
+
- [`inc-heading`](reference.html)
|
|
137
|
+
- [`inc-data`](reference.html)
|
|
138
|
+
- [`inc-card`](reference.html)
|
|
139
|
+
- [`inc-header-body`](reference.html)
|
|
140
|
+
- [`inc-summary-block`](reference.html)
|
|
105
141
|
|
|
106
|
-
The BEM/modifier structure stays consistent across the package, for example `inc-table__cell--numeric` or `inc-btn--primary
|
|
142
|
+
The BEM/modifier structure stays consistent across the package, for example [`inc-table__cell--numeric`](reference.html) or [`inc-btn--primary`](reference.html).
|
|
107
143
|
|
|
108
|
-
For titled sections that wrap tables, use `inc-header-body--table-body` to keep body padding while removing extra bottom margin from nested table wrappers.
|
|
144
|
+
For titled sections that wrap tables, use [`inc-header-body--table-body`](reference.html) to keep body padding while removing extra bottom margin from nested table wrappers.
|
|
109
145
|
|
|
110
146
|
## Design language summary
|
|
111
147
|
|
|
@@ -119,45 +155,110 @@ For titled sections that wrap tables, use `inc-header-body--table-body` to keep
|
|
|
119
155
|
- Layout aware: sidebar menus, inline form fields, and multi-column page examples are included so common admin-page composition is demonstrated directly.
|
|
120
156
|
- Workflow aware: validation, filter bars, bulk action bars, audit timelines, and file-review surfaces are part of the package now because those patterns recur constantly in B2B products.
|
|
121
157
|
- Native capable: the package now also includes styled `<details>` disclosures, a native summary-based menu, and `<dialog>` surfaces for both centered modals and drawer-style side sheets so you can choose browser primitives when they fit better than helper-managed components.
|
|
158
|
+
- Color mode: `data-bs-theme` is the global light/dark activation hook, and the bundled `IncTheme` helper can persist light, dark, or system mode from a small control surface.
|
|
122
159
|
|
|
123
160
|
## CSS-only vs JS-assisted
|
|
124
161
|
|
|
125
162
|
- CSS-only/native behavior is enough for layout, cards, tables, buttons, alerts, form fields, badges, breadcrumbs, sticky footer, and most surface styling.
|
|
126
163
|
- Stateful controls still need behavior:
|
|
127
|
-
tabs, collapsible sections, menus/dropdowns,
|
|
128
|
-
-
|
|
129
|
-
|
|
164
|
+
tabs, collapsible sections, menus/dropdowns, modal and offcanvas shells, and auto-refresh countdowns with pause/resume behavior.
|
|
165
|
+
- Alert and toast surfaces stay CSS/HTML-first unless the consuming app adds its own dismissal or lifecycle logic.
|
|
166
|
+
- This package now includes an optional dependency-free helper at [`dist/inc-design-language.js`](dist/inc-design-language.js) for:
|
|
167
|
+
user-menu dropdowns, tab switching, collapse/accordion toggles, legacy modal/offcanvas shells, native dialog launching, page auto-refresh countdown widgets, and theme switching controls.
|
|
168
|
+
- The helper also exposes `window.IncTheme` and listens for [`data-inc-theme-mode`](src/inc-design-language.js), [`data-inc-theme-toggle`](src/inc-design-language.js), and [`data-inc-theme-select`](src/inc-design-language.js) controls.
|
|
169
|
+
- `window.IncTheme` also supports `createSwitcher(options)` and `mountSwitcher(target, options)` when you want to drop in the packaged switcher without hand-writing the markup.
|
|
130
170
|
- This package also includes native-styled patterns for:
|
|
131
|
-
`details.inc-disclosure
|
|
171
|
+
[`details.inc-disclosure`](reference.html), [`details.inc-native-menu`](reference.html), [`dialog.inc-native-dialog`](reference.html), and [`dialog.inc-native-dialog--drawer`](reference.html).
|
|
132
172
|
- If you prefer native HTML behavior where possible, use browser primitives like `<details>` and `<dialog>` for product-specific implementations. The helper exists for places where the design language is intentionally Bootstrap-like and needs matching interaction behavior.
|
|
133
173
|
|
|
174
|
+
## Web Component usage
|
|
175
|
+
|
|
176
|
+
- Use the CSS class surface when you already have the HTML structure and only need the design language.
|
|
177
|
+
- Use the Web Component entrypoint when you want declarative slots, attributes, and DOM events around the approved v1 component families.
|
|
178
|
+
- Use native HTML primitives when they already solve the interaction cleanly and keep the semantics simpler.
|
|
179
|
+
- Keep tables, utilities, and other low-level atoms class-based until there is a clear component contract worth adding.
|
|
180
|
+
- Treat the Web Component layer as a layered entrypoint in the same package, not as a separate design system.
|
|
181
|
+
|
|
134
182
|
## Use it quickly
|
|
135
183
|
|
|
136
184
|
If you just want the look in another app:
|
|
137
185
|
|
|
138
|
-
1. Copy `dist/inc-design-language.css
|
|
139
|
-
2. If you need interactive tabs/menus/collapses, also copy `dist/inc-design-language.js
|
|
140
|
-
3.
|
|
141
|
-
4. Load the
|
|
142
|
-
5.
|
|
143
|
-
6.
|
|
144
|
-
7.
|
|
186
|
+
1. Copy [`dist/inc-design-language.css`](dist/inc-design-language.css).
|
|
187
|
+
2. If you need interactive tabs/menus/collapses or helper-managed overlays, also copy [`dist/inc-design-language.js`](dist/inc-design-language.js).
|
|
188
|
+
3. If you want browser-native custom elements, see [`web-components.html`](web-components.html) for the optional layered entrypoint.
|
|
189
|
+
4. Load the CSS after your reset or base stylesheet.
|
|
190
|
+
5. Load the optional JS near the end of the page.
|
|
191
|
+
6. Use the [`inc-*`](reference.html) classes shown in [`reference.html`](reference.html) for direct copy/paste control markup, or use the matching custom elements from the Web Component layer when that better fits the page.
|
|
192
|
+
7. Check [`states.html`](states.html), [`forms-and-validation.html`](forms-and-validation.html), [`data-grid-advanced.html`](data-grid-advanced.html), and [`overlay-workflows.html`](overlay-workflows.html) for the workflow-heavy patterns that do not read well as isolated snippets.
|
|
193
|
+
8. Use [`demo.html`](demo.html), [`work-queue.html`](work-queue.html), [`record-detail.html`](record-detail.html), and [`native-patterns.html`](native-patterns.html) for fuller page composition.
|
|
194
|
+
|
|
195
|
+
If you want the color mode to follow the saved user preference before first paint, add a tiny bootstrap script in the `<head>`:
|
|
196
|
+
|
|
197
|
+
```html
|
|
198
|
+
<script>
|
|
199
|
+
(() => {
|
|
200
|
+
const storageKey = "inc-theme-mode";
|
|
201
|
+
const resolveTheme = (mode) => mode === "dark" || mode === "light"
|
|
202
|
+
? mode
|
|
203
|
+
: (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
|
|
204
|
+
let mode = "system";
|
|
205
|
+
|
|
206
|
+
try {
|
|
207
|
+
const storedMode = window.localStorage.getItem(storageKey);
|
|
208
|
+
|
|
209
|
+
if (storedMode === "light" || storedMode === "dark" || storedMode === "system") {
|
|
210
|
+
mode = storedMode;
|
|
211
|
+
}
|
|
212
|
+
} catch {
|
|
213
|
+
// Ignore storage restrictions.
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
document.documentElement.setAttribute("data-inc-theme-mode", mode);
|
|
217
|
+
document.documentElement.setAttribute("data-bs-theme", resolveTheme(mode));
|
|
218
|
+
document.documentElement.style.colorScheme = resolveTheme(mode);
|
|
219
|
+
})();
|
|
220
|
+
</script>
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Then you can either mount the packaged switcher:
|
|
224
|
+
|
|
225
|
+
```html
|
|
226
|
+
<div data-inc-theme-switcher data-inc-theme-switcher-variant="navbar"></div>
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
or control the mode yourself:
|
|
230
|
+
|
|
231
|
+
```html
|
|
232
|
+
<button type="button" data-inc-theme-toggle>Cycle theme</button>
|
|
233
|
+
<button type="button" data-inc-theme-mode="light">Light</button>
|
|
234
|
+
<button type="button" data-inc-theme-mode="dark">Dark</button>
|
|
235
|
+
<button type="button" data-inc-theme-mode="system">System</button>
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
```html
|
|
239
|
+
<script src="/path/to/inc-design-language.js"></script>
|
|
240
|
+
<script>
|
|
241
|
+
window.IncTheme.setMode("dark");
|
|
242
|
+
window.IncTheme.mountSwitcher("[data-inc-theme-switcher]", { variant: "navbar" });
|
|
243
|
+
</script>
|
|
244
|
+
```
|
|
145
245
|
|
|
146
246
|
## Use it as a package
|
|
147
247
|
|
|
148
248
|
This repository is shaped as a normal npm package:
|
|
149
249
|
|
|
150
|
-
- `main`, `style`, and `
|
|
250
|
+
- `main`, `style`, `sass`, and the layered `web-components/style.css` entry points are set.
|
|
151
251
|
- `files` limits packaged output to the reusable source and dist assets.
|
|
152
252
|
- `npm pack` produces a local tarball.
|
|
153
253
|
- `publishConfig.access` is set for public scoped publishing.
|
|
154
254
|
- GitHub Actions is set up for npm Trusted Publishing on release.
|
|
255
|
+
- `npm run verify` is the repo-local build, smoke, and dry-run package gate.
|
|
155
256
|
|
|
156
257
|
Typical flow:
|
|
157
258
|
|
|
158
259
|
```bash
|
|
159
260
|
npm install
|
|
160
|
-
npm run
|
|
261
|
+
npm run verify
|
|
161
262
|
npm pack
|
|
162
263
|
```
|
|
163
264
|
|
|
@@ -179,12 +280,19 @@ If you publish it publicly:
|
|
|
179
280
|
npm install @incursa/ui-kit
|
|
180
281
|
```
|
|
181
282
|
|
|
182
|
-
Import
|
|
283
|
+
Import the base CSS:
|
|
183
284
|
|
|
184
285
|
```js
|
|
185
286
|
import "@incursa/ui-kit/dist/inc-design-language.css";
|
|
186
287
|
```
|
|
187
288
|
|
|
289
|
+
Or, for the browser-native layer, import the paired stylesheet and runtime:
|
|
290
|
+
|
|
291
|
+
```js
|
|
292
|
+
import "@incursa/ui-kit/web-components/style.css";
|
|
293
|
+
import "@incursa/ui-kit/web-components";
|
|
294
|
+
```
|
|
295
|
+
|
|
188
296
|
or, if you want to own the theme variables:
|
|
189
297
|
|
|
190
298
|
```scss
|
|
@@ -194,25 +302,34 @@ or, if you want to own the theme variables:
|
|
|
194
302
|
|
|
195
303
|
## How It Fits Into A Razor Or ASP.NET Core App
|
|
196
304
|
|
|
197
|
-
There are
|
|
305
|
+
There are three supported ways to use it.
|
|
198
306
|
|
|
199
307
|
1. Use the compiled assets.
|
|
200
308
|
|
|
201
|
-
- Add `dist/inc-design-language.css` to your site and optionally `dist/inc-design-language.js
|
|
309
|
+
- Add [`dist/inc-design-language.css`](dist/inc-design-language.css) to your site and optionally [`dist/inc-design-language.js`](dist/inc-design-language.js).
|
|
202
310
|
- This is the simplest path.
|
|
203
311
|
- You do not need Bootstrap CSS at runtime because the compiled CSS already includes the Bootstrap layer it was built on.
|
|
204
312
|
- You do not need Bootstrap JS unless your app separately uses Bootstrap's own JavaScript components.
|
|
313
|
+
- If you want light/dark/system switching, keep `data-bs-theme` on the root element and let `window.IncTheme` persist the user's override or mount the packaged switcher into your layout.
|
|
314
|
+
- If you want browser-native custom elements instead of helper wiring, import the same-package `./web-components` entrypoint and keep the CSS bundle in place. The companion stylesheet lives at `./web-components/style.css`.
|
|
205
315
|
|
|
206
316
|
2. Use the SCSS source.
|
|
207
317
|
|
|
208
|
-
- Import `src/inc-design-language.scss` into your own Sass pipeline.
|
|
318
|
+
- Import [`src/inc-design-language.scss`](src/inc-design-language.scss) into your own Sass pipeline.
|
|
209
319
|
- This path is for when you want to override theme variables or deeper Bootstrap-facing tokens.
|
|
210
320
|
- In this mode you do need Bootstrap and Sass available at build time because the source imports `bootstrap/scss/bootstrap`.
|
|
211
321
|
|
|
322
|
+
3. Use the optional Web Component layer.
|
|
323
|
+
|
|
324
|
+
- Import the same-package `./web-components` entrypoint when you want browser-native custom elements for the supported v1 families.
|
|
325
|
+
- Keep the CSS bundle in place because the custom elements are designed to sit on top of the same class and token vocabulary.
|
|
326
|
+
- Prefer this layer for declarative shell components, and keep static atoms and tables on the CSS surface.
|
|
327
|
+
|
|
212
328
|
Practical recommendation for a .NET Razor Pages or MVC app:
|
|
213
329
|
|
|
214
|
-
- If you just want the finished look, copy or install the package and reference `dist/inc-design-language.css` from your layout.
|
|
215
|
-
- Add `dist/inc-design-language.js`
|
|
330
|
+
- If you just want the finished look, copy or install the package and reference [`dist/inc-design-language.css`](dist/inc-design-language.css) from your layout.
|
|
331
|
+
- Add [`dist/inc-design-language.js`](dist/inc-design-language.js) if you want the optional [`inc-*`](reference.html) menu/tab/collapse helper behavior or the bundled theme switcher helper.
|
|
332
|
+
- Add the same-package `./web-components` entrypoint when you want declarative custom elements for the supported v1 component families. Pair it with `./web-components/style.css` for the default look.
|
|
216
333
|
- Use the native `<details>` and `<dialog>` patterns when you want less JavaScript.
|
|
217
334
|
- Use the SCSS source path only if you want this package to become part of your app's own asset build and theme pipeline.
|
|
218
335
|
|
|
@@ -220,11 +337,11 @@ Practical recommendation for a .NET Razor Pages or MVC app:
|
|
|
220
337
|
|
|
221
338
|
This repository is set up for:
|
|
222
339
|
|
|
223
|
-
- CI on pushes and pull requests via `.github/workflows/ci.yml`
|
|
224
|
-
- GitHub Pages showcase deployment from `main` via `.github/workflows/pages.yml`
|
|
225
|
-
- npm Trusted Publishing on `v*` tag pushes via `.github/workflows/npm-publish.yml`
|
|
226
|
-
- Public release hygiene through `LICENSE`, `CHANGELOG.md
|
|
227
|
-
- Brand assets in `assets/brand/` so README and future docs do not depend on external image hosting
|
|
340
|
+
- CI on pushes and pull requests via [`.github/workflows/ci.yml`](.github/workflows/ci.yml)
|
|
341
|
+
- GitHub Pages showcase deployment from `main` via [`.github/workflows/pages.yml`](.github/workflows/pages.yml)
|
|
342
|
+
- npm Trusted Publishing on `v*` tag pushes via [`.github/workflows/npm-publish.yml`](.github/workflows/npm-publish.yml)
|
|
343
|
+
- Public release hygiene through `LICENSE`, [`CHANGELOG.md`](CHANGELOG.md), [`CONTRIBUTING.md`](CONTRIBUTING.md), and [`RELEASING.md`](RELEASING.md)
|
|
344
|
+
- Brand assets in [`assets/brand/`](assets/brand) so README and future docs do not depend on external image hosting
|
|
228
345
|
|
|
229
346
|
## Release flow
|
|
230
347
|
|
|
@@ -240,17 +357,17 @@ For normal releases:
|
|
|
240
357
|
"@
|
|
241
358
|
```
|
|
242
359
|
|
|
243
|
-
Use `minor` or `major` when needed. The script verifies the repo state, bumps the version, runs the package validation step, updates `CHANGELOG.md
|
|
360
|
+
Use `minor` or `major` when needed. The script verifies the repo state, bumps the version, runs the build, smoke, and package validation step, updates [`CHANGELOG.md`](CHANGELOG.md), creates the release commit and tag, and pushes them. Pushing the tag publishes the package to npm automatically. If you need to retry a failed publish, rerun the original tag-triggered workflow run rather than dispatching a separate manual publish.
|
|
244
361
|
|
|
245
362
|
## Use it as source
|
|
246
363
|
|
|
247
364
|
If you want to keep editing it:
|
|
248
365
|
|
|
249
366
|
1. Install Bootstrap 5.3 and Sass in the consuming project.
|
|
250
|
-
2. Copy the `src/` folder.
|
|
251
|
-
3. Import `src/inc-design-language.scss
|
|
252
|
-
4. Edit `src/_inc-theme.scss` for the fonts and colors you want.
|
|
253
|
-
5. Use `src/_inc-tokens.scss` only when you need deeper spacing, radius, shadow, or Bootstrap-level tuning.
|
|
367
|
+
2. Copy the [`src/`](src) folder.
|
|
368
|
+
3. Import [`src/inc-design-language.scss`](src/inc-design-language.scss).
|
|
369
|
+
4. Edit [`src/_inc-theme.scss`](src/_inc-theme.scss) for the fonts and colors you want.
|
|
370
|
+
5. Use [`src/_inc-tokens.scss`](src/_inc-tokens.scss) only when you need deeper spacing, radius, shadow, or Bootstrap-level tuning.
|
|
254
371
|
|
|
255
372
|
Example:
|
|
256
373
|
|