nk_jtb 0.27.1 → 0.27.3

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.
@@ -6,26 +6,15 @@ description: >-
6
6
  updated, this skill applies.
7
7
  ---
8
8
 
9
- Apply both this skill and `nk-documentation-best-practices`. This skill takes
9
+ Extends `nk-documentation-best-practices` apply both, this skill takes
10
10
  precedence where they conflict.
11
11
 
12
12
  ## Documentation Types
13
13
 
14
14
  ### Component Documentation
15
15
 
16
- Use for named structural classes such as `navbar`, `menu`, `bx`, or form controls.
17
-
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:**
21
-
22
- 1. One-line lead
23
- 2. `## Basic Usage` — minimum working markup
24
- 3. Additional `##` sections — simple to fuller usage
25
- 4. `## SCSS Variables` — if the component exposes overridable variables
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.
16
+ Follow the shared component-doc rules in `nk-documentation-best-practices` first.
17
+ Then apply these JTB-specific additions.
29
18
 
30
19
  **Rules:**
31
20
 
@@ -33,7 +22,7 @@ A class-based component has a named CSS class (e.g. `.spinner`, `.accordion`) th
33
22
  - Open Basic Usage with `Apply the [component class] to...` — directive, not descriptive.
34
23
  - Component class examples use `class="bx example-jtb"`.
35
24
  - Utility examples use `class="bx example-utils"`.
36
- - Place SCSS Variables directly before Utility Examples.
25
+ - Place `## SCSS Variables` directly before `## Utility Examples`.
37
26
  - Link to `/docs/jtb/variable-system` for override instructions rather than explaining inline.
38
27
 
39
28
  ### Utility Documentation
@@ -120,7 +109,3 @@ Base path is `/docs/jtb/` + directory and filename without extension:
120
109
 
121
110
  - `docs/components/list.md` → `/docs/jtb/components/list`
122
111
  - `docs/variable-system.md` → `/docs/jtb/variable-system`
123
-
124
- ## Formatting Rules
125
-
126
- - **No `<hr>` in demo markup** — never use horizontal rules in examples
@@ -4,61 +4,39 @@ Page loaders and spinners to communicate in-progress and waiting states.
4
4
 
5
5
  ## Spinners
6
6
 
7
- The `.spinner` class provides a CSS-only animated border spinner.
7
+ ### SVG Arc
8
8
 
9
- ### Border Spinner
9
+ Apply `animate-spin` to an SVG with a dashed stroke to create a spinner.
10
10
 
11
- Apply the `.spinner` class to a `div` for an animated loading indicator.
11
+ Use `wh-*` utilities to control size.
12
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">
13
+ ```html +demo-folded class="bx example-utils" preview-class="flex-centered vac gap-2"
14
+ <svg class="animate-spin wh-2" viewBox="0 0 36 36">
15
+ <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-opacity="0.25" />
16
+ <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="butt" stroke-dasharray="22 66" />
17
+ </svg>
18
+ <svg class="animate-spin wh-3" viewBox="0 0 36 36">
19
+ <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-opacity="0.25" />
20
+ <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="butt" stroke-dasharray="22 66" />
21
+ </svg>
22
+ <svg class="animate-spin wh-4" viewBox="0 0 36 36">
45
23
  <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-opacity="0.25" />
46
24
  <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="butt" stroke-dasharray="22 66" />
47
25
  </svg>
48
26
  ```
49
27
 
50
- Use text color utilities to control the spinner color.
28
+ Use `txt-*` utilities to control colour.
51
29
 
