@hubpav/hwio-ui 0.1.0 → 0.1.3

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.1.0",
3
+ "version": "0.1.3",
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",
@@ -20,7 +20,10 @@
20
20
  "./components/*": "./src/components/*",
21
21
  "./types": "./src/types.ts",
22
22
  "./schemas": "./src/schemas.ts",
23
- "./integration": "./src/integration.mjs",
23
+ "./integration": {
24
+ "types": "./src/integration.d.mts",
25
+ "default": "./src/integration.mjs"
26
+ },
24
27
  "./package.json": "./package.json",
25
28
  "./html": "./src/html.ts"
26
29
  },
@@ -28,9 +31,9 @@
28
31
  "build": "node scripts/build-themes.mjs"
29
32
  },
30
33
  "dependencies": {
31
- "@hubpav/hwio-brand": "0.1.0",
32
- "@hubpav/hwio-web-runtime": "0.1.0",
33
- "@hubpav/hwio-web-worker": "0.1.0",
34
+ "@hubpav/hwio-brand": "0.1.3",
35
+ "@hubpav/hwio-web-runtime": "0.1.3",
36
+ "@hubpav/hwio-web-worker": "0.1.3",
34
37
  "daisyui": "5.7.28"
35
38
  },
36
39
  "peerDependencies": {
@@ -31,8 +31,8 @@ const optional = ['preferences', 'statistics', 'marketing'] as const;
31
31
  </p>
32
32
  </div>
33
33
  <div class="flex flex-col gap-2 sm:flex-row md:shrink-0">
34
- <button type="button" data-hwio-consent-reject class="btn btn-outline btn-secondary">{labels.rejectAll}</button>
35
- {variant === 'categories' && labels.customize && <button type="button" data-hwio-consent-customize class="btn btn-outline btn-secondary">{labels.customize}</button>}
34
+ <button type="button" data-hwio-consent-reject class="btn btn-outline btn-primary">{labels.rejectAll}</button>
35
+ {variant === 'categories' && labels.customize && <button type="button" data-hwio-consent-customize class="btn btn-outline btn-primary">{labels.customize}</button>}
36
36
  <button type="button" data-hwio-consent-accept class="btn btn-primary">{labels.acceptAll}</button>
37
37
  </div>
38
38
  </div>
@@ -73,8 +73,8 @@ const optional = ['preferences', 'statistics', 'marketing'] as const;
73
73
  ))}
74
74
  </div>
75
75
  <div class="flex flex-col-reverse gap-2 sm:flex-row sm:justify-end">
76
- <button type="button" data-hwio-consent-reject class="btn btn-outline btn-secondary">{labels.rejectAll}</button>
77
- <button type="button" data-hwio-consent-save class="btn btn-outline btn-secondary">{labels.save}</button>
76
+ <button type="button" data-hwio-consent-reject class="btn btn-outline btn-primary">{labels.rejectAll}</button>
77
+ <button type="button" data-hwio-consent-save class="btn btn-outline btn-primary">{labels.save}</button>
78
78
  <button type="button" data-hwio-consent-accept class="btn btn-primary">{labels.acceptAll}</button>
79
79
  </div>
80
80
  </div>
@@ -20,14 +20,14 @@ interface Props {
20
20
  class?: string;
21
21
  }
22
22
  const { columns, social = [], branches, legal = [], cookieSettingsLabel, sites, copyright, tagline, class: className = '' } = Astro.props;
23
- const linkClass = 'link link-hover inline-flex items-center gap-1';
23
+ const linkClass = 'inline-flex items-center gap-1 text-neutral-content/80 transition-colors hover:text-accent';
24
24
  ---
25
25
  <footer class:list={['bg-neutral text-neutral-content', className]} data-hwio-footer>
