anentrypoint-design 0.0.208 → 0.0.209

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.
@@ -15,7 +15,7 @@ export function Chip({ tone = '', children }) {
15
15
  return h('span', { class: 'chip' + (tone ? ' tone-' + tone : '') }, children);
16
16
  }
17
17
 
18
- export function Btn({ href, variant = 'default', children, onClick, 'aria-label': ariaLabel, primary, ghost, danger, disabled, className }) {
18
+ export function Btn({ href, variant = 'default', children, onClick, 'aria-label': ariaLabel, primary, ghost, danger, disabled, className, key }) {
19
19
  // Support legacy primary/ghost props for backward compatibility, but prefer variant
20
20
  const resolvedVariant = variant !== 'default' ? variant : (primary ? 'primary' : (ghost ? 'ghost' : (danger ? 'danger' : 'default')));
21
21
  const cls = (resolvedVariant === 'primary' ? 'btn-primary' : (resolvedVariant === 'ghost' ? 'btn-ghost' : (resolvedVariant === 'danger' ? 'btn-primary danger' : 'btn')))
@@ -37,6 +37,7 @@ export function Btn({ href, variant = 'default', children, onClick, 'aria-label'
37
37
  const isLink = href != null && href !== '' && href !== '#';
38
38
  if (isLink) {
39
39
  return h('a', {
40
+ key,
40
41
  class: cls, href,
41
42
  'aria-label': ariaName,
42
43
  'aria-disabled': disabled ? 'true' : null,
@@ -45,6 +46,7 @@ export function Btn({ href, variant = 'default', children, onClick, 'aria-label'
45
46
  }, ...kids);
46
47
  }
47
48
  return h('button', {
49
+ key,
48
50
  type: 'button', class: cls,
49
51
  disabled: disabled ? true : null,
50
52
  'aria-label': ariaName,
@@ -159,6 +161,9 @@ const ICON_PATHS = {
159
161
  // Icon(); use innerHTML = iconMarkup(name). Keeps the icon paths upstream so
160
162
  // raw-DOM call sites never reintroduce decorative glyph literals.
161
163
  export function iconMarkup(name, { size = 16 } = {}) {
164
+ // Accept the props-object shape too - every sibling component takes a
165
+ // single object, so Icon({name}) is what the barrel trains consumers to try.
166
+ if (name && typeof name === 'object') ({ name, size = 16 } = name);
162
167
  const inner = ICON_PATHS[name];
163
168
  if (!inner) return '';
164
169
  return '<svg class="ds-icon ds-icon-' + name + '" width="' + size + '" height="' + size +
@@ -166,6 +171,7 @@ export function iconMarkup(name, { size = 16 } = {}) {
166
171
  ' stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">' + inner + '</svg>';
167
172
  }
168
173
  export function Icon(name, { size = 16 } = {}) {
174
+ if (name && typeof name === 'object') ({ name, size = 16 } = name);
169
175
  const inner = ICON_PATHS[name];
170
176
  if (!inner) return h('span', { class: 'glyph', 'aria-hidden': 'true' }, '');
171
177
  return h('svg', {
@@ -34,19 +34,26 @@ export function ThemeToggle({ compact = false, onChange } = {}) {
34
34
  const current = getTheme();
35
35
 
36
36
  if (compact) {
37
- const resolved = resolvedTheme();
38
- const label = current === 'auto' ? `auto (${resolved})` : (current === 'ink' ? 'dark' : 'light');
37
+ // Plain words only - 'ink'/'paper' are internal theme codenames a user
38
+ // never chose; the resolved scheme rides in the title, not the label.
39
+ const resolvedWord = resolvedTheme() === 'ink' ? 'dark' : 'light';
40
+ const word = current === 'auto' ? 'auto' : (current === 'ink' ? 'dark' : 'light');
41
+ const label = 'theme: ' + word;
39
42
  return h('button', {
40
43
  class: 'btn ds-theme-toggle',
41
44
  type: 'button',
42
- 'aria-label': 'theme: ' + label,
43
- title: 'theme: ' + label + ' — click to cycle',
45
+ 'aria-label': label,
46
+ title: label + (current === 'auto' ? ' (currently ' + resolvedWord + ')' : '') + ' — click to cycle',
44
47
  onclick: () => {
45
48
  const next = current === 'auto' ? 'paper' : (current === 'paper' ? 'ink' : 'auto');
46
49
  applyTheme(next);
47
50
  if (onChange) try { onChange(next); } catch {}
48
51
  }
49
- }, label);
52
+ },
53
+ // CSS-drawn half-disc so the control still reads as the theme switch
54
+ // when the label is hidden (icon-only rail strip).
55
+ h('span', { class: 'ds-theme-disc', 'aria-hidden': 'true' }),
56
+ h('span', { class: 'ds-theme-toggle-label' }, label));
50
57
  }
51
58
 
52
59
  return h('div', {