@contentrain/astro-kit 0.40.0 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/catalog.json +123 -15
- package/components/_shared/Lines.astro +12 -0
- package/components/_shared/Section.astro +13 -9
- package/components/_shared/SectionHeader.astro +3 -2
- package/components/_shared/bleed.ts +8 -0
- package/components/_shared/instance-id.ts +24 -0
- package/components/_shared/muted.ts +19 -0
- package/components/band/Band.astro +10 -7
- package/components/band/meta.json +2 -0
- package/components/behavior/Behavior.astro +7 -2
- package/components/behavior/fixtures.json +2 -2
- package/components/behavior/meta.json +7 -0
- package/components/card-grid/CardGrid.astro +84 -24
- package/components/card-grid/fixtures.json +4 -1
- package/components/card-grid/meta.json +21 -0
- package/components/contact-details/ContactDetails.astro +7 -3
- package/components/contact-details/meta.json +2 -0
- package/components/contact-form/ContactForm.astro +11 -7
- package/components/contact-form/meta.json +2 -0
- package/components/cta/Cta.astro +14 -10
- package/components/cta/meta.json +2 -2
- package/components/dialog/Dialog.astro +6 -3
- package/components/dialog/meta.json +2 -0
- package/components/faq/Faq.astro +8 -4
- package/components/faq/meta.json +1 -1
- package/components/feature-list/FeatureList.astro +10 -6
- package/components/feature-list/meta.json +3 -1
- package/components/footer/Footer.astro +4 -3
- package/components/footer/meta.json +1 -0
- package/components/gallery/Gallery.astro +8 -4
- package/components/gallery/meta.json +2 -0
- package/components/header/Header.astro +8 -4
- package/components/header/meta.json +1 -1
- package/components/hero/Hero.astro +44 -15
- package/components/hero/fixtures.json +7 -1
- package/components/hero/meta.json +30 -1
- package/components/language-switcher/LanguageSwitcher.astro +3 -2
- package/components/language-switcher/meta.json +1 -1
- package/components/logo-cloud/LogoCloud.astro +9 -5
- package/components/logo-cloud/meta.json +3 -1
- package/components/nav/Nav.astro +10 -6
- package/components/nav/meta.json +2 -0
- package/components/newsletter/Newsletter.astro +9 -5
- package/components/newsletter/meta.json +2 -0
- package/components/post-list/PostList.astro +7 -3
- package/components/post-list/meta.json +2 -0
- package/components/pricing/Pricing.astro +15 -11
- package/components/pricing/meta.json +3 -1
- package/components/search-box/SearchBox.astro +4 -1
- package/components/search-box/meta.json +1 -1
- package/components/slider/Slider.astro +4 -1
- package/components/slider/SliderTrack.astro +11 -5
- package/components/slider/meta.json +1 -1
- package/components/social-links/SocialLinks.astro +2 -1
- package/components/social-links/meta.json +3 -2
- package/components/split/Split.astro +16 -11
- package/components/split/fixtures.json +4 -1
- package/components/split/meta.json +9 -3
- package/components/stats/Stats.astro +11 -7
- package/components/stats/meta.json +3 -1
- package/components/steps/Steps.astro +9 -5
- package/components/steps/meta.json +3 -1
- package/components/tabs/Tabs.astro +8 -4
- package/components/tabs/meta.json +1 -1
- package/components/team/Team.astro +10 -6
- package/components/team/meta.json +4 -2
- package/components/testimonial/Testimonial.astro +9 -5
- package/components/testimonial/fixtures.json +1 -1
- package/components/testimonial/meta.json +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -81,6 +81,22 @@ The starter sets it to the accent; a site whose accent does not reach 4.5:1 on i
|
|
|
81
81
|
surface sets a readable one. A dark section (`tone="inverse"`) reads
|
|
82
82
|
`--color-accent-text-inverse` in its place.
|
|
83
83
|
|
|
84
|
+
Quieter text (an intro, a caption, a role, a footer link) is a colour role, never
|
|
85
|
+
opacity: dimmed text lays its colour over the band, and on a mid-tone band that falls
|
|
86
|
+
under 4.5:1. It reads `--color-ink-muted` on a light band, `--color-ink-muted-inverse`
|
|
87
|
+
on a dark one (the starter mixes the surface toward the ink; without it, the band's own
|
|
88
|
+
text colour) and the fill's own ink on an accent or brand band. A light surface inside
|
|
89
|
+
a band (a card, a form panel, a menu) is back on `--color-ink-muted`. The classes are
|
|
90
|
+
in `_shared/muted.ts`.
|
|
91
|
+
|
|
92
|
+
### Section hooks
|
|
93
|
+
|
|
94
|
+
Every section component renders its root with an `id` and `data-kit-section="<component id>"`
|
|
95
|
+
(`hero`, `card-grid`, `slider`, …), so a site's theme or a design layer can style one
|
|
96
|
+
kind of section, or one section, without touching the component. The id is the one the
|
|
97
|
+
page gives, or the component id counted per page (`hero`, then `hero-2`), the same on
|
|
98
|
+
every build.
|
|
99
|
+
|
|
84
100
|
A migrated site also carries its theme's type and shape, and components read
|
|
85
101
|
these with a fallback to the kit's own values, so a site without them looks
|
|
86
102
|
unchanged:
|
package/catalog.json
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"--radius-control",
|
|
24
24
|
"--radius-image",
|
|
25
25
|
"--spacing-gutter",
|
|
26
|
+
"--color-ink-muted-inverse",
|
|
26
27
|
"--text-nav",
|
|
27
28
|
"--text-footer",
|
|
28
29
|
"--text-heading-1",
|
|
@@ -103,7 +104,9 @@
|
|
|
103
104
|
"Button.astro",
|
|
104
105
|
"KitImage.astro",
|
|
105
106
|
"Section.astro",
|
|
107
|
+
"instance-id.ts",
|
|
106
108
|
"measured.ts",
|
|
109
|
+
"muted.ts",
|
|
107
110
|
"safe-url.ts",
|
|
108
111
|
"types.ts"
|
|
109
112
|
],
|
|
@@ -457,7 +460,9 @@
|
|
|
457
460
|
"behaviors.ts",
|
|
458
461
|
"embed-frame.ts",
|
|
459
462
|
"embed-target.ts",
|
|
463
|
+
"instance-id.ts",
|
|
460
464
|
"measured.ts",
|
|
465
|
+
"muted.ts",
|
|
461
466
|
"safe-url.ts",
|
|
462
467
|
"types.ts"
|
|
463
468
|
],
|
|
@@ -643,6 +648,11 @@
|
|
|
643
648
|
"description": "The section's minimum height."
|
|
644
649
|
}
|
|
645
650
|
}
|
|
651
|
+
},
|
|
652
|
+
"id": {
|
|
653
|
+
"type": "string",
|
|
654
|
+
"content": false,
|
|
655
|
+
"description": "Anchor id of the section. Without one, `behavior`, `behavior-2`, … in render order, so every section on a page has its own."
|
|
646
656
|
}
|
|
647
657
|
},
|
|
648
658
|
"slots": {},
|
|
@@ -742,7 +752,9 @@
|
|
|
742
752
|
"KitImage.astro",
|
|
743
753
|
"Section.astro",
|
|
744
754
|
"image.ts",
|
|
755
|
+
"instance-id.ts",
|
|
745
756
|
"measured.ts",
|
|
757
|
+
"muted.ts",
|
|
746
758
|
"safe-url.ts",
|
|
747
759
|
"types.ts"
|
|
748
760
|
],
|
|
@@ -773,6 +785,14 @@
|
|
|
773
785
|
"default": "start",
|
|
774
786
|
"description": "Text alignment inside cards and of the header."
|
|
775
787
|
},
|
|
788
|
+
"layout": {
|
|
789
|
+
"options": [
|
|
790
|
+
"grid",
|
|
791
|
+
"rows"
|
|
792
|
+
],
|
|
793
|
+
"default": "grid",
|
|
794
|
+
"description": "Cards in a grid, or one item per row: title, text and link on one axis, a hairline between rows, no card box (columns and style do not apply)."
|
|
795
|
+
},
|
|
776
796
|
"tone": {
|
|
777
797
|
"options": [
|
|
778
798
|
"default",
|
|
@@ -847,6 +867,12 @@
|
|
|
847
867
|
},
|
|
848
868
|
"description": "The cards. image is an ImageInput ({ src, alt, width?, height? })."
|
|
849
869
|
},
|
|
870
|
+
"index": {
|
|
871
|
+
"type": "boolean",
|
|
872
|
+
"default": false,
|
|
873
|
+
"content": false,
|
|
874
|
+
"description": "With layout rows: a numbered list, each row led by its number (01, 02, …) in the muted role."
|
|
875
|
+
},
|
|
850
876
|
"headingLevel": {
|
|
851
877
|
"type": "integer",
|
|
852
878
|
"min": 2,
|
|
@@ -964,6 +990,11 @@
|
|
|
964
990
|
"description": "The section's minimum height."
|
|
965
991
|
}
|
|
966
992
|
}
|
|
993
|
+
},
|
|
994
|
+
"id": {
|
|
995
|
+
"type": "string",
|
|
996
|
+
"content": false,
|
|
997
|
+
"description": "Anchor id of the section; the title gets `<id>-title`. Without one, `card-grid`, `card-grid-2`, … in render order, so every section on a page has its own."
|
|
967
998
|
}
|
|
968
999
|
},
|
|
969
1000
|
"slots": {},
|
|
@@ -1087,7 +1118,9 @@
|
|
|
1087
1118
|
"uses": [],
|
|
1088
1119
|
"shared": [
|
|
1089
1120
|
"Section.astro",
|
|
1121
|
+
"instance-id.ts",
|
|
1090
1122
|
"measured.ts",
|
|
1123
|
+
"muted.ts",
|
|
1091
1124
|
"safe-url.ts",
|
|
1092
1125
|
"types.ts"
|
|
1093
1126
|
],
|
|
@@ -1319,7 +1352,9 @@
|
|
|
1319
1352
|
"shared": [
|
|
1320
1353
|
"KitImage.astro",
|
|
1321
1354
|
"Section.astro",
|
|
1355
|
+
"instance-id.ts",
|
|
1322
1356
|
"measured.ts",
|
|
1357
|
+
"muted.ts",
|
|
1323
1358
|
"safe-url.ts",
|
|
1324
1359
|
"types.ts"
|
|
1325
1360
|
],
|
|
@@ -1646,7 +1681,9 @@
|
|
|
1646
1681
|
"Button.astro",
|
|
1647
1682
|
"KitImage.astro",
|
|
1648
1683
|
"Section.astro",
|
|
1684
|
+
"instance-id.ts",
|
|
1649
1685
|
"measured.ts",
|
|
1686
|
+
"muted.ts",
|
|
1650
1687
|
"safe-url.ts",
|
|
1651
1688
|
"types.ts"
|
|
1652
1689
|
],
|
|
@@ -1901,7 +1938,7 @@
|
|
|
1901
1938
|
"id": {
|
|
1902
1939
|
"type": "string",
|
|
1903
1940
|
"content": false,
|
|
1904
|
-
"description": "Anchor id of the section; the heading gets `<id>-title`."
|
|
1941
|
+
"description": "Anchor id of the section; the heading gets `<id>-title`. Without one, `cta`, `cta-2`, … in render order, so every section on a page has its own."
|
|
1905
1942
|
}
|
|
1906
1943
|
},
|
|
1907
1944
|
"slots": {},
|
|
@@ -1947,7 +1984,9 @@
|
|
|
1947
1984
|
"shared": [
|
|
1948
1985
|
"Button.astro",
|
|
1949
1986
|
"Section.astro",
|
|
1987
|
+
"instance-id.ts",
|
|
1950
1988
|
"measured.ts",
|
|
1989
|
+
"muted.ts",
|
|
1951
1990
|
"safe-url.ts",
|
|
1952
1991
|
"types.ts"
|
|
1953
1992
|
],
|
|
@@ -2338,7 +2377,9 @@
|
|
|
2338
2377
|
"uses": [],
|
|
2339
2378
|
"shared": [
|
|
2340
2379
|
"Section.astro",
|
|
2380
|
+
"instance-id.ts",
|
|
2341
2381
|
"measured.ts",
|
|
2382
|
+
"muted.ts",
|
|
2342
2383
|
"safe-url.ts",
|
|
2343
2384
|
"types.ts"
|
|
2344
2385
|
],
|
|
@@ -2611,7 +2652,9 @@
|
|
|
2611
2652
|
"shared": [
|
|
2612
2653
|
"KitImage.astro",
|
|
2613
2654
|
"Section.astro",
|
|
2655
|
+
"instance-id.ts",
|
|
2614
2656
|
"measured.ts",
|
|
2657
|
+
"muted.ts",
|
|
2615
2658
|
"safe-url.ts",
|
|
2616
2659
|
"types.ts"
|
|
2617
2660
|
],
|
|
@@ -2823,7 +2866,7 @@
|
|
|
2823
2866
|
"id": {
|
|
2824
2867
|
"type": "string",
|
|
2825
2868
|
"content": false,
|
|
2826
|
-
"description": "Anchor id of the section; the heading gets `<id>-title`."
|
|
2869
|
+
"description": "Anchor id of the section; the heading gets `<id>-title`. Without one, `feature-list`, `feature-list-2`, … in render order, so every section on a page has its own."
|
|
2827
2870
|
}
|
|
2828
2871
|
},
|
|
2829
2872
|
"slots": {},
|
|
@@ -2871,6 +2914,7 @@
|
|
|
2871
2914
|
"category": "chrome",
|
|
2872
2915
|
"uses": [],
|
|
2873
2916
|
"shared": [
|
|
2917
|
+
"muted.ts",
|
|
2874
2918
|
"safe-url.ts",
|
|
2875
2919
|
"types.ts"
|
|
2876
2920
|
],
|
|
@@ -3093,7 +3137,9 @@
|
|
|
3093
3137
|
"KitImage.astro",
|
|
3094
3138
|
"Section.astro",
|
|
3095
3139
|
"image.ts",
|
|
3140
|
+
"instance-id.ts",
|
|
3096
3141
|
"measured.ts",
|
|
3142
|
+
"muted.ts",
|
|
3097
3143
|
"safe-url.ts",
|
|
3098
3144
|
"types.ts"
|
|
3099
3145
|
],
|
|
@@ -3389,6 +3435,8 @@
|
|
|
3389
3435
|
"shared": [
|
|
3390
3436
|
"Button.astro",
|
|
3391
3437
|
"KitImage.astro",
|
|
3438
|
+
"instance-id.ts",
|
|
3439
|
+
"muted.ts",
|
|
3392
3440
|
"safe-url.ts",
|
|
3393
3441
|
"types.ts"
|
|
3394
3442
|
],
|
|
@@ -3618,8 +3666,12 @@
|
|
|
3618
3666
|
"shared": [
|
|
3619
3667
|
"Button.astro",
|
|
3620
3668
|
"KitImage.astro",
|
|
3669
|
+
"Lines.astro",
|
|
3621
3670
|
"Section.astro",
|
|
3671
|
+
"bleed.ts",
|
|
3672
|
+
"instance-id.ts",
|
|
3622
3673
|
"measured.ts",
|
|
3674
|
+
"muted.ts",
|
|
3623
3675
|
"safe-url.ts",
|
|
3624
3676
|
"types.ts"
|
|
3625
3677
|
],
|
|
@@ -3691,6 +3743,31 @@
|
|
|
3691
3743
|
],
|
|
3692
3744
|
"default": "own",
|
|
3693
3745
|
"description": "The level whose site size the heading takes when it is not the level it is written at: h1 on an h2 heading keeps a source's second h1 at the h1 size under a page that keeps one h1. own: the heading's own level under headingScale theme, nothing otherwise. Any other value than own sets the size by itself."
|
|
3746
|
+
},
|
|
3747
|
+
"headingLines": {
|
|
3748
|
+
"options": [
|
|
3749
|
+
"flow",
|
|
3750
|
+
"lines"
|
|
3751
|
+
],
|
|
3752
|
+
"default": "flow",
|
|
3753
|
+
"description": "flow: the heading is one run of text. lines: each line the author broke it into (a line break, \\n, in the heading) is a block of its own, data-kit-line=\"1\", \"2\", …, so a theme or a design layer can give a line its own ink, indent or size. Still one heading, read as one sentence."
|
|
3754
|
+
},
|
|
3755
|
+
"stackOrder": {
|
|
3756
|
+
"options": [
|
|
3757
|
+
"text-first",
|
|
3758
|
+
"media-first"
|
|
3759
|
+
],
|
|
3760
|
+
"default": "text-first",
|
|
3761
|
+
"description": "Split and centered: the image before the text, on phones and on the start side (split), or above the heading (centered). A cover ignores it."
|
|
3762
|
+
},
|
|
3763
|
+
"imageBleed": {
|
|
3764
|
+
"options": [
|
|
3765
|
+
"none",
|
|
3766
|
+
"edge",
|
|
3767
|
+
"overlap"
|
|
3768
|
+
],
|
|
3769
|
+
"default": "none",
|
|
3770
|
+
"description": "Split and centered: edge runs the image on to the window's edge on its side (both sides when centered); overlap also lets it cross the section's bottom edge by --hero-overlap (3rem), over the next section's top padding, when the image comes last: with stackOrder media-first it draws as edge, so it never covers the text. A cover ignores it."
|
|
3694
3771
|
}
|
|
3695
3772
|
},
|
|
3696
3773
|
"props": {
|
|
@@ -3809,7 +3886,7 @@
|
|
|
3809
3886
|
"id": {
|
|
3810
3887
|
"type": "string",
|
|
3811
3888
|
"content": false,
|
|
3812
|
-
"description": "Anchor id of the section; the heading gets `<id>-title`."
|
|
3889
|
+
"description": "Anchor id of the section; the heading gets `<id>-title`. Without one, `hero`, `hero-2`, … in render order, so every section on a page has its own."
|
|
3813
3890
|
},
|
|
3814
3891
|
"minHeight": {
|
|
3815
3892
|
"type": "integer",
|
|
@@ -3976,6 +4053,7 @@
|
|
|
3976
4053
|
"category": "chrome",
|
|
3977
4054
|
"uses": [],
|
|
3978
4055
|
"shared": [
|
|
4056
|
+
"muted.ts",
|
|
3979
4057
|
"safe-url.ts"
|
|
3980
4058
|
],
|
|
3981
4059
|
"variants": {
|
|
@@ -4057,7 +4135,9 @@
|
|
|
4057
4135
|
"KitImage.astro",
|
|
4058
4136
|
"Section.astro",
|
|
4059
4137
|
"image.ts",
|
|
4138
|
+
"instance-id.ts",
|
|
4060
4139
|
"measured.ts",
|
|
4140
|
+
"muted.ts",
|
|
4061
4141
|
"safe-url.ts",
|
|
4062
4142
|
"types.ts"
|
|
4063
4143
|
],
|
|
@@ -4266,7 +4346,7 @@
|
|
|
4266
4346
|
"id": {
|
|
4267
4347
|
"type": "string",
|
|
4268
4348
|
"content": false,
|
|
4269
|
-
"description": "Anchor id of the section; the heading gets `<id>-title`."
|
|
4349
|
+
"description": "Anchor id of the section; the heading gets `<id>-title`. Without one, `logo-cloud`, `logo-cloud-2`, … in render order, so every section on a page has its own."
|
|
4270
4350
|
}
|
|
4271
4351
|
},
|
|
4272
4352
|
"slots": {},
|
|
@@ -4312,6 +4392,8 @@
|
|
|
4312
4392
|
"category": "chrome",
|
|
4313
4393
|
"uses": [],
|
|
4314
4394
|
"shared": [
|
|
4395
|
+
"instance-id.ts",
|
|
4396
|
+
"muted.ts",
|
|
4315
4397
|
"safe-url.ts",
|
|
4316
4398
|
"types.ts"
|
|
4317
4399
|
],
|
|
@@ -4437,7 +4519,9 @@
|
|
|
4437
4519
|
"uses": [],
|
|
4438
4520
|
"shared": [
|
|
4439
4521
|
"Section.astro",
|
|
4522
|
+
"instance-id.ts",
|
|
4440
4523
|
"measured.ts",
|
|
4524
|
+
"muted.ts",
|
|
4441
4525
|
"safe-url.ts",
|
|
4442
4526
|
"types.ts"
|
|
4443
4527
|
],
|
|
@@ -4927,7 +5011,9 @@
|
|
|
4927
5011
|
],
|
|
4928
5012
|
"shared": [
|
|
4929
5013
|
"Section.astro",
|
|
5014
|
+
"instance-id.ts",
|
|
4930
5015
|
"measured.ts",
|
|
5016
|
+
"muted.ts",
|
|
4931
5017
|
"safe-url.ts",
|
|
4932
5018
|
"types.ts"
|
|
4933
5019
|
],
|
|
@@ -5247,7 +5333,9 @@
|
|
|
5247
5333
|
"shared": [
|
|
5248
5334
|
"Button.astro",
|
|
5249
5335
|
"Section.astro",
|
|
5336
|
+
"instance-id.ts",
|
|
5250
5337
|
"measured.ts",
|
|
5338
|
+
"muted.ts",
|
|
5251
5339
|
"safe-url.ts",
|
|
5252
5340
|
"types.ts"
|
|
5253
5341
|
],
|
|
@@ -5385,7 +5473,7 @@
|
|
|
5385
5473
|
"id": {
|
|
5386
5474
|
"type": "string",
|
|
5387
5475
|
"content": false,
|
|
5388
|
-
"description": "Anchor id of the section; the heading gets `<id>-title`."
|
|
5476
|
+
"description": "Anchor id of the section; the heading gets `<id>-title`. Without one, `pricing`, `pricing-2`, … in render order, so every section on a page has its own."
|
|
5389
5477
|
},
|
|
5390
5478
|
"compact": {
|
|
5391
5479
|
"type": "boolean",
|
|
@@ -5660,6 +5748,7 @@
|
|
|
5660
5748
|
"category": "chrome",
|
|
5661
5749
|
"uses": [],
|
|
5662
5750
|
"shared": [
|
|
5751
|
+
"instance-id.ts",
|
|
5663
5752
|
"safe-url.ts"
|
|
5664
5753
|
],
|
|
5665
5754
|
"variants": {
|
|
@@ -5747,7 +5836,9 @@
|
|
|
5747
5836
|
"embed-frame.ts",
|
|
5748
5837
|
"embed-target.ts",
|
|
5749
5838
|
"image.ts",
|
|
5839
|
+
"instance-id.ts",
|
|
5750
5840
|
"measured.ts",
|
|
5841
|
+
"muted.ts",
|
|
5751
5842
|
"safe-url.ts",
|
|
5752
5843
|
"types.ts"
|
|
5753
5844
|
],
|
|
@@ -6102,8 +6193,9 @@
|
|
|
6102
6193
|
"category": "chrome",
|
|
6103
6194
|
"uses": [],
|
|
6104
6195
|
"shared": [
|
|
6105
|
-
"
|
|
6106
|
-
"safe-url.ts"
|
|
6196
|
+
"muted.ts",
|
|
6197
|
+
"safe-url.ts",
|
|
6198
|
+
"social.ts"
|
|
6107
6199
|
],
|
|
6108
6200
|
"variants": {
|
|
6109
6201
|
"display": {
|
|
@@ -6205,7 +6297,10 @@
|
|
|
6205
6297
|
"Button.astro",
|
|
6206
6298
|
"KitImage.astro",
|
|
6207
6299
|
"Section.astro",
|
|
6300
|
+
"bleed.ts",
|
|
6301
|
+
"instance-id.ts",
|
|
6208
6302
|
"measured.ts",
|
|
6303
|
+
"muted.ts",
|
|
6209
6304
|
"safe-url.ts",
|
|
6210
6305
|
"types.ts"
|
|
6211
6306
|
],
|
|
@@ -6239,10 +6334,13 @@
|
|
|
6239
6334
|
"options": [
|
|
6240
6335
|
"none",
|
|
6241
6336
|
"rounded",
|
|
6242
|
-
"circle"
|
|
6337
|
+
"circle",
|
|
6338
|
+
"arch",
|
|
6339
|
+
"chamfer",
|
|
6340
|
+
"blob"
|
|
6243
6341
|
],
|
|
6244
6342
|
"default": "rounded",
|
|
6245
|
-
"description": "The image's
|
|
6343
|
+
"description": "The image's outline: square, the theme's rounding, a circle, or a fixed mask: an arch over the image, a cut corner (chamfer), a soft blob."
|
|
6246
6344
|
},
|
|
6247
6345
|
"imageBleed": {
|
|
6248
6346
|
"options": [
|
|
@@ -6533,7 +6631,7 @@
|
|
|
6533
6631
|
"id": {
|
|
6534
6632
|
"type": "string",
|
|
6535
6633
|
"content": false,
|
|
6536
|
-
"description": "Anchor id of the section; the heading gets `<id>-title`."
|
|
6634
|
+
"description": "Anchor id of the section; the heading gets `<id>-title`. Without one, `split`, `split-2`, … in render order, so every section on a page has its own."
|
|
6537
6635
|
},
|
|
6538
6636
|
"sticky": {
|
|
6539
6637
|
"type": "boolean",
|
|
@@ -6605,7 +6703,9 @@
|
|
|
6605
6703
|
"embed-frame.ts",
|
|
6606
6704
|
"embed-target.ts",
|
|
6607
6705
|
"image.ts",
|
|
6706
|
+
"instance-id.ts",
|
|
6608
6707
|
"measured.ts",
|
|
6708
|
+
"muted.ts",
|
|
6609
6709
|
"safe-url.ts",
|
|
6610
6710
|
"types.ts"
|
|
6611
6711
|
],
|
|
@@ -6854,7 +6954,7 @@
|
|
|
6854
6954
|
"id": {
|
|
6855
6955
|
"type": "string",
|
|
6856
6956
|
"content": false,
|
|
6857
|
-
"description": "Anchor id of the section; the heading gets `<id>-title`."
|
|
6957
|
+
"description": "Anchor id of the section; the heading gets `<id>-title`. Without one, `stats`, `stats-2`, … in render order, so every section on a page has its own."
|
|
6858
6958
|
}
|
|
6859
6959
|
},
|
|
6860
6960
|
"slots": {},
|
|
@@ -6905,7 +7005,9 @@
|
|
|
6905
7005
|
"KitImage.astro",
|
|
6906
7006
|
"Section.astro",
|
|
6907
7007
|
"image.ts",
|
|
7008
|
+
"instance-id.ts",
|
|
6908
7009
|
"measured.ts",
|
|
7010
|
+
"muted.ts",
|
|
6909
7011
|
"safe-url.ts",
|
|
6910
7012
|
"types.ts"
|
|
6911
7013
|
],
|
|
@@ -7016,7 +7118,7 @@
|
|
|
7016
7118
|
"id": {
|
|
7017
7119
|
"type": "string",
|
|
7018
7120
|
"content": false,
|
|
7019
|
-
"description": "Anchor id of the section; the heading gets `<id>-title`."
|
|
7121
|
+
"description": "Anchor id of the section; the heading gets `<id>-title`. Without one, `steps`, `steps-2`, … in render order, so every section on a page has its own."
|
|
7020
7122
|
},
|
|
7021
7123
|
"currentLabel": {
|
|
7022
7124
|
"type": "string",
|
|
@@ -7185,7 +7287,9 @@
|
|
|
7185
7287
|
"Button.astro",
|
|
7186
7288
|
"Section.astro",
|
|
7187
7289
|
"SectionHeader.astro",
|
|
7290
|
+
"instance-id.ts",
|
|
7188
7291
|
"measured.ts",
|
|
7292
|
+
"muted.ts",
|
|
7189
7293
|
"safe-url.ts",
|
|
7190
7294
|
"types.ts"
|
|
7191
7295
|
],
|
|
@@ -7441,9 +7545,11 @@
|
|
|
7441
7545
|
"KitImage.astro",
|
|
7442
7546
|
"Section.astro",
|
|
7443
7547
|
"image.ts",
|
|
7548
|
+
"instance-id.ts",
|
|
7444
7549
|
"measured.ts",
|
|
7445
|
-
"
|
|
7550
|
+
"muted.ts",
|
|
7446
7551
|
"safe-url.ts",
|
|
7552
|
+
"social.ts",
|
|
7447
7553
|
"types.ts"
|
|
7448
7554
|
],
|
|
7449
7555
|
"variants": {
|
|
@@ -7564,7 +7670,7 @@
|
|
|
7564
7670
|
"id": {
|
|
7565
7671
|
"type": "string",
|
|
7566
7672
|
"content": false,
|
|
7567
|
-
"description": "Anchor id of the section; the heading gets `<id>-title`."
|
|
7673
|
+
"description": "Anchor id of the section; the heading gets `<id>-title`. Without one, `team`, `team-2`, … in render order, so every section on a page has its own."
|
|
7568
7674
|
},
|
|
7569
7675
|
"bioClamp": {
|
|
7570
7676
|
"type": "integer",
|
|
@@ -7748,7 +7854,9 @@
|
|
|
7748
7854
|
"KitImage.astro",
|
|
7749
7855
|
"Section.astro",
|
|
7750
7856
|
"image.ts",
|
|
7857
|
+
"instance-id.ts",
|
|
7751
7858
|
"measured.ts",
|
|
7859
|
+
"muted.ts",
|
|
7752
7860
|
"safe-url.ts",
|
|
7753
7861
|
"types.ts"
|
|
7754
7862
|
],
|
|
@@ -7990,7 +8098,7 @@
|
|
|
7990
8098
|
"id": {
|
|
7991
8099
|
"type": "string",
|
|
7992
8100
|
"content": false,
|
|
7993
|
-
"description": "Anchor id of the section; the heading gets `<id>-title`."
|
|
8101
|
+
"description": "Anchor id of the section; the heading gets `<id>-title`. Without one, `testimonial`, `testimonial-2`, … in render order, so every section on a page has its own."
|
|
7994
8102
|
},
|
|
7995
8103
|
"ratingLabel": {
|
|
7996
8104
|
"type": "string",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
// Text the author broke into lines (`\n`), one block per line, each marked `data-kit-line="<n>"` so a theme or a
|
|
3
|
+
// design layer can give a line its own ink, indent or size. The lines stay one text: a heading made of them is
|
|
4
|
+
// still one heading, read as one sentence (a space between the blocks keeps the words apart when it is read out).
|
|
5
|
+
// Without a line break the text is printed as it is.
|
|
6
|
+
interface Props {
|
|
7
|
+
text: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const lines = Astro.props.text.split('\n').map(line => line.trim()).filter(Boolean)
|
|
11
|
+
---
|
|
12
|
+
{lines.length > 1 ? lines.map((line, i) => <>{i > 0 && ' '}<span class="block" data-kit-line={i + 1}>{line}</span></>) : Astro.props.text}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// their order.
|
|
5
5
|
import { tv } from 'tailwind-variants'
|
|
6
6
|
import { measuredFrame } from './measured'
|
|
7
|
+
import { mutedAccent, mutedBrand, mutedInverse, mutedReset } from './muted'
|
|
7
8
|
import { safeSrc } from './safe-url'
|
|
8
9
|
import type { MeasuredStyle } from './types'
|
|
9
10
|
|
|
@@ -11,13 +12,14 @@ const section = tv({
|
|
|
11
12
|
base: '',
|
|
12
13
|
variants: {
|
|
13
14
|
tone: {
|
|
14
|
-
default:
|
|
15
|
-
muted:
|
|
16
|
-
// A dark band reads the accent's text colour made for it (`--color-accent-text-inverse`)
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
default: `bg-surface text-ink ${mutedReset}`,
|
|
16
|
+
muted: `bg-surface-muted text-ink ${mutedReset}`,
|
|
17
|
+
// A dark band reads the accent's text colour made for it (`--color-accent-text-inverse`), and its quieter text
|
|
18
|
+
// the muted role made for it (`muted.ts`).
|
|
19
|
+
inverse: `bg-ink text-surface [--color-accent-text:var(--color-accent-text-inverse)] ${mutedInverse}`,
|
|
20
|
+
accent: `bg-accent text-accent-ink ${mutedAccent}`,
|
|
19
21
|
// The site's brand colour where it is not the accent (a band the source paints in the builder's own colour).
|
|
20
|
-
brand:
|
|
22
|
+
brand: `bg-brand text-brand-ink ${mutedBrand}`,
|
|
21
23
|
// No fill of its own: the page's background and text colour show through.
|
|
22
24
|
none: '',
|
|
23
25
|
},
|
|
@@ -42,15 +44,17 @@ interface Props {
|
|
|
42
44
|
id?: string | undefined
|
|
43
45
|
class?: string | undefined
|
|
44
46
|
'aria-labelledby'?: string | undefined
|
|
47
|
+
/** The component this section is (`hero`, `card-grid`): `data-kit-section`'s value, the hook a theme or a design layer styles one kind of section by. */
|
|
48
|
+
kit?: string | undefined
|
|
45
49
|
/** The source section's measured style (`MeasuredStyle`): frame width, padding, fill, image, columns, gap. Wins over `tone`. */
|
|
46
50
|
measured?: MeasuredStyle | undefined
|
|
47
51
|
}
|
|
48
52
|
|
|
49
|
-
const { tone: given, spacing, width = 'page', as: Tag = 'section', id, class: className, 'aria-labelledby': labelledBy, measured } = Astro.props
|
|
53
|
+
const { tone: given, spacing, width = 'page', as: Tag = 'section', id, class: className, 'aria-labelledby': labelledBy, kit, measured } = Astro.props
|
|
50
54
|
const m = measuredFrame(measured)
|
|
51
55
|
// A measured fill is the section's own colour, its text set by the measured tone; a tone alone picks the kit's band.
|
|
52
56
|
const tone = m.color ? 'none' : m.tone === 'dark' ? 'inverse' : m.tone === 'light' ? 'default' : given
|
|
53
|
-
const text = m.color ? (m.tone === 'dark' ?
|
|
57
|
+
const text = m.color ? (m.tone === 'dark' ? `text-surface [--color-accent-text:var(--color-accent-text-inverse)] ${mutedInverse}` : `text-ink ${mutedReset}`) : undefined
|
|
54
58
|
const layered = m.image || m.overlay ? 'relative isolate overflow-hidden' : undefined
|
|
55
59
|
const style = [m.color && `background-color: ${m.color}`, m.style].filter(Boolean).join('; ') || undefined
|
|
56
60
|
// The reading column reads its own width token.
|
|
@@ -58,7 +62,7 @@ const frameStyle = width === 'prose' ? m.frameStyle?.replace('--container-page:'
|
|
|
58
62
|
const backdrop = safeSrc(m.image?.src)
|
|
59
63
|
const dataTone = m.color ? (m.tone === 'dark' ? 'inverse' : 'default') : tone ?? 'default'
|
|
60
64
|
---
|
|
61
|
-
<Tag id={id} aria-labelledby={labelledBy} class={section({ tone, spacing, class: [text, layered, className].filter(Boolean).join(' ') || undefined })} style={style} data-tone={dataTone} data-kit-section data-kit-spacing={spacing ?? 'md'} data-kit-measured={measured ? '' : undefined}>
|
|
65
|
+
<Tag id={id} aria-labelledby={labelledBy} class={section({ tone, spacing, class: [text, layered, className].filter(Boolean).join(' ') || undefined })} style={style} data-tone={dataTone} data-kit-section={kit ?? ''} data-kit-spacing={spacing ?? 'md'} data-kit-measured={measured ? '' : undefined}>
|
|
62
66
|
{m.image && backdrop && <img src={backdrop} alt="" loading="lazy" decoding="async" class="absolute inset-0 -z-10 h-full w-full" style={`object-fit: ${m.image.fit}${m.image.position ? `; object-position: ${m.image.position}` : ''}`} />}
|
|
63
67
|
{m.overlay && <div class="absolute inset-0 -z-10" style={`background: ${m.overlay}`} aria-hidden="true" />}
|
|
64
68
|
{width === 'none' ? <slot /> : <div class={width === 'prose' ? 'container-prose' : 'container-page'} style={frameStyle}><slot /></div>}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// section components that have no header of their own use it; with none of the four given it draws nothing.
|
|
4
4
|
import Button from './Button.astro'
|
|
5
5
|
import type { ActionInput } from './types'
|
|
6
|
+
import { muted } from './muted'
|
|
6
7
|
|
|
7
8
|
interface Props {
|
|
8
9
|
heading?: string | undefined
|
|
@@ -19,9 +20,9 @@ const Heading = `h${headingLevel}` as 'h2' | 'h3'
|
|
|
19
20
|
---
|
|
20
21
|
{(heading || intro || eyebrow || actions.length > 0) && (
|
|
21
22
|
<header class="mb-10 flex max-w-2xl flex-col gap-3">
|
|
22
|
-
{eyebrow && <p class=
|
|
23
|
+
{eyebrow && <p class:list={['text-sm font-semibold tracking-wide uppercase', muted]}>{eyebrow}</p>}
|
|
23
24
|
{heading && <Heading id={headingId} class="text-3xl [font-weight:var(--font-weight-heading,700)] tracking-tight text-balance md:text-4xl">{heading}</Heading>}
|
|
24
|
-
{intro && <p class=
|
|
25
|
+
{intro && <p class:list={['text-lg', muted]} data-kit-text>{intro}</p>}
|
|
25
26
|
{actions.length > 0 && <div class="mt-2 flex flex-wrap gap-3">{actions.map(action => <Button action={action} />)}</div>}
|
|
26
27
|
</header>
|
|
27
28
|
)}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// The viewport's edge, from the content's edge: what the page frame leaves of the window, halved, plus the frame's own
|
|
2
|
+
// gutter (`container-page` caps its width with the gutter inside it). A section whose image runs on to the window's
|
|
3
|
+
// edge (Split, Hero `imageBleed`) pulls it out by this much on its side, on wide screens. Literal class names, so the
|
|
4
|
+
// stylesheet builder sees them.
|
|
5
|
+
export const BLEED = {
|
|
6
|
+
end: 'md:-me-[calc((100vw-min(var(--container-page)+2*var(--container-inset,0px),100vw))/2+var(--spacing-gutter,2rem))]',
|
|
7
|
+
start: 'md:-ms-[calc((100vw-min(var(--container-page)+2*var(--container-inset,0px),100vw))/2+var(--spacing-gutter,2rem))]',
|
|
8
|
+
} as const
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// A component's id when the page gives none. Its tabs, lightboxes, labels and buttons point at elements by id
|
|
2
|
+
// (`aria-controls`, `popovertarget`, `for`), so two instances on one page that both took the same default (two galleries,
|
|
3
|
+
// two FAQs, two newsletters) would point into each other: a click in the second opened the first one's image. Each
|
|
4
|
+
// default is taken once per page instead: `gallery`, then `gallery-2`, `gallery-3`, in the order the page renders
|
|
5
|
+
// them, the same on every build. An id the page gives is kept as it is, and a default steps around it.
|
|
6
|
+
|
|
7
|
+
const taken = new WeakMap<object, Set<string>>()
|
|
8
|
+
|
|
9
|
+
/** `given` when set, else `base`, `base-2`, … — the first one not yet used on this page (`page` = `Astro.locals`). */
|
|
10
|
+
export function instanceId(page: object, given: string | undefined, base: string): string {
|
|
11
|
+
let ids = taken.get(page)
|
|
12
|
+
if (!ids) {
|
|
13
|
+
ids = new Set()
|
|
14
|
+
taken.set(page, ids)
|
|
15
|
+
}
|
|
16
|
+
if (given) {
|
|
17
|
+
ids.add(given)
|
|
18
|
+
return given
|
|
19
|
+
}
|
|
20
|
+
let id = base
|
|
21
|
+
for (let n = 2; ids.has(id); n++) id = `${base}-${n}`
|
|
22
|
+
ids.add(id)
|
|
23
|
+
return id
|
|
24
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Quieter text (an intro, a caption, a role, a footer link) in a colour role, never a dimmed ink: opacity lays the
|
|
2
|
+
// text over whatever is behind it, and on a mid-tone band that falls under 4.5:1. The role is the one made for the
|
|
3
|
+
// band the text sits on. A band sets `--kit-muted` (dark: `--color-ink-muted-inverse`, a fill: its own ink), a light
|
|
4
|
+
// surface inside it (a card, a form panel, a drawer) clears it again, and without either it is `--color-ink-muted`.
|
|
5
|
+
|
|
6
|
+
/** Quieter text: the band's muted role. */
|
|
7
|
+
export const muted = 'text-[color:var(--kit-muted,var(--color-ink-muted))]'
|
|
8
|
+
|
|
9
|
+
/** On a dark band: the muted role made for it, or the band's own text where the site's theme has none. */
|
|
10
|
+
export const mutedInverse = '[--kit-muted:var(--color-ink-muted-inverse,var(--color-surface))]'
|
|
11
|
+
|
|
12
|
+
/** On the accent fill: no muted role is made for it, so quieter text there is the fill's own ink. */
|
|
13
|
+
export const mutedAccent = '[--kit-muted:var(--color-accent-ink)]'
|
|
14
|
+
|
|
15
|
+
/** On the brand fill: the fill's own ink, as on the accent. */
|
|
16
|
+
export const mutedBrand = '[--kit-muted:var(--color-brand-ink)]'
|
|
17
|
+
|
|
18
|
+
/** A light surface inside a band (a card, a form panel, a drawer): back to the page's muted role. */
|
|
19
|
+
export const mutedReset = '[--kit-muted:initial]'
|