26
26
  {social.length > 0 && (
27
27
  <div class="border-b border-neutral-content/10">
28
28
  <div class="container flex justify-center gap-6 py-6">
29
29
  {social.filter((s) => s.icon !== 'forum').map((s) => (
30
- <a href={s.href} target="_blank" rel="noopener noreferrer" class="hover:text-accent transition-colors" aria-label={s.label}>
30
+ <a href={s.href} target="_blank" rel="noopener noreferrer" class="text-neutral-content transition-colors hover:text-accent" aria-label={s.label}>
31
31
  <HWioIcon name={s.icon} class="size-9" />
32
32
  </a>
33
33
  ))}
@@ -74,7 +74,7 @@ const linkClass = 'link link-hover inline-flex items-center gap-1';
74
74
  {legal.map((l) => (
75
75
  <li><a href={l.href} target={l.external ? '_blank' : undefined} rel={l.external ? 'noopener noreferrer' : undefined} class={linkClass}>{l.label}{l.external && <HWioIcon name="download" size="sm" />}</a></li>
76
76
  ))}
77
- {cookieSettingsLabel && <li><button type="button" data-hwio-cookie-settings class="link link-hover text-left">{cookieSettingsLabel}</button></li>}
77
+ {cookieSettingsLabel && <li><button type="button" data-hwio-cookie-settings class="text-left text-neutral-content/80 transition-colors hover:text-accent">{cookieSettingsLabel}</button></li>}
78
78
  </ul>
79
79
  </div>
80
80
  )}
@@ -9,7 +9,7 @@ const { items, label, class: className = '' } = Astro.props;
9
9
  {items.map((site, i) => (
10
10
  <>
11
11
  {i > 0 && <span class="opacity-50" aria-hidden="true">&middot;</span>}
12
- <a href={site.href} target="_blank" rel="noopener noreferrer" class="link link-hover">{site.label}</a>
12
+ <a href={site.href} target="_blank" rel="noopener noreferrer" class="text-neutral-content/80 transition-colors hover:text-accent">{site.label}</a>
13
13
  </>
14
14
  ))}
15
15
  </nav>