52
30
  ```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">
31
+ <svg class="animate-spin wh-2 txt-blue" viewBox="0 0 36 36">
54
32
  <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-opacity="0.25" />
55
33
  <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="butt" stroke-dasharray="22 66" />
56
34
  </svg>
57
- <svg class="animate-spin wh-5 txt-blue-900" viewBox="0 0 36 36">
35
+ <svg class="animate-spin wh-2 txt-blue-900" viewBox="0 0 36 36">
58
36
  <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-opacity="0.25" />
59
37
  <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="butt" stroke-dasharray="22 66" />
60
38
  </svg>
61
- <svg class="animate-spin wh-5 txt-orange-400" viewBox="0 0 36 36">
39
+ <svg class="animate-spin wh-2 txt-orange-400" viewBox="0 0 36 36">
62
40
  <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-opacity="0.25" />
63
41
  <circle cx="18" cy="18" r="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="butt" stroke-dasharray="22 66" />
64
42
  </svg>
@@ -68,18 +46,3 @@ Use text color utilities to control the spinner color.
68
46
 
69
47
  `.loader-container` centers a spinner and loading text as a column. For a
70
48
  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,16 +1,5 @@
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
-
14
3
  ## Lists
15
4
 
16
5
  ### Checklist
@@ -295,7 +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
+ | `components/loaders-and-spinners.md` | partial | Spinners section confirmed (SVG Arc utility approach). Loader Container still pending. |
299
299
  | `components/example-navigations.md` | stub | Bare HTML, no explanation |
300
300
 
301
301
  ### Utilities
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nk_jtb",
3
3
  "description": "Yet another utility based framework.",
4
- "version": "0.27.1",
4
+ "version": "0.27.3",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/naykel76/nk_jtb.git"
package/skills-lock.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "source": "naykel76/skills-and-guidelines",
6
6
  "sourceType": "github",
7
7
  "skillPath": "code-review/SKILL.md",
8
- "computedHash": "80927ef183fc7c52837e829dcffa37c3b737f7570d56a259bd2e31ce6627b31d"
8
+ "computedHash": "83753a3d13c03a429372077ba6e6f0f98d4bad1b448d5b4bc0dbe0f45acfad04"
9
9
  },
10
10
  "grill-me": {
11
11
  "source": "naykel76/skills-and-guidelines",
@@ -23,7 +23,7 @@
23
23
  "source": "naykel76/skills-and-guidelines",
24
24
  "sourceType": "github",
25
25
  "skillPath": "nk-documentation-best-practices/SKILL.md",
26
- "computedHash": "ba3237364f6aac95b43c792df0a363e2b83fb9f4c0c4a3cc68b83071e793a600"
26
+ "computedHash": "ad8bdd5e8b52cd29d50caf9a1be1615fd107e37b1b00114e4447f3656b22f956"
27
27
  },
28
28
  "skill-creation": {
29
29
  "source": "naykel76/skills-and-guidelines",
@@ -2,16 +2,6 @@
2
2
  @use '../maps_and_variables/colors' as *;
3
3
  @use '../maps_and_variables/components' as *;
4
4
  @use '../maps_and_variables/typography' as *;
5
- @use '../functions/color-functions' as *;
6
- @use 'sass:map';
7
-
8
- @mixin define-runtime-theme-vars($theme-name, $theme-color) {
9
- --#{$theme-name}: #{$theme-color};
10
- --#{$theme-name}-hover: color-mix(in srgb, var(--#{$theme-name}), white 5%);
11
- --#{$theme-name}-active: color-mix(in srgb, var(--#{$theme-name}), black 5%);
12
- --#{$theme-name}-border: #{border-contrast($theme-color)};
13
- --on-#{$theme-name}: #{text-color($theme-color)};
14
- }
15
5
 
16
6
  :root {
17
7
  // create css variables including brand colors
@@ -47,10 +37,10 @@
47
37
  --bg-toggle-on: var(--primary);
48
38
  --bg-toggle-ball: var(--white);
49
39
 
50
- // -- Runtime Semantic Theme Colors --
51
- @each $theme-name in $runtime-theme-colors {
52
- @include define-runtime-theme-vars($theme-name, map.get($base-colors, $theme-name));
53
- }
40
+ // -- Brand Colors --
41
+ --primary: #{$primary};
42
+ --secondary: #{$secondary};
43
+ --accent: #{$accent};
54
44
 
55
45
  // -- Text Colors --
56
46
  --text-color: #{$text-color};
@@ -37,13 +37,6 @@
37
37
  opacity: 0.5;
38
38
  }
39
39
 
40
- // ICON SUPPORT
41
- > svg,
42
- > i {
43
- flex-shrink: 0; // prevent the icon from shrinking when button resizes or text wraps
44
- height: var(--icon-size, 1em); // match the icon height to the button's font-size for automatic scaling
45
- width: var(--icon-size, 1em); // match the icon width to the button's font-size for consistent sizing
46
- }
47
40
 
48
41
  &:where(.xs) {
49
42
  padding-inline: 0.625rem;
@@ -80,6 +73,14 @@
80
73
  }
81
74
  }
82
75
 
76
+ // ICON SUPPORT — :where() gives zero specificity so wh-* utilities can override
77
+ :where(.#{$button-prefix}) > svg,
78
+ :where(.#{$button-prefix}) > i {
79
+ flex-shrink: 0;
80
+ height: var(--icon-size, 1em);
81
+ width: var(--icon-size, 1em);
82
+ }
83
+
83
84
  // ============================================================================
84
85
  // -- THEMES AND VARIATIONS --
85
86
  // ============================================================================
@@ -108,19 +109,3 @@
108
109
  @include active($color);
109
110
  }
110
111
  }
111
-
112
- @each $theme-name in $runtime-theme-colors {
113
- .#{$button-prefix}.#{$theme-name} {
114
- &:hover {
115
- background-color: var(--#{$theme-name}-hover);
116
- border-color: var(--#{$theme-name}-border);
117
- color: var(--on-#{$theme-name});
118
- }
119
-
120
- &:active {
121
- background-color: var(--#{$theme-name}-active);
122
- border-color: var(--#{$theme-name}-border);
123
- color: var(--on-#{$theme-name});
124
- }
125
- }
126
- }
@@ -1,43 +1,9 @@
1
- .spinner {
2
- --size: 2.5rem;
3
- --thickness: 0.08;
4
-
5
- animation: spin 1.5s linear infinite;
6
- border: calc(var(--size) * var(--thickness)) solid #f3f3f3;
7
- border-radius: 50%;
8
- border-top: calc(var(--size) * var(--thickness)) solid #3498db;
9
- height: var(--size);
10
- width: var(--size);
11
-
12
- &.sm {
13
- --size: 1.25rem;
14
- }
15
-
16
- &.lg {
17
- --size: 5rem;
18
- }
19
-
20
- &.thick {
21
- --thickness: 0.15;
22
- }
23
- }
24
-
25
1
  .loader-container {
26
2
  align-items: center;
27
3
  display: flex;
28
4
  flex-direction: column;
29
5
  justify-content: center;
30
6
 
31
- .spinner {
32
- animation: spin 1.5s linear infinite;
33
- border: 4px solid rgb(255 255 255 / 30%);
34
- border-radius: 50%;
35
- border-top-color: #fff;
36
- height: 60px;
37
- margin: 0 auto 20px;
38
- width: 60px;
39
- }
40
-
41
7
  .loading-text {
42
8
  color: #fff;
43
9
  font-size: 18px;
@@ -51,10 +51,6 @@ $theme-colors: (
51
51
  'warning': #ffdd57
52
52
  ) !default;
53
53
 
54
- // Semantic theme names that should remain runtime-swappable via CSS custom
55
- // properties. Hue and scale colors stay compile-time tokens.
56
- $runtime-theme-colors: ('primary', 'secondary', 'accent') !default;
57
-
58
54
  // based on Tailwind 500 series colors
59
55
  $base-colors: (
60
56
  'primary': base.$primary,
@@ -22,18 +22,4 @@ $background-color-properties: (
22
22
  )
23
23
  );
24
24
 
25
- $runtime-background-colors: ();
26
-
27
- @each $theme-name in $runtime-theme-colors {
28
- $runtime-background-colors: map.set($runtime-background-colors, $theme-name, var(--#{$theme-name}));
29
- }
30
-
31
- $runtime-background-color-properties: (
32
- background-color: (
33
- prefix: 'bg-',
34
- values: $runtime-background-colors
35
- )
36
- );
37
-
38
25
  @include build-classes($background-color-properties, $responsive: false, $with-state: true);
39
- @include build-classes($runtime-background-color-properties, $responsive: false, $with-state: true);
@@ -51,23 +51,6 @@ $divider-properties-map: (
51
51
  )
52
52
  ) !default;
53
53
 
54
- $runtime-border-colors: ();
55
-
56
- @each $theme-name in $runtime-theme-colors {
57
- $runtime-border-colors: map.set($runtime-border-colors, $theme-name, var(--#{$theme-name}));
58
- }
59
-
60
- $runtime-border-properties-map: (
61
- border-color: (
62
- prefix: #{$border-prefix},
63
- values: $runtime-border-colors
64
- ),
65
- outline-color: (
66
- prefix: 'outline-',
67
- values: $runtime-border-colors
68
- )
69
- );
70
-
71
54
  .divide-y-gradient > :not(:last-child) {
72
55
  border-block-end-width: 3px;
73
56
  border-image-slice: 1;
@@ -85,5 +68,4 @@ $runtime-border-properties-map: (
85
68
  // Builds
86
69
  // ============================================================================
87
70
  @include build-classes($border-properties-map, $responsive: true);
88
- @include build-classes($runtime-border-properties-map, $responsive: true);
89
71
  @include build-composite-classes($divider-properties-map, $responsive: true);
@@ -50,22 +50,3 @@ $themes-map: ();
50
50
  @each $color, $value in map.merge($base-colors, $theme-colors) {
51
51
  @include build-outline-theme('#{$color}-outline', $value);
52
52
  }
53
-
54
- @each $theme-name in $runtime-theme-colors {
55
- .#{$theme-name} {
56
- background-color: var(--#{$theme-name});
57
- border: 1px solid var(--#{$theme-name}-border);
58
- color: var(--on-#{$theme-name});
59
- }
60
-
61
- .#{$theme-name}-outline {
62
- background-color: transparent;
63
- border: 1px solid var(--#{$theme-name});
64
- color: var(--#{$theme-name});
65
-
66
- &:hover:not(:disabled, .disabled) {
67
- background-color: var(--#{$theme-name});
68
- color: var(--on-#{$theme-name});
69
- }
70
- }
71
- }
@@ -124,23 +124,8 @@ $text-classes-map: (
124
124
  )
125
125
  );
126
126
 
127
- $runtime-text-colors: ();
128
-
129
- @each $theme-name in $runtime-theme-colors {
130
- $runtime-text-colors: map.set($runtime-text-colors, $theme-name, var(--#{$theme-name}));
131
- }
132
-
133
- $runtime-typography-properties-map: (
134
- color: (
135
- prefix: '#{$text-prefix}',
136
- values: $runtime-text-colors,
137
- states: ('hover', 'focus')
138
- )
139
- );
140
-
141
127
  // ============================================================================
142
128
  // BUILDS
143
129
  // ============================================================================
144
130
  @include build-classes($typography-properties-map, $responsive: true);
145
- @include build-classes($runtime-typography-properties-map, $responsive: true);
146
131
  @include build-composite-classes($text-classes-map, $responsive: true);
package/tasks.md CHANGED
@@ -6,14 +6,8 @@ now, it goes here before the topic changes.
6
6
 
7
7
  ## Planned
8
8
 
9
- - **Complete `loaders-and-spinners.md`** — three sections still pending:
9
+ - **Complete `loaders-and-spinners.md`** — one section still pending:
10
10
  - `## Loader Container (review)` — needs proper content, currently just a one-liner pointing to UI examples
