nk_jtb 0.27.0 → 0.27.1

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.
@@ -15,23 +15,26 @@ precedence where they conflict.
15
15
 
16
16
  Use for named structural classes such as `navbar`, `menu`, `bx`, or form controls.
17
17
 
18
- **Structure:**
18
+ A class-based component has a named CSS class (e.g. `.spinner`, `.accordion`) that drives its core structure. A utility-based pattern achieves a similar result through composition of utility classes with no dedicated component class.
19
+
20
+ **Single-component page structure:**
19
21
 
20
22
  1. One-line lead
21
23
  2. `## Basic Usage` — minimum working markup
22
- 3. Additional examples — simple to fuller usage
24
+ 3. Additional `##` sections — simple to fuller usage
23
25
  4. `## SCSS Variables` — if the component exposes overridable variables
24
- 5. `## Utility Examples` — if a utility-based approach is viable, always last
26
+ 5. `## Utility Examples` — utility-based alternatives, always last
27
+
28
+ **Multi-component page:** repeat the same structure for each component, shifted down one heading level. The page title (`#`) becomes the group, each component becomes `##`, and its sections become `###`. A page with many components just repeats this pattern as many times as needed.
25
29
 
26
30
  **Rules:**
27
31
 
28
32
  - The lead describes purpose, not implementation. Do not mention specific CSS properties.
29
- - Open `## Basic Usage` with `Apply the [component class] to...` — directive, not descriptive.
33
+ - Open Basic Usage with `Apply the [component class] to...` — directive, not descriptive.
30
34
  - Component class examples use `class="bx example-jtb"`.
31
35
  - Utility examples use `class="bx example-utils"`.
32
- - Place the SCSS Variables table directly after the class examples, before `## Utility Examples`.
36
+ - Place SCSS Variables directly before Utility Examples.
33
37
  - Link to `/docs/jtb/variable-system` for override instructions rather than explaining inline.
34
- - `## Utility Examples` is always last. Lives in the component doc — not a separate file.
35
38
 
36
39
  ### Utility Documentation
37
40
 
package/AGENTS.md CHANGED
@@ -200,8 +200,10 @@ follow the direction.
200
200
  - Do not treat reading a `SKILL.md` file as a substitute for invoking the skill.
201
201
  - When updating prompts, guidelines, or skills, first identify the project's
202
202
  source-of-truth file before editing.
203
- - Files under `.ai/` may be symlinks into a shared prompts/guidelines repo. If
204
- so, update the symlink target.
203
+ - Skills and guidelines are always edited via `.ai/` never agent-managed
204
+ directories (`.claude/`, `.cursor/`, `.windsurf/`, etc.) directly.
205
+ - Check whether the `.ai/` entry is a local file or a symlink before editing.
206
+ If it is a symlink, follow it to the target and edit there.
205
207
  - Do not update matching copies in parallel or alternate locations unless they
206
208
  are the confirmed source of truth or the user explicitly asks.
207
209
  - After changing project guidelines or adding/updating skills, run
package/CLAUDE.md CHANGED
@@ -200,8 +200,10 @@ follow the direction.
200
200
  - Do not treat reading a `SKILL.md` file as a substitute for invoking the skill.
201
201
  - When updating prompts, guidelines, or skills, first identify the project's
202
202
  source-of-truth file before editing.
203
- - Files under `.ai/` may be symlinks into a shared prompts/guidelines repo. If
204
- so, update the symlink target.
203
+ - Skills and guidelines are always edited via `.ai/` never agent-managed
204
+ directories (`.claude/`, `.cursor/`, `.windsurf/`, etc.) directly.
205
+ - Check whether the `.ai/` entry is a local file or a symlink before editing.
206
+ If it is a symlink, follow it to the target and edit there.
205
207
  - Do not update matching copies in parallel or alternate locations unless they
206
208
  are the confirmed source of truth or the user explicitly asks.
207
209
  - After changing project guidelines or adding/updating skills, run