@@ -30,7 +30,7 @@ const CTA_VARIANT = { primary: 'primary', secondary: 'secondary', ghost: 'ghost'
30
30
  </div>
31
31
 
32
32
  <nav class="hidden flex-1 justify-center lg:flex" aria-label={labels.nav} data-hwio-scrollspy={scrollspy ? 'true' : undefined}>
33
- <ul class="menu menu-horizontal gap-1 px-1">
33
+ <ul class="menu menu-horizontal flex-nowrap gap-0 px-0 whitespace-nowrap">
34
34
  {nav.map((item) => (
35
35
  <li>
36
36
  {item.mega ? (
@@ -41,7 +41,7 @@ const CTA_VARIANT = { primary: 'primary', secondary: 'secondary', ghost: 'ghost'
41
41
  </div>
42
42
  </details>
43
43
  ) : (
44
- <a href={item.href} class="text-[15px] font-medium text-base-content/80 hover:text-accent" aria-current={item.current ? 'page' : undefined} data-track={item.track?.id} data-track-location={item.track?.location ?? 'header'}>{item.label}</a>
44
+ <a href={item.href} class="px-3 text-[15px] font-medium text-base-content/80 hover:text-accent" aria-current={item.current ? 'page' : undefined} data-track={item.track?.id} data-track-location={item.track?.location ?? 'header'}>{item.label}</a>
45
45
  )}
46
46
  </li>
47
47
  ))}
@@ -8,7 +8,7 @@ const current = items.find((i) => i.current);
8
8
  {variant === 'pills' ? (
9
9
  <nav aria-label={label} class:list={['join', className]}>
10
10
  {items.map((i) => (
11
- <a href={i.href} hreflang={i.code} lang={i.code} class:list={['btn btn-sm join-item', i.current ? 'btn-primary' : 'btn-ghost']} aria-current={i.current ? 'page' : undefined}>{i.label}</a>
11
+ <a href={i.href} hreflang={i.code} lang={i.code} class:list={['btn btn-sm join-item', i.current ? 'btn-primary' : 'btn-ghost']} aria-current={i.current ? 'page' : undefined} title={i.label} aria-label={i.label}><span class="uppercase">{i.code}</span></a>
12
12
  ))}
13
13
  </nav>
14
14
  ) : (
@@ -20,7 +20,7 @@ const current = items.find((i) => i.current);
20
20
  </summary>
21
21
  <ul class="menu dropdown-content bg-base-100 rounded-box z-50 mt-2 w-44 p-2 shadow-lg border border-base-300" aria-label={label}>
22
22
  {items.map((i) => (
23
- <li><a href={i.href} hreflang={i.code} lang={i.code} class:list={[i.current ? 'menu-active' : '']} aria-current={i.current ? 'page' : undefined}>{i.label}</a></li>
23
+ <li><a href={i.href} hreflang={i.code} lang={i.code} class:list={[i.current ? 'menu-active' : '']} aria-current={i.current ? 'page' : undefined}>{i.label.toLowerCase() !== i.code.toLowerCase() && <span class="w-6 text-xs font-semibold uppercase opacity-60">{i.code}</span>}<span>{i.label}</span></a></li>
24
24
  ))}
25
25
  </ul>
26
26
  </details>
@@ -2,8 +2,8 @@
2
2
  /** Proof numbers in a hairline band with dividers (direction A); counts up on first view unless `animate` is false. */
3
3
  interface Props { id?: string; items: { value: string | number; suffix?: string; label: string; description?: string }[]; animate?: boolean; class?: string }
4
4
  const { id, items, animate = true, class: className = '' } = Astro.props;
5
- const COLS = { 2: 'sm:grid-cols-2', 3: 'sm:grid-cols-3', 4: 'sm:grid-cols-2 lg:grid-cols-4' } as const;
6
- const cols = COLS[(Math.min(Math.max(items.length, 2), 4) as 2 | 3 | 4)];
5
+ const COLS = { 2: 'sm:grid-cols-2', 3: 'sm:grid-cols-3', 4: 'sm:grid-cols-2 lg:grid-cols-4', 5: 'sm:grid-cols-2 lg:grid-cols-5' } as const;
6
+ const cols = COLS[(Math.min(Math.max(items.length, 2), 5) as 2 | 3 | 4 | 5)];
7
7
  ---
8
8
  <section id={id} class:list={['border-y border-base-300 bg-base-100 text-base-content', className]}>
9
9
  <div class:list={['container grid py-9', cols]}>
@@ -11,7 +11,7 @@ const cols = COLS[(Math.min(Math.max(items.length, 2), 4) as 2 | 3 | 4)];
11
11
  const numeric = typeof s.value === 'number';
12
12
  return (
13
13
  <div class:list={['px-8 py-2', i > 0 ? 'sm:border-l sm:border-base-300' : '']}>
14
- <div class="mb-2.5 text-[2.5rem] font-bold leading-none tracking-[-0.03em]">
14
+ <div class="mb-2.5 text-[2.25rem] font-bold leading-none tracking-[-0.03em] lg:text-[2.5rem]">
15
15
  <span class="hwio-stat-value" data-hwio-counter={animate && numeric ? 'true' : undefined} data-target={numeric ? String(s.value) : undefined} data-suffix={s.suffix ?? ''}>{s.value}{s.suffix ?? ''}</span>
16
16
  </div>
17
17
  <div class="text-[15px] font-semibold">{s.label}</div>
@@ -0,0 +1,9 @@
1
+ import type { AstroIntegration } from 'astro';
2
+ import type { HWioHeadersOptions } from '@hubpav/hwio-web-worker/headers';
3
+ export interface HWioUiOptions {
4
+ /** Security headers written into `_headers` at build time; `false` leaves the site's own file alone. */
5
+ headers?: HWioHeadersOptions | false;
6
+ /** Serve the brand fonts and logos in dev and copy them into the build output. */
7
+ assets?: boolean;
8
+ }
9
+ export function hwioUi(options?: HWioUiOptions): AstroIntegration;
@@ -20,8 +20,10 @@
20
20
  --font-sans: var(--hwio-font-sans);
21
21
  }
22
22
 
23
- /* One container for the fleet; width comes from the theme (hub) or the site (landing). */
24
- @utility container {
23
+ /* One container for the fleet; width comes from the theme (hub) or the site (landing).
24
+ Unlayered on purpose: Tailwind's built-in `container` utility caps max-width at each
25
+ breakpoint (40/48/64/80/96rem) and would otherwise win over the theme's width. */
26
+ .container {
25
27
  width: 100%;
26
28
  margin-inline: auto;
27
29
  max-width: var(--hwio-container);