@nextrap/ntl-card-row 2.0.0 → 2.0.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.
- package/.agents/skills/ntl-card-row-theming/SKILL.md +16 -0
- package/.agents/skills/ntl-card-row-usage/SKILL.md +20 -1
- package/.ai-usage-info.md +22 -2
- package/CHANGELOG.md +24 -0
- package/README.md +30 -1
- package/index.scss +2 -0
- package/package.json +8 -6
- package/src/scss/_with-horizontal-flow.scss +42 -0
- package/src/scss/_with-modifier-classes.scss +9 -0
|
@@ -16,6 +16,7 @@ Nutze diesen Skill für Theme-SCSS und visuelle Varianten. Für Markup und Card-
|
|
|
16
16
|
- Nutze für visuelle Anpassungen die Parts `container`, `header`, `main` und `footer` sowie vorhandene Mixins.
|
|
17
17
|
- Setze `--gutter-x` und `--gutter-y` immer als echte Längenwerte mit Einheit, z. B. `0px`, `16px` oder `24px`, niemals als einheitsloses `0`.
|
|
18
18
|
- Desktop-spezifische Regeln werden auf `[mode='desktop']` gescoped.
|
|
19
|
+
- Für mobile Sequenzen `with-horizontal-flow()` verwenden; Themes dürfen dessen Flex-, Breiten- und Overflow-Regeln nicht nachbauen oder überschreiben.
|
|
19
20
|
|
|
20
21
|
## Vorhandene Mixins
|
|
21
22
|
|
|
@@ -24,6 +25,21 @@ Nutze diesen Skill für Theme-SCSS und visuelle Varianten. Für Markup und Card-
|
|
|
24
25
|
| `default-style()` | Vollständige visuelle Baseline; optionaler `$cols`-Fallback |
|
|
25
26
|
| `with-borderless-cards()` | Card-Rahmen und Innenabstand entfernen |
|
|
26
27
|
| `with-footer-separators()` | Desktop-Trenner für Footer-Cards |
|
|
28
|
+
| `with-horizontal-flow()` | Opt-in Horizontal-Scroll mit nativer Snap-Logik ausschließlich im Mobile-Modus |
|
|
27
29
|
| `with-item-separators()` | Responsive Trenner zwischen Cards |
|
|
28
30
|
| `with-raised-card()` | Einzelne Card hervorheben |
|
|
29
31
|
| `with-modifier-classes()` | Vorbereitete Modifier-Klassen registrieren |
|
|
32
|
+
|
|
33
|
+
## Horizontal-Flow konfigurieren
|
|
34
|
+
|
|
35
|
+
```scss
|
|
36
|
+
ntl-card-row.timeline {
|
|
37
|
+
@include cardRow.with-horizontal-flow(
|
|
38
|
+
$visible-cols-mobile: 1.25,
|
|
39
|
+
$gap: 1rem,
|
|
40
|
+
$snap: proximity
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`default-style()` registriert zusätzlich `.with-horizontal-flow` mit den Defaults. Öffentliche Instanzwerte sind `--visible-cols-mobile`, `--horizontal-flow-gap` und `--horizontal-flow-snap`; der vorhandene `main`-Part bleibt die Scrollfläche.
|
|
@@ -53,7 +53,26 @@ Nutze immer die `trunkjs/content-pane`-Notation `{: layout="..."}`. Die Default-
|
|
|
53
53
|
- Desktop verwendet feste Breiten von `--cols: 1` bis `--cols: 12`.
|
|
54
54
|
- Ohne `--cols` an Row oder Card nutzt die Card die volle verfügbare Zeile.
|
|
55
55
|
- Eine Card-Breite wächst oder schrumpft nicht; überbreiter Inhalt wird abgeschnitten.
|
|
56
|
-
- Im Mobile-Modus stehen Cards
|
|
56
|
+
- Im Mobile-Modus stehen Cards standardmäßig untereinander in voller Breite.
|
|
57
|
+
- `.with-horizontal-flow` aktiviert opt-in eine nativ horizontal scrollbare mobile Reihe; Desktop verwendet weiterhin `--cols`.
|
|
58
|
+
- `--visible-cols-mobile` bestimmt dabei die sichtbare Kartenanzahl (Default `1.15`), `--horizontal-flow-gap` den Inline-Abstand und `--horizontal-flow-snap` die Snap-Stärke.
|
|
57
59
|
- `--min-width` und `--max-width` sind standardmäßig `unset`.
|
|
58
60
|
- `--gutter-x` und `--gutter-y` benötigen immer Längeneinheiten und dürfen nie als einheitsloses `0` gesetzt werden; verwende `0px`, `16px` oder andere echte Längenwerte.
|
|
59
61
|
- Verwende keine `cols`-Attribut-API.
|
|
62
|
+
|
|
63
|
+
## Horizontaler Mobile-Flow
|
|
64
|
+
|
|
65
|
+
```markdown
|
|
66
|
+
## Meilensteine
|
|
67
|
+
{: layout="ntl-card-row.with-horizontal-flow" section-style="--cols: 3; --visible-cols-mobile: 1.2; --horizontal-flow-gap: 16px;"}
|
|
68
|
+
|
|
69
|
+
### Analyse
|
|
70
|
+
|
|
71
|
+
Gemeinsames Zielbild definieren.
|
|
72
|
+
|
|
73
|
+
### Umsetzung
|
|
74
|
+
|
|
75
|
+
Lösung ausliefern und messen.
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Der Modifier ändert weder die DOM-Reihenfolge noch den Desktop-Contract. Native Touch- und Trackpad-Interaktion funktioniert ohne zusätzliche Slider-Controls.
|
package/.ai-usage-info.md
CHANGED
|
@@ -46,6 +46,21 @@ Text
|
|
|
46
46
|
Wide highlighted card
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
+
Horizontal mobile sequence with the regular desktop grid:
|
|
50
|
+
|
|
51
|
+
```md
|
|
52
|
+
## Milestones
|
|
53
|
+
{: layout="ntl-card-row.with-horizontal-flow" section-style="--cols: 3; --visible-cols-mobile: 1.2; --horizontal-flow-gap: 16px;"}
|
|
54
|
+
|
|
55
|
+
### Discover
|
|
56
|
+
|
|
57
|
+
Define the goal.
|
|
58
|
+
|
|
59
|
+
### Deliver
|
|
60
|
+
|
|
61
|
+
Ship the result.
|
|
62
|
+
```
|
|
63
|
+
|
|
49
64
|
Demo/theme SCSS binds the visual baseline to `ntl-card-row.style-default`; examples do not add a `.default` class. Demo modifier classes should be defined on `ntl-card-row` in demo/theme SCSS and include mixins there:
|
|
50
65
|
|
|
51
66
|
```scss
|
|
@@ -64,7 +79,7 @@ ntl-card-row.with-item-separators {
|
|
|
64
79
|
- Uses `SubLayoutApplyMixin` to assign direct headings to `header`, direct `footer` to `footer`, and direct `section` children to `nte-card`.
|
|
65
80
|
- Desktop layout uses a 12-column model. Set `--cols: 1` through `--cols: 12` on `ntl-card-row` and optionally on individual cards.
|
|
66
81
|
- A card-level `--cols` value overrides the inherited row value. Without either value, cards use the full available row width.
|
|
67
|
-
- Fixed columns do not grow or shrink; overflowing content is clipped. Mobile mode stacks cards full-width.
|
|
82
|
+
- Fixed columns do not grow or shrink; overflowing content is clipped. Mobile mode stacks cards full-width unless `.with-horizontal-flow` enables the opt-in native horizontal scroller.
|
|
68
83
|
|
|
69
84
|
Important CSS variables:
|
|
70
85
|
|
|
@@ -73,6 +88,9 @@ Important CSS variables:
|
|
|
73
88
|
- `--cols`: desktop card width from 1 through 12; inherited by cards and defaults to full width
|
|
74
89
|
- `--min-width` / `--max-width`: optional card constraints; both default to `unset`
|
|
75
90
|
- `--gutter-x` / `--gutter-y`: card gaps; always pass real length values with units, preferably `px` such as `0px`, `16px` or `24px`, never unitless values like `0`
|
|
91
|
+
- `--visible-cols-mobile`: visible cards in the horizontal mobile flow, default `1.15`; values below `1` are clamped to `1`
|
|
92
|
+
- `--horizontal-flow-gap`: inline gap in the horizontal mobile flow, default `var(--gutter-x)`
|
|
93
|
+
- `--horizontal-flow-snap`: native scroll-snap strength (`none`, `proximity` or `mandatory`), default `proximity`
|
|
76
94
|
|
|
77
95
|
## CSS parts
|
|
78
96
|
|
|
@@ -94,18 +112,20 @@ Use `::part(container)`, `::part(header)`, `::part(main)` and `::part(footer)` f
|
|
|
94
112
|
|
|
95
113
|
@include cardRow.with-borderless-cards();
|
|
96
114
|
@include cardRow.with-footer-separators($separator-color: var(--nt-primary));
|
|
115
|
+
@include cardRow.with-horizontal-flow($visible-cols-mobile: 1.2, $gap: 16px);
|
|
97
116
|
@include cardRow.with-item-separators($separator-color: var(--nt-gray-400));
|
|
98
117
|
@include cardRow.with-raised-card();
|
|
99
118
|
@include cardRow.with-modifier-classes();
|
|
100
119
|
```
|
|
101
120
|
|
|
102
|
-
`default-style()` includes modifier classes by default. Available classes: `.highlight` for raised cards and `.footer-separators` / legacy `.style-footer` for desktop footer separators.
|
|
121
|
+
`default-style()` includes modifier classes by default. Available classes: `.with-horizontal-flow` for the mobile scroller, `.highlight` for raised cards and `.footer-separators` / legacy `.style-footer` for desktop footer separators.
|
|
103
122
|
|
|
104
123
|
`$cols` is an optional theme fallback only. Prefer setting `--cols` in usage markup so the layout stays flexible; a card-level value overrides the inherited row value.
|
|
105
124
|
|
|
106
125
|
When setting `--gutter-x` or `--gutter-y`, always include a length unit. Use `0px` instead of `0`, because the component uses gutter values in `calc()` expressions.
|
|
107
126
|
|
|
108
127
|
- `with-borderless-cards()` sets `--border: none` and `--inner-padding: 0` for all direct `nte-card` children.
|
|
128
|
+
- `with-horizontal-flow()` styles the existing `main` part and direct cards only in `mode="mobile"`; desktop and the unmodified mobile stack remain unchanged.
|
|
109
129
|
- `with-item-separators()` adds separator pseudo-elements between direct `nte-card` children: vertical in desktop mode at half the horizontal gap, horizontal in mobile/tablet mode at half the vertical gap.
|
|
110
130
|
|
|
111
131
|
Keep Shadow DOM styles functional only; visual row styles belong in these mixins.
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
## 2.0.1 (2026-09-10)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **ntl-card-row:** add mobile horizontal flow ([f533ebf](https://github.com/nextrap/nextrap-monorepo/commit/f533ebf))
|
|
6
|
+
- add component theme and usage skills ([617cfde](https://github.com/nextrap/nextrap-monorepo/commit/617cfde))
|
|
7
|
+
- **card-row:** add attribute-driven sizing ([6269960](https://github.com/nextrap/nextrap-monorepo/commit/6269960))
|
|
8
|
+
- add list styles and footer demo for card row ([cacf6ac](https://github.com/nextrap/nextrap-monorepo/commit/cacf6ac))
|
|
9
|
+
|
|
10
|
+
### 🩹 Fixes
|
|
11
|
+
|
|
12
|
+
- declare external libraries as peers and retain test dependencies ([67c6ffa](https://github.com/nextrap/nextrap-monorepo/commit/67c6ffa))
|
|
13
|
+
- **card-row:** keep cols as CSS variable ([036ebb0](https://github.com/nextrap/nextrap-monorepo/commit/036ebb0))
|
|
14
|
+
- **card-row:** restore attribute column sizing ([d795aa3](https://github.com/nextrap/nextrap-monorepo/commit/d795aa3))
|
|
15
|
+
- **card-row:** restore cross-browser CSS sizing ([2825d8b](https://github.com/nextrap/nextrap-monorepo/commit/2825d8b))
|
|
16
|
+
- **ntl:** migrate ntl-card-row to nt-core ([f91b854](https://github.com/nextrap/nextrap-monorepo/commit/f91b854))
|
|
17
|
+
- **layout:** keep layout packages separate ([c82b05a](https://github.com/nextrap/nextrap-monorepo/commit/c82b05a))
|
|
18
|
+
- use aliasesExclude to avoid internal relative paths ([6b8123e](https://github.com/nextrap/nextrap-monorepo/commit/6b8123e))
|
|
19
|
+
|
|
20
|
+
### ❤️ Thank You
|
|
21
|
+
|
|
22
|
+
- Enzo Volkmann @evolkmann
|
|
23
|
+
- Matthias Leuffen
|
|
24
|
+
- Paul Buehler
|
package/README.md
CHANGED
|
@@ -20,6 +20,14 @@ import '@nextrap/ntl-card-row';
|
|
|
20
20
|
ntl-card-row {
|
|
21
21
|
@include cardRow.default-style();
|
|
22
22
|
}
|
|
23
|
+
|
|
24
|
+
ntl-card-row.timeline {
|
|
25
|
+
@include cardRow.with-horizontal-flow(
|
|
26
|
+
$visible-cols-mobile: 1.25,
|
|
27
|
+
$gap: 1rem,
|
|
28
|
+
$snap: proximity
|
|
29
|
+
);
|
|
30
|
+
}
|
|
23
31
|
```
|
|
24
32
|
|
|
25
33
|
Content-Pane example:
|
|
@@ -38,10 +46,31 @@ Content-Pane example:
|
|
|
38
46
|
{: layout="nte-card"}
|
|
39
47
|
```
|
|
40
48
|
|
|
41
|
-
|
|
49
|
+
Opt-in mobile horizontal flow with a visible preview of the next card:
|
|
50
|
+
|
|
51
|
+
```markdown
|
|
52
|
+
## Milestones
|
|
53
|
+
{: layout="ntl-card-row.with-horizontal-flow" section-style="--cols: 3; --visible-cols-mobile: 1.2; --horizontal-flow-gap: 16px;"}
|
|
54
|
+
|
|
55
|
+
### Discover
|
|
56
|
+
|
|
57
|
+
Define the shared goal.
|
|
58
|
+
|
|
59
|
+
### Prototype
|
|
60
|
+
|
|
61
|
+
Test the first solution.
|
|
62
|
+
|
|
63
|
+
### Deliver
|
|
64
|
+
|
|
65
|
+
Ship and measure the result.
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The row follows Bootstrap's 12-column model. `--cols: 4` makes every card four columns wide; an individual card can override the inherited row value with its own `--cols`. Fixed columns neither grow nor shrink, and overflowing card content is clipped. Without `--cols`, a card uses the full available row width. Mobile mode remains a full-width single column unless `.with-horizontal-flow` is present. The modifier creates a native horizontal scroller only in mobile mode; desktop keeps the 12-column layout.
|
|
42
69
|
|
|
43
70
|
`--min-width` and `--max-width` optionally constrain cards and both default to `unset`.
|
|
44
71
|
|
|
72
|
+
For `.with-horizontal-flow`, `--visible-cols-mobile` controls how many cards are visible (default `1.15`), `--horizontal-flow-gap` controls their inline gap, and `--horizontal-flow-snap` accepts `none`, `proximity` or `mandatory` (default `proximity`). Values below `1` for `--visible-cols-mobile` are clamped to `1` by the sizing rule.
|
|
73
|
+
|
|
45
74
|
When setting `--gutter-x` or `--gutter-y`, always use real length values with units such as `0px`, `16px` or `24px`. Never use unitless `0`, because gutter values are used in `calc()` expressions.
|
|
46
75
|
|
|
47
76
|
```markdown
|
package/index.scss
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
// Veröffentlicht die selektorunabhängigen Styling- und Feature-Mixins des Packages.
|
|
1
2
|
@forward 'src/scss/default-style';
|
|
2
3
|
@forward 'src/scss/with-borderless-cards';
|
|
3
4
|
@forward 'src/scss/with-footer-separators';
|
|
5
|
+
@forward 'src/scss/with-horizontal-flow';
|
|
4
6
|
@forward 'src/scss/with-item-separators';
|
|
5
7
|
@forward 'src/scss/with-modifier-classes';
|
|
6
8
|
@forward 'src/scss/with-raised-card';
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextrap/ntl-card-row",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"files": [
|
|
5
5
|
"*.*",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
6
|
+
".agents",
|
|
7
|
+
"src"
|
|
8
8
|
],
|
|
9
9
|
"main": "./index.js",
|
|
10
10
|
"repository": {
|
|
@@ -13,16 +13,18 @@
|
|
|
13
13
|
"url": "https://github.com/nextrap/nextrap-monorepo"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@nextrap/nte-card": "^2.0.0",
|
|
17
16
|
"@nextrap/nt-core": "^2.0.0",
|
|
18
|
-
"@nextrap/
|
|
19
|
-
"
|
|
17
|
+
"@nextrap/nte-card": "^2.0.0",
|
|
18
|
+
"@nextrap/style-reset": "^2.0.0"
|
|
20
19
|
},
|
|
21
20
|
"devDependencies": {
|
|
22
21
|
"@nextrap/style-base": "^2.0.0",
|
|
23
22
|
"@nextrap/style-utils": "^2.0.0",
|
|
24
23
|
"@trunkjs/markdown-loader": "^1.0.0"
|
|
25
24
|
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"lit": "^3.3.1"
|
|
27
|
+
},
|
|
26
28
|
"type": "module",
|
|
27
29
|
"types": "./index.d.ts",
|
|
28
30
|
"web-types": "./web-types.json"
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Aktiviert im mobilen Responsive-Modus eine horizontal scrollbare Kartenreihe,
|
|
2
|
+
// ohne den bestehenden Desktop-Contract oder die mobile Einzelspalte zu verändern.
|
|
3
|
+
@mixin with-horizontal-flow(
|
|
4
|
+
$visible-cols-mobile: 1.15,
|
|
5
|
+
$gap: var(--gutter-x, var(--nt-spacing-layout)),
|
|
6
|
+
$snap: proximity
|
|
7
|
+
) {
|
|
8
|
+
--visible-cols-mobile: #{$visible-cols-mobile};
|
|
9
|
+
--horizontal-flow-gap: #{$gap};
|
|
10
|
+
--horizontal-flow-snap: #{$snap};
|
|
11
|
+
|
|
12
|
+
// Der vorhandene main-Part wird zur nativen Scrollfläche; zusätzliche Controls
|
|
13
|
+
// oder ein eigener Slider-Lifecycle sind für den Basis-Flow nicht erforderlich.
|
|
14
|
+
&[mode='mobile']::part(main) {
|
|
15
|
+
flex-flow: row nowrap;
|
|
16
|
+
justify-content: flex-start;
|
|
17
|
+
gap: 0 var(--horizontal-flow-gap, var(--gutter-x, 0px));
|
|
18
|
+
overflow-x: auto;
|
|
19
|
+
overflow-y: visible;
|
|
20
|
+
overscroll-behavior-inline: contain;
|
|
21
|
+
scroll-padding-inline: var(--horizontal-flow-gap, var(--gutter-x, 0px));
|
|
22
|
+
scroll-snap-type: x var(--horizontal-flow-snap, proximity);
|
|
23
|
+
-webkit-overflow-scrolling: touch;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Die Kartenbasis berücksichtigt die sichtbare Kartenzahl und alle Zwischenräume.
|
|
27
|
+
// max(1, ...) verhindert bei Werten unter eins eine überbreite Scroll-Karte.
|
|
28
|
+
&[mode='mobile'] > nte-card {
|
|
29
|
+
flex: 0 0 calc(
|
|
30
|
+
(100% - (max(1, var(--visible-cols-mobile, 1.15)) - 1) * var(--horizontal-flow-gap, var(--gutter-x, 0px))) /
|
|
31
|
+
max(1, var(--visible-cols-mobile, 1.15))
|
|
32
|
+
);
|
|
33
|
+
width: calc(
|
|
34
|
+
(100% - (max(1, var(--visible-cols-mobile, 1.15)) - 1) * var(--horizontal-flow-gap, var(--gutter-x, 0px))) /
|
|
35
|
+
max(1, var(--visible-cols-mobile, 1.15))
|
|
36
|
+
);
|
|
37
|
+
min-width: 0;
|
|
38
|
+
max-width: none;
|
|
39
|
+
overflow: visible;
|
|
40
|
+
scroll-snap-align: start;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
@use 'with-footer-separators' as footer-separators;
|
|
2
|
+
@use 'with-horizontal-flow' as horizontal-flow;
|
|
2
3
|
@use 'with-raised-card' as raised-card;
|
|
3
4
|
|
|
5
|
+
// Registriert die mit der Default-Style-Baseline ausgelieferten Modifier-Klassen.
|
|
4
6
|
@mixin with-modifier-classes {
|
|
7
|
+
// Der horizontale Flow bleibt ein explizites Opt-in am Row-Element.
|
|
8
|
+
&.with-horizontal-flow {
|
|
9
|
+
@include horizontal-flow.with-horizontal-flow();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Bestehende Footer-Varianten bleiben als aktuelle und Legacy-Klasse verfügbar.
|
|
5
13
|
&.footer-separators,
|
|
6
14
|
&.style-footer {
|
|
7
15
|
@include footer-separators.with-footer-separators();
|
|
8
16
|
}
|
|
9
17
|
|
|
18
|
+
// Einzelne hervorgehobene Cards erhalten weiterhin das bestehende Raised-Mixin.
|
|
10
19
|
> nte-card.highlight {
|
|
11
20
|
@include raised-card.with-raised-card();
|
|
12
21
|
}
|