@@ -0,0 +1,104 @@
1
+ # Code Review — Loaders and Spinners
2
+ **Date:** 2026-05-14
3
+ **Scope:** Component review — loaders and spinners subsystem
4
+
5
+ ---
6
+
7
+ ## Scope Reviewed
8
+
9
+ - **Type:** Component/package review
10
+ - **Target:** `src/components/_loaders-and-spinners.scss`, `src/utilities/_animation.scss`, `docs/utilities/animation.md`, `docs/review/animation.md`
11
+ - **Coverage:** Full read of all four files; cross-referenced keyframe definitions against class usage
12
+ - **Exclusions:** No UI test harness or compiled output inspected
13
+
14
+ ---
15
+
16
+ ## Findings
17
+
18
+ ### High — `@keyframes dots` is never defined; `.dots` animation is a no-op
19
+
20
+ - **Impact:** The animated dots in `.loader-container` (e.g. "Loading...") never animate — `animation: dots 1.5s steps(4, end) infinite` silently fails.
21
+ - **Evidence:** `_loaders-and-spinners.scss:54` references `animation: dots`. `_animation.scss` defines `spin`, `bounce`, `pulse-ring`, `pulse`, `checkmark`, `circle` — no `dots` keyframe exists anywhere in the codebase.
22
+ - **Fix:** Define `@keyframes dots` (typically stepping through `""`, `"."`, `".."`, `"..."` via `content`) in `_animation.scss` alongside the other keyframes.
23
+
24
+ ---
25
+
26
+ ### High — `@keyframes ping` is never defined; `.animate-ping` is broken
27
+
28
+ - **Impact:** `.animate-ping` always resolves to `animation: none` and the `--animate-ping` CSS custom property is dead.
29
+ - **Evidence:** `_animation.scss:66` defines `--animate-ping: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite` and `_animation.scss:88–90` outputs the `.animate-ping` class, but no `@keyframes ping` exists in the file or anywhere else in `src/`.
30
+ - **Fix:** Add `@keyframes ping` (typically a scale-and-fade-out expanding ring) to `_animation.scss`, or remove `.animate-ping` and the `--animate-ping` custom property if ping is not planned.
31
+
32
+ ---
33
+
34
+ ### Medium — `.loader-container .spinner` abandons the variable system with hardcoded values
35
+
36
+ - **Impact:** The nested `.spinner` is unaffected by `--size` or `--thickness`, so size variants (`sm`, `lg`, `thick`) do nothing inside a loader container. The two `.spinner` implementations are behaviourally inconsistent.
37
+ - **Evidence:** `_loaders-and-spinners.scss:32–39` — hardcoded `border: 4px solid`, `height: 60px`, `width: 60px`, `margin: 0 auto 20px` instead of `--size`/`--thickness`. The outer `.spinner` (lines 1–23) uses the variable system correctly.
38
+ - **Fix:** Remove the nested `.spinner` override; let the outer `.spinner` definition handle sizing, and rely on the `dark` context modifier or a wrapper class for colour changes rather than overriding the element entirely.
39
+
40
+ ---
41
+
42
+ ### Medium — `.loading-text` and `.dots` use hardcoded px values and hex colours
43
+
44
+ - **Impact:** These values sit outside the framework variable and scale system, making them impossible to theme or override via custom properties.
45
+ - **Evidence:** `_loaders-and-spinners.scss:43–46` — `font-size: 18px`, `color: #fff`, `letter-spacing: 0.5px`; line 51 — `width: 20px`.
46
+ - **Fix:** Replace with framework scale references (e.g. `var(--fs-base)`, a color token or `currentColor`) and rem units.
47
+
48
+ ---
49
+
50
+ ### Medium — `.spinner` uses physical `border-top` shorthand
51
+
52
+ - **Impact:** Breaks logical-property consistency; does not respect writing-mode.
53
+ - **Evidence:** `_loaders-and-spinners.scss:8` — `border-top: calc(var(--size) * var(--thickness)) solid #3498db`. CLAUDE.md requires logical properties (`border-block-start`) except in explicitly positioned contexts.
54
+ - **Fix:** Replace `border-top` with `border-block-start`.
55
+
56
+ ---
57
+
58
+ ### Medium — Docs examples use class names that are not confirmed JTB utilities
59
+
60
+ - **Impact:** Examples may not render correctly and set misleading precedent for how the framework is used.
61
+ - **Evidence:** `docs/utilities/animation.md` lines 8–78 use: `rounded-full`, `space-x-05`, `opacity-0`, `opacity-30`, `opacity-80`, `overflow-hidden`, `items-center`, `w-full`, `h-2`, `h-full`, `font-semibold` — none of which appear in JTB docs or confirmed source files.
62
+ - **Fix:** Audit each class against JTB source; replace non-JTB classes with confirmed equivalents or extract to inline styles where no JTB utility exists.
63
+
64
+ ---
65
+
66
+ ### Low — Large dead code block in `_animation.scss`
67
+
68
+ - **Impact:** Adds noise; the commented code differs from the live implementation, creating confusion about which version is canonical.
69
+ - **Evidence:** `_animation.scss:109–177` — three commented-out `.spinner` implementations spanning 68 lines.
70
+ - **Fix:** Delete the commented block. History is in git.
71
+
72
+ ---
73
+
74
+ ### Low — `docs/utilities/animation.md` and `docs/review/animation.md` are identical
75
+
76
+ - **Impact:** Any update to one must be manually mirrored to the other; they will diverge.
77
+ - **Evidence:** Both files are byte-for-byte identical — same headings, same content, same `(review)` markers on every section heading.
78
+ - **Fix:** Delete `docs/review/animation.md` or make it a redirect/include. One source of truth.
79
+
80
+ ---
81
+
82
+ ### Low — All section headings carry `(review)` markers; no content is marked final
83
+
84
+ - **Impact:** The docs page cannot be published or referenced as authoritative in its current state.
85
+ - **Evidence:** `docs/utilities/animation.md:1` — title is "Animation Utilities (review)"; every `##` heading appends `(review)`.
86
+ - **Fix:** Remove `(review)` markers as each section is confirmed; track incomplete sections explicitly.
87
+
88
+ ---
89
+
90
+ ### Low — No dedicated loaders/spinners documentation page
91
+
92
+ - **Impact:** The `.spinner`, `.loader-container`, `.loading-text`, and `.dots` components are undiscoverable outside the animation utilities page. There is no entry in `docs/components/` for them, despite being defined as a named component file.
93
+ - **Evidence:** `docs/components/` has accordion, box, button, forms, list, menu, navbar, table — no loaders entry. The component is documented only as a subsection of `docs/utilities/animation.md`.
94
+ - **Fix:** Create `docs/components/loaders.md` covering the `.spinner` variants and `.loader-container` pattern, separate from the animation utility reference.
95
+
96
+ ---
97
+
98
+ ## Maintainability Risk: **High**
99
+
100
+ Two broken animations (`dots`, `ping`), a nested component that silently overrides and breaks the variable system, and documentation that is unfinished and duplicated. The `.loader-container .spinner` inconsistency means any refactor of the variable approach requires tracking two divergent implementations.
101
+
102
+ ## Cross-Boundary Coupling Risk: **Low**
103
+
104
+ The component is self-contained. The only cross-file dependency is `@keyframes spin` from `_animation.scss`, which is correctly defined.
package/dev.html CHANGED
@@ -11,64 +11,9 @@
11
11
  <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
