@artooi/ag-ui-web-component 0.49.0 → 0.50.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.
@@ -44,6 +44,15 @@ export const FRAME_STYLES: string = `
44
44
  touch-action: auto;
45
45
  }
46
46
 
47
+ /* A panel that is the screen has nowhere to go, so its header refuses the drag
48
+ and must not offer it. No selector can see that a host has sized the panel to
49
+ the window, so the placement stamps this from the measurement that refuses the
50
+ drag. :host is carried for the specificity, not the scope, as below. Before the
51
+ dragging rule, so a drag the header did take keeps its grabbing cursor. */
52
+ :host .header[data-fills-screen] {
53
+ cursor: auto;
54
+ }
55
+
47
56
  /* :host is carried for the specificity, not the scope: the placement rules
48
57
  above are a host selector plus a class plus an attribute, and a bare
49
58
  .header[data-dragging] loses to them -- silently, because the drag still
@@ -93,6 +102,14 @@ export const FRAME_STYLES: string = `
93
102
  flex: none;
94
103
  }
95
104
 
105
+ /* Under every theme: once the host sets the header text, the header behind the
106
+ buttons is the host's colour, so their rest opacity goes. The frame's 0.85
107
+ lets the header through the glyph, which took white on a mid-blue header from
108
+ 5.1:1 to 4.2:1. With the header text set, the opacity below reads a colour,
109
+ which no opacity can be, so it is invalid at computed-value time and falls to
110
+ the initial 1; unset, it reads the fallback. The glyph is each theme's own
111
+ business: this inherits the header text, and a theme that draws the buttons
112
+ in another ink reads the same switch to yield. */
96
113
  .header-btn {
97
114
  display: inline-flex;
98
115
  flex: 0 0 auto;
@@ -109,11 +126,14 @@ export const FRAME_STYLES: string = `
109
126
  padding: 0;
110
127
  border-radius: 6px;
111
128
  cursor: pointer;
112
- opacity: 0.85;
129
+ opacity: var(--_header-fg-set, 0.85);
113
130
  }
114
131
 
132
+ /* The square is the host's own when it set one; otherwise it is mixed from the
133
+ header text when the host set that, so it reads on any header the host
134
+ painted; otherwise it is the theme's own. See the alias in the token defaults. */
115
135
  .header-btn:hover {
116
136
  opacity: 1;
117
- background: rgba(255, 255, 255, 0.18);
137
+ background: var(--_header-btn-hover);
118
138
  }
119
139
  `;
@@ -61,18 +61,19 @@ export const TOKEN_STYLES: string = `
61
61
  /* Switches: a public token read with no fallback, named for it with -set.
62
62
  With the token unset the switch computes to the guaranteed-invalid value,
63
63
  so a rule that reads it with a fallback gets the fallback; that is how a
64
- rule tells a token the host set from the theme's default for it. The
65
- default theme's header buttons follow the header text only once a host
66
- sets it, and a step group's calls follow the tool token only once a host
67
- sets it (classic defaults --_tool-fg to the accent, which a group never
68
- drew). */
64
+ rule tells a token the host set from the theme's default for it. Every
65
+ theme's header buttons follow the header text only once a host sets it,
66
+ and a step group's calls follow the tool token only once a host sets it
67
+ (classic defaults --_tool-fg to the accent, which a group never drew). */
69
68
  --_header-fg-set: var(--ag-ui-header-fg);
70
69
  --_tool-fg-set: var(--ag-ui-tool-fg);
71
70
  /* The header buttons' hover square, by default, once the header text is
72
71
  set. Here it is the text at about a fifth, which every browser can mix;
73
72
  where relative colour syntax is supported (see the block at the end) it
74
73
  is the text's opposite instead. It reads the switch, so it is unset with
75
- it, and the square below falls to the panel's hover shade. */
74
+ it, and the square below falls to the theme's own: the panel's hover shade
75
+ here, restated by each theme that draws another, so one rule in the frame
76
+ paints them all. */
76
77
  --_header-btn-hover-auto: color-mix(in srgb, var(--_header-fg-set) 18%, transparent);
77
78
  --_header-btn-hover: var(--ag-ui-header-btn-hover, var(--_header-btn-hover-auto, var(--_hover)));
78
79
  --_border: var(--ag-ui-border, var(--_line));
@@ -18,6 +18,7 @@ export const CLASSIC_TOKENS: string = `
18
18
  --_tool-fg: var(--ag-ui-tool-fg, var(--_accent));
19
19
  --_header-bg: var(--ag-ui-header-bg, light-dark(var(--_accent), #1f1f30));
20
20
  --_header-fg: var(--ag-ui-header-fg, light-dark(#ffffff, #e8e8f2));
21
+ --_header-btn-hover: var(--ag-ui-header-btn-hover, var(--_header-btn-hover-auto, rgba(255, 255, 255, 0.18)));
21
22
  --_border: var(--ag-ui-border, light-dark(#e2e2ec, #33334a));
22
23
  --_muted: var(--ag-ui-muted, light-dark(#6b7280, #9aa0b4));
23
24
  --_success: var(--ag-ui-success, #15803d);
@@ -32,14 +32,15 @@ export const LEDGER_STYLES: string = `
32
32
  vertical-align: 1px;
33
33
  }
34
34
 
35
+ /* Both inks yield once the host sets the header text, since the header behind
36
+ them is then the host's colour (see the switches in the token defaults). */
35
37
  :host([theme~="ledger"]) .header-btn {
36
- color: var(--_ink-3);
38
+ color: var(--_header-fg-set, var(--_ink-3));
37
39
  border-radius: 3px;
38
40
  }
39
41
 
40
42
  :host([theme~="ledger"]) .header-btn:hover {
41
- background: var(--_hover);
42
- color: var(--_fg);
43
+ color: var(--_header-fg-set, var(--_fg));
43
44
  }
44
45
 
45
46
  :host([theme~="ledger"]) .message--user {
@@ -20,6 +20,7 @@ export const LEDGER_TOKENS: string = `
20
20
  --_msg-radius: var(--ag-ui-msg-radius, 0px);
21
21
  --_composer-radius: var(--ag-ui-composer-radius, 4px);
22
22
  --_user-bg: var(--ag-ui-user-bg, transparent);
23
+ --_header-btn-hover: var(--ag-ui-header-btn-hover, var(--_header-btn-hover-auto, var(--_hover)));
23
24
  --_frame-shadow: var(--ag-ui-frame-shadow, 0 0 0 1px var(--_line-strong), 0 20px 40px -28px rgb(0 0 0 / 0.45));
24
25
  --_launcher-bg: var(--ag-ui-launcher-bg, var(--_fg));
25
26
  --_launcher-fg: var(--ag-ui-launcher-fg, var(--_bg));
@@ -26,28 +26,15 @@ ${THEME_HOST.quiet} .header-title {
26
26
 
27
27
  /* The buttons sit back in the third ink on the panel. Once the host sets the
28
28
  header text they draw in it instead, since the header behind them is then
29
- the host's colour (see the switches in the token defaults). So does their
30
- rest opacity: the frame's 0.85 lets the header through the glyph, which
31
- took white on a mid-blue header from 5.1:1 to 4.2:1. With the header text
32
- set, the opacity below reads a colour, which no opacity can be, so it is
33
- invalid at computed-value time and falls to the initial 1; unset, it reads
34
- the fallback, the frame's own 0.85. */
29
+ the host's colour (see the switches in the token defaults). */
35
30
  ${THEME_HOST.quiet} .header-btn {
36
31
  color: var(--_header-fg-set, var(--_ink-3));
37
- opacity: var(--_header-fg-set, 0.85);
38
32
  border-radius: 8px;
39
33
  }
40
34
 
41
- /* The hover square is the host's own when it set one; otherwise it is mixed
42
- from the header text when the host set that, so it reads on any header the
43
- host painted; otherwise it is the panel shade.
44
- The glyph takes the header text, which is the full ink when that is unset.
45
- The opacity restates the frame's hover value, which the rest rule above
46
- outweighs. */
35
+ /* The glyph takes the header text, which is the full ink when that is unset. */
47
36
  ${THEME_HOST.quiet} .header-btn:hover {
48
37
  color: var(--_header-fg);
49
- opacity: 1;
50
- background: var(--_header-btn-hover);
51
38
  }
52
39
 
53
40
  ${THEME_HOST.quiet} .message--user {
@@ -31,14 +31,15 @@ export const SOFT_STYLES: string = `
31
31
  background: linear-gradient(140deg, color-mix(in oklch, var(--_accent) 55%, var(--_bg)), var(--_accent));
32
32
  }
33
33
 
34
+ /* Both inks yield once the host sets the header text, since the header behind
35
+ them is then the host's colour (see the switches in the token defaults). */
34
36
  :host([theme~="soft"]) .header-btn {
35
- color: var(--_ink-3);
37
+ color: var(--_header-fg-set, var(--_ink-3));
36
38
  border-radius: 10px;
37
39
  }
38
40
 
39
41
  :host([theme~="soft"]) .header-btn:hover {
40
- background: var(--_tint-2);
41
- color: var(--_accent-ink);
42
+ color: var(--_header-fg-set, var(--_accent-ink));
42
43
  }
43
44
 
44
45
  :host([theme~="soft"]) .messages {
@@ -10,6 +10,7 @@ export const SOFT_TOKENS: string = `
10
10
  --_tint: var(--ag-ui-tint, color-mix(in oklch, var(--_accent) 5%, var(--_bg)));
11
11
  --_tint-2: var(--ag-ui-tint-2, color-mix(in oklch, var(--_accent) 13%, var(--_bg)));
12
12
  --_header-bg: var(--ag-ui-header-bg, var(--_tint));
13
+ --_header-btn-hover: var(--ag-ui-header-btn-hover, var(--_header-btn-hover-auto, var(--_tint-2)));
13
14
  --_user-bg: var(--ag-ui-user-bg, var(--_tint-2));
14
15
  --_border: var(--ag-ui-border, color-mix(in oklch, var(--_accent) 14%, var(--_bg)));
15
16
  --_radius: var(--ag-ui-radius, 16px);
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION: string = "0.49.0";
1
+ export const VERSION: string = "0.50.0";