@neetechs/ui 0.0.3 → 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/CHANGELOG.md +103 -0
- package/CONTRIBUTING.md +60 -0
- package/LICENSE +21 -21
- package/README.md +861 -650
- package/dist/ai/ai-action-button/ai-action-button.css +271 -270
- package/dist/ai/ai-approval-card/ai-approval-card.css +323 -320
- package/dist/ai/ai-conversation-panel/ai-conversation-panel.css +447 -403
- package/dist/ai/ai-prompt-input/ai-prompt-input.css +380 -377
- package/dist/ai/ai-proposal-card/ai-proposal-card.css +358 -358
- package/dist/ai/ai-suggestion-card/ai-suggestion-card.css +295 -293
- package/dist/ai/ai-tool-call/ai-tool-call.css +256 -255
- package/dist/ai/index.css +7 -7
- package/dist/appearance/cache.d.ts +6 -1
- package/dist/appearance/cache.d.ts.map +1 -1
- package/dist/appearance/cache.js +57 -1
- package/dist/appearance/cache.js.map +1 -1
- package/dist/appearance/cookie.d.ts +16 -1
- package/dist/appearance/cookie.d.ts.map +1 -1
- package/dist/appearance/cookie.js +73 -4
- package/dist/appearance/cookie.js.map +1 -1
- package/dist/appearance/index.d.ts +9 -6
- package/dist/appearance/index.d.ts.map +1 -1
- package/dist/appearance/index.js +5 -4
- package/dist/appearance/index.js.map +1 -1
- package/dist/appearance/inline-bootstrap.d.ts +29 -0
- package/dist/appearance/inline-bootstrap.d.ts.map +1 -0
- package/dist/appearance/inline-bootstrap.js +154 -0
- package/dist/appearance/inline-bootstrap.js.map +1 -0
- package/dist/appearance/preference.d.ts +9 -1
- package/dist/appearance/preference.d.ts.map +1 -1
- package/dist/appearance/preference.js +54 -0
- package/dist/appearance/preference.js.map +1 -1
- package/dist/appearance/theme-controller.d.ts +37 -49
- package/dist/appearance/theme-controller.d.ts.map +1 -1
- package/dist/appearance/theme-controller.js +153 -143
- package/dist/appearance/theme-controller.js.map +1 -1
- package/dist/appearance/types.d.ts +29 -2
- package/dist/appearance/types.d.ts.map +1 -1
- package/dist/behaviors/announcer.d.ts +34 -0
- package/dist/behaviors/announcer.d.ts.map +1 -0
- package/dist/behaviors/announcer.js +150 -0
- package/dist/behaviors/announcer.js.map +1 -0
- package/dist/behaviors/calendar.d.ts +15 -0
- package/dist/behaviors/calendar.d.ts.map +1 -0
- package/dist/behaviors/calendar.js +77 -0
- package/dist/behaviors/calendar.js.map +1 -0
- package/dist/behaviors/data-grid.d.ts +18 -0
- package/dist/behaviors/data-grid.d.ts.map +1 -0
- package/dist/behaviors/data-grid.js +114 -0
- package/dist/behaviors/data-grid.js.map +1 -0
- package/dist/behaviors/dialog.d.ts +14 -0
- package/dist/behaviors/dialog.d.ts.map +1 -1
- package/dist/behaviors/dialog.js +24 -6
- package/dist/behaviors/dialog.js.map +1 -1
- package/dist/behaviors/direction.d.ts +10 -0
- package/dist/behaviors/direction.d.ts.map +1 -0
- package/dist/behaviors/direction.js +24 -0
- package/dist/behaviors/direction.js.map +1 -0
- package/dist/behaviors/drawer.d.ts +15 -3
- package/dist/behaviors/drawer.d.ts.map +1 -1
- package/dist/behaviors/drawer.js +25 -10
- package/dist/behaviors/drawer.js.map +1 -1
- package/dist/behaviors/dropdown.d.ts +11 -0
- package/dist/behaviors/dropdown.d.ts.map +1 -1
- package/dist/behaviors/dropdown.js +53 -11
- package/dist/behaviors/dropdown.js.map +1 -1
- package/dist/behaviors/focus-trap.d.ts.map +1 -1
- package/dist/behaviors/focus-trap.js +45 -5
- package/dist/behaviors/focus-trap.js.map +1 -1
- package/dist/behaviors/forms.d.ts +32 -0
- package/dist/behaviors/forms.d.ts.map +1 -0
- package/dist/behaviors/forms.js +147 -0
- package/dist/behaviors/forms.js.map +1 -0
- package/dist/behaviors/index.d.ts +11 -0
- package/dist/behaviors/index.d.ts.map +1 -1
- package/dist/behaviors/index.js +11 -0
- package/dist/behaviors/index.js.map +1 -1
- package/dist/behaviors/keyboard.d.ts.map +1 -1
- package/dist/behaviors/keyboard.js +4 -2
- package/dist/behaviors/keyboard.js.map +1 -1
- package/dist/behaviors/navigation.d.ts +98 -0
- package/dist/behaviors/navigation.d.ts.map +1 -0
- package/dist/behaviors/navigation.js +295 -0
- package/dist/behaviors/navigation.js.map +1 -0
- package/dist/behaviors/overlay.d.ts +6 -0
- package/dist/behaviors/overlay.d.ts.map +1 -1
- package/dist/behaviors/overlay.js +93 -3
- package/dist/behaviors/overlay.js.map +1 -1
- package/dist/behaviors/popover.d.ts +22 -0
- package/dist/behaviors/popover.d.ts.map +1 -0
- package/dist/behaviors/popover.js +126 -0
- package/dist/behaviors/popover.js.map +1 -0
- package/dist/behaviors/sidebar.d.ts +78 -0
- package/dist/behaviors/sidebar.d.ts.map +1 -0
- package/dist/behaviors/sidebar.js +263 -0
- package/dist/behaviors/sidebar.js.map +1 -0
- package/dist/behaviors/state.d.ts +49 -0
- package/dist/behaviors/state.d.ts.map +1 -0
- package/dist/behaviors/state.js +220 -0
- package/dist/behaviors/state.js.map +1 -0
- package/dist/behaviors/tabs.d.ts +18 -0
- package/dist/behaviors/tabs.d.ts.map +1 -0
- package/dist/behaviors/tabs.js +103 -0
- package/dist/behaviors/tabs.js.map +1 -0
- package/dist/behaviors/viewport.d.ts +40 -0
- package/dist/behaviors/viewport.d.ts.map +1 -0
- package/dist/behaviors/viewport.js +47 -0
- package/dist/behaviors/viewport.js.map +1 -0
- package/dist/components/alert/alert.css +220 -217
- package/dist/components/avatar/avatar.css +220 -219
- package/dist/components/badge/badge.css +174 -174
- package/dist/components/breadcrumb/breadcrumb.css +207 -205
- package/dist/components/button/button.css +238 -167
- package/dist/components/button-group/button-group.css +111 -0
- package/dist/components/card/card.css +265 -220
- package/dist/components/checkbox/checkbox.css +189 -187
- package/dist/components/chip/chip.css +269 -267
- package/dist/components/data-grid/data-grid.css +520 -369
- package/dist/components/description-list/description-list.css +187 -0
- package/dist/components/dialog/dialog.css +339 -275
- package/dist/components/drawer/drawer.css +484 -403
- package/dist/components/dropdown/dropdown.css +316 -298
- package/dist/components/icon-button/icon-button.css +162 -158
- package/dist/components/index.css +5 -2
- package/dist/components/input/input.css +163 -163
- package/dist/components/menu/menu.css +315 -314
- package/dist/components/pagination/pagination.css +250 -249
- package/dist/components/panel/panel.css +284 -283
- package/dist/components/popover/popover.css +153 -0
- package/dist/components/progress/progress.css +256 -248
- package/dist/components/radio/radio.css +166 -164
- package/dist/components/segmented-control/segmented-control.css +205 -205
- package/dist/components/select/select.css +117 -103
- package/dist/components/skeleton/skeleton.css +267 -262
- package/dist/components/split-button/split-button.css +292 -285
- package/dist/components/stat/stat.css +403 -0
- package/dist/components/switch/switch.css +195 -181
- package/dist/components/table/table.css +220 -0
- package/dist/components/tabs/tabs.css +293 -289
- package/dist/components/textarea/textarea.css +86 -86
- package/dist/components/toast/toast.css +345 -323
- package/dist/components/tooltip/tooltip.css +258 -255
- package/dist/domain/billing/index.css +629 -498
- package/dist/domain/calendar/agenda-list/agenda-list.css +224 -0
- package/dist/domain/calendar/day-slice/day-slice.css +384 -383
- package/dist/domain/calendar/day-timeline/day-timeline.css +332 -324
- package/dist/domain/calendar/event-card/event-card.css +338 -336
- package/dist/domain/calendar/index.css +5 -4
- package/dist/domain/calendar/month-grid/month-grid.css +426 -420
- package/dist/domain/calendar/week-grid/week-grid.css +480 -470
- package/dist/domain/companies/index.css +526 -525
- package/dist/domain/index.css +3 -3
- package/dist/index.css +5 -5
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/localization/index.d.ts +8 -0
- package/dist/localization/index.d.ts.map +1 -0
- package/dist/localization/index.js +22 -0
- package/dist/localization/index.js.map +1 -0
- package/dist/patterns/command-palette/command-palette.css +447 -439
- package/dist/patterns/company-switcher/company-switcher.css +390 -363
- package/dist/patterns/content-state/content-state.css +236 -0
- package/dist/patterns/empty-state/empty-state.css +260 -259
- package/dist/patterns/error-state/error-state.css +272 -271
- package/dist/patterns/form-layout/form-layout.css +106 -0
- package/dist/patterns/index.css +9 -3
- package/dist/patterns/loading-state/loading-state.css +287 -287
- package/dist/patterns/master-detail/master-detail.css +103 -0
- package/dist/patterns/notification-center/notification-center.css +443 -438
- package/dist/patterns/page/page.css +303 -0
- package/dist/patterns/profile-menu/profile-menu.css +298 -297
- package/dist/patterns/record-list/record-list.css +302 -0
- package/dist/patterns/search-bar/search-bar.css +457 -444
- package/dist/patterns/settings-layout/settings-layout.css +150 -0
- package/dist/patterns/workflow/workflow.css +168 -0
- package/dist/shell/app-shell/app-shell.css +211 -68
- package/dist/shell/content-frame/content-frame.css +93 -93
- package/dist/shell/footer/footer.css +256 -0
- package/dist/shell/header/header.css +328 -178
- package/dist/shell/index.css +8 -6
- package/dist/shell/mobile-nav/mobile-nav.css +254 -171
- package/dist/shell/navbar/navbar.css +255 -0
- package/dist/shell/sidebar/sidebar.css +314 -146
- package/dist/styles/accessibility.css +150 -0
- package/dist/styles/animations/motion.css +162 -162
- package/dist/styles/appearance/accent.css +215 -0
- package/dist/styles/appearance/density.css +61 -0
- package/dist/styles/appearance/motion.css +40 -0
- package/dist/styles/base.css +83 -82
- package/dist/styles/index.css +28 -21
- package/dist/styles/localization.css +56 -0
- package/dist/styles/reset.css +51 -50
- package/dist/styles/responsive.css +101 -0
- package/dist/styles/themes/dark.css +202 -120
- package/dist/styles/themes/high-contrast.css +290 -119
- package/dist/styles/themes/light.css +201 -119
- package/dist/styles/tokens/breakpoints.css +37 -15
- package/dist/styles/tokens/color.css +102 -96
- package/dist/styles/tokens/compatibility.css +33 -0
- package/dist/styles/tokens/elevation.css +26 -32
- package/dist/styles/tokens/index.css +9 -8
- package/dist/styles/tokens/motion.css +35 -35
- package/dist/styles/tokens/radius.css +26 -21
- package/dist/styles/tokens/spacing.css +56 -50
- package/dist/styles/tokens/typography.css +85 -84
- package/dist/styles/tokens/z-index.css +14 -14
- package/dist/styles/utilities/layout.css +153 -135
- package/dist/styles/utilities/text.css +152 -152
- package/dist/styles/utilities/visibility.css +47 -47
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/docs/NEETECHS_UI_UPGRADE_PLAN.md +192 -0
- package/docs/accessibility.md +218 -0
- package/docs/appearance-and-theming.md +150 -0
- package/docs/brand-palette.md +36 -0
- package/docs/component-architecture.md +137 -0
- package/docs/component-guidelines.md +64 -0
- package/docs/components.md +173 -0
- package/docs/content-and-terminology.md +207 -0
- package/docs/design-system-audit.md +120 -0
- package/docs/design-system-baseline-audit.md +226 -0
- package/docs/design-token-contract.md +279 -0
- package/docs/layering.md +53 -0
- package/docs/localization-and-rtl.md +147 -0
- package/docs/migration.md +193 -0
- package/docs/page-patterns-and-workflows.md +275 -0
- package/docs/responsive-and-adaptive-design.md +351 -0
- package/docs/semantic-role-migration-audit.md +77 -0
- package/docs/site-chrome.md +313 -0
- package/docs/states-feedback-and-recovery.md +206 -0
- package/docs/theming.md +5 -227
- package/package.json +48 -6
- package/src/ai/ai-action-button/ai-action-button.css +271 -270
- package/src/ai/ai-approval-card/ai-approval-card.css +323 -320
- package/src/ai/ai-conversation-panel/ai-conversation-panel.css +447 -403
- package/src/ai/ai-prompt-input/ai-prompt-input.css +380 -377
- package/src/ai/ai-proposal-card/ai-proposal-card.css +358 -358
- package/src/ai/ai-suggestion-card/ai-suggestion-card.css +295 -293
- package/src/ai/ai-tool-call/ai-tool-call.css +256 -255
- package/src/ai/index.css +7 -7
- package/src/appearance/cache.ts +236 -160
- package/src/appearance/cookie.ts +184 -68
- package/src/appearance/index.ts +86 -38
- package/src/appearance/inline-bootstrap.ts +163 -0
- package/src/appearance/preference.ts +121 -35
- package/src/appearance/theme-controller.ts +384 -383
- package/src/appearance/types.ts +61 -23
- package/src/behaviors/announcer.ts +222 -0
- package/src/behaviors/calendar.ts +92 -0
- package/src/behaviors/data-grid.ts +133 -0
- package/src/behaviors/dialog.ts +203 -168
- package/src/behaviors/direction.ts +34 -0
- package/src/behaviors/drawer.ts +210 -177
- package/src/behaviors/dropdown.ts +344 -281
- package/src/behaviors/focus-trap.ts +304 -261
- package/src/behaviors/forms.ts +205 -0
- package/src/behaviors/ids.ts +47 -47
- package/src/behaviors/index.ts +12 -1
- package/src/behaviors/keyboard.ts +305 -303
- package/src/behaviors/navigation.ts +417 -0
- package/src/behaviors/overlay.ts +344 -231
- package/src/behaviors/popover.ts +157 -0
- package/src/behaviors/sidebar.ts +342 -0
- package/src/behaviors/state.ts +282 -0
- package/src/behaviors/tabs.ts +137 -0
- package/src/behaviors/viewport.ts +61 -0
- package/src/components/alert/alert.css +220 -217
- package/src/components/avatar/avatar.css +220 -219
- package/src/components/badge/badge.css +174 -174
- package/src/components/breadcrumb/breadcrumb.css +207 -205
- package/src/components/button/button.css +238 -167
- package/src/components/button-group/button-group.css +111 -0
- package/src/components/card/card.css +265 -220
- package/src/components/checkbox/checkbox.css +189 -187
- package/src/components/chip/chip.css +269 -267
- package/src/components/data-grid/data-grid.css +520 -369
- package/src/components/description-list/description-list.css +187 -0
- package/src/components/dialog/dialog.css +339 -275
- package/src/components/drawer/drawer.css +484 -403
- package/src/components/dropdown/dropdown.css +316 -298
- package/src/components/icon-button/icon-button.css +162 -158
- package/src/components/index.css +5 -2
- package/src/components/input/input.css +163 -163
- package/src/components/menu/menu.css +315 -314
- package/src/components/pagination/pagination.css +250 -249
- package/src/components/panel/panel.css +284 -283
- package/src/components/popover/popover.css +153 -0
- package/src/components/progress/progress.css +256 -248
- package/src/components/radio/radio.css +166 -164
- package/src/components/segmented-control/segmented-control.css +205 -205
- package/src/components/select/select.css +117 -103
- package/src/components/skeleton/skeleton.css +267 -262
- package/src/components/split-button/split-button.css +292 -285
- package/src/components/stat/stat.css +403 -0
- package/src/components/switch/switch.css +195 -181
- package/src/components/table/table.css +220 -0
- package/src/components/tabs/tabs.css +293 -289
- package/src/components/textarea/textarea.css +86 -86
- package/src/components/toast/toast.css +345 -323
- package/src/components/tooltip/tooltip.css +258 -255
- package/src/domain/billing/index.css +629 -498
- package/src/domain/calendar/agenda-list/agenda-list.css +224 -0
- package/src/domain/calendar/day-slice/day-slice.css +384 -383
- package/src/domain/calendar/day-timeline/day-timeline.css +332 -324
- package/src/domain/calendar/event-card/event-card.css +338 -336
- package/src/domain/calendar/index.css +5 -4
- package/src/domain/calendar/month-grid/month-grid.css +426 -420
- package/src/domain/calendar/week-grid/week-grid.css +480 -470
- package/src/domain/companies/index.css +526 -525
- package/src/domain/index.css +3 -3
- package/src/index.css +5 -5
- package/src/index.ts +7 -6
- package/src/localization/index.ts +56 -0
- package/src/patterns/command-palette/command-palette.css +447 -439
- package/src/patterns/company-switcher/company-switcher.css +390 -363
- package/src/patterns/content-state/content-state.css +236 -0
- package/src/patterns/empty-state/empty-state.css +260 -259
- package/src/patterns/error-state/error-state.css +272 -271
- package/src/patterns/form-layout/form-layout.css +106 -0
- package/src/patterns/index.css +9 -3
- package/src/patterns/loading-state/loading-state.css +287 -287
- package/src/patterns/master-detail/master-detail.css +103 -0
- package/src/patterns/notification-center/notification-center.css +443 -438
- package/src/patterns/page/page.css +303 -0
- package/src/patterns/profile-menu/profile-menu.css +298 -297
- package/src/patterns/record-list/record-list.css +302 -0
- package/src/patterns/search-bar/search-bar.css +457 -444
- package/src/patterns/settings-layout/settings-layout.css +150 -0
- package/src/patterns/workflow/workflow.css +168 -0
- package/src/shell/app-shell/app-shell.css +211 -68
- package/src/shell/content-frame/content-frame.css +93 -93
- package/src/shell/footer/footer.css +256 -0
- package/src/shell/header/header.css +328 -178
- package/src/shell/index.css +8 -6
- package/src/shell/mobile-nav/mobile-nav.css +254 -171
- package/src/shell/navbar/navbar.css +255 -0
- package/src/shell/sidebar/sidebar.css +314 -146
- package/src/styles/accessibility.css +150 -0
- package/src/styles/animations/motion.css +162 -162
- package/src/styles/appearance/accent.css +215 -0
- package/src/styles/appearance/density.css +61 -0
- package/src/styles/appearance/motion.css +40 -0
- package/src/styles/base.css +83 -82
- package/src/styles/index.css +28 -21
- package/src/styles/localization.css +56 -0
- package/src/styles/reset.css +51 -50
- package/src/styles/responsive.css +101 -0
- package/src/styles/themes/dark.css +202 -120
- package/src/styles/themes/high-contrast.css +290 -119
- package/src/styles/themes/light.css +201 -119
- package/src/styles/tokens/breakpoints.css +37 -15
- package/src/styles/tokens/color.css +102 -96
- package/src/styles/tokens/compatibility.css +33 -0
- package/src/styles/tokens/elevation.css +26 -32
- package/src/styles/tokens/index.css +9 -8
- package/src/styles/tokens/motion.css +35 -35
- package/src/styles/tokens/radius.css +26 -21
- package/src/styles/tokens/spacing.css +56 -50
- package/src/styles/tokens/typography.css +85 -84
- package/src/styles/tokens/z-index.css +14 -14
- package/src/styles/utilities/layout.css +153 -135
- package/src/styles/utilities/text.css +152 -152
- package/src/styles/utilities/visibility.css +47 -47
- package/src/types/index.ts +126 -125
- package/src/version.ts +2 -0
- package/dist/components/modal/modal.css +0 -318
- package/dist/patterns/workspace-switcher/workspace-switcher.css +0 -380
- package/dist/shell/right-drawer/right-drawer.css +0 -108
- package/src/components/modal/modal.css +0 -318
- package/src/patterns/workspace-switcher/workspace-switcher.css +0 -380
- package/src/shell/right-drawer/right-drawer.css +0 -108
|
@@ -1,256 +1,257 @@
|
|
|
1
|
-
.nt-ai-tool-call {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
gap: var(--nt-space-3);
|
|
5
|
-
min-width: 0;
|
|
6
|
-
padding: var(--nt-space-3);
|
|
7
|
-
border: 1px solid var(--nt-border-subtle);
|
|
8
|
-
border-radius: var(--nt-radius-
|
|
9
|
-
background: var(--nt-bg-muted);
|
|
10
|
-
color: var(--nt-text-primary);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.nt-ai-tool-call__header {
|
|
14
|
-
display: grid;
|
|
15
|
-
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
16
|
-
align-items: center;
|
|
17
|
-
gap: var(--nt-space-2);
|
|
18
|
-
min-width: 0;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.nt-ai-tool-call__icon {
|
|
22
|
-
display: inline-flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
justify-content: center;
|
|
25
|
-
width: 1.75rem;
|
|
26
|
-
height: 1.75rem;
|
|
27
|
-
border: 1px solid var(--nt-border-subtle);
|
|
28
|
-
border-radius: var(--nt-radius-
|
|
29
|
-
background: var(--nt-bg-surface);
|
|
30
|
-
color: var(--nt-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.nt-ai-tool-call__main {
|
|
34
|
-
display: flex;
|
|
35
|
-
flex-direction: column;
|
|
36
|
-
gap: var(--nt-space-0-5);
|
|
37
|
-
min-width: 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.nt-ai-tool-call__name {
|
|
41
|
-
margin: 0;
|
|
42
|
-
overflow: hidden;
|
|
43
|
-
color: var(--nt-text-primary);
|
|
44
|
-
font: var(--nt-text-label-sm);
|
|
45
|
-
letter-spacing: var(--nt-letter-spacing-label);
|
|
46
|
-
text-overflow: ellipsis;
|
|
47
|
-
white-space: nowrap;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.nt-ai-tool-call__description {
|
|
51
|
-
margin: 0;
|
|
52
|
-
overflow: hidden;
|
|
53
|
-
color: var(--nt-text-muted);
|
|
54
|
-
font: var(--nt-text-caption);
|
|
55
|
-
text-overflow: ellipsis;
|
|
56
|
-
white-space: nowrap;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.nt-ai-tool-call__status {
|
|
60
|
-
display: inline-flex;
|
|
61
|
-
align-items: center;
|
|
62
|
-
justify-content: center;
|
|
63
|
-
gap: var(--nt-space-1);
|
|
64
|
-
min-height: 1.375rem;
|
|
65
|
-
padding: 0 var(--nt-space-2);
|
|
66
|
-
border: 1px solid var(--nt-border-subtle);
|
|
67
|
-
border-radius: var(--nt-radius-
|
|
68
|
-
background: var(--nt-bg-surface);
|
|
69
|
-
color: var(--nt-text-muted);
|
|
70
|
-
font: var(--nt-text-label-xs);
|
|
71
|
-
letter-spacing: var(--nt-letter-spacing-label);
|
|
72
|
-
white-space: nowrap;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.nt-ai-tool-call__status-dot {
|
|
76
|
-
display: inline-block;
|
|
77
|
-
width: 0.375rem;
|
|
78
|
-
height: 0.375rem;
|
|
79
|
-
border-radius: var(--nt-radius-
|
|
80
|
-
background: currentColor;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.nt-ai-tool-call__body {
|
|
84
|
-
display: flex;
|
|
85
|
-
flex-direction: column;
|
|
86
|
-
gap: var(--nt-space-2);
|
|
87
|
-
min-width: 0;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.nt-ai-tool-call__code {
|
|
91
|
-
max-height: 16rem;
|
|
92
|
-
margin: 0;
|
|
93
|
-
overflow: auto;
|
|
94
|
-
padding: var(--nt-space-3);
|
|
95
|
-
border: 1px solid var(--nt-border-subtle);
|
|
96
|
-
border-radius: var(--nt-radius-
|
|
97
|
-
background: var(--nt-bg-surface);
|
|
98
|
-
color: var(--nt-text-primary);
|
|
99
|
-
font: var(--nt-text-
|
|
100
|
-
white-space: pre-wrap;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.nt-ai-tool-call__meta {
|
|
104
|
-
display: flex;
|
|
105
|
-
flex-wrap: wrap;
|
|
106
|
-
align-items: center;
|
|
107
|
-
gap: var(--nt-space-2);
|
|
108
|
-
color: var(--nt-text-muted);
|
|
109
|
-
font: var(--nt-text-caption);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.nt-ai-tool-call__footer {
|
|
113
|
-
display: flex;
|
|
114
|
-
align-items: center;
|
|
115
|
-
justify-content: space-between;
|
|
116
|
-
gap: var(--nt-space-3);
|
|
117
|
-
min-width: 0;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.nt-ai-tool-call__actions {
|
|
121
|
-
display: inline-flex;
|
|
122
|
-
align-items: center;
|
|
123
|
-
justify-content: flex-end;
|
|
124
|
-
gap: var(--nt-space-2);
|
|
125
|
-
flex: 0 0 auto;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.nt-ai-tool-call__toggle {
|
|
129
|
-
display: inline-flex;
|
|
130
|
-
align-items: center;
|
|
131
|
-
gap: var(--nt-space-1);
|
|
132
|
-
border: 0;
|
|
133
|
-
background: transparent;
|
|
134
|
-
color: var(--nt-
|
|
135
|
-
font: var(--nt-text-label-sm);
|
|
136
|
-
letter-spacing: var(--nt-letter-spacing-label);
|
|
137
|
-
cursor: pointer;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.nt-ai-tool-call__toggle:hover {
|
|
141
|
-
color: var(--nt-
|
|
142
|
-
text-decoration: underline;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.nt-ai-tool-call__toggle:focus-visible {
|
|
146
|
-
outline:
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
.nt-ai-tool-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
.nt-ai-tool-call--running .nt-ai-tool-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
.nt-ai-tool-call--success .nt-ai-tool-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
.nt-ai-tool-call--
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
.nt-ai-tool-call--danger .nt-ai-tool-
|
|
193
|
-
.nt-ai-tool-call--
|
|
194
|
-
.nt-ai-tool-call--error .nt-ai-tool-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
1
|
+
.nt-ai-tool-call {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--nt-space-3);
|
|
5
|
+
min-width: 0;
|
|
6
|
+
padding: var(--nt-space-3);
|
|
7
|
+
border: 1px solid var(--nt-border-subtle);
|
|
8
|
+
border-radius: var(--nt-radius-item);
|
|
9
|
+
background: var(--nt-bg-surface-muted);
|
|
10
|
+
color: var(--nt-text-primary);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.nt-ai-tool-call__header {
|
|
14
|
+
display: grid;
|
|
15
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: var(--nt-space-2);
|
|
18
|
+
min-width: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.nt-ai-tool-call__icon {
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
width: 1.75rem;
|
|
26
|
+
height: 1.75rem;
|
|
27
|
+
border: 1px solid var(--nt-border-subtle);
|
|
28
|
+
border-radius: var(--nt-radius-item);
|
|
29
|
+
background: var(--nt-bg-surface);
|
|
30
|
+
color: var(--nt-ai-fg);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.nt-ai-tool-call__main {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
gap: var(--nt-space-0-5);
|
|
37
|
+
min-width: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.nt-ai-tool-call__name {
|
|
41
|
+
margin: 0;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
color: var(--nt-text-primary);
|
|
44
|
+
font: var(--nt-text-label-sm);
|
|
45
|
+
letter-spacing: var(--nt-letter-spacing-label);
|
|
46
|
+
text-overflow: ellipsis;
|
|
47
|
+
white-space: nowrap;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.nt-ai-tool-call__description {
|
|
51
|
+
margin: 0;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
color: var(--nt-text-muted);
|
|
54
|
+
font: var(--nt-text-caption);
|
|
55
|
+
text-overflow: ellipsis;
|
|
56
|
+
white-space: nowrap;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.nt-ai-tool-call__status {
|
|
60
|
+
display: inline-flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
gap: var(--nt-space-1);
|
|
64
|
+
min-height: 1.375rem;
|
|
65
|
+
padding: 0 var(--nt-space-2);
|
|
66
|
+
border: 1px solid var(--nt-border-subtle);
|
|
67
|
+
border-radius: var(--nt-radius-pill);
|
|
68
|
+
background: var(--nt-bg-surface);
|
|
69
|
+
color: var(--nt-text-muted);
|
|
70
|
+
font: var(--nt-text-label-xs);
|
|
71
|
+
letter-spacing: var(--nt-letter-spacing-label);
|
|
72
|
+
white-space: nowrap;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.nt-ai-tool-call__status-dot {
|
|
76
|
+
display: inline-block;
|
|
77
|
+
width: 0.375rem;
|
|
78
|
+
height: 0.375rem;
|
|
79
|
+
border-radius: var(--nt-radius-pill);
|
|
80
|
+
background: currentColor;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.nt-ai-tool-call__body {
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
gap: var(--nt-space-2);
|
|
87
|
+
min-width: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.nt-ai-tool-call__code {
|
|
91
|
+
max-height: 16rem;
|
|
92
|
+
margin: 0;
|
|
93
|
+
overflow: auto;
|
|
94
|
+
padding: var(--nt-space-3);
|
|
95
|
+
border: 1px solid var(--nt-border-subtle);
|
|
96
|
+
border-radius: var(--nt-radius-control);
|
|
97
|
+
background: var(--nt-bg-surface);
|
|
98
|
+
color: var(--nt-text-primary);
|
|
99
|
+
font: var(--nt-text-mono-sm);
|
|
100
|
+
white-space: pre-wrap;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.nt-ai-tool-call__meta {
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-wrap: wrap;
|
|
106
|
+
align-items: center;
|
|
107
|
+
gap: var(--nt-space-2);
|
|
108
|
+
color: var(--nt-text-muted);
|
|
109
|
+
font: var(--nt-text-caption);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.nt-ai-tool-call__footer {
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-content: space-between;
|
|
116
|
+
gap: var(--nt-space-3);
|
|
117
|
+
min-width: 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.nt-ai-tool-call__actions {
|
|
121
|
+
display: inline-flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
justify-content: flex-end;
|
|
124
|
+
gap: var(--nt-space-2);
|
|
125
|
+
flex: 0 0 auto;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.nt-ai-tool-call__toggle {
|
|
129
|
+
display: inline-flex;
|
|
130
|
+
align-items: center;
|
|
131
|
+
gap: var(--nt-space-1);
|
|
132
|
+
border: 0;
|
|
133
|
+
background: transparent;
|
|
134
|
+
color: var(--nt-ai-fg);
|
|
135
|
+
font: var(--nt-text-label-sm);
|
|
136
|
+
letter-spacing: var(--nt-letter-spacing-label);
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.nt-ai-tool-call__toggle:hover {
|
|
141
|
+
color: var(--nt-ai-action-hover);
|
|
142
|
+
text-decoration: underline;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.nt-ai-tool-call__toggle:focus-visible {
|
|
146
|
+
outline: var(--nt-focus-ring-width) solid var(--nt-focus-ring-color);
|
|
147
|
+
outline-offset: var(--nt-focus-ring-offset);
|
|
148
|
+
border-radius: var(--nt-radius-indicator);
|
|
149
|
+
box-shadow: 0 0 0 3px var(--nt-focus-ring-muted);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.nt-ai-tool-call__toggle-icon {
|
|
153
|
+
display: inline-flex;
|
|
154
|
+
align-items: center;
|
|
155
|
+
justify-content: center;
|
|
156
|
+
width: 1rem;
|
|
157
|
+
height: 1rem;
|
|
158
|
+
transition: transform var(--nt-duration-fast) var(--nt-ease-standard);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.nt-ai-tool-call[data-state='open'] .nt-ai-tool-call__toggle-icon,
|
|
162
|
+
.nt-ai-tool-call__toggle[aria-expanded='true'] .nt-ai-tool-call__toggle-icon {
|
|
163
|
+
transform: rotate(180deg);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.nt-ai-tool-call--running {
|
|
167
|
+
border-color: var(--nt-warning-border);
|
|
168
|
+
background: var(--nt-warning-bg);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.nt-ai-tool-call--running .nt-ai-tool-call__icon,
|
|
172
|
+
.nt-ai-tool-call--running .nt-ai-tool-call__status {
|
|
173
|
+
color: var(--nt-warning-text);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.nt-ai-tool-call--success {
|
|
177
|
+
border-color: var(--nt-success-border);
|
|
178
|
+
background: var(--nt-success-bg);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.nt-ai-tool-call--success .nt-ai-tool-call__icon,
|
|
182
|
+
.nt-ai-tool-call--success .nt-ai-tool-call__status {
|
|
183
|
+
color: var(--nt-success-text);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.nt-ai-tool-call--danger,
|
|
187
|
+
.nt-ai-tool-call--error {
|
|
188
|
+
border-color: var(--nt-danger-border);
|
|
189
|
+
background: var(--nt-danger-bg);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.nt-ai-tool-call--danger .nt-ai-tool-call__icon,
|
|
193
|
+
.nt-ai-tool-call--danger .nt-ai-tool-call__status,
|
|
194
|
+
.nt-ai-tool-call--error .nt-ai-tool-call__icon,
|
|
195
|
+
.nt-ai-tool-call--error .nt-ai-tool-call__status {
|
|
196
|
+
color: var(--nt-danger-text);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.nt-ai-tool-call--compact {
|
|
200
|
+
gap: var(--nt-space-2);
|
|
201
|
+
padding: var(--nt-space-2);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.nt-ai-tool-call--compact .nt-ai-tool-call__icon {
|
|
205
|
+
width: 1.5rem;
|
|
206
|
+
height: 1.5rem;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.nt-ai-tool-call--compact .nt-ai-tool-call__code {
|
|
210
|
+
padding: var(--nt-space-2);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.nt-ai-tool-call--ghost {
|
|
214
|
+
border-color: transparent;
|
|
215
|
+
background: transparent;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.nt-ai-tool-call--surface {
|
|
219
|
+
background: var(--nt-bg-surface);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.nt-ai-tool-call-list {
|
|
223
|
+
display: flex;
|
|
224
|
+
flex-direction: column;
|
|
225
|
+
gap: var(--nt-space-2);
|
|
226
|
+
min-width: 0;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
@media (max-width: 40rem) {
|
|
230
|
+
.nt-ai-tool-call__header {
|
|
231
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.nt-ai-tool-call__status {
|
|
235
|
+
grid-column: 1 / -1;
|
|
236
|
+
justify-self: start;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.nt-ai-tool-call__footer {
|
|
240
|
+
flex-direction: column;
|
|
241
|
+
align-items: stretch;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.nt-ai-tool-call__actions {
|
|
245
|
+
justify-content: stretch;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.nt-ai-tool-call__actions > * {
|
|
249
|
+
flex: 1 1 auto;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
@media (prefers-reduced-motion: reduce) {
|
|
254
|
+
.nt-ai-tool-call__toggle-icon {
|
|
255
|
+
transition: none !important;
|
|
256
|
+
}
|
|
256
257
|
}
|
package/dist/ai/index.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
@import './ai-action-button/ai-action-button.css';
|
|
2
|
-
@import './ai-suggestion-card/ai-suggestion-card.css';
|
|
3
|
-
@import './ai-conversation-panel/ai-conversation-panel.css';
|
|
4
|
-
@import './ai-proposal-card/ai-proposal-card.css';
|
|
5
|
-
@import './ai-prompt-input/ai-prompt-input.css';
|
|
6
|
-
@import './ai-tool-call/ai-tool-call.css';
|
|
7
|
-
@import './ai-approval-card/ai-approval-card.css';
|
|
1
|
+
@import './ai-action-button/ai-action-button.css';
|
|
2
|
+
@import './ai-suggestion-card/ai-suggestion-card.css';
|
|
3
|
+
@import './ai-conversation-panel/ai-conversation-panel.css';
|
|
4
|
+
@import './ai-proposal-card/ai-proposal-card.css';
|
|
5
|
+
@import './ai-prompt-input/ai-prompt-input.css';
|
|
6
|
+
@import './ai-tool-call/ai-tool-call.css';
|
|
7
|
+
@import './ai-approval-card/ai-approval-card.css';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { ThemePreference } from './types.js';
|
|
1
|
+
import type { NtAppearancePreference, ThemePreference } from './types.js';
|
|
2
|
+
/** Complete appearance cache. This remains a startup optimization, never account truth. */
|
|
3
|
+
export declare const NT_APPEARANCE_CACHE_KEY = "nt_appearance_preference";
|
|
2
4
|
/**
|
|
3
5
|
* Canonical local-storage cache key. The cache is a bootstrap fallback
|
|
4
6
|
* only — the backend account setting and the `nt_theme` cookie always
|
|
@@ -26,6 +28,9 @@ export declare function readThemeCache(storage?: ThemeStorage | null): ThemePref
|
|
|
26
28
|
* Caches a preference for the next bootstrap. Storage errors never throw.
|
|
27
29
|
*/
|
|
28
30
|
export declare function writeThemeCache(preference: ThemePreference, storage?: ThemeStorage | null): void;
|
|
31
|
+
export declare function readAppearanceCache(storage?: ThemeStorage | null): NtAppearancePreference | null;
|
|
32
|
+
export declare function writeAppearanceCache(preference: NtAppearancePreference, storage?: ThemeStorage | null): void;
|
|
33
|
+
export declare function clearAppearanceCache(storage?: ThemeStorage | null): void;
|
|
29
34
|
/**
|
|
30
35
|
* Removes the cached preference. Storage errors never throw.
|
|
31
36
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/appearance/cache.ts"],"names":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;;;;GAWG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,8BAAmC,GAC3C,eAAe,GAAG,IAAI,CAmCxB"}
|
package/dist/appearance/cache.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { normalizeThemePreference } from './preference.js';
|
|
1
|
+
import { appearanceFromTheme, normalizeAppearancePreference, normalizeThemePreference, } from './preference.js';
|
|
2
|
+
/** Complete appearance cache. This remains a startup optimization, never account truth. */
|
|
3
|
+
export const NT_APPEARANCE_CACHE_KEY = 'nt_appearance_preference';
|
|
2
4
|
/**
|
|
3
5
|
* Canonical local-storage cache key. The cache is a bootstrap fallback
|
|
4
6
|
* only — the backend account setting and the `nt_theme` cookie always
|
|
@@ -68,6 +70,60 @@ export function writeThemeCache(preference, storage = getDefaultThemeStorage())
|
|
|
68
70
|
/* Cache is best-effort only. */
|
|
69
71
|
}
|
|
70
72
|
}
|
|
73
|
+
export function readAppearanceCache(storage = getDefaultThemeStorage()) {
|
|
74
|
+
if (!storage) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
try {
|
|
78
|
+
const raw = storage.getItem(NT_APPEARANCE_CACHE_KEY);
|
|
79
|
+
if (raw !== null) {
|
|
80
|
+
try {
|
|
81
|
+
const preference = normalizeAppearancePreference(JSON.parse(raw));
|
|
82
|
+
if (preference !== null) {
|
|
83
|
+
return preference;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
/* Removed below. */
|
|
88
|
+
}
|
|
89
|
+
storage.removeItem(NT_APPEARANCE_CACHE_KEY);
|
|
90
|
+
}
|
|
91
|
+
const legacyTheme = readThemeCache(storage);
|
|
92
|
+
return legacyTheme === null ? null : appearanceFromTheme(legacyTheme);
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
export function writeAppearanceCache(preference, storage = getDefaultThemeStorage()) {
|
|
99
|
+
if (!storage) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const normalized = normalizeAppearancePreference(preference);
|
|
103
|
+
if (normalized === null) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
try {
|
|
107
|
+
storage.setItem(NT_APPEARANCE_CACHE_KEY, JSON.stringify(normalized));
|
|
108
|
+
// Keep the frozen theme-only key synchronized for older applications.
|
|
109
|
+
storage.setItem(NT_THEME_CACHE_KEY, normalized.theme);
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
/* Cache is best-effort only. */
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
export function clearAppearanceCache(storage = getDefaultThemeStorage()) {
|
|
116
|
+
if (!storage) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
try {
|
|
120
|
+
storage.removeItem(NT_APPEARANCE_CACHE_KEY);
|
|
121
|
+
storage.removeItem(NT_THEME_CACHE_KEY);
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
/* Cache is best-effort only. */
|
|
125
|
+
}
|
|
126
|
+
}
|
|
71
127
|
/**
|
|
72
128
|
* Removes the cached preference. Storage errors never throw.
|
|
73
129
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/appearance/cache.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/appearance/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,6BAA6B,EAC7B,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AAGzB,2FAA2F;AAC3F,MAAM,CAAC,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;AAElE;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AAExD;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAsB;IAC3D,WAAW;IACX,eAAe;IACf,SA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YAED,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;gBACtB,OAAO,CAAC,OAAO,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;YAChD,CAAC;QACH,CAAC;QAED,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;YAC7B,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;QAED,OAAO,QAAQ,IAAI,QAAQ,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ThemePreference } from './types.js';
|
|
1
|
+
import type { NtAppearancePreference, ThemePreference } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Shared-domain bootstrap cookie set by the backend
|
|
4
4
|
* (`Domain=.neetechs.com; Secure; SameSite=Lax` in production).
|
|
@@ -6,6 +6,13 @@ import type { ThemePreference } from './types.js';
|
|
|
6
6
|
* source of truth.
|
|
7
7
|
*/
|
|
8
8
|
export declare const NT_THEME_COOKIE_NAME = "nt_theme";
|
|
9
|
+
export interface NtAppearanceCookieOptions {
|
|
10
|
+
domain?: string;
|
|
11
|
+
path?: string;
|
|
12
|
+
sameSite?: 'Strict' | 'Lax' | 'None';
|
|
13
|
+
secure?: boolean;
|
|
14
|
+
maxAge?: number;
|
|
15
|
+
}
|
|
9
16
|
/**
|
|
10
17
|
* Reads the `nt_theme` bootstrap cookie. Only reads this single cookie —
|
|
11
18
|
* never authentication or other sensitive cookies.
|
|
@@ -15,4 +22,12 @@ export declare const NT_THEME_COOKIE_NAME = "nt_theme";
|
|
|
15
22
|
* otherwise `null` is returned.
|
|
16
23
|
*/
|
|
17
24
|
export declare function readThemeCookie(cookieString?: string): ThemePreference | null;
|
|
25
|
+
/** Reads either the versioned appearance payload or the legacy raw theme value. */
|
|
26
|
+
export declare function readAppearanceCookie(cookieString?: string): NtAppearancePreference | null;
|
|
27
|
+
export declare function serializeAppearanceCookieValue(preference: NtAppearancePreference): string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Produces a browser cookie assignment / Set-Cookie value. Domain is optional
|
|
30
|
+
* so local development works; production may pass `.neetechs.com`.
|
|
31
|
+
*/
|
|
32
|
+
export declare function createAppearanceCookie(preference: NtAppearancePreference, options?: NtAppearanceCookieOptions): string | null;
|
|
18
33
|
//# sourceMappingURL=cookie.d.ts.map
|