12
12
  </head>
13
13
 
14
- <body class="bg-stone-100 pxy-075">
14
+ <body class="container py-5 bg-gray-200">
15
15
 
16
- <style>
17
- :root {
18
- --primary: #6b1a3c;
19
- --primary-hover: color-mix(in srgb, var(--primary), white 5%);
20
- --primary-active: color-mix(in srgb, var(--primary), black 5%);
21
- --primary-border: transparent;
22
- --on-primary: #fff;
23
- }
24
- </style>
25
-
26
- <section class="grid md:cols-2 gap-1">
27
- <article class="bx flex-col md:flex-row p-0 overflow-hidden rounded-xl shadow-none bdr-stone-200">
28
- <div class="h-8 md:h-auto md:w-8 md:min-w-8 bg-stone-300"></div>
29
- <div class="flex-col flex-1 gap-075 pxy-1">
30
- <span class="txt-primary txt-xs font-bold tracking-widest uppercase">Program</span>
31
- <h3 class="font-serif txt-base font-bold lh-tight txt-stone-950">Ethics Program</h3>
32
- <p class="txt-xs lh-relaxed txt-stone-700 flex-1">Two comprehensive courses equipping lactation professionals with practical skills in ethical decision-making and Code-compliant practice</p>
33
- <a class="btn primary rounded-full w-full txt-xs">Enrol Now $154.00</a>
34
- <a class="txt-primary txt-xs font-semibold">View Details →</a>
35
- </div>
36
- </article>
37
-
38
- <article class="bx flex-col md:flex-row p-0 overflow-hidden rounded-xl shadow-none bdr-stone-200">
39
- <div class="h-8 md:h-auto md:w-8 md:min-w-8 bg-stone-400"></div>
40
- <div class="flex-col flex-1 gap-075 pxy-1">
41
- <span class="txt-primary txt-xs font-bold tracking-widest uppercase">Program</span>
42
- <h3 class="font-serif txt-base font-bold lh-tight txt-stone-950">Lactation Consultant Exam Prep Program</h3>
43
- <p class="txt-xs lh-relaxed txt-stone-700 flex-1">13 targeted courses building core lactation science, clinical reasoning and exam strategy skills to help IBCLC candidates feel confident and ready to pass</p>
44
- <a class="btn primary rounded-full w-full txt-xs">Enrol Now $1,200.00</a>
45
- <a class="txt-primary txt-xs font-semibold">View Details →</a>
46
- </div>
47
- </article>
48
-
49
- <article class="bx flex-col md:flex-row p-0 overflow-hidden rounded-xl shadow-none bdr-stone-200">
50
- <div class="h-8 md:h-auto md:w-8 md:min-w-8 bg-stone-300"></div>
51
- <div class="flex-col flex-1 gap-075 pxy-1">
52
- <span class="txt-primary txt-xs font-bold tracking-widest uppercase">Program</span>
53
- <h3 class="font-serif txt-base font-bold lh-tight txt-stone-950">Recertify, Renew, Refresh</h3>
54
- <p class="txt-xs lh-relaxed txt-stone-700 flex-1">7 focused courses mapped to the IBCLC Detailed Content Outline to refresh knowledge, update evidence-based practice for recertification</p>
55
- <a class="btn primary rounded-full w-full txt-xs">Enrol Now $385.00</a>
56
- <a class="txt-primary txt-xs font-semibold">View Details →</a>
57
- </div>
58
- </article>
59
-
60
- <article class="bx flex-col md:flex-row p-0 overflow-hidden rounded-xl shadow-none bdr-stone-200">
61
- <div class="h-8 md:h-auto md:w-8 md:min-w-8 bg-emerald-200"></div>
62
- <div class="flex-col flex-1 gap-075 pxy-1">
63
- <span class="txt-primary txt-xs font-bold tracking-widest uppercase">Program</span>
64
- <h3 class="font-serif txt-base font-bold lh-tight txt-stone-950">New Program Name</h3>
65
- <p class="txt-xs lh-relaxed txt-stone-700 flex-1">Description text here for the new 4th program that your client wants to add to the page</p>
66
- <a class="btn primary rounded-full w-full txt-xs">Enrol Now $XXX.00</a>
67
- <a class="txt-primary txt-xs font-semibold">View Details →</a>
68
- </div>
69
- </article>
70
- </section>
71
16
  <script type="module" src="/main.js"></script>
