@hubpav/hwio-ui 0.10.5 → 0.10.7

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": "@hubpav/hwio-ui",
3
- "version": "0.10.5",
3
+ "version": "0.10.7",
4
4
  "description": "HARDWARIO web design system for Astro: DaisyUI 5 themes generated from the brand tokens, the Tailwind entry stylesheet and the HWio* components.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -32,9 +32,9 @@
32
32
  "test": "node --test \"test/**/*.test.mjs\""
33
33
  },
34
34
  "dependencies": {
35
- "@hubpav/hwio-brand": "0.10.5",
36
- "@hubpav/hwio-web-runtime": "0.10.5",
37
- "@hubpav/hwio-web-worker": "0.10.5",
35
+ "@hubpav/hwio-brand": "0.10.7",
36
+ "@hubpav/hwio-web-runtime": "0.10.7",
37
+ "@hubpav/hwio-web-worker": "0.10.7",
38
38
  "daisyui": "5.7.47"
39
39
  },
40
40
  "peerDependencies": {
@@ -6,7 +6,8 @@ import HWioIcon from './HWioIcon.astro';
6
6
  * imperative verb, no article). `track` writes the measurement attributes data-track / data-track-location.
7
7
  * `arrow` (the page's primary call to action only) adds an arrow that nudges 3 px on hover and focus
8
8
  * (.hwio-arrow; no nudge under reduced motion). An external link shows the external glyph after the label
9
- * unless `externalIcon={false}` (HWioHeader's icon-only CTAs place it beside the label themselves).
9
+ * unless `externalIcon={false}` (HWioHeader's icon-only CTAs place it beside the label themselves); the
10
+ * glyph takes the arrow's place, so a link that opens a new tab always says so.
10
11
  */
11
12
  interface Props {
12
13
  href?: string;
@@ -33,12 +34,13 @@ const SIZE = { sm: 'btn-sm', md: '', lg: 'btn-lg', wide: 'btn-wide' } as const;
33
34
  const { href, external = false, variant = 'primary', size = 'md', track, arrow = false, externalIcon = true, type = 'button', class: className = '', ...rest } = Astro.props;
34
35
  const classes = [VARIANT[variant], SIZE[size], className];
35
36
  const trackAttrs = track ? { 'data-track': track.id, 'data-track-location': track.location } : {};
37
+ const showExternal = external && externalIcon;
36
38
  ---
37
39
  {href ? (
38
40
  <a href={href} class:list={classes} target={external ? '_blank' : undefined} rel={external ? 'noopener noreferrer' : undefined} {...trackAttrs} {...rest}>
39
41
  <slot />
40
- {arrow && <HWioIcon name="arrow-right" size="sm" class="hwio-arrow" />}
41
- {external && externalIcon && !arrow && <HWioIcon name="external" size="sm" />}
42
+ {arrow && !showExternal && <HWioIcon name="arrow-right" size="sm" class="hwio-arrow" />}
43
+ {showExternal && <HWioIcon name="external" size="sm" />}
42
44
  </a>
43
45
  ) : (
44
46
  <button type={type} class:list={classes} {...trackAttrs} {...rest}>
@@ -15,7 +15,7 @@
15
15
  * The theme toggle and the language dropdown are quiet utilities (.hwio-utility: the nav's weight, size
16
16
  * and gray, thin icons). The language dropdown, the mega panels and the menu close each other: one
17
17
  * popup at a time (@hubpav/hwio-web-runtime/popup). A CTA with an icon collapses to the icon alone below
18
- * 2xl; an external CTA's arrow shows only beside its full label.
18
+ * 2xl and carries no external arrow: its icon already says where it goes (owner, 2026-11-03, the store's bag).
19
19
  *
20
20
  * `navDensity="tight"` with `desktopFrom="xl"`: between 1280 and 1535 px, where the container is still
21
21
  * 1280 px wide, the nav labels drop from 15 to 14 px and the item padding from 12 to 8 px, so a long nav
@@ -88,8 +88,6 @@ const linkAttrs = (item: HWioLinkItem) => (item.external ? { target: '_blank', r
88
88
  <HWioButton href={cta.href} external={cta.external} externalIcon={!cta.icon} variant={CTA_VARIANT[cta.variant ?? 'primary']} size="sm" track={cta.track ?? { id: 'header-cta', location: 'header' }} class={cta.icon ? '2xl:px-4 px-2.5' : ''} aria-label={cta.icon ? cta.label : undefined} title={cta.icon ? cta.label : undefined}>
89
89
  {cta.icon && <HWioIcon name={cta.icon as 'bag'} size="sm" />}
90
90
  {cta.icon ? <span class="hidden 2xl:inline">{cta.label}</span> : cta.label}
91
- {/* Collapsed (icon only, below 2xl) the button shows just its icon; the external glyph returns beside the label. */}
92
- {cta.icon && cta.external && <HWioIcon name="external" size="sm" class="hidden 2xl:block" />}
93
91
  </HWioButton>
94
92
  ))}
95
93
  </div>