anentrypoint-design 0.0.312 → 0.0.313

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anentrypoint-design",
3
- "version": "0.0.312",
3
+ "version": "0.0.313",
4
4
  "description": "247420 design system SDK — webjsx + modified ripple-ui, single-file ESM bundle for reproducible use of the AnEntrypoint design.",
5
5
  "type": "module",
6
6
  "main": "./dist/247420.js",
@@ -547,7 +547,10 @@ export function SearchInput({ value = '', placeholder = 'search…', onInput, on
547
547
  h('span', { key: 'cnt', class: 'sr-only', role: 'status', 'aria-live': 'polite' }, resultCount));
548
548
  }
549
549
 
550
- export function TextField({ label, value = '', type = 'text', placeholder = '', onInput, onChange, name, key, hint, multiline, rows = 4, maxLength, min, max, error, title, 'aria-label': ariaLabel, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy }) {
550
+ export function TextField({ label, value = '', type = 'text', placeholder = '', onInput, onChange, name, key, hint, multiline, rows = 4, maxLength, min, max, error, title, size = 'md', 'aria-label': ariaLabel, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy }) {
551
+ // size: 'sm' | 'md' | 'lg' — md is the base .ds-field control; sm/lg add a
552
+ // wrapper modifier that snaps the control height/padding/font to --ctl-*.
553
+ const sizeCls = size === 'sm' ? ' ds-field--sm' : (size === 'lg' ? ' ds-field--lg' : '');
551
554
  const errorId = error != null ? ((key ? key : 'tf') + '-err') : null;
552
555
  const describedBy = ariaDescribedBy || errorId || null;
553
556
  const input = multiline
@@ -573,7 +576,7 @@ export function TextField({ label, value = '', type = 'text', placeholder = '',
573
576
  oninput: onInput ? (e) => onInput(e.target.value, e) : null,
574
577
  onchange: onChange ? (e) => onChange(e.target.value, e) : null
575
578
  });
576
- return h('label', { key, class: 'ds-field' },
579
+ return h('label', { key, class: 'ds-field' + sizeCls },
577
580
  ...[
578
581
  label != null ? h('span', { key: 'l', class: 'ds-field-label' }, label) : null,
579
582
  input,
@@ -584,7 +587,8 @@ export function TextField({ label, value = '', type = 'text', placeholder = '',
584
587
  );
585
588
  }
586
589
 
587
- export function Select({ label, value = '', options = [], onChange, name, key, placeholder, hint, title, 'aria-label': ariaLabel }) {
590
+ export function Select({ label, value = '', options = [], onChange, name, key, placeholder, hint, title, size = 'md', 'aria-label': ariaLabel }) {
591
+ const sizeCls = size === 'sm' ? ' ds-field--sm' : (size === 'lg' ? ' ds-field--lg' : '');
588
592
  const opts = [];
589
593
  if (placeholder != null) opts.push(h('option', { key: '_ph', value: '', disabled: true, selected: value === '' || value == null }, placeholder));
590
594
  for (const o of options) {
@@ -599,8 +603,9 @@ export function Select({ label, value = '', options = [], onChange, name, key, p
599
603
  title,
600
604
  onchange: onChange ? (e) => onChange(e.target.value, e) : null
601
605
  }, ...opts);
602
- if (label == null && hint == null) return select;
603
- return h('label', { key, class: 'ds-field' },
606
+ if (label == null && hint == null && size === 'md') return select;
607
+ if (label == null && hint == null) return h('label', { key, class: 'ds-field' + sizeCls }, select);
608
+ return h('label', { key, class: 'ds-field' + sizeCls },
604
609
  label != null ? h('span', { key: 'l', class: 'ds-field-label' }, label) : null,
605
610
  select,
606
611
  hint != null ? h('span', { key: 'h', class: 'ds-field-hint' }, hint) : null
@@ -53,7 +53,30 @@ export function Tabs({ items = [], active, onChange, children, 'aria-label': ari
53
53
  if (btn) btn.focus();
54
54
  });
55
55
  };
56
- return h('div', { class: 'ds-ep-tabs' },
56
+ // Position the sliding underline from the active tab's geometry. The ref is
57
+ // on the OUTER .ds-ep-tabs (position:relative) — the indicator is its child,
58
+ // NOT the flex head's (an abspos child of a horizontal flex row mis-sizes to
59
+ // 0 in Chromium). Runs on every render (ref fires after applyDiff) so a tab
60
+ // change re-measures; the CSS transition animates the move. left/width come
61
+ // from the active tab; top sits the bar on the head's bottom edge.
62
+ const positionSlider = (root) => {
63
+ if (!root) return;
64
+ const head = root.querySelector('.ds-ep-tabs-head');
65
+ const active = root.querySelector('.ds-ep-tab.active');
66
+ const ind = root.querySelector('.ds-ep-tab-indicator');
67
+ if (!head || !active || !ind) return;
68
+ // Size via left+right insets, NOT width: an abspos element's inline
69
+ // `width` computes to 0 in some flex-sibling layouts (Chromium), but
70
+ // left+right insets size reliably. left/right animate via the CSS
71
+ // transition on .ds-ep-tab-indicator.
72
+ const rootW = root.offsetWidth;
73
+ const l = active.offsetLeft, w = active.offsetWidth;
74
+ ind.style.left = l + 'px';
75
+ ind.style.right = Math.max(0, rootW - l - w) + 'px';
76
+ ind.style.top = (head.offsetTop + head.offsetHeight - 2) + 'px';
77
+ head.classList.add('has-slider');
78
+ };
79
+ return h('div', { class: 'ds-ep-tabs', ref: positionSlider },
57
80
  h('div', { class: 'ds-ep-tabs-head', role: 'tablist', 'aria-label': ariaLabel || 'tabs' },
58
81
  ...items.map((it, idx) => h('button', {
59
82
  key: it.id,
@@ -69,6 +92,9 @@ export function Tabs({ items = [], active, onChange, children, 'aria-label': ari
69
92
  onkeydown: (e) => onTabKeyDown(e, idx)
70
93
  }, it.label))
71
94
  ),
95
+ // The sliding underline — child of the outer column (see positionSlider).
96
+ // Keyed + decorative. Renders at 0-width until positioned (no-JS: hidden).
97
+ h('span', { key: '__ind', class: 'ds-ep-tab-indicator', 'aria-hidden': 'true' }),
72
98
  h('div', {
73
99
  class: 'ds-ep-tabs-body',
74
100
  role: 'tabpanel',
@@ -12,14 +12,22 @@ export function Brand({ name = '247420', leaf } = {}) {
12
12
  leaf || null);
13
13
  }
14
14
 
15
- export function Chip({ tone = '', children }) {
16
- return h('span', { class: 'chip' + (tone ? ' tone-' + tone : '') }, children);
15
+ export function Chip({ tone = '', size = 'md', tag = false, children }) {
16
+ // size: 'sm' | 'md' | 'lg'; tag=true -> rectangular sentence-case variant
17
+ // for dense data (drops the all-caps pill). Both are orthogonal to tone.
18
+ const sizeCls = size === 'sm' ? ' chip--sm' : (size === 'lg' ? ' chip--lg' : '');
19
+ return h('span', { class: 'chip' + sizeCls + (tag ? ' chip--tag' : '') + (tone ? ' tone-' + tone : '') }, children);
17
20
  }
18
21
 
19
- export function Btn({ href, variant = 'default', children, onClick, 'aria-label': ariaLabel, primary, ghost, danger, disabled, class: className, key }) {
22
+ export function Btn({ href, variant = 'default', size = 'md', children, onClick, 'aria-label': ariaLabel, primary, ghost, danger, disabled, class: className, key }) {
20
23
  // Support legacy primary/ghost props for backward compatibility, but prefer variant
21
24
  const resolvedVariant = variant !== 'default' ? variant : (primary ? 'primary' : (ghost ? 'ghost' : (danger ? 'danger' : 'default')));
25
+ // size: 'sm' | 'md' | 'lg' — md is the base .btn rule (no class); sm/lg add a
26
+ // modifier that snaps height/padding/font to the --ctl-* ladder. Unknown
27
+ // sizes fall back to md so a typo never drops the button's base styling.
28
+ const sizeCls = size === 'sm' ? ' btn-sm' : (size === 'lg' ? ' btn-lg' : '');
22
29
  const cls = (resolvedVariant === 'primary' ? 'btn-primary' : (resolvedVariant === 'ghost' ? 'btn-ghost' : (resolvedVariant === 'danger' ? 'btn-primary danger' : 'btn')))
30
+ + sizeCls
23
31
  + (disabled ? ' is-disabled' : '')
24
32
  + (className ? ' ' + className : '');
25
33
  const onclick = (e) => {
@@ -67,8 +75,10 @@ export function IconButton({ icon, onClick, title, size = 'base', variant = 'gho
67
75
  }, Glyph({ children: icon, size }));
68
76
  }
69
77
 
70
- export function Badge({ children, variant = 'default', tone = 'neutral' }) {
71
- return h('span', { class: 'ds-badge ds-badge-' + variant + ' tone-' + tone }, children);
78
+ export function Badge({ children, variant = 'default', tone = 'neutral', size = 'md' }) {
79
+ // size: 'sm' | 'md' | 'lg' — md is the base 18px badge.
80
+ const sizeCls = size === 'sm' ? ' ds-badge--sm' : (size === 'lg' ? ' ds-badge--lg' : '');
81
+ return h('span', { class: 'ds-badge ds-badge-' + variant + sizeCls + ' tone-' + tone }, children);
72
82
  }
73
83
 
74
84
  // Pill — plain non-interactive label chip for tag-like annotations (a phase