@madecki/ui 1.5.0 → 2.1.0
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/CHANGELOG.md +30 -0
- package/README.md +99 -12
- package/cursor-rule-template.md +1 -1
- package/dist/index.cjs +362 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +79 -8
- package/dist/index.d.ts +79 -8
- package/dist/index.js +361 -69
- package/dist/index.js.map +1 -1
- package/llm-context.md +31 -13
- package/package.json +5 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
## [2.1.0](https://github.com/madecki/ui/compare/v2.0.0...v2.1.0) (2026-04-08)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* add DetailsPanel native details/summary disclosure ([d1d24d9](https://github.com/madecki/ui/commit/d1d24d989537fe1845aeb5059b3f59d745357c23))
|
|
6
|
+
* add Toast with placement, auto-close, and variants ([5874709](https://github.com/madecki/ui/commit/587470962cf265eafe8cc9659b78b073f6ef1756))
|
|
7
|
+
|
|
8
|
+
## [2.0.0](https://github.com/madecki/ui/compare/v1.5.0...v2.0.0) (2026-04-08)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* RadioButtons requires `label`. Group uses radiogroup; options use radio + aria-checked.
|
|
13
|
+
|
|
14
|
+
Made-with: Cursor
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* add visible form labels, Textarea, and automated changelog ([f00476c](https://github.com/madecki/ui/commit/f00476ca7c548f0e7c1397c22e426449bed2d3f1))
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* unblock release checks for Textarea story and workflows ([6aed8a7](https://github.com/madecki/ui/commit/6aed8a77fbb46ae9734024e0195cf323176abd31))
|
|
23
|
+
|
|
24
|
+
# Changelog
|
|
25
|
+
|
|
26
|
+
All release notes in this file are **generated automatically** by [semantic-release](https://semantic-release.gitbook.io/) when a version is published to npm. They are built **only** from [Conventional Commits](https://www.conventionalcommits.org/) on **`main`** (see **Releasing** in the repository README).
|
|
27
|
+
|
|
28
|
+
**Reading this file:** The **latest** published release is always the **topmost** `## [x.y.z]` section. It should match `"version"` in `package.json` inside the package you installed.
|
|
29
|
+
|
|
30
|
+
**Contributing:** Do not hand-edit versioned sections. Describe user-visible work in commits: use **`feat`**, **`fix`**, or **`perf`** so they appear in the notes. For **breaking** API or behavior changes, use a **`!`** after the type (e.g. **`feat!:`**) and/or a **`BREAKING CHANGE:`** paragraph in the commit **body**. [commitlint](https://commitlint.js.org/) validates messages on **`git commit`** (Husky) and on **every push to `main`** (CI).
|
package/README.md
CHANGED
|
@@ -424,6 +424,47 @@ Full-screen loading overlay.
|
|
|
424
424
|
<SpinnerOverlay isVisible={isLoading} />
|
|
425
425
|
```
|
|
426
426
|
|
|
427
|
+
#### Toast
|
|
428
|
+
|
|
429
|
+
Fixed-position message in any screen corner, with configurable auto-dismiss (milliseconds) and a close control. Border colors match semantic tokens (`info` uses the same blue accent as `ContentBox`).
|
|
430
|
+
|
|
431
|
+
```tsx
|
|
432
|
+
import { Toast } from "@madecki/ui";
|
|
433
|
+
import { useState } from "react";
|
|
434
|
+
|
|
435
|
+
function Example() {
|
|
436
|
+
const [toastKey, setToastKey] = useState(0);
|
|
437
|
+
|
|
438
|
+
return (
|
|
439
|
+
<>
|
|
440
|
+
<button type="button" onClick={() => setToastKey((n) => n + 1)}>
|
|
441
|
+
Save
|
|
442
|
+
</button>
|
|
443
|
+
{toastKey > 0 ? (
|
|
444
|
+
<Toast
|
|
445
|
+
key={toastKey}
|
|
446
|
+
variant="success"
|
|
447
|
+
placement="bottom-right"
|
|
448
|
+
autoCloseMs={4000}
|
|
449
|
+
onClose={() => setToastKey(0)}
|
|
450
|
+
>
|
|
451
|
+
<p className="text-white">Saved.</p>
|
|
452
|
+
</Toast>
|
|
453
|
+
) : null}
|
|
454
|
+
</>
|
|
455
|
+
);
|
|
456
|
+
}
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
| Prop | Type | Default | Description |
|
|
460
|
+
|------|------|---------|-------------|
|
|
461
|
+
| `children` | `ReactNode` | (required) | Message body (use `Text` / markup as needed). |
|
|
462
|
+
| `variant` | `"info"` \| `"success"` \| `"danger"` | `"info"` | Semantic style (border / live region). |
|
|
463
|
+
| `placement` | `"top-left"` \| `"top-right"` \| `"bottom-left"` \| `"bottom-right"` | `"bottom-right"` | Viewport corner (`fixed`, offset with spacing token `5`). |
|
|
464
|
+
| `autoCloseMs` | `number` | `5000` | Auto-dismiss delay in ms; use `0` to disable. |
|
|
465
|
+
| `onClose` | `() => void` | — | Fired when the toast is dismissed (timer or close control). |
|
|
466
|
+
| `className` | `string` | `""` | Extra classes on the root element. |
|
|
467
|
+
|
|
427
468
|
### Content Components
|
|
428
469
|
|
|
429
470
|
#### BlockQuote
|
|
@@ -452,6 +493,37 @@ import { ContentBox, Info, Warning } from "@madecki/ui";
|
|
|
452
493
|
</ContentBox>
|
|
453
494
|
```
|
|
454
495
|
|
|
496
|
+
#### DetailsPanel
|
|
497
|
+
|
|
498
|
+
Collapsible panel using native **`<details>`** and **`<summary>`** (accessible disclosure), with the same border variants as `ContentBox`.
|
|
499
|
+
|
|
500
|
+
```tsx
|
|
501
|
+
import { DetailsPanel, Info } from "@madecki/ui";
|
|
502
|
+
|
|
503
|
+
<DetailsPanel variant="info" summary="Show more">
|
|
504
|
+
<p className="text-white">Extra content appears here when expanded.</p>
|
|
505
|
+
</DetailsPanel>
|
|
506
|
+
|
|
507
|
+
<DetailsPanel
|
|
508
|
+
variant="warning"
|
|
509
|
+
icon={<Info />}
|
|
510
|
+
defaultOpen
|
|
511
|
+
summary="Important details"
|
|
512
|
+
>
|
|
513
|
+
<p className="text-white">Initially open; still toggles like a normal details element.</p>
|
|
514
|
+
</DetailsPanel>
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
| Prop | Type | Default | Description |
|
|
518
|
+
|------|------|---------|-------------|
|
|
519
|
+
| `summary` | `ReactNode` | (required) | Content of the `<summary>` row (click to toggle). |
|
|
520
|
+
| `children` | `ReactNode` | (required) | Panel body shown when open. |
|
|
521
|
+
| `variant` | `"info"` \| `"warning"` \| `"success"` \| `"danger"` | `"info"` | Border color (matches `ContentBox`). |
|
|
522
|
+
| `icon` | `ReactNode` | — | Optional icon before the summary text. |
|
|
523
|
+
| `defaultOpen` | `boolean` | `false` | Initial open state; toggling still uses native `<details>` behavior (open state is synced in React so `defaultOpen` works reliably). |
|
|
524
|
+
| `className` | `string` | `""` | Extra classes on `<details>`. |
|
|
525
|
+
| `id` | `string` | — | `id` on `<details>`. |
|
|
526
|
+
|
|
455
527
|
#### Hr
|
|
456
528
|
|
|
457
529
|
Styled horizontal rule.
|
|
@@ -574,30 +646,45 @@ src/components/ComponentName/
|
|
|
574
646
|
|
|
575
647
|
## Releasing
|
|
576
648
|
|
|
577
|
-
Releases are fully automated using [semantic-release](https://semantic-release.gitbook.io/). When commits are pushed to `main`, the
|
|
649
|
+
Releases are fully automated using [semantic-release](https://semantic-release.gitbook.io/). When commits are pushed to `main`, the **Release** workflow runs `typecheck`, `lint`, `build`, and **`npm test`**, then **`npx semantic-release`**, which in order:
|
|
650
|
+
|
|
651
|
+
1. Analyzes **conventional** commit messages since the last release to pick the **semver** bump
|
|
652
|
+
2. Generates release notes **only** from those commits
|
|
653
|
+
3. **Prepends** a new `## [version]` section to **`CHANGELOG.md`** and sets **`package.json`** `"version"`
|
|
654
|
+
4. Publishes to npm (the `prepublishOnly` script builds again)
|
|
655
|
+
5. Pushes the version commit, creates a Git tag, and opens a **GitHub Release**
|
|
578
656
|
|
|
579
|
-
|
|
580
|
-
2. Updates `package.json` and `CHANGELOG.md`
|
|
581
|
-
3. Creates a Git tag and GitHub Release
|
|
582
|
-
4. Publishes to NPM with provenance
|
|
657
|
+
There is **no** separate manual changelog step: if it is not described in a merged commit on `main`, it will not appear in **`CHANGELOG.md`**.
|
|
583
658
|
|
|
584
659
|
### Commit Message Format
|
|
585
660
|
|
|
586
|
-
This project uses [Conventional Commits](https://www.conventionalcommits.org/) enforced by [commitlint](https://commitlint.js.org/)
|
|
661
|
+
This project uses [Conventional Commits](https://www.conventionalcommits.org/) enforced by [commitlint](https://commitlint.js.org/):
|
|
662
|
+
|
|
663
|
+
- **Locally:** Husky runs **`commitlint`** on the **`commit-msg`** hook, so **`git commit` fails** if the message does not follow the rules (bypass only with **`git commit --no-verify`**).
|
|
664
|
+
- **Locally:** Husky runs **`npm run precheck`** on **`pre-push`** (typecheck, lint, build, tests, Storybook build — same as CI/Release). Bypass with **`git push --no-verify`** if you must.
|
|
665
|
+
- **On `main`:** CI runs commitlint on **every push** for the commits in that push, so bad messages are caught even if someone skipped the hook.
|
|
587
666
|
|
|
588
667
|
**Format:** `type(scope?): description`
|
|
589
668
|
|
|
590
|
-
| Type | Description | Release |
|
|
591
|
-
|
|
592
|
-
| `feat` | New feature | Minor |
|
|
593
|
-
| `fix` | Bug fix | Patch |
|
|
594
|
-
| `
|
|
669
|
+
| Type | Description | Release / changelog |
|
|
670
|
+
|------|-------------|---------------------|
|
|
671
|
+
| `feat` | New feature | Minor; appears under **Features** |
|
|
672
|
+
| `fix` | Bug fix | Patch; appears under **Bug Fixes** |
|
|
673
|
+
| `perf` | Performance improvement | Patch; appears under **Performance Improvements** |
|
|
674
|
+
| `docs` | Documentation only | None (not in changelog by default) |
|
|
595
675
|
| `style` | Code style (formatting) | None |
|
|
596
676
|
| `refactor` | Code change (no fix/feat) | None |
|
|
597
|
-
| `perf` | Performance improvement | Patch |
|
|
598
677
|
| `test` | Adding/updating tests | None |
|
|
599
678
|
| `chore` | Maintenance tasks | None |
|
|
600
679
|
|
|
680
|
+
**Breaking changes** (major bump): use **`feat!:`** / **`fix!:`** and/or a **`BREAKING CHANGE:`** paragraph in the commit **body** (after a blank line). Example body:
|
|
681
|
+
|
|
682
|
+
```text
|
|
683
|
+
feat!: require label on RadioButtons
|
|
684
|
+
|
|
685
|
+
BREAKING CHANGE: RadioButtons now requires a `label` prop.
|
|
686
|
+
```
|
|
687
|
+
|
|
601
688
|
### Examples
|
|
602
689
|
|
|
603
690
|
```bash
|
package/cursor-rule-template.md
CHANGED
|
@@ -44,7 +44,7 @@ This file contains:
|
|
|
44
44
|
## Import Pattern
|
|
45
45
|
|
|
46
46
|
\`\`\`tsx
|
|
47
|
-
import { Container, Stack, Heading, Text, Button } from "@madecki/ui";
|
|
47
|
+
import { Container, Stack, Heading, Text, Button, DetailsPanel, Toast } from "@madecki/ui";
|
|
48
48
|
import { Heart, Info } from "@madecki/ui";
|
|
49
49
|
\`\`\`
|
|
50
50
|
|