11
- - `## CSS Custom Properties (review)` — content exists, needs confirmation; also has an inline style in the code example that should be a local helper
12
- - `### SVG Arc` utility example — base demo done, intro sentence still missing
13
- - **Fix `.spinner` SCSS** — three issues in `src/components/_loaders-and-spinners.scss`:
14
- - `border-top` → `border-block-start` (physical property)
15
- - Hardcoded colours (`#f3f3f3`, `#3498db`) — add CSS custom properties for track and accent colour
16
- - `.loader-container .spinner` abandons the variable system — hardcodes `60px`, `4px`, `margin: 0 auto 20px`
17
11
 
18
12
  ## Parked
19
13
 
@@ -23,6 +17,5 @@ now, it goes here before the topic changes.
23
17
 
24
18
  - **JTB nav is authored in `nk_jtb`** — keep the nav file updated there as the
25
19
  source of truth, then copy it into the Laravel docs app when needed.
26
- - **`loaders-and-spinners.md` structure** — `## Spinners` currently wraps only `### Border Spinner`. Consider flattening once the full page is settled (would shift `###` sections back to `##`).
27
- - **SVG Arc approach decided** uses two-circle stroke pattern (track circle at 25% opacity + arc circle). No local CSS needed beyond `animate-spin`. `stroke-linecap="butt"` for square ends, `stroke-dasharray="22 66"` for quarter-arc. The fill-based two-path SVG and the `@keyframes dash` approach were both considered and set aside.
28
- - **`jtb-conversion-notes.md`** — open gaps recorded there: positional border-color (`bdr-t-{color}` not generated), `flex-shrink: 0` no utility, percentage widths not in scale, spinner colour theming, icon-only button variant.
20
+ - **Spinner approach decided** — no `.spinner` component class. SVG Arc utility pattern only: two-circle stroke approach (`stroke-opacity="0.25"` track + `stroke-dasharray="22 66"` arc, `stroke-linecap="butt"`). Size via `wh-*`, colour via `txt-*`. CSS border spinner and `@keyframes dash` approaches considered and set aside.
21
+ - **`jtb-conversion-notes.md`**open gaps recorded there: positional border-color (`bdr-t-{color}` not generated), `flex-shrink: 0` no utility, percentage widths not in scale, icon-only button variant.