@adia-ai/web-modules 0.4.7 → 0.4.9
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 +85 -0
- package/chat/chat-composer/chat-composer.a2ui.json +1 -0
- package/chat/chat-composer/chat-composer.d.ts +47 -0
- package/chat/chat-empty/chat-empty.a2ui.json +1 -0
- package/chat/chat-header/chat-header.a2ui.json +1 -0
- package/chat/chat-shell/chat-shell.a2ui.json +3 -0
- package/chat/chat-shell/chat-shell.d.ts +86 -0
- package/chat/chat-shell/chat-shell.yaml +4 -0
- package/chat/chat-sidebar/chat-sidebar.a2ui.json +1 -0
- package/chat/chat-sidebar/chat-sidebar.d.ts +70 -0
- package/chat/chat-status/chat-status.a2ui.json +1 -0
- package/chat/chat-thread/chat-thread.a2ui.json +1 -0
- package/chat/chat-thread/chat-thread.d.ts +38 -0
- package/editor/editor-canvas/editor-canvas.a2ui.json +1 -0
- package/editor/editor-canvas/editor-canvas.d.ts +40 -0
- package/editor/editor-canvas-empty/editor-canvas-empty.a2ui.json +1 -0
- package/editor/editor-shell/editor-shell.a2ui.json +1 -0
- package/editor/editor-shell/editor-shell.d.ts +21 -0
- package/editor/editor-sidebar/editor-sidebar.a2ui.json +11 -0
- package/editor/editor-sidebar/editor-sidebar.d.ts +63 -0
- package/editor/editor-sidebar/editor-sidebar.js +13 -6
- package/editor/editor-sidebar/editor-sidebar.yaml +14 -0
- package/editor/editor-statusbar/editor-statusbar.a2ui.json +1 -0
- package/editor/editor-toolbar/editor-toolbar.a2ui.json +1 -0
- package/editor/editor-toolbar/editor-toolbar.d.ts +39 -0
- package/editor/index.d.ts +5 -0
- package/editor/index.js +1 -0
- package/editor/utils.d.ts +8 -0
- package/editor/utils.js +47 -0
- package/package.json +9 -2
- package/runtime/a2ui-root/a2ui-root.a2ui.json +1 -0
- package/runtime/a2ui-root/a2ui-root.d.ts +47 -0
- package/runtime/gen-root/gen-root.a2ui.json +5 -0
- package/runtime/gen-root/gen-root.d.ts +23 -0
- package/runtime/gen-root/gen-root.yaml +6 -0
- package/shell/admin-command/admin-command.a2ui.json +1 -0
- package/shell/admin-command/admin-command.d.ts +50 -0
- package/shell/admin-content/admin-content.a2ui.json +1 -0
- package/shell/admin-page/admin-page.a2ui.json +1 -0
- package/shell/admin-page-body/admin-page-body.a2ui.json +1 -0
- package/shell/admin-page-header/admin-page-header.a2ui.json +1 -0
- package/shell/admin-scroll/admin-scroll.a2ui.json +1 -0
- package/shell/admin-shell/admin-shell.a2ui.json +1 -0
- package/shell/admin-shell/admin-shell.d.ts +49 -0
- package/shell/admin-sidebar/admin-sidebar.a2ui.json +1 -0
- package/shell/admin-sidebar/admin-sidebar.d.ts +68 -0
- package/shell/admin-statusbar/admin-statusbar.a2ui.json +1 -0
- package/shell/admin-topbar/admin-topbar.a2ui.json +1 -0
- package/simple/simple-content/simple-content.a2ui.json +1 -0
- package/simple/simple-hero/simple-hero.a2ui.json +1 -0
- package/simple/simple-shell/simple-shell.a2ui.json +1 -0
- package/simple/simple-shell/simple-shell.d.ts +29 -0
- package/theme/theme-panel/theme-panel.a2ui.json +9 -0
- package/theme/theme-panel/theme-panel.d.ts +77 -0
- package/theme/theme-panel/theme-panel.html +2 -0
- package/theme/theme-panel/theme-panel.yaml +10 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<theme-panel-ui>` — Module-tier appearance-preferences control surface. Owns the three knobs
|
|
3
|
+
of the AdiaUI theming contract: [data-theme=<slug>] named themes,
|
|
4
|
+
--a-density / --a-radius-k parametric overrides, and color-scheme
|
|
5
|
+
light/dark switching, plus optional localStorage persistence behind a
|
|
6
|
+
small attribute API.
|
|
7
|
+
|
|
8
|
+
Drops into any consumer's <popover-ui slot="content"> (the canonical
|
|
9
|
+
composition) or directly into a sidebar section. Eight named themes
|
|
10
|
+
ship by default; section visibility flips on/off via boolean attributes
|
|
11
|
+
([parametric], [presets], [scheme-toggle]).
|
|
12
|
+
|
|
13
|
+
Promoted from the duplicated <div id="theme-panel"> block in site/ and
|
|
14
|
+
playgrounds/admin-shell/ — see docs/specs/theme-panel-module.md.
|
|
15
|
+
|
|
16
|
+
*
|
|
17
|
+
* @see https://ui-kit.exe.xyz/site/components/theme-panel
|
|
18
|
+
*
|
|
19
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
20
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
21
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
22
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
23
|
+
* needed beyond what the yaml `events:` block can express.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
27
|
+
|
|
28
|
+
export interface ThemePanelThemeChangeEventDetail {
|
|
29
|
+
theme: string;
|
|
30
|
+
density: string;
|
|
31
|
+
radius: string;
|
|
32
|
+
scheme: string;
|
|
33
|
+
source: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type ThemePanelThemeChangeEvent = CustomEvent<ThemePanelThemeChangeEventDetail>;
|
|
37
|
+
|
|
38
|
+
export class UIThemePanel extends UIElement {
|
|
39
|
+
/** Renders the density + radius slider block. Sliders bind to
|
|
40
|
+
--a-density and --a-radius-k on the target element.
|
|
41
|
+
*/
|
|
42
|
+
parametric: boolean;
|
|
43
|
+
/** Persists selections to localStorage. Defaults to ephemeral so
|
|
44
|
+
playgrounds and embedded demos do not silently mutate a user's
|
|
45
|
+
docs-shell preferences.
|
|
46
|
+
*/
|
|
47
|
+
persist: boolean;
|
|
48
|
+
/** Renders the compact / reset / spacious preset row. Each preset
|
|
49
|
+
applies a (density, radius) pair; "default" also clears the
|
|
50
|
+
[data-theme] attribute.
|
|
51
|
+
*/
|
|
52
|
+
presets: boolean;
|
|
53
|
+
/** Initial color-scheme. "auto" follows prefers-color-scheme via a
|
|
54
|
+
matchMedia listener; user clicks on the scheme toggle promote to
|
|
55
|
+
an explicit light or dark choice.
|
|
56
|
+
*/
|
|
57
|
+
scheme: 'light' | 'dark' | 'auto';
|
|
58
|
+
/** CSS selector for the element that receives [data-theme] and
|
|
59
|
+
--a-density / --a-radius-k writes. Defaults to :root (the
|
|
60
|
+
<html> element). Scoped targets are useful for preview-pane
|
|
61
|
+
demos.
|
|
62
|
+
*/
|
|
63
|
+
target: string;
|
|
64
|
+
/** Space-separated list of theme slugs to render as buttons. Author
|
|
65
|
+
may restrict ([themes="default ocean"]) or extend. Tolerant —
|
|
66
|
+
unknown slugs render a button; clicking applies [data-theme=slug]
|
|
67
|
+
regardless of whether themes.css has a matching block.
|
|
68
|
+
*/
|
|
69
|
+
themes: string;
|
|
70
|
+
|
|
71
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
72
|
+
type: K,
|
|
73
|
+
listener: (this: UIThemePanel, ev: HTMLElementEventMap[K]) => unknown,
|
|
74
|
+
options?: boolean | AddEventListenerOptions,
|
|
75
|
+
): void;
|
|
76
|
+
addEventListener(type: 'theme-change', listener: (ev: ThemePanelThemeChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
77
|
+
}
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
<link rel="stylesheet" href="../../../web-components/components/code/code.css">
|
|
24
24
|
<link rel="stylesheet" href="../../../web-components/components/tag/tag.css">
|
|
25
25
|
|
|
26
|
+
<link rel="stylesheet" href="../segment/segment.css">
|
|
26
27
|
<!-- Module CSS -->
|
|
27
28
|
<link rel="stylesheet" href="./theme-panel.css">
|
|
28
29
|
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
<script type="module" src="../../../web-components/components/code/code.js"></script>
|
|
39
40
|
<script type="module" src="../../../web-components/components/tag/tag.js"></script>
|
|
40
41
|
|
|
42
|
+
<script type="module" src="../segment/segment.js"></script>
|
|
41
43
|
<!-- Module JS -->
|
|
42
44
|
<script type="module" src="./theme-panel.js"></script>
|
|
43
45
|
|
|
@@ -20,6 +20,16 @@ description: |
|
|
|
20
20
|
Promoted from the duplicated <div id="theme-panel"> block in site/ and
|
|
21
21
|
playgrounds/admin-shell/ — see docs/specs/theme-panel-module.md.
|
|
22
22
|
|
|
23
|
+
# Per ADR-0027 — primitives that programmatically create other primitives
|
|
24
|
+
# do NOT auto-import them. Consumer (or demo shell) must explicitly import.
|
|
25
|
+
composes:
|
|
26
|
+
- segmented-ui
|
|
27
|
+
- segment-ui
|
|
28
|
+
- text-ui
|
|
29
|
+
- button-ui
|
|
30
|
+
- divider-ui
|
|
31
|
+
- field-ui
|
|
32
|
+
- slider-ui
|
|
23
33
|
props:
|
|
24
34
|
themes:
|
|
25
35
|
description: |
|