@human-synthesis/norns-ui 0.2.0 → 0.2.2

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": "@human-synthesis/norns-ui",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "UI library for the Norns ecosystem — Pug + Civet components on Tailwind v4.",
5
5
  "license": "MIT",
6
6
  "author": "Daniel Teodoroiu (https://humansynthesis.ai)",
@@ -16,6 +16,7 @@
16
16
  target!="{target}"
17
17
  rel!="{rel}"
18
18
  class!="{classes}"
19
+ aria-label!="{ariaLabel}"
19
20
  aria-disabled!="{disabled || loading ? 'true' : undefined}"
20
21
  )
21
22
  | {@render body()}
@@ -25,6 +26,7 @@
25
26
  class!="{classes}"
26
27
  disabled!="{disabled || loading}"
27
28
  onclick!="{onclick}"
29
+ aria-label!="{ariaLabel}"
28
30
  aria-busy!="{loading ? 'true' : undefined}"
29
31
  )
30
32
  | {@render body()}
@@ -44,6 +46,9 @@
44
46
  href
45
47
  target
46
48
  rel
49
+ // Icon-only buttons (icon set, no children) have no accessible name
50
+ // without this — always pass ariaLabel for those.
51
+ ariaLabel
47
52
  children
48
53
  leading
49
54
  trailing
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "library": "@human-synthesis/norns-ui",
3
- "version": "0.1.0",
3
+ "version": "0.2.2",
4
4
  "counts": {
5
5
  "components": 78,
6
6
  "motion": 5,
@@ -372,6 +372,11 @@
372
372
  "type": "string",
373
373
  "required": false
374
374
  },
375
+ {
376
+ "name": "ariaLabel",
377
+ "type": "string",
378
+ "required": false
379
+ },
375
380
  {
376
381
  "name": "class",
377
382
  "type": "string",
@@ -1697,3 +1697,73 @@
1697
1697
  }
1698
1698
  .carousel-dot-active { background-color: var(--color-bg-inverse); }
1699
1699
  }
1700
+
1701
+ @layer components {
1702
+ /* ============================================================ */
1703
+ /* App shell — the generated +layout.svelte (spec-first apps) */
1704
+ /* ============================================================ */
1705
+
1706
+ .norns-shell {
1707
+ @apply grid min-h-screen;
1708
+ grid-template-columns: 15rem minmax(0, 1fr);
1709
+ }
1710
+ .norns-sidebar {
1711
+ @apply sticky top-0 flex h-screen flex-col gap-4 overflow-y-auto border-r px-3 py-4;
1712
+ border-color: var(--color-border);
1713
+ background-color: var(--color-bg);
1714
+ }
1715
+ .norns-brand {
1716
+ @apply px-2 text-sm font-semibold tracking-wide;
1717
+ color: var(--color-fg);
1718
+ }
1719
+ .norns-nav {
1720
+ @apply flex flex-col gap-0.5;
1721
+ }
1722
+ .norns-nav a {
1723
+ @apply block px-2 py-1.5 text-sm no-underline;
1724
+ color: var(--color-fg-muted);
1725
+ border-radius: var(--ui-radius-sm);
1726
+ transition:
1727
+ background-color var(--ui-motion-fast) var(--ui-motion-ease),
1728
+ color var(--ui-motion-fast) var(--ui-motion-ease);
1729
+ }
1730
+ .norns-nav a:hover {
1731
+ background-color: var(--color-bg-muted);
1732
+ color: var(--color-fg);
1733
+ }
1734
+ .norns-nav a:focus-visible {
1735
+ outline: none;
1736
+ box-shadow: var(--ui-focus-ring);
1737
+ }
1738
+ .norns-nav a[aria-current='page'] {
1739
+ @apply font-medium;
1740
+ background-color: var(--color-bg-muted);
1741
+ color: var(--color-fg);
1742
+ }
1743
+ .norns-main {
1744
+ @apply min-w-0 px-8 py-6;
1745
+ }
1746
+ @media (max-width: 40rem) {
1747
+ .norns-shell {
1748
+ grid-template-columns: 1fr;
1749
+ }
1750
+ .norns-sidebar {
1751
+ @apply static h-auto flex-row items-center gap-3 border-r-0 border-b py-2;
1752
+ }
1753
+ .norns-nav {
1754
+ @apply flex-1 flex-row overflow-x-auto;
1755
+ }
1756
+ .norns-main {
1757
+ @apply px-4 py-4;
1758
+ }
1759
+ }
1760
+
1761
+ /* Generated page container: readable width, consistent rhythm. */
1762
+ .norns-page {
1763
+ @apply mx-auto flex w-full flex-col gap-6;
1764
+ max-width: 72rem;
1765
+ }
1766
+ .norns-page-title {
1767
+ @apply text-2xl font-semibold tracking-tight leading-snug;
1768
+ }
1769
+ }
@@ -25,6 +25,12 @@ export type BtnProps = Omit<HTMLButtonAttributes, 'class' | 'children'> & {
25
25
  href?: string;
26
26
  target?: string;
27
27
  rel?: string;
28
+ /**
29
+ * Accessible name, rendered as `aria-label`. Required in practice for
30
+ * icon-only buttons (`icon` set, no `children`), which otherwise have
31
+ * no accessible name at all.
32
+ */
33
+ ariaLabel?: string;
28
34
  class?: string;
29
35
  children?: Snippet;
30
36
  leading?: Snippet;