72
17
  </body>
73
18
 
74
- </html>
19
+ </html>
@@ -0,0 +1,85 @@
1
+ # Loaders and Spinners
2
+
3
+ Page loaders and spinners to communicate in-progress and waiting states.
4
+
5
+ ## Spinners
6
+
7
+ The `.spinner` class provides a CSS-only animated border spinner.
8
+
9
+ ### Border Spinner
10
+
11
+ Apply the `.spinner` class to a `div` for an animated loading indicator.
12
+
13
+ #### Basic Usage
14
+
15
+ ```html +demo-folded class="bx example-jtb" preview-class="flex-centered"
16
+ <div class="spinner"></div>
17
+ ```
18
+
19
+ #### Size
20
+
21
+ Add `.sm` or `.lg` to resize.
22
+
23
+ ```html +demo-folded class="bx example-jtb" preview-class="flex-centered gap"
24
+ <div class="spinner sm"></div>
25
+ <div class="spinner"></div>
26
+ <div class="spinner lg"></div>
27
+ ```
28
+
29
+ #### Thickness
30
+
31
+ Add `.thick` to increase the border width. Combine with size modifiers.
32
+
33
+ ```html +demo-folded class="bx example-jtb" preview-class="flex-centered gap"
34
+ <div class="spinner sm thick"></div>
35
+ <div class="spinner thick"></div>
36
+ <div class="spinner lg thick"></div>
37
+ ```
38
+
39
+ ### Utility Examples
40
+
41
+ #### SVG Arc
42
+
43
+ ```html +demo-folded class="bx example-utils" preview-class="flex-centered gap"
44
+ <svg class="animate-spin wh-5" viewBox="0 0 36 36">
45
+ <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-opacity="0.25" />
46
+ <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="butt" stroke-dasharray="22 66" />
47
+ </svg>
48
+ ```
49
+
50
+ Use text color utilities to control the spinner color.
51
+
52
+ ```html +demo-folded class="bx example-utils" preview-class="flex-centered gap"
53
+ <svg class="animate-spin wh-5 txt-blue" viewBox="0 0 36 36">
54
+ <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-opacity="0.25" />
55
+ <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="butt" stroke-dasharray="22 66" />
56
+ </svg>
57
+ <svg class="animate-spin wh-5 txt-blue-900" viewBox="0 0 36 36">
58
+ <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-opacity="0.25" />
59
+ <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="butt" stroke-dasharray="22 66" />
60
+ </svg>
61
+ <svg class="animate-spin wh-5 txt-orange-400" viewBox="0 0 36 36">
62
+ <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-opacity="0.25" />
63
+ <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="butt" stroke-dasharray="22 66" />
64
+ </svg>
65
+ ```
66
+
67
+ ## Loader Container (review)
68
+
69
+ `.loader-container` centers a spinner and loading text as a column. For a
70
+ composed example see [UI Examples](/docs/jtb/examples/showcase-ui).
71
+
72
+ ## CSS Custom Properties (review)
73
+
74
+ | Property | Default | Controls |
75
+ | ------------- | -------- | ------------------------------------ |
76
+ | `--size` | `2.5rem` | Spinner diameter |
77
+ | `--thickness` | `0.08` | Border width as a proportion of size |
78
+
79
+ Override on the element directly or scoped to a parent:
80
+
81
+ ```html +code
82
+ <div class="spinner" style="--size: 4rem; --thickness: 0.12;"></div>
83
+ ```
84
+
85
+ See [Variable System](/docs/jtb/variable-system) for override instructions.
@@ -1,5 +1,16 @@
1
1
  # JTB UI Showcase
