@mhmo91/schmancy 0.9.4 → 0.9.5
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/.claude-plugin/plugin.json +13 -0
- package/README.md +14 -4
- package/dist/.claude-plugin/plugin.json +13 -0
- package/dist/skills/SKILL.md +120 -0
- package/dist/skills/schmancy/SKILL.md +120 -0
- package/package.json +3 -3
- package/skills/schmancy/INDEX.md +72 -0
- package/skills/schmancy/SKILL.md +120 -0
- package/skills/schmancy/animation.md +64 -0
- package/skills/schmancy/area.md +141 -0
- package/skills/schmancy/audio.md +69 -0
- package/skills/schmancy/autocomplete.md +53 -0
- package/skills/schmancy/avatar.md +47 -0
- package/skills/schmancy/badge.md +41 -0
- package/skills/schmancy/boat.md +47 -0
- package/skills/schmancy/busy.md +36 -0
- package/skills/schmancy/button.md +59 -0
- package/skills/schmancy/card.md +53 -0
- package/skills/schmancy/charts.md +93 -0
- package/skills/schmancy/checkbox.md +36 -0
- package/skills/schmancy/chips.md +87 -0
- package/skills/schmancy/code-highlight.md +47 -0
- package/skills/schmancy/connectivity.md +36 -0
- package/skills/schmancy/content-drawer.md +65 -0
- package/skills/schmancy/date-range-inline.md +44 -0
- package/skills/schmancy/date-range.md +50 -0
- package/skills/schmancy/delay.md +50 -0
- package/skills/schmancy/details.md +66 -0
- package/skills/schmancy/dialog.md +69 -0
- package/skills/schmancy/directives.md +298 -0
- package/skills/schmancy/discovery.md +67 -0
- package/skills/schmancy/divider.md +31 -0
- package/skills/schmancy/dropdown.md +47 -0
- package/skills/schmancy/expand.md +63 -0
- package/skills/schmancy/extra.md +59 -0
- package/skills/schmancy/float.md +14 -0
- package/skills/schmancy/form.md +49 -0
- package/skills/schmancy/icons.md +44 -0
- package/skills/schmancy/iframe.md +44 -0
- package/skills/schmancy/input.md +56 -0
- package/skills/schmancy/json.md +33 -0
- package/skills/schmancy/layout.md +63 -0
- package/skills/schmancy/lightbox.md +36 -0
- package/skills/schmancy/list.md +67 -0
- package/skills/schmancy/mailbox.md +102 -0
- package/skills/schmancy/map.md +55 -0
- package/skills/schmancy/menu.md +39 -0
- package/skills/schmancy/mixins.md +99 -0
- package/skills/schmancy/nav-drawer.md +52 -0
- package/skills/schmancy/navigation-bar.md +48 -0
- package/skills/schmancy/navigation-rail.md +62 -0
- package/skills/schmancy/notification.md +60 -0
- package/skills/schmancy/option.md +43 -0
- package/skills/schmancy/page.md +42 -0
- package/skills/schmancy/progress.md +30 -0
- package/skills/schmancy/qr-scanner.md +51 -0
- package/skills/schmancy/radio-group.md +50 -0
- package/skills/schmancy/range.md +47 -0
- package/skills/schmancy/rxjs-utils.md +60 -0
- package/skills/schmancy/select.md +49 -0
- package/skills/schmancy/sheet.md +76 -0
- package/skills/schmancy/slider.md +43 -0
- package/skills/schmancy/steps.md +53 -0
- package/skills/schmancy/store.md +126 -0
- package/skills/schmancy/surface.md +86 -0
- package/skills/schmancy/table.md +60 -0
- package/skills/schmancy/tabs.md +49 -0
- package/skills/schmancy/teleport.md +55 -0
- package/skills/schmancy/textarea.md +48 -0
- package/skills/schmancy/theme-button.md +26 -0
- package/skills/schmancy/theme.md +58 -0
- package/skills/schmancy/tooltip.md +38 -0
- package/skills/schmancy/tree.md +53 -0
- package/skills/schmancy/typewriter.md +46 -0
- package/skills/schmancy/typography.md +53 -0
- package/skills/schmancy/utils.md +95 -0
- package/skills/schmancy/window.md +67 -0
- /package/{ai → dist/skills}/INDEX.md +0 -0
- /package/{ai → dist/skills}/animation.md +0 -0
- /package/{ai → dist/skills}/area.md +0 -0
- /package/{ai → dist/skills}/audio.md +0 -0
- /package/{ai → dist/skills}/autocomplete.md +0 -0
- /package/{ai → dist/skills}/avatar.md +0 -0
- /package/{ai → dist/skills}/badge.md +0 -0
- /package/{ai → dist/skills}/boat.md +0 -0
- /package/{ai → dist/skills}/busy.md +0 -0
- /package/{ai → dist/skills}/button.md +0 -0
- /package/{ai → dist/skills}/card.md +0 -0
- /package/{ai → dist/skills}/charts.md +0 -0
- /package/{ai → dist/skills}/checkbox.md +0 -0
- /package/{ai → dist/skills}/chips.md +0 -0
- /package/{ai → dist/skills}/code-highlight.md +0 -0
- /package/{ai → dist/skills}/connectivity.md +0 -0
- /package/{ai → dist/skills}/content-drawer.md +0 -0
- /package/{ai → dist/skills}/date-range-inline.md +0 -0
- /package/{ai → dist/skills}/date-range.md +0 -0
- /package/{ai → dist/skills}/delay.md +0 -0
- /package/{ai → dist/skills}/details.md +0 -0
- /package/{ai → dist/skills}/dialog.md +0 -0
- /package/{ai → dist/skills}/directives.md +0 -0
- /package/{ai → dist/skills}/discovery.md +0 -0
- /package/{ai → dist/skills}/divider.md +0 -0
- /package/{ai → dist/skills}/dropdown.md +0 -0
- /package/{ai → dist/skills}/expand.md +0 -0
- /package/{ai → dist/skills}/extra.md +0 -0
- /package/{ai → dist/skills}/float.md +0 -0
- /package/{ai → dist/skills}/form.md +0 -0
- /package/{ai → dist/skills}/icons.md +0 -0
- /package/{ai → dist/skills}/iframe.md +0 -0
- /package/{ai → dist/skills}/input.md +0 -0
- /package/{ai → dist/skills}/json.md +0 -0
- /package/{ai → dist/skills}/layout.md +0 -0
- /package/{ai → dist/skills}/lightbox.md +0 -0
- /package/{ai → dist/skills}/list.md +0 -0
- /package/{ai → dist/skills}/mailbox.md +0 -0
- /package/{ai → dist/skills}/map.md +0 -0
- /package/{ai → dist/skills}/menu.md +0 -0
- /package/{ai → dist/skills}/mixins.md +0 -0
- /package/{ai → dist/skills}/nav-drawer.md +0 -0
- /package/{ai → dist/skills}/navigation-bar.md +0 -0
- /package/{ai → dist/skills}/navigation-rail.md +0 -0
- /package/{ai → dist/skills}/notification.md +0 -0
- /package/{ai → dist/skills}/option.md +0 -0
- /package/{ai → dist/skills}/page.md +0 -0
- /package/{ai → dist/skills}/progress.md +0 -0
- /package/{ai → dist/skills}/qr-scanner.md +0 -0
- /package/{ai → dist/skills}/radio-group.md +0 -0
- /package/{ai → dist/skills}/range.md +0 -0
- /package/{ai → dist/skills}/rxjs-utils.md +0 -0
- /package/dist/{ai → skills/schmancy}/INDEX.md +0 -0
- /package/dist/{ai → skills/schmancy}/animation.md +0 -0
- /package/dist/{ai → skills/schmancy}/area.md +0 -0
- /package/dist/{ai → skills/schmancy}/audio.md +0 -0
- /package/dist/{ai → skills/schmancy}/autocomplete.md +0 -0
- /package/dist/{ai → skills/schmancy}/avatar.md +0 -0
- /package/dist/{ai → skills/schmancy}/badge.md +0 -0
- /package/dist/{ai → skills/schmancy}/boat.md +0 -0
- /package/dist/{ai → skills/schmancy}/busy.md +0 -0
- /package/dist/{ai → skills/schmancy}/button.md +0 -0
- /package/dist/{ai → skills/schmancy}/card.md +0 -0
- /package/dist/{ai → skills/schmancy}/charts.md +0 -0
- /package/dist/{ai → skills/schmancy}/checkbox.md +0 -0
- /package/dist/{ai → skills/schmancy}/chips.md +0 -0
- /package/dist/{ai → skills/schmancy}/code-highlight.md +0 -0
- /package/dist/{ai → skills/schmancy}/connectivity.md +0 -0
- /package/dist/{ai → skills/schmancy}/content-drawer.md +0 -0
- /package/dist/{ai → skills/schmancy}/date-range-inline.md +0 -0
- /package/dist/{ai → skills/schmancy}/date-range.md +0 -0
- /package/dist/{ai → skills/schmancy}/delay.md +0 -0
- /package/dist/{ai → skills/schmancy}/details.md +0 -0
- /package/dist/{ai → skills/schmancy}/dialog.md +0 -0
- /package/dist/{ai → skills/schmancy}/directives.md +0 -0
- /package/dist/{ai → skills/schmancy}/discovery.md +0 -0
- /package/dist/{ai → skills/schmancy}/divider.md +0 -0
- /package/dist/{ai → skills/schmancy}/dropdown.md +0 -0
- /package/dist/{ai → skills/schmancy}/expand.md +0 -0
- /package/dist/{ai → skills/schmancy}/extra.md +0 -0
- /package/dist/{ai → skills/schmancy}/float.md +0 -0
- /package/dist/{ai → skills/schmancy}/form.md +0 -0
- /package/dist/{ai → skills/schmancy}/icons.md +0 -0
- /package/dist/{ai → skills/schmancy}/iframe.md +0 -0
- /package/dist/{ai → skills/schmancy}/input.md +0 -0
- /package/dist/{ai → skills/schmancy}/json.md +0 -0
- /package/dist/{ai → skills/schmancy}/layout.md +0 -0
- /package/dist/{ai → skills/schmancy}/lightbox.md +0 -0
- /package/dist/{ai → skills/schmancy}/list.md +0 -0
- /package/dist/{ai → skills/schmancy}/mailbox.md +0 -0
- /package/dist/{ai → skills/schmancy}/map.md +0 -0
- /package/dist/{ai → skills/schmancy}/menu.md +0 -0
- /package/dist/{ai → skills/schmancy}/mixins.md +0 -0
- /package/dist/{ai → skills/schmancy}/nav-drawer.md +0 -0
- /package/dist/{ai → skills/schmancy}/navigation-bar.md +0 -0
- /package/dist/{ai → skills/schmancy}/navigation-rail.md +0 -0
- /package/dist/{ai → skills/schmancy}/notification.md +0 -0
- /package/dist/{ai → skills/schmancy}/option.md +0 -0
- /package/dist/{ai → skills/schmancy}/page.md +0 -0
- /package/dist/{ai → skills/schmancy}/progress.md +0 -0
- /package/dist/{ai → skills/schmancy}/qr-scanner.md +0 -0
- /package/dist/{ai → skills/schmancy}/radio-group.md +0 -0
- /package/dist/{ai → skills/schmancy}/range.md +0 -0
- /package/dist/{ai → skills/schmancy}/rxjs-utils.md +0 -0
- /package/{ai → dist/skills/schmancy}/select.md +0 -0
- /package/{ai → dist/skills/schmancy}/sheet.md +0 -0
- /package/{ai → dist/skills/schmancy}/slider.md +0 -0
- /package/{ai → dist/skills/schmancy}/steps.md +0 -0
- /package/{ai → dist/skills/schmancy}/store.md +0 -0
- /package/{ai → dist/skills/schmancy}/surface.md +0 -0
- /package/{ai → dist/skills/schmancy}/table.md +0 -0
- /package/{ai → dist/skills/schmancy}/tabs.md +0 -0
- /package/{ai → dist/skills/schmancy}/teleport.md +0 -0
- /package/{ai → dist/skills/schmancy}/textarea.md +0 -0
- /package/{ai → dist/skills/schmancy}/theme-button.md +0 -0
- /package/{ai → dist/skills/schmancy}/theme.md +0 -0
- /package/{ai → dist/skills/schmancy}/tooltip.md +0 -0
- /package/{ai → dist/skills/schmancy}/tree.md +0 -0
- /package/{ai → dist/skills/schmancy}/typewriter.md +0 -0
- /package/{ai → dist/skills/schmancy}/typography.md +0 -0
- /package/{ai → dist/skills/schmancy}/utils.md +0 -0
- /package/{ai → dist/skills/schmancy}/window.md +0 -0
- /package/dist/{ai → skills}/select.md +0 -0
- /package/dist/{ai → skills}/sheet.md +0 -0
- /package/dist/{ai → skills}/slider.md +0 -0
- /package/dist/{ai → skills}/steps.md +0 -0
- /package/dist/{ai → skills}/store.md +0 -0
- /package/dist/{ai → skills}/surface.md +0 -0
- /package/dist/{ai → skills}/table.md +0 -0
- /package/dist/{ai → skills}/tabs.md +0 -0
- /package/dist/{ai → skills}/teleport.md +0 -0
- /package/dist/{ai → skills}/textarea.md +0 -0
- /package/dist/{ai → skills}/theme-button.md +0 -0
- /package/dist/{ai → skills}/theme.md +0 -0
- /package/dist/{ai → skills}/tooltip.md +0 -0
- /package/dist/{ai → skills}/tree.md +0 -0
- /package/dist/{ai → skills}/typewriter.md +0 -0
- /package/dist/{ai → skills}/typography.md +0 -0
- /package/dist/{ai → skills}/utils.md +0 -0
- /package/dist/{ai → skills}/window.md +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# schmancy-typewriter
|
|
2
|
+
|
|
3
|
+
> Text-reveal component powered by [TypeIt](https://typeitjs.com). Characters pop in with entrance + wobble physics; custom cursor pulses with drop-shadow glow.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
```html
|
|
7
|
+
<schmancy-typewriter>
|
|
8
|
+
Hello, world.
|
|
9
|
+
</schmancy-typewriter>
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Properties
|
|
13
|
+
| Property | Type | Default | Description |
|
|
14
|
+
|----------|------|---------|-------------|
|
|
15
|
+
| `speed` | number | `35` | Ms per character typed |
|
|
16
|
+
| `deleteSpeed` | number | `20` | Ms per character deleted |
|
|
17
|
+
| `delay` | number | `0` | Initial delay before typing (inherited via `delayContext`) |
|
|
18
|
+
| `autoStart` | boolean | `true` | Start typing on connect |
|
|
19
|
+
| `cursorChar` | string | `''` | Character for the cursor (empty = default block cursor) |
|
|
20
|
+
| `once` | boolean | `true` | Only animate once per session (`sessionStorage` hash) |
|
|
21
|
+
| `loop` | boolean | `false` | Loop infinitely (overrides `once`) |
|
|
22
|
+
| `cyclePause` | number | `1500` | Default pause for cycling (ms) |
|
|
23
|
+
|
|
24
|
+
## Behavior
|
|
25
|
+
- **Lazy start** via IntersectionObserver — won't type until visible.
|
|
26
|
+
- **Session caching** — when `once=true`, content hash is stored; subsequent visits skip the animation.
|
|
27
|
+
- **Delay coordination** — consumes `delayContext`, staggering with parent `schmancy-delay`.
|
|
28
|
+
- Character entrance animation: scale 0.3 → 1.1 → 1 with blur-to-focus.
|
|
29
|
+
- Alternating characters get a subtle `wobble` rotation.
|
|
30
|
+
- Cursor pulses with `drop-shadow(0 0 8px currentColor)` glow.
|
|
31
|
+
|
|
32
|
+
## Slot Content
|
|
33
|
+
Text (or nested HTML) goes in the default slot. TypeIt handles strings, tags, line breaks.
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<schmancy-typewriter speed="50">
|
|
37
|
+
First line.<br>
|
|
38
|
+
<strong>Bold second.</strong>
|
|
39
|
+
</schmancy-typewriter>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Vs. `typewriter` directive
|
|
43
|
+
- **Component (`schmancy-typewriter`)**: slot-based, lazy-starts on visibility, one-shot content reveal with cached skipping.
|
|
44
|
+
- **Directive (`typewriter([...phrases])`)**: cycles through a phrase array with typing + deleting + optional Web Audio sound. See [directives.md](./directives.md).
|
|
45
|
+
|
|
46
|
+
Use the directive for looping taglines. Use the component for one-time paragraph reveals.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# schmancy-typography
|
|
2
|
+
|
|
3
|
+
> Typography component with type scale tokens, editable mode, and line clamping.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
```html
|
|
7
|
+
<schmancy-typography type="headline" token="lg">Page Title</schmancy-typography>
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Properties
|
|
11
|
+
| Property | Type | Default | Description |
|
|
12
|
+
|----------|------|---------|-------------|
|
|
13
|
+
| type | `'display'\|'headline'\|'title'\|'subtitle'\|'body'\|'label'` | `'body'` | Typography category |
|
|
14
|
+
| token | `'xs'\|'sm'\|'md'\|'lg'\|'xl'\|''` | `'md'` | Size token (set `''` to use Tailwind classes) |
|
|
15
|
+
| align | `'left'\|'center'\|'right'\|'justify'` | `undefined` | Text alignment |
|
|
16
|
+
| weight | `'normal'\|'medium'\|'bold'` | `undefined` | Font weight |
|
|
17
|
+
| transform | `'uppercase'\|'lowercase'\|'capitalize'\|'normal'` | `undefined` | Text transform |
|
|
18
|
+
| maxLines | 1-6 | `undefined` | Line clamp (truncate with ellipsis) |
|
|
19
|
+
| editable | boolean | `false` | Enable inline editing |
|
|
20
|
+
| value | string | `''` | Text value (editable mode) |
|
|
21
|
+
| placeholder | string | `''` | Placeholder (editable mode) |
|
|
22
|
+
|
|
23
|
+
## Events (editable mode only)
|
|
24
|
+
| Event | Detail | Description |
|
|
25
|
+
|-------|--------|-------------|
|
|
26
|
+
| change | `{ value: string }` | When edited text is committed (blur/Enter) |
|
|
27
|
+
|
|
28
|
+
## Type Scale Reference
|
|
29
|
+
| Type | Token | Size |
|
|
30
|
+
|------|-------|------|
|
|
31
|
+
| display | xl/lg/md/sm/xs | 72/57/45/36/28px |
|
|
32
|
+
| headline | xl/lg/md/sm/xs | 36/32/28/24/20px |
|
|
33
|
+
| title | xl/lg/md/sm/xs | 24/22/16/14/12px |
|
|
34
|
+
| body | xl/lg/md/sm/xs | 18/16/14/12/10px |
|
|
35
|
+
| label | xl/lg/md/sm/xs | 16/14/12/11/10px |
|
|
36
|
+
|
|
37
|
+
## Examples
|
|
38
|
+
```html
|
|
39
|
+
<!-- Responsive sizing with Tailwind (set token="") -->
|
|
40
|
+
<schmancy-typography type="display" token="" class="text-2xl md:text-4xl">
|
|
41
|
+
Responsive Title
|
|
42
|
+
</schmancy-typography>
|
|
43
|
+
|
|
44
|
+
<!-- Editable text -->
|
|
45
|
+
<schmancy-typography type="title" token="lg" editable .value=${'Click to edit'}
|
|
46
|
+
@change=${(e) => save(e.detail.value)}>
|
|
47
|
+
</schmancy-typography>
|
|
48
|
+
|
|
49
|
+
<!-- Clamped to 2 lines -->
|
|
50
|
+
<schmancy-typography type="body" token="md" maxLines="2">
|
|
51
|
+
Long text that will be truncated after two lines...
|
|
52
|
+
</schmancy-typography>
|
|
53
|
+
```
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Schmancy Utils
|
|
2
|
+
|
|
3
|
+
> Non-component utilities exported from `@mhmo91/schmancy` (or `@mhmo91/schmancy/utils`). Animation presets, similarity search, number formatting, intersection observer wrapper, overlay z-index manager, and content hashing.
|
|
4
|
+
|
|
5
|
+
## Animation
|
|
6
|
+
|
|
7
|
+
See [animation.md](./animation.md) for the full Blackbird spring system. In brief:
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import {
|
|
11
|
+
SPRING_SMOOTH, SPRING_SNAPPY, SPRING_BOUNCY, SPRING_GENTLE,
|
|
12
|
+
createAnimation, createRevealAnimation, createDismissAnimation, createScaleAnimation,
|
|
13
|
+
getEasing, prefersReducedMotion,
|
|
14
|
+
ANIMATION_CSS_VARS, tailwindAnimations, GRID_ANIMATION_CSS,
|
|
15
|
+
} from '@mhmo91/schmancy'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Number Formatting — `numbers` / `Numbers`
|
|
19
|
+
Locale-aware number formatting + currency + rounding.
|
|
20
|
+
```typescript
|
|
21
|
+
import numbers from '@mhmo91/schmancy'
|
|
22
|
+
|
|
23
|
+
numbers.roundNumber(3.14159, 2) // 3.14
|
|
24
|
+
numbers.format(1234567.89) // "1,234,567.89" (system locale)
|
|
25
|
+
numbers.format(1234.5, 'de-DE') // "1.234,5"
|
|
26
|
+
numbers.formatCurrency(99.95, 'EUR') // "€99.95"
|
|
27
|
+
numbers.systemLocale // "en-US" / "de-DE" / etc.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Fuzzy Search — `similarity(query, target, options?)`
|
|
31
|
+
Autocomplete-tuned similarity scoring. Prioritizes start-matches and word boundaries.
|
|
32
|
+
```typescript
|
|
33
|
+
import { similarity } from '@mhmo91/schmancy'
|
|
34
|
+
|
|
35
|
+
similarity('john', 'John Doe') // ~0.975 (starts-with)
|
|
36
|
+
similarity('doe', 'John Doe') // ~0.765 (word-boundary)
|
|
37
|
+
similarity('jhn', 'John Doe') // ~0.3–0.5 (fuzzy)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Tiers:
|
|
41
|
+
- `1.00` exact
|
|
42
|
+
- `0.95–1.00` target starts with query
|
|
43
|
+
- `0.765–0.85` word-boundary match
|
|
44
|
+
- `0.56–0.70` substring
|
|
45
|
+
- `0.50` subsequence
|
|
46
|
+
- `0.00–0.50` fuzzy (Dice + Levenshtein + Jaccard + anagram)
|
|
47
|
+
|
|
48
|
+
Options:
|
|
49
|
+
| Key | Default | Effect |
|
|
50
|
+
|-----|---------|--------|
|
|
51
|
+
| `normalizeAccents` | `true` | Strip diacritics before compare |
|
|
52
|
+
| `includeWordJaccard` | `true` | Add word-set overlap to fuzzy score |
|
|
53
|
+
| `maxLevenshteinDistance` | `0` | Early-terminate above this distance (`0` = off) |
|
|
54
|
+
|
|
55
|
+
## Intersection Observer — `intersection$(element, options?)`
|
|
56
|
+
RxJS wrapper around `IntersectionObserver`.
|
|
57
|
+
```typescript
|
|
58
|
+
import { intersection$ } from '@mhmo91/schmancy'
|
|
59
|
+
|
|
60
|
+
intersection$(this.card, { threshold: 0.5 })
|
|
61
|
+
.pipe(takeUntil(this.disconnecting))
|
|
62
|
+
.subscribe(entries => {
|
|
63
|
+
if (entries[0].isIntersecting) this.loadContent()
|
|
64
|
+
})
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Overlay Stack — `overlayStack`
|
|
68
|
+
Singleton z-index coordinator used internally by dialogs, sheets, and windows. Ensures overlays stack in open order.
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
import { overlayStack } from '@mhmo91/schmancy'
|
|
72
|
+
|
|
73
|
+
// Anonymous (fire-and-forget) — dialogs/sheets
|
|
74
|
+
const z = overlayStack.getNextZIndex()
|
|
75
|
+
// …on close:
|
|
76
|
+
overlayStack.release()
|
|
77
|
+
|
|
78
|
+
// ID-tracked — windows (supports bringToFront)
|
|
79
|
+
overlayStack.assignZIndex('my-window')
|
|
80
|
+
overlayStack.bringToFront('my-window')
|
|
81
|
+
overlayStack.releaseId('my-window')
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Base z-index: `10000`. Counter resets when all overlays close.
|
|
85
|
+
|
|
86
|
+
## Content Hashing — `hashContent(string)`
|
|
87
|
+
Fast 32-bit FNV-1a style hash, returns a hex string. Used by [`schmancy-delay`](./delay.md) and [`schmancy-typewriter`](./typewriter.md) for session-scoped caching.
|
|
88
|
+
```typescript
|
|
89
|
+
import hashContent from '@mhmo91/schmancy/utils/hashContent'
|
|
90
|
+
const key = hashContent(element.outerHTML) // stable across renders for identical content
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## See Also
|
|
94
|
+
- [rxjs-utils](./rxjs-utils.md) — DOM observation helpers (`waitForElement`, `waitUntil`, etc.)
|
|
95
|
+
- [discovery](./discovery.md) — cross-shadow component discovery
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# schmancy-window
|
|
2
|
+
|
|
3
|
+
> Floating draggable window with corner snapping, resize, and minimize/maximize states. Replaces deprecated `schmancy-float`.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
```html
|
|
7
|
+
<schmancy-window id="chat" corner="bottom-right">
|
|
8
|
+
<span slot="header">Chat</span>
|
|
9
|
+
<schmancy-icon slot="icon">chat</schmancy-icon>
|
|
10
|
+
<div>Window body content…</div>
|
|
11
|
+
</schmancy-window>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Properties
|
|
15
|
+
| Property | Type | Default | Description |
|
|
16
|
+
|----------|------|---------|-------------|
|
|
17
|
+
| `id` | string | `'default'` | Unique window identifier (used by `windowManager` registry) |
|
|
18
|
+
| `open` | boolean | `false` | Body expanded state |
|
|
19
|
+
| `corner` | `'bottom-right' \| 'bottom-left' \| 'top-right' \| 'top-left'` | `'bottom-right'` | Anchor corner |
|
|
20
|
+
| `freePosition` | boolean | `false` | Keep dragged position instead of snapping to corner |
|
|
21
|
+
| `resizable` | boolean | `false` | Allow user resizing from edges |
|
|
22
|
+
| `visualState` | `'minimized' \| 'normal' \| 'maximized'` | `'normal'` | Reflected state attribute |
|
|
23
|
+
| `expandedWidth` | string | responsive | e.g. `'320px'`, `'24rem'` |
|
|
24
|
+
| `expandedHeight` | string | auto | e.g. `'400px'`, `'50vh'` |
|
|
25
|
+
| `minWidth` | number | `280` | Minimum width px during resize |
|
|
26
|
+
| `minHeight` | number | `200` | Minimum height px during resize |
|
|
27
|
+
| `lowered` | boolean | `false` | Lower elevation shadow in collapsed state |
|
|
28
|
+
|
|
29
|
+
## Slots
|
|
30
|
+
| Slot | Purpose |
|
|
31
|
+
|------|---------|
|
|
32
|
+
| `icon` | Leading icon in the head (minimized FAB state) |
|
|
33
|
+
| `header` | Header label (visible when expanded) |
|
|
34
|
+
| (default) | Window body content (lazy rendered — not in DOM until first open) |
|
|
35
|
+
|
|
36
|
+
## Behavior
|
|
37
|
+
- Drag from head to reposition. Release snaps to the nearest corner unless `freePosition`.
|
|
38
|
+
- `windowManager` tracks focused window and resolves overlap between multiple windows.
|
|
39
|
+
- `cursorGlow` applied to head while expanded.
|
|
40
|
+
- Collapsed state uses a clip-path reveal animation; expand uses `SPRING_SMOOTH` physics.
|
|
41
|
+
- Body content mounts lazily on first expand (`_hasOpened`).
|
|
42
|
+
- All animations respect `prefers-reduced-motion` via `reducedMotion$`.
|
|
43
|
+
|
|
44
|
+
## Examples
|
|
45
|
+
```html
|
|
46
|
+
<!-- Chat-style window docked bottom-right -->
|
|
47
|
+
<schmancy-window id="support" corner="bottom-right">
|
|
48
|
+
<schmancy-icon slot="icon">support_agent</schmancy-icon>
|
|
49
|
+
<span slot="header">Support</span>
|
|
50
|
+
<div class="p-4">How can we help?</div>
|
|
51
|
+
</schmancy-window>
|
|
52
|
+
|
|
53
|
+
<!-- Resizable, free-position floating panel -->
|
|
54
|
+
<schmancy-window id="inspector" resizable free-position expanded-width="420px" expanded-height="60vh">
|
|
55
|
+
<span slot="header">Inspector</span>
|
|
56
|
+
<div>…</div>
|
|
57
|
+
</schmancy-window>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## windowManager
|
|
61
|
+
```typescript
|
|
62
|
+
import { windowManager } from '@mhmo91/schmancy/window'
|
|
63
|
+
|
|
64
|
+
windowManager.focus('support') // Bring window to front
|
|
65
|
+
windowManager.getBounds('inspector') // Read tracked bounds
|
|
66
|
+
windowManager.all$ .subscribe(...) // Observable of registered windows
|
|
67
|
+
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|