@f-ewald/components 0.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/LICENSE +28 -0
- package/README.md +147 -0
- package/custom-elements.json +3398 -0
- package/dist/address-autocomplete.d.ts +75 -0
- package/dist/address-autocomplete.d.ts.map +1 -0
- package/dist/address-autocomplete.js +342 -0
- package/dist/address-autocomplete.js.map +1 -0
- package/dist/animate-confetti.d.ts +53 -0
- package/dist/animate-confetti.d.ts.map +1 -0
- package/dist/animate-confetti.js +180 -0
- package/dist/animate-confetti.js.map +1 -0
- package/dist/autocomplete-input.d.ts +73 -0
- package/dist/autocomplete-input.d.ts.map +1 -0
- package/dist/autocomplete-input.js +309 -0
- package/dist/autocomplete-input.js.map +1 -0
- package/dist/confirm-dialog.d.ts +36 -0
- package/dist/confirm-dialog.d.ts.map +1 -0
- package/dist/confirm-dialog.js +191 -0
- package/dist/confirm-dialog.js.map +1 -0
- package/dist/copy-link-button.d.ts +27 -0
- package/dist/copy-link-button.d.ts.map +1 -0
- package/dist/copy-link-button.js +84 -0
- package/dist/copy-link-button.js.map +1 -0
- package/dist/distance-value.d.ts +24 -0
- package/dist/distance-value.d.ts.map +1 -0
- package/dist/distance-value.js +50 -0
- package/dist/distance-value.js.map +1 -0
- package/dist/distribution-chart.d.ts +52 -0
- package/dist/distribution-chart.d.ts.map +1 -0
- package/dist/distribution-chart.js +299 -0
- package/dist/distribution-chart.js.map +1 -0
- package/dist/icons.d.ts +32 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +35 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/percent-bar-chart.d.ts +29 -0
- package/dist/percent-bar-chart.d.ts.map +1 -0
- package/dist/percent-bar-chart.js +92 -0
- package/dist/percent-bar-chart.js.map +1 -0
- package/dist/price-history-chart.d.ts +39 -0
- package/dist/price-history-chart.d.ts.map +1 -0
- package/dist/price-history-chart.js +217 -0
- package/dist/price-history-chart.js.map +1 -0
- package/dist/relative-time.d.ts +26 -0
- package/dist/relative-time.d.ts.map +1 -0
- package/dist/relative-time.js +64 -0
- package/dist/relative-time.js.map +1 -0
- package/dist/reveal-button.d.ts +19 -0
- package/dist/reveal-button.d.ts.map +1 -0
- package/dist/reveal-button.js +62 -0
- package/dist/reveal-button.js.map +1 -0
- package/dist/roman-numeral.d.ts +18 -0
- package/dist/roman-numeral.d.ts.map +1 -0
- package/dist/roman-numeral.js +54 -0
- package/dist/roman-numeral.js.map +1 -0
- package/dist/slide-panel.d.ts +27 -0
- package/dist/slide-panel.d.ts.map +1 -0
- package/dist/slide-panel.js +149 -0
- package/dist/slide-panel.js.map +1 -0
- package/dist/toast-notification.d.ts +53 -0
- package/dist/toast-notification.d.ts.map +1 -0
- package/dist/toast-notification.js +173 -0
- package/dist/toast-notification.js.map +1 -0
- package/dist/tokens.css +21 -0
- package/dist/tokens.d.ts +16 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +79 -0
- package/dist/tokens.js.map +1 -0
- package/dist/utils/distance.d.ts +11 -0
- package/dist/utils/distance.d.ts.map +1 -0
- package/dist/utils/distance.js +25 -0
- package/dist/utils/distance.js.map +1 -0
- package/dist/utils/time.d.ts +10 -0
- package/dist/utils/time.d.ts.map +1 -0
- package/dist/utils/time.js +33 -0
- package/dist/utils/time.js.map +1 -0
- package/dist/weight-bar-chart.d.ts +29 -0
- package/dist/weight-bar-chart.d.ts.map +1 -0
- package/dist/weight-bar-chart.js +96 -0
- package/dist/weight-bar-chart.js.map +1 -0
- package/docs/address-autocomplete.md +68 -0
- package/docs/animate-confetti.md +34 -0
- package/docs/autocomplete-input.md +79 -0
- package/docs/confirm-dialog.md +65 -0
- package/docs/copy-link-button.md +46 -0
- package/docs/distance-value.md +38 -0
- package/docs/distribution-chart.md +51 -0
- package/docs/mcp-evaluation.md +31 -0
- package/docs/percent-bar-chart.md +40 -0
- package/docs/price-history-chart.md +44 -0
- package/docs/relative-time.md +37 -0
- package/docs/reveal-button.md +43 -0
- package/docs/roman-numeral.md +33 -0
- package/docs/slide-panel.md +56 -0
- package/docs/toast-notification.md +52 -0
- package/docs/weight-bar-chart.md +53 -0
- package/llms.txt +361 -0
- package/package.json +69 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# `<percent-bar-chart>`
|
|
2
|
+
|
|
3
|
+
Horizontal bar chart for labeled percentage rows, using D3's linear scale.
|
|
4
|
+
Each group gets its own labeled row; bars are proportional to percentage of 100.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```js
|
|
9
|
+
import "@f-ewald/components/percent-bar-chart.js";
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```html
|
|
15
|
+
<percent-bar-chart></percent-bar-chart>
|
|
16
|
+
<script type="module">
|
|
17
|
+
document.querySelector("percent-bar-chart").groups = [
|
|
18
|
+
{ key: "a", label: "White", pct: 45.2, color: "#4f46e5" },
|
|
19
|
+
{ key: "b", label: "Asian", pct: 28.1, color: "#0d9488" },
|
|
20
|
+
];
|
|
21
|
+
</script>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Attributes / properties
|
|
25
|
+
|
|
26
|
+
| Property | Attribute | Type | Default | Description |
|
|
27
|
+
| --- | --- | --- | --- | --- |
|
|
28
|
+
| `groups` | _(JS property only)_ | `PercentBarGroup[]` | `[]` | Rows to render, one per group. |
|
|
29
|
+
|
|
30
|
+
## Events
|
|
31
|
+
|
|
32
|
+
_None._
|
|
33
|
+
|
|
34
|
+
## Slots
|
|
35
|
+
|
|
36
|
+
_None._
|
|
37
|
+
|
|
38
|
+
## CSS custom properties
|
|
39
|
+
|
|
40
|
+
_None._
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# `<price-history-chart>`
|
|
2
|
+
|
|
3
|
+
D3-powered SVG line chart for property price history.
|
|
4
|
+
|
|
5
|
+
Uses scaleTime (X) + scaleLinear (Y) from d3-scale and line/area path
|
|
6
|
+
generators from d3-shape. Adapts to container width via ResizeObserver.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```js
|
|
11
|
+
import "@f-ewald/components/price-history-chart.js";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```html
|
|
17
|
+
<price-history-chart></price-history-chart>
|
|
18
|
+
<script type="module">
|
|
19
|
+
document.querySelector("price-history-chart").history = [
|
|
20
|
+
{ date: "2023-01-01", price: 620000, eventType: "Listed" },
|
|
21
|
+
{ date: "2024-02-01", price: 680000, eventType: "Sold" },
|
|
22
|
+
];
|
|
23
|
+
</script>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Attributes / properties
|
|
27
|
+
|
|
28
|
+
| Property | Attribute | Type | Default | Description |
|
|
29
|
+
| --- | --- | --- | --- | --- |
|
|
30
|
+
| `history` | `history` | `PricePoint[]` | `[]` | Array of price points (points with null price/date are skipped). |
|
|
31
|
+
| `yLabels` | `y-labels` | `"auto" | "always" | "never"` | `"auto"` | "auto" (default) | "always" | "never" |
|
|
32
|
+
| `maxXLabels` | `max-x-labels` | `number` | `3` | Max X-axis date ticks (default 3). |
|
|
33
|
+
|
|
34
|
+
## Events
|
|
35
|
+
|
|
36
|
+
_None._
|
|
37
|
+
|
|
38
|
+
## Slots
|
|
39
|
+
|
|
40
|
+
_None._
|
|
41
|
+
|
|
42
|
+
## CSS custom properties
|
|
43
|
+
|
|
44
|
+
_None._
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# `<relative-time>`
|
|
2
|
+
|
|
3
|
+
Inline relative-time display (e.g. "3 hours ago"). Accepts either a
|
|
4
|
+
standard ISO 8601 string or a SQLite `datetime('now')` string
|
|
5
|
+
("YYYY-MM-DD HH:MM:SS", UTC, no zone marker) via `datetime`. Shows the
|
|
6
|
+
full date/time in the viewer's local timezone as a hover tooltip, and
|
|
7
|
+
re-renders on an interval so the text stays current while visible.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import "@f-ewald/components/relative-time.js";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```html
|
|
18
|
+
<relative-time datetime="2026-07-17T07:00:00Z"></relative-time>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Attributes / properties
|
|
22
|
+
|
|
23
|
+
| Property | Attribute | Type | Default | Description |
|
|
24
|
+
| --- | --- | --- | --- | --- |
|
|
25
|
+
| `datetime` | `datetime` | `string | null` | `null` | Timestamp to render, relative to now. |
|
|
26
|
+
|
|
27
|
+
## Events
|
|
28
|
+
|
|
29
|
+
_None._
|
|
30
|
+
|
|
31
|
+
## Slots
|
|
32
|
+
|
|
33
|
+
_None._
|
|
34
|
+
|
|
35
|
+
## CSS custom properties
|
|
36
|
+
|
|
37
|
+
_None._
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# `<reveal-button>`
|
|
2
|
+
|
|
3
|
+
Button that reveals hidden slotted content when clicked.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import "@f-ewald/components/reveal-button.js";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<reveal-button label="Show the secret">
|
|
15
|
+
Surprise! This content was hidden.
|
|
16
|
+
</reveal-button>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Attributes / properties
|
|
20
|
+
|
|
21
|
+
| Property | Attribute | Type | Default | Description |
|
|
22
|
+
| --- | --- | --- | --- | --- |
|
|
23
|
+
| `label` | `label` | `string` | `"Reveal hidden content"` | Label shown on the button before it's clicked. |
|
|
24
|
+
|
|
25
|
+
## Events
|
|
26
|
+
|
|
27
|
+
_None._
|
|
28
|
+
|
|
29
|
+
## Slots
|
|
30
|
+
|
|
31
|
+
| Slot | Description |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| `(default)` | Content to reveal when clicked. |
|
|
34
|
+
|
|
35
|
+
## CSS custom properties
|
|
36
|
+
|
|
37
|
+
| Custom property |
|
|
38
|
+
| --- |
|
|
39
|
+
| `--ui-font` |
|
|
40
|
+
| `--ui-font-size` |
|
|
41
|
+
| `--ui-primary` |
|
|
42
|
+
| `--ui-primary-hover` |
|
|
43
|
+
| `--ui-radius-sm` |
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# `<roman-numeral>`
|
|
2
|
+
|
|
3
|
+
Converts an integer to a roman numeral inline.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import "@f-ewald/components/roman-numeral.js";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<roman-numeral value="2004"></roman-numeral>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Attributes / properties
|
|
18
|
+
|
|
19
|
+
| Property | Attribute | Type | Default | Description |
|
|
20
|
+
| --- | --- | --- | --- | --- |
|
|
21
|
+
| `value` | `value` | `number | undefined` | `—` | Integer value to render as a roman numeral. |
|
|
22
|
+
|
|
23
|
+
## Events
|
|
24
|
+
|
|
25
|
+
_None._
|
|
26
|
+
|
|
27
|
+
## Slots
|
|
28
|
+
|
|
29
|
+
_None._
|
|
30
|
+
|
|
31
|
+
## CSS custom properties
|
|
32
|
+
|
|
33
|
+
_None._
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# `<slide-panel>`
|
|
2
|
+
|
|
3
|
+
Generic sliding panel shell. Handles positioning, open/close animation,
|
|
4
|
+
header chrome, and a close button. Body content is provided via the
|
|
5
|
+
default slot; the consumer controls its own padding and overflow.
|
|
6
|
+
|
|
7
|
+
Desktop: 300 px fixed right-side panel that slides from the right.
|
|
8
|
+
Mobile (≤768px): bottom-sheet drawer (60vh) — reserved for future use.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```js
|
|
13
|
+
import "@f-ewald/components/slide-panel.js";
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<slide-panel open heading="Property details">
|
|
20
|
+
Panel body content goes here.
|
|
21
|
+
</slide-panel>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Attributes / properties
|
|
25
|
+
|
|
26
|
+
| Property | Attribute | Type | Default | Description |
|
|
27
|
+
| --- | --- | --- | --- | --- |
|
|
28
|
+
| `open` | `open` | `boolean` | `false` | Whether the panel is currently visible. |
|
|
29
|
+
| `heading` | `heading` | `string` | `""` | Title text shown in the panel header (overridable via slot="title"). |
|
|
30
|
+
|
|
31
|
+
## Events
|
|
32
|
+
|
|
33
|
+
| Event | Description |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| `panel-close` | User clicked the close (✕) button. |
|
|
36
|
+
|
|
37
|
+
## Slots
|
|
38
|
+
|
|
39
|
+
| Slot | Description |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `(default)` | Panel body content. |
|
|
42
|
+
| `title` | Overrides the header title text (falls back to the `heading` property). |
|
|
43
|
+
|
|
44
|
+
## CSS custom properties
|
|
45
|
+
|
|
46
|
+
| Custom property |
|
|
47
|
+
| --- |
|
|
48
|
+
| `--ui-border` |
|
|
49
|
+
| `--ui-font` |
|
|
50
|
+
| `--ui-font-size` |
|
|
51
|
+
| `--ui-radius-sm` |
|
|
52
|
+
| `--ui-shadow-lg` |
|
|
53
|
+
| `--ui-surface` |
|
|
54
|
+
| `--ui-surface-muted` |
|
|
55
|
+
| `--ui-text` |
|
|
56
|
+
| `--ui-text-muted` |
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# `<toast-notification>`
|
|
2
|
+
|
|
3
|
+
Fixed-position stack of dismissible notifications, anchored top-right
|
|
4
|
+
(top-full-width on mobile). Not wired to any app state yet — callers add
|
|
5
|
+
toasts imperatively via the `show()` method on a live element reference,
|
|
6
|
+
e.g. `document.querySelector('toast-notification')?.show('Offline', { variant: 'error' })`,
|
|
7
|
+
or via the `notifySuccess`/`notifyError`/`notifyInfo` module-level helpers
|
|
8
|
+
exported from this file. Each toast auto-dismisses after `duration` ms and
|
|
9
|
+
can also be dismissed via its ✕ button. Appears/disappears instantly — no
|
|
10
|
+
slide/fade transitions.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
import "@f-ewald/components/toast-notification.js";
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```html
|
|
21
|
+
<toast-notification></toast-notification>
|
|
22
|
+
<script type="module">
|
|
23
|
+
import { notifySuccess } from "@f-ewald/components/toast-notification.js";
|
|
24
|
+
notifySuccess("Saved!");
|
|
25
|
+
</script>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Attributes / properties
|
|
29
|
+
|
|
30
|
+
_None._
|
|
31
|
+
|
|
32
|
+
## Events
|
|
33
|
+
|
|
34
|
+
_None._
|
|
35
|
+
|
|
36
|
+
## Slots
|
|
37
|
+
|
|
38
|
+
_None._
|
|
39
|
+
|
|
40
|
+
## CSS custom properties
|
|
41
|
+
|
|
42
|
+
| Custom property |
|
|
43
|
+
| --- |
|
|
44
|
+
| `--ui-danger` |
|
|
45
|
+
| `--ui-font` |
|
|
46
|
+
| `--ui-font-size` |
|
|
47
|
+
| `--ui-primary` |
|
|
48
|
+
| `--ui-radius` |
|
|
49
|
+
| `--ui-radius-sm` |
|
|
50
|
+
| `--ui-shadow-lg` |
|
|
51
|
+
| `--ui-success` |
|
|
52
|
+
| `--ui-text` |
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# `<weight-bar-chart>`
|
|
2
|
+
|
|
3
|
+
Sorted horizontal bar chart of labeled weights (normalized fractions
|
|
4
|
+
summing to ~1). Bars sort descending — the order IS the priority ranking.
|
|
5
|
+
Widths scale relative to the largest weight (which fills its track); the
|
|
6
|
+
percent labels carry the absolute values. Rows are keyed by item id
|
|
7
|
+
(repeat directive) so a re-render with new weights moves the existing
|
|
8
|
+
rows; bar widths animate via CSS, re-sorting is instant.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```js
|
|
13
|
+
import "@f-ewald/components/weight-bar-chart.js";
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<weight-bar-chart></weight-bar-chart>
|
|
20
|
+
<script type="module">
|
|
21
|
+
document.querySelector("weight-bar-chart").items = [
|
|
22
|
+
{ id: "price", label: "Price", value: 0.4 },
|
|
23
|
+
{ id: "schools", label: "Schools", value: 0.35 },
|
|
24
|
+
{ id: "commute", label: "Commute", value: 0.25 },
|
|
25
|
+
];
|
|
26
|
+
</script>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Attributes / properties
|
|
30
|
+
|
|
31
|
+
| Property | Attribute | Type | Default | Description |
|
|
32
|
+
| --- | --- | --- | --- | --- |
|
|
33
|
+
| `items` | _(JS property only)_ | `WeightBarItem[]` | `[]` | Items to render as weighted rows, sorted descending by value. |
|
|
34
|
+
|
|
35
|
+
## Events
|
|
36
|
+
|
|
37
|
+
_None._
|
|
38
|
+
|
|
39
|
+
## Slots
|
|
40
|
+
|
|
41
|
+
_None._
|
|
42
|
+
|
|
43
|
+
## CSS custom properties
|
|
44
|
+
|
|
45
|
+
| Custom property |
|
|
46
|
+
| --- |
|
|
47
|
+
| `--ui-font` |
|
|
48
|
+
| `--ui-font-size-sm` |
|
|
49
|
+
| `--ui-primary` |
|
|
50
|
+
| `--ui-radius-sm` |
|
|
51
|
+
| `--ui-surface-muted` |
|
|
52
|
+
| `--ui-text` |
|
|
53
|
+
| `--ui-text-muted` |
|