2
2
 
3
+ ## Loaders
4
+
5
+ ### Loader Container
6
+
7
+ ```html +demo-folded class="bx dark"
8
+ <div class="loader-container">
9
+ <div class="spinner"></div>
10
+ <div class="loading-text">Loading<span class="dots"></span></div>
11
+ </div>
12
+ ```
13
+
3
14
  ## Lists
4
15
 
5
16
  ### Checklist
@@ -295,6 +295,7 @@ Files parked in `docs/review/` — purpose or audience unclear.
295
295
  | `components/menu.md` | review | |
296
296
  | `components/navbar.md` | review | |
297
297
  | `components/table.md` | review | |
298
+ | `components/loaders-and-spinners.md` | partial | Border Spinner confirmed. Loader Container, CSS Custom Properties, SVG Arc utility example still pending. |
298
299
  | `components/example-navigations.md` | stub | Bare HTML, no explanation |
299
300
 
300
301
  ### Utilities
@@ -303,7 +304,7 @@ Files parked in `docs/review/` — purpose or audience unclear.
303
304
  | ------------------------------------- | ------ | --------------------------------------------------- |
304
305
  | `utilities/border.md` | review | Border, outline, and divider utilities |
305
306
  | `utilities/typography.md` | review | New — needs review pass |
306
- | `utilities/animation.md` | review | |
307
+ | `utilities/animation.md` | review | Rewritten — loader/spinner content moved to components/loaders-and-spinners.md |
307
308
  | `utilities/display-and-visibility.md` | review | |
308
309
  | `utilities/effects.md` | review | |
309
310
  | `utilities/position.md` | review | |
@@ -1,130 +1,81 @@
1
- # Animation Utilities (review)
2
-
3
- <h2>Loading States</h2>
4
- <div class="grid md:cols-2 lg:cols-3 gap">
5
- <!-- Simple Spinner -->
6
- <div class="bx bdr-none shadow-lg flex-centered flex-col gap">
7
- <h3 class="bx-title txt-1 font-semibold">Simple Spinner</h3>
8
- <div class="animate-spin rounded-full wh-4 bdr-4 bdr-gray-200 bdr-t-blue-600"></div>
9
- <p class="txt-sm txt-gray-600">Sending message...</p>
10
- </div>
11
- <!-- Ring Spinner (Thicker) -->
12
- <div class="bx bdr-none shadow-lg flex-centered flex-col gap">
13
- <h3 class="bx-title txt-1 font-semibold">Ring Spinner</h3>
14
- <div class="animate-spin rounded-full wh-4 bdr-8 bdr-gray-200 bdr-t-indigo-600"></div>
15
- <p class="txt-sm txt-gray-600">Processing...</p>
16
- </div>
17
- <!-- Dual Ring -->
18
- <div class="bx bdr-none shadow-lg flex-centered flex-col gap">
19
- <h3 class="bx-title txt-1 font-semibold">Dual Ring</h3>
20
- <div class="relative">
21
- <div class="animate-spin rounded-full wh-4 bdr-4 bdr-gray-200 bdr-t-purple-600"></div>
22
- <div class="absolute top-05 left-05 animate-spin rounded-full wh-3 bdr-4 bdr-gray-100 bdr-t-purple-400" style="animation-direction: reverse;"></div>
23
- </div>
24
- <p class="txt-sm txt-gray-600">Loading...</p>
25
- </div>
26
- <!-- Bouncing Dots -->
27
- <div class="bx bdr-none shadow-lg flex-centered flex-col gap">
28
- <h3 class="bx-title txt-1 font-semibold">Bouncing Dots</h3>
29
- <div class="flex space-x-05">
30
- <div class="wh-1 bg-blue-600 rounded-full animate-bounce" style="animation-delay: 0s;"></div>
31
- <div class="wh-1 bg-blue-600 rounded-full animate-bounce" style="animation-delay: 0.1s;"></div>
32
- <div class="wh-1 bg-blue-600 rounded-full animate-bounce" style="animation-delay: 0.2s;"></div>
33
- </div>
34
- <p class="txt-sm txt-gray-600">Submitting...</p>
35
- </div>
36
- <!-- Pulsing Circle -->
37
- <div class="bx bdr-none shadow-lg flex-centered flex-col gap">
38
- <h3 class="bx-title txt-1 font-semibold">Pulse</h3>
39
- <div class="wh-4 bg-teal-500 rounded-full animate-pulse"></div>
40
- <p class="txt-sm txt-gray-600">Please wait...</p>
41
- </div>
42
- <!-- Pulse Rings -->
43
- <div class="bx bdr-none shadow-lg flex-centered flex-col gap">
44
- <h3 class="bx-title txt-1 font-semibold">Pulse Rings</h3>
45
- <div class="relative">
46
- <div class="wh-4 bg-emerald-500 rounded-full"></div>
47
- <div class="absolute top-0 left-0 wh-4 bg-emerald-400 rounded-full animate-pulse-ring"></div>
48
- <div class="absolute top-0 left-0 wh-4 bg-emerald-400 rounded-full animate-pulse-ring" style="animation-delay: 0.5s;"></div>
49
- </div>
50
- <p class="txt-sm txt-gray-600">Processing...</p>
51
- </div>
52
- <!-- SVG Spinner -->
53
- <div class="bx bdr-none shadow-lg flex-centered flex-col gap">
54
- <h3 class="bx-title txt-1 font-semibold">SVG Spinner</h3>
55
- <svg class="animate-spin wh-4 txt-orange-600" fill="none" viewBox="0 0 24 24">
56
- <circle class="opacity-30" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
57
- <path class="opacity-80" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
58
- </svg>
59
- <p class="txt-sm txt-gray-600">Uploading...</p>
60
- </div>
61
- <!-- Progress Bar -->
62
- <div class="bx bdr-none shadow-lg flex-centered flex-col gap">
63
- <h3 class="bx-title txt-1 font-semibold">Progress Bar</h3>
64
- <div class="w-full h-2 bg-gray-200 rounded-full overflow-hidden">
65
- <div class="h-full bg-blue-600 rounded-full animate-pulse" style="width: 70%;"></div>
66
- </div>
67
- <p class="txt-sm txt-gray-600">70% Complete</p>
68
- </div>
69
- <!-- Sequential Dots -->
70
- <div class="bx bdr-none shadow-lg flex-centered flex-col gap">
71
- <h3 class="bx-title txt-1 font-semibold">Sequential Dots</h3>
72
- <div class="flex space-x-05 items-center h-2">
73
- <div class="wh-05 bg-gray-600 rounded-full opacity-0 animate-pulse" style="animation-delay: 0s;"></div>
74
- <div class="wh-05 bg-gray-600 rounded-full opacity-0 animate-pulse" style="animation-delay: 0.3s;"></div>
75
- <div class="wh-05 bg-gray-600 rounded-full opacity-0 animate-pulse" style="animation-delay: 0.6s;"></div>
76
- </div>
77
- <p class="txt-sm txt-gray-600">Loading...</p>
78
- </div>
79
- </div>
80
-
81
- ## Loading Animations (review)
82
-
83
- <div class="loader-container bx dark">
84
- <div class="spinner"></div>
85
- <div class="loading-text">Loading<span class="dots"></span></div>
86
- </div>
87
-
88
- <div class="loader-container bx dark">
89
- <div class="loading-text">Loading<span class="dots"></span></div>
90
- </div>
91
-
92
- ## SVG Spinners (review)
93
-
94
- <div class="bx flex va-c">
95
- <svg class="wh-2 animate-spin" viewBox="0 0 200 200">
96
- <circle cx="100" cy="100" r="80" fill="none" class="stroke-gray-400" stroke-width="12" />
97
- <circle cx="100" cy="100" r="80" fill="none" class="stroke-gray-100" stroke-width="12" stroke-linecap="round" stroke-dasharray="251.2" stroke-dashoffset="188.4" />
98
- </svg>
99
- <svg class="wh-3 animate-spin" viewBox="0 0 200 200">
100
- <circle cx="100" cy="100" r="80" fill="none" class="stroke-red-300" stroke-width="12" />
101
- <circle cx="100" cy="100" r="80" fill="none" class="stroke-blue-500" stroke-width="12" stroke-linecap="round" stroke-dasharray="251.2" stroke-dashoffset="188.4" />
102
- </svg>
103
- <svg class="wh-4 animate-spin" viewBox="0 0 200 200">
104
- <circle cx="100" cy="100" r="80" fill="none" class="stroke-yellow-300" stroke-width="12" />
105
- <circle cx="100" cy="100" r="80" fill="none" class="stroke-green-500" stroke-width="12" stroke-linecap="round" stroke-dasharray="251.2" stroke-dashoffset="188.4" />
106
- </svg>
107
- </div>
108
-
109
- ## Border Animations (review)
110
-
111
- ### Spinner (review)
112
-
113
- ```html +demo-folded
114
- <div class="dark flex-centered gap bx">
115
- <div class="spinner sm"></div>
116
- <div class="spinner"></div>
117
- <div class="spinner lg"></div>
118
- </div>
119
- ```
120
-
121
- **Thick Spinners:**
122
-
123
- ```html +demo-folded
124
- <div class="dark flex-centered gap bx">
125
- <div class="spinner sm thick"></div>
126
- <div class="spinner thick "></div>
127
- <div class="spinner lg thick"></div>
128
- </div>
129
- ```
130
-
1
+ # Animation Utilities
2
+
3
+ Utility classes for applying CSS animations.
4
+
5
+ | Class | Animation |
6
+ | --------------------- | ------------------- |
7
+ | `animate-spin` | Continuous rotation |
8
+ | `animate-bounce` | Vertical bounce |
9
+ | `animate-pulse` | Opacity fade |
10
+ | `animate-pulse-ring` | Expanding ring |
11
+ | `animate-ping` | Scale and fade out |
12
+ | `animate-checkmark` | SVG stroke draw-in |
13
+ | `animate-circle` | SVG stroke draw-in |
14
+ | `animate-none` | Removes animation |
15
+
16
+ ## Spin (review)
17
+
18
+ Rotates an element continuously. Commonly used for loading indicators.
19
+
20
+ ```html +demo-folded class="bx"
21
+ <div class="animate-spin wh-3 bdr-4 bdr-gray-200 bdr-t-blue-500 rounded-full"></div>
22
+ ```
23
+
24
+ ## Bounce (review)
25
+
26
+ Applies a vertical bounce. Stagger `animation-delay` across sibling elements for
27
+ a sequential effect.
28
+
29
+ ```html +demo-folded class="bx" preview-class="flex-centered gap-05"
30
+ <div class="wh-1 bg-blue-600 rounded-full animate-bounce" style="animation-delay: 0s;"></div>
31
+ <div class="wh-1 bg-blue-600 rounded-full animate-bounce" style="animation-delay: 0.1s;"></div>
32
+ <div class="wh-1 bg-blue-600 rounded-full animate-bounce" style="animation-delay: 0.2s;"></div>
33
+ ```
34
+
35
+ ## Pulse (review)
36
+
37
+ Fades an element's opacity in and out. Use for skeleton loaders or ambient
38
+ status indicators.
39
+
40
+ ```html +demo-folded class="bx"
41
+ <div class="wh-4 bg-teal-500 rounded-full animate-pulse"></div>
42
+ ```
43
+
44
+ ## Pulse Ring (review)
45
+
46
+ Scales and fades an element outward to create an expanding ring effect. Use
47
+ `relative` positioning with overlapping siblings for layered rings.
48
+
49
+ ```html +demo-folded class="bx"
50
+ <div class="relative">
51
+ <div class="wh-4 bg-emerald-500 rounded-full"></div>
52
+ <div class="absolute top-0 left-0 wh-4 bg-emerald-400 rounded-full animate-pulse-ring"></div>
53
+ <div class="absolute top-0 left-0 wh-4 bg-emerald-400 rounded-full animate-pulse-ring" style="animation-delay: 0.5s;"></div>
54
+ </div>
55
+ ```
56
+
57
+ ## Ping (review)
58
+
59
+ Scales an element to twice its size while fading it out — a one-shot burst
60
+ effect. Commonly used as a notification indicator layered over a badge or dot.
61
+
62
+ ```html +demo-folded class="bx"
63
+ <div class="relative">
64
+ <div class="wh-2 bg-red-500 rounded-full"></div>
65
+ <div class="absolute top-0 left-0 wh-2 bg-red-400 rounded-full animate-ping"></div>
66
+ </div>
67
+ ```
68
+
69
+ ## SVG Animations (review)
70
+
71
+ `animate-circle` draws a circular stroke in from nothing to full.
72
+ `animate-checkmark` does the same for a path. Both classes set `stroke-dasharray`
73
+ and animate `stroke-dashoffset`. The SVG path or circle length must be no greater
74
+ than the class's `stroke-dasharray` value (166 for circle, 100 for checkmark).
75
+
76
+ ```html +demo-folded class="bx"
77
+ <svg viewBox="0 0 52 52" class="wh-4 txt-green-600" fill="none">
78
+ <circle cx="26" cy="26" r="25" stroke="currentColor" stroke-width="2" class="animate-circle" />
79
+ <path d="M14 27l8 8 16-16" stroke="currentColor" stroke-width="2" class="animate-checkmark" />
80
+ </svg>
81
+ ```