@incursa/ui-kit 1.0.1 → 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 +41 -28
- package/LLMS.txt +55 -41
- package/README.md +181 -68
- package/dist/inc-design-language.css +413 -239
- 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 +11 -2
- package/src/inc-design-language.js +520 -0
- package/src/inc-design-language.scss +434 -246
- 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
|
|
@@ -30,7 +59,8 @@ Licensed under Apache 2.0.
|
|
|
30
59
|
- Contextual floating content for tooltip and popover shells anchored to a trigger.
|
|
31
60
|
- A small overlay/navigation layer for tabs, pagination, dropdown actions, native details/dialog patterns, and compatibility modals/offcanvas panels.
|
|
32
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.
|
|
33
|
-
- A public-surface standards layer for `inc-` prefixing, BEM naming, and accessible interactive behavior.
|
|
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.
|
|
34
64
|
|
|
35
65
|
## What was intentionally left out
|
|
36
66
|
|
|
@@ -40,74 +70,78 @@ Licensed under Apache 2.0.
|
|
|
40
70
|
|
|
41
71
|
## Specification Baseline
|
|
42
72
|
|
|
43
|
-
- First-pass Spec Trace suite: [specs/requirements/ui-kit/_index.md](./specs/requirements/ui-kit/_index.md)
|
|
44
|
-
- Open requirement gaps and follow-up questions: [specs/requirements/ui-kit/REQUIREMENT-GAPS.md](./specs/requirements/ui-kit/REQUIREMENT-GAPS.md)
|
|
45
|
-
- Architecture / design-rationale layer: [specs/architecture/_index.md](./specs/architecture/_index.md)
|
|
46
|
-
- Verification baseline and smoke gate: [specs/verification/ui-kit/_index.md](./specs/verification/ui-kit/_index.md)
|
|
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)
|
|
47
77
|
|
|
48
78
|
## Files
|
|
49
79
|
|
|
50
|
-
- `assets/brand/`
|
|
80
|
+
- [`assets/brand/`](assets/brand)
|
|
51
81
|
Repository brand assets for GitHub, docs, and future package-site usage.
|
|
52
|
-
- `src/_inc-tokens.scss`
|
|
82
|
+
- [`src/_inc-tokens.scss`](src/_inc-tokens.scss)
|
|
53
83
|
Bootstrap-facing theme tokens and override variables.
|
|
54
|
-
- `src/_inc-theme.scss`
|
|
84
|
+
- [`src/_inc-theme.scss`](src/_inc-theme.scss)
|
|
55
85
|
Dedicated brand-facing variables for fonts, palette, semantic surfaces, and text colors.
|
|
56
|
-
- `src/inc-design-language.scss`
|
|
57
|
-
Main source entrypoint for the `inc-*` class surface.
|
|
58
|
-
- `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)
|
|
59
89
|
Compiled standalone CSS output.
|
|
60
|
-
- `dist/inc-design-language.js`
|
|
61
|
-
Optional vanilla-JS helper for menus, tabs, collapsible sections, modal/offcanvas shells, native dialog launch hooks,
|
|
62
|
-
- `
|
|
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)
|
|
63
95
|
Showcase hub for the included example pages.
|
|
64
|
-
- `demo.html`
|
|
96
|
+
- [`demo.html`](demo.html)
|
|
65
97
|
Dashboard-style preview of the extracted patterns.
|
|
66
|
-
- `work-queue.html`
|
|
98
|
+
- [`work-queue.html`](work-queue.html)
|
|
67
99
|
Sidebar and table-heavy queue example.
|
|
68
|
-
- `record-detail.html`
|
|
100
|
+
- [`record-detail.html`](record-detail.html)
|
|
69
101
|
Three-column detail example with action rail.
|
|
70
|
-
- `native-patterns.html`
|
|
102
|
+
- [`native-patterns.html`](native-patterns.html)
|
|
71
103
|
Native-first details/menu/dialog example.
|
|
72
|
-
- `overlay-workflows.html`
|
|
104
|
+
- [`overlay-workflows.html`](overlay-workflows.html)
|
|
73
105
|
Modal and offcanvas workflow example with validation and assignment flows.
|
|
74
|
-
- `reference.html`
|
|
106
|
+
- [`reference.html`](reference.html)
|
|
75
107
|
Copy/paste catalog for the standard controls, page framing, metrics, lists, overlays, and markup patterns.
|
|
76
|
-
- `
|
|
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)
|
|
77
111
|
First-pass Spec Trace specification suite for the UI kit, including the gap log for unresolved questions.
|
|
78
|
-
- `specs/verification/ui-kit/`
|
|
112
|
+
- [`specs/verification/ui-kit/`](specs/verification/ui-kit)
|
|
79
113
|
Auditable verification baseline for the current UI kit public surface, including the repo-local smoke gate.
|
|
80
|
-
- `states.html`
|
|
114
|
+
- [`states.html`](states.html)
|
|
81
115
|
Empty, no-results, loading, error, permission, timeline, file, and notification patterns.
|
|
82
|
-
- `forms-and-validation.html`
|
|
116
|
+
- [`forms-and-validation.html`](forms-and-validation.html)
|
|
83
117
|
Validation, error-summary, filter-bar, chip, and read-only/edit form patterns.
|
|
84
|
-
- `data-grid-advanced.html`
|
|
118
|
+
- [`data-grid-advanced.html`](data-grid-advanced.html)
|
|
85
119
|
Sticky-header table, bulk selection, row states, busy buttons, and side drawer pattern.
|
|
86
|
-
- `showcase.css`
|
|
120
|
+
- [`showcase.css`](showcase.css)
|
|
87
121
|
Small demo-only helper stylesheet for the static examples.
|
|
88
|
-
- `LLMS.txt`
|
|
89
|
-
Plain-text agent guidance in the emerging `llms.txt
|
|
90
|
-
- `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)
|
|
91
125
|
Short operational guidance for an AI agent or another engineer.
|
|
92
126
|
|
|
93
127
|
## Naming
|
|
94
128
|
|
|
95
|
-
The reusable public class surface uses the `inc-*` prefix.
|
|
129
|
+
The reusable public class surface uses the [`inc-*`](reference.html) prefix.
|
|
96
130
|
|
|
97
131
|
Examples:
|
|
98
132
|
|
|
99
|
-
- `inc-table`
|
|
100
|
-
- `inc-btn`
|
|
101
|
-
- `inc-text`
|
|
102
|
-
- `inc-heading`
|
|
103
|
-
- `inc-data`
|
|
104
|
-
- `inc-card`
|
|
105
|
-
- `inc-header-body`
|
|
106
|
-
- `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)
|
|
107
141
|
|
|
108
|
-
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).
|
|
109
143
|
|
|
110
|
-
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.
|
|
111
145
|
|
|
112
146
|
## Design language summary
|
|
113
147
|
|
|
@@ -121,6 +155,7 @@ For titled sections that wrap tables, use `inc-header-body--table-body` to keep
|
|
|
121
155
|
- Layout aware: sidebar menus, inline form fields, and multi-column page examples are included so common admin-page composition is demonstrated directly.
|
|
122
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.
|
|
123
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.
|
|
124
159
|
|
|
125
160
|
## CSS-only vs JS-assisted
|
|
126
161
|
|
|
@@ -128,29 +163,91 @@ For titled sections that wrap tables, use `inc-header-body--table-body` to keep
|
|
|
128
163
|
- Stateful controls still need behavior:
|
|
129
164
|
tabs, collapsible sections, menus/dropdowns, modal and offcanvas shells, and auto-refresh countdowns with pause/resume behavior.
|
|
130
165
|
- Alert and toast surfaces stay CSS/HTML-first unless the consuming app adds its own dismissal or lifecycle logic.
|
|
131
|
-
- This package now includes an optional dependency-free helper at `dist/inc-design-language.js` for:
|
|
132
|
-
user-menu dropdowns, tab switching, collapse/accordion toggles, legacy modal/offcanvas shells, native dialog launching,
|
|
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.
|
|
133
170
|
- This package also includes native-styled patterns for:
|
|
134
|
-
`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).
|
|
135
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.
|
|
136
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
|
+
|
|
137
182
|
## Use it quickly
|
|
138
183
|
|
|
139
184
|
If you just want the look in another app:
|
|
140
185
|
|
|
141
|
-
1. Copy `dist/inc-design-language.css
|
|
142
|
-
2. If you need interactive tabs/menus/collapses or helper-managed overlays, also copy `dist/inc-design-language.js
|
|
143
|
-
3.
|
|
144
|
-
4. Load the
|
|
145
|
-
5.
|
|
146
|
-
6.
|
|
147
|
-
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
|
+
```
|
|
148
245
|
|
|
149
246
|
## Use it as a package
|
|
150
247
|
|
|
151
248
|
This repository is shaped as a normal npm package:
|
|
152
249
|
|
|
153
|
-
- `main`, `style`, and `
|
|
250
|
+
- `main`, `style`, `sass`, and the layered `web-components/style.css` entry points are set.
|
|
154
251
|
- `files` limits packaged output to the reusable source and dist assets.
|
|
155
252
|
- `npm pack` produces a local tarball.
|
|
156
253
|
- `publishConfig.access` is set for public scoped publishing.
|
|
@@ -183,12 +280,19 @@ If you publish it publicly:
|
|
|
183
280
|
npm install @incursa/ui-kit
|
|
184
281
|
```
|
|
185
282
|
|
|
186
|
-
Import
|
|
283
|
+
Import the base CSS:
|
|
187
284
|
|
|
188
285
|
```js
|
|
189
286
|
import "@incursa/ui-kit/dist/inc-design-language.css";
|
|
190
287
|
```
|
|
191
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
|
+
|
|
192
296
|
or, if you want to own the theme variables:
|
|
193
297
|
|
|
194
298
|
```scss
|
|
@@ -198,25 +302,34 @@ or, if you want to own the theme variables:
|
|
|
198
302
|
|
|
199
303
|
## How It Fits Into A Razor Or ASP.NET Core App
|
|
200
304
|
|
|
201
|
-
There are
|
|
305
|
+
There are three supported ways to use it.
|
|
202
306
|
|
|
203
307
|
1. Use the compiled assets.
|
|
204
308
|
|
|
205
|
-
- 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).
|
|
206
310
|
- This is the simplest path.
|
|
207
311
|
- You do not need Bootstrap CSS at runtime because the compiled CSS already includes the Bootstrap layer it was built on.
|
|
208
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`.
|
|
209
315
|
|
|
210
316
|
2. Use the SCSS source.
|
|
211
317
|
|
|
212
|
-
- 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.
|
|
213
319
|
- This path is for when you want to override theme variables or deeper Bootstrap-facing tokens.
|
|
214
320
|
- In this mode you do need Bootstrap and Sass available at build time because the source imports `bootstrap/scss/bootstrap`.
|
|
215
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
|
+
|
|
216
328
|
Practical recommendation for a .NET Razor Pages or MVC app:
|
|
217
329
|
|
|
218
|
-
- If you just want the finished look, copy or install the package and reference `dist/inc-design-language.css` from your layout.
|
|
219
|
-
- 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.
|
|
220
333
|
- Use the native `<details>` and `<dialog>` patterns when you want less JavaScript.
|
|
221
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.
|
|
222
335
|
|
|
@@ -224,11 +337,11 @@ Practical recommendation for a .NET Razor Pages or MVC app:
|
|
|
224
337
|
|
|
225
338
|
This repository is set up for:
|
|
226
339
|
|
|
227
|
-
- CI on pushes and pull requests via `.github/workflows/ci.yml`
|
|
228
|
-
- GitHub Pages showcase deployment from `main` via `.github/workflows/pages.yml`
|
|
229
|
-
- npm Trusted Publishing on `v*` tag pushes via `.github/workflows/npm-publish.yml`
|
|
230
|
-
- Public release hygiene through `LICENSE`, `CHANGELOG.md
|
|
231
|
-
- 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
|
|
232
345
|
|
|
233
346
|
## Release flow
|
|
234
347
|
|
|
@@ -244,17 +357,17 @@ For normal releases:
|
|
|
244
357
|
"@
|
|
245
358
|
```
|
|
246
359
|
|
|
247
|
-
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
|
|
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.
|
|
248
361
|
|
|
249
362
|
## Use it as source
|
|
250
363
|
|
|
251
364
|
If you want to keep editing it:
|
|
252
365
|
|
|
253
366
|
1. Install Bootstrap 5.3 and Sass in the consuming project.
|
|
254
|
-
2. Copy the `src/` folder.
|
|
255
|
-
3. Import `src/inc-design-language.scss
|
|
256
|
-
4. Edit `src/_inc-theme.scss` for the fonts and colors you want.
|
|
257
|
-
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.
|
|
258
371
|
|
|
259
372
|
Example:
|
|
260
373
|
|