@sinnstack/ui 0.2.0 → 0.3.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.
Files changed (138) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/README.md +6 -4
  3. package/docs/blocks.md +373 -364
  4. package/docs/data.md +128 -128
  5. package/docs/finishes.md +165 -0
  6. package/docs/primitives.md +4 -4
  7. package/docs/seo.md +191 -187
  8. package/package.json +15 -24
  9. package/src/blocks/BlockRenderer.astro +13 -7
  10. package/src/blocks/CTABanner.astro +8 -8
  11. package/src/blocks/CTAPair.astro +9 -9
  12. package/src/blocks/CardGrid.astro +7 -7
  13. package/src/blocks/ConsentEmbed.astro +1 -1
  14. package/src/blocks/ConsentManager.astro +1 -1
  15. package/src/blocks/ContactCard.astro +14 -14
  16. package/src/blocks/ContactForm.astro +4 -4
  17. package/src/blocks/ErrorPage.astro +1 -1
  18. package/src/blocks/FAQ.astro +9 -9
  19. package/src/blocks/FeatureGrid.astro +7 -7
  20. package/src/blocks/Hero.astro +11 -11
  21. package/src/blocks/HeroCarousel.astro +11 -11
  22. package/src/blocks/HighlightCards.astro +10 -10
  23. package/src/blocks/LocationHours.astro +14 -14
  24. package/src/blocks/LogoCloud.astro +7 -7
  25. package/src/blocks/MaintenancePage.astro +8 -3
  26. package/src/blocks/MediaText.astro +12 -12
  27. package/src/blocks/PageHeader.astro +9 -9
  28. package/src/blocks/ProseSection.astro +8 -8
  29. package/src/blocks/Reviews.astro +11 -11
  30. package/src/blocks/RichText.astro +58 -57
  31. package/src/blocks/StatsBand.astro +117 -117
  32. package/src/blocks/Steps.astro +9 -9
  33. package/src/blocks/Testimonials.astro +13 -13
  34. package/src/blocks/cms/card-grid.ts +48 -80
  35. package/src/blocks/cms/consent.ts +1 -30
  36. package/src/blocks/cms/contact-card.ts +4 -46
  37. package/src/blocks/cms/contact-form.ts +2 -20
  38. package/src/blocks/cms/cta-banner.ts +2 -23
  39. package/src/blocks/cms/cta-pair.ts +4 -37
  40. package/src/blocks/cms/data-base.ts +2 -4
  41. package/src/blocks/cms/data.ts +19 -19
  42. package/src/blocks/cms/faq.ts +4 -36
  43. package/src/blocks/cms/feature-grid.ts +47 -80
  44. package/src/blocks/cms/fixtures.ts +591 -599
  45. package/src/blocks/cms/hero-carousel.ts +4 -48
  46. package/src/blocks/cms/hero.ts +2 -46
  47. package/src/blocks/cms/highlight-cards.ts +4 -39
  48. package/src/blocks/cms/images.ts +1 -2
  49. package/src/blocks/cms/index.ts +59 -87
  50. package/src/blocks/cms/location-hours.ts +3 -85
  51. package/src/blocks/cms/logo-cloud.ts +36 -62
  52. package/src/blocks/cms/media-text.ts +2 -20
  53. package/src/blocks/cms/page-header.ts +27 -49
  54. package/src/blocks/cms/pages.ts +35 -81
  55. package/src/blocks/cms/prose-section.ts +2 -22
  56. package/src/blocks/cms/reviews.ts +5 -56
  57. package/src/blocks/cms/schema-dsl.ts +134 -0
  58. package/src/blocks/cms/schema.ts +794 -0
  59. package/src/blocks/cms/shared.ts +63 -115
  60. package/src/blocks/cms/stats-band.ts +35 -61
  61. package/src/blocks/cms/steps.ts +4 -31
  62. package/src/blocks/cms/testimonials.ts +4 -38
  63. package/src/blocks/cms/topbar.ts +4 -41
  64. package/src/blocks/cms/types.ts +1 -37
  65. package/src/blocks/consent.ts +2 -2
  66. package/src/blocks/index.ts +2 -2
  67. package/src/blocks/internal/Actions.astro +11 -5
  68. package/src/blocks/internal/BlockHeader.astro +7 -7
  69. package/src/blocks/internal/Placeholder.astro +3 -3
  70. package/src/blocks/internal/fields.ts +18 -0
  71. package/src/blocks/internal/registry-contract.ts +67 -0
  72. package/src/blocks/internal/util.ts +4 -4
  73. package/src/blocks/lib/contact.ts +10 -4
  74. package/src/blocks/lib/faq.ts +1 -1
  75. package/src/blocks/lib/markdown.ts +350 -0
  76. package/src/blocks/lib/rich-text.ts +132 -143
  77. package/src/blocks/scripts/consent-manager.ts +1 -1
  78. package/src/blocks/scripts/consent-store.ts +1 -1
  79. package/src/blocks/scripts/hours.ts +3 -2
  80. package/src/blocks/types.ts +33 -23
  81. package/src/data/ChartContainer.astro +2 -1
  82. package/src/data/cms.ts +130 -190
  83. package/src/data/lib/chart.ts +13 -4
  84. package/src/data/schema.ts +65 -0
  85. package/src/finishes/aurora.css +75 -0
  86. package/src/finishes/autumn.css +87 -0
  87. package/src/finishes/blueprint.css +69 -0
  88. package/src/finishes/brutalist.css +55 -0
  89. package/src/finishes/clay.css +48 -0
  90. package/src/finishes/day-cycle.css +46 -0
  91. package/src/finishes/fog.css +71 -0
  92. package/src/finishes/glass.css +149 -0
  93. package/src/finishes/holographic.css +91 -0
  94. package/src/finishes/night.css +77 -0
  95. package/src/finishes/paper.css +58 -0
  96. package/src/finishes/polished-glass.css +159 -0
  97. package/src/finishes/rain.css +84 -0
  98. package/src/finishes/scripts/day-cycle.ts +30 -0
  99. package/src/finishes/scripts/holographic.ts +37 -0
  100. package/src/finishes/scripts/spotlight.ts +30 -0
  101. package/src/finishes/spotlight.css +41 -0
  102. package/src/finishes/spring.css +80 -0
  103. package/src/finishes/terminal.css +49 -0
  104. package/src/primitives/Divider.astro +1 -1
  105. package/src/primitives/FocusRing.astro +1 -1
  106. package/src/primitives/FormField.astro +2 -2
  107. package/src/primitives/Image.astro +3 -3
  108. package/src/primitives/Input.astro +4 -2
  109. package/src/primitives/MetricCard.astro +3 -1
  110. package/src/primitives/Picture.astro +3 -3
  111. package/src/primitives/Prose.astro +1 -1
  112. package/src/primitives/Select.astro +4 -2
  113. package/src/primitives/Slider.astro +1 -1
  114. package/src/primitives/Table.astro +1 -1
  115. package/src/primitives/Textarea.astro +4 -2
  116. package/src/primitives/Thumbnail.astro +2 -2
  117. package/src/primitives/index.ts +4 -4
  118. package/src/primitives/internal/ChoiceField.astro +4 -2
  119. package/src/primitives/scripts/slider.ts +1 -1
  120. package/src/primitives/scripts/table-sort.ts +2 -2
  121. package/src/seo/cms.ts +59 -80
  122. package/src/seo/index.ts +1 -1
  123. package/src/seo/integration.ts +40 -3
  124. package/src/seo/lib/jsonld.ts +10 -2
  125. package/src/seo/lib/meta.ts +2 -2
  126. package/src/seo/lib/redirects.ts +14 -4
  127. package/src/seo/lib/rss.ts +1 -1
  128. package/src/seo/lib/sitemap.ts +1 -1
  129. package/src/seo/schema.ts +43 -0
  130. package/src/blocks/internal/tina.ts +0 -19
  131. /package/src/blocks/{lib → internal}/consent.ts +0 -0
  132. /package/src/blocks/{lib → internal}/reviews.ts +0 -0
  133. /package/src/blocks/{lib → internal}/slug.ts +0 -0
  134. /package/src/data/{lib → internal}/scale.ts +0 -0
  135. /package/src/primitives/{lib → internal}/image-plan.ts +0 -0
  136. /package/src/primitives/{lib → internal}/image.ts +0 -0
  137. /package/src/primitives/{lib → internal}/slider.ts +0 -0
  138. /package/src/seo/{lib → internal}/url.ts +0 -0
@@ -28,7 +28,7 @@ import type { BlockProps, CtaPanelItem, HeadingLevelNumber } from './types';
28
28
  import Actions from './internal/Actions.astro';
29
29
  import Placeholder from './internal/Placeholder.astro';
30
30
  import { blockIds, slugify, PLACEHOLDER_DEFAULT } from './internal/util';
31
- import { tf, tinaField } from './internal/tina';
31
+ import { sf, joinField } from './internal/fields';
32
32
  import './styles/blocks.css';
33
33
 
34
34
  type Props = Omit<HTMLAttributes<'section'>, 'title'> &
@@ -55,7 +55,7 @@ const {
55
55
  scheme,
56
56
  containerSize = 'default',
57
57
  placeholder = PLACEHOLDER_DEFAULT,
58
- tina,
58
+ fieldPath,
59
59
  id,
60
60
  class: className,
61
61
  ...rest
@@ -69,7 +69,7 @@ const panelId = (i: number) => `${sectionId ?? 'sinn-cta-pair'}-${i}-${slugify(p
69
69
 
70
70
  {
71
71
  panels.length === 0 ? (
72
- placeholder && <Placeholder label="Two calls to action" hint="Add a heading and an action to each panel." tinaField={tinaField(tina, 'items')} />
72
+ placeholder && <Placeholder label="Two calls to action" hint="Add a heading and an action to each panel." field={joinField(fieldPath, 'items')} />
73
73
  ) : (
74
74
  <section
75
75
  id={sectionId}
@@ -81,24 +81,24 @@ const panelId = (i: number) => `${sectionId ?? 'sinn-cta-pair'}-${i}-${slugify(p
81
81
  data-align={align === 'center' ? 'center' : undefined}
82
82
  data-bleed={bleed ? '' : undefined}
83
83
  data-count={panels.length}
84
- {...tf(tina)}
84
+ {...sf(fieldPath)}
85
85
  {...rest}
86
86
  >
87
87
  <Container size={bleed ? 'full' : containerSize} gutter={bleed ? 'none' : 'm'} query={false}>
88
- <ul class="sinn-cta-pair__list" role="list" {...tf(tina, 'items')}>
88
+ <ul class="sinn-cta-pair__list" role="list" {...sf(fieldPath, 'items')}>
89
89
  {panels.map((panel, i) => {
90
90
  const tone = panel.tone ?? (i === 0 ? 'accent' : 'neutral');
91
91
  const hid = `${panelId(i)}-title`;
92
92
  return (
93
- <li class="sinn-cta-pair__panel" data-surface="strong" data-tone={tone} {...tf(tina, 'items', i)}>
93
+ <li class="sinn-cta-pair__panel" data-surface="strong" data-tone={tone} {...sf(fieldPath, panel.field)}>
94
94
  <div class="sinn-cta-pair__inner">
95
- <Heading level={headingLevel} size={size === 'l' ? '2xl' : 'xl'} weight="bold" id={hid} class="sinn-cta-pair__title" {...tf(panel.tina, 'heading')}>
95
+ <Heading level={headingLevel} size={size === 'l' ? '2xl' : 'xl'} weight="bold" id={hid} class="sinn-cta-pair__title" {...sf(fieldPath, panel.field, 'heading')}>
96
96
  {panel.heading}
97
97
  </Heading>
98
98
  {panel.description && (
99
- <Text class="sinn-cta-pair__description" {...tf(panel.tina, 'description')}>{panel.description}</Text>
99
+ <Text class="sinn-cta-pair__description" {...sf(fieldPath, panel.field, 'description')}>{panel.description}</Text>
100
100
  )}
101
- <Actions actions={panel.actions ?? []} size="m" class="sinn-cta-pair__actions" tina={panel.tina} />
101
+ <Actions actions={panel.actions ?? []} size="m" class="sinn-cta-pair__actions" fieldPath={joinField(fieldPath, panel.field)} />
102
102
  </div>
103
103
  </li>
104
104
  );
@@ -30,7 +30,7 @@ import BlockShell from './internal/BlockShell.astro';
30
30
  import BlockHeader from './internal/BlockHeader.astro';
31
31
  import Placeholder from './internal/Placeholder.astro';
32
32
  import { blockIds, PLACEHOLDER_DEFAULT } from './internal/util';
33
- import { tf, tinaField } from './internal/tina';
33
+ import { sf, joinField } from './internal/fields';
34
34
  import { renameProp, renameValue } from '../primitives/lib/deprecate';
35
35
 
36
36
  type Props = Omit<HTMLAttributes<'section'>, 'title'> &
@@ -82,7 +82,7 @@ const {
82
82
  scheme,
83
83
  containerSize = 'default',
84
84
  placeholder = PLACEHOLDER_DEFAULT,
85
- tina,
85
+ fieldPath,
86
86
  id,
87
87
  class: className,
88
88
  ...rest
@@ -103,7 +103,7 @@ const sizes = isList ? '(min-width: 48rem) 40vw, 100vw' : `(min-width: 64rem) ${
103
103
 
104
104
  {
105
105
  isEmpty && !showEmpty ? (
106
- placeholder && <Placeholder label="Card grid" hint="Add at least one card." tinaField={tinaField(tina, 'items')} />
106
+ placeholder && <Placeholder label="Card grid" hint="Add at least one card." field={joinField(fieldPath, 'items')} />
107
107
  ) : (
108
108
  <BlockShell
109
109
  name="cards"
@@ -119,21 +119,21 @@ const sizes = isList ? '(min-width: 48rem) 40vw, 100vw' : `(min-width: 64rem) ${
119
119
  data-title-size={titleSize === 'l' ? undefined : titleSize}
120
120
  data-layout={isList ? 'list' : undefined}
121
121
  data-featured={featured && !isList ? '' : undefined}
122
- {...tf(tina)}
122
+ {...sf(fieldPath)}
123
123
  {...rest}
124
124
  >
125
- <BlockHeader eyebrow={eyebrow} heading={heading} headingId={headingId} headingLevel={headingLevel} description={description} tina={tina} />
125
+ <BlockHeader eyebrow={eyebrow} heading={heading} headingId={headingId} headingLevel={headingLevel} description={description} fieldPath={fieldPath} />
126
126
  {showEmpty ? (
127
127
  <div class="sinn-block__empty" role="status">
128
128
  {emptyMessage && <Text tone="muted">{emptyMessage}</Text>}
129
129
  {slots.has('empty') && <div class="sinn-block__empty-action"><slot name="empty" /></div>}
130
130
  </div>
131
131
  ) : (
132
- <ul class="sinn-block__grid" role="list" data-columns={cols} {...tf(tina, 'items')}>
132
+ <ul class="sinn-block__grid" role="list" data-columns={cols} {...sf(fieldPath, 'items')}>
133
133
  {items.map((item, i) => {
134
134
  const horizontal = isList || (featured && i === 0);
135
135
  return (
136
- <li data-featured-item={featured && !isList && i === 0 ? '' : undefined} {...tf(tina, 'items', i)}>
136
+ <li data-featured-item={featured && !isList && i === 0 ? '' : undefined} {...sf(fieldPath, item.field)}>
137
137
  <Card as="article" variant={variant} size={size} orientation={horizontal ? 'horizontal' : 'vertical'} mediaAspect={item.image ? (isList ? '4/3' : aspect) : undefined}>
138
138
  {item.image && (
139
139
  <Image
@@ -72,7 +72,7 @@ const {
72
72
  ...rest
73
73
  } = Astro.props;
74
74
 
75
- const fill = (s: string) => s.replace(/\{provider\}/g, provider).replace(/\{kind\}/g, kind);
75
+ const fill = (s: string) => s.replace(/\{provider\}/g, () => provider).replace(/\{kind\}/g, () => kind);
76
76
  const text = {
77
77
  notice: fill(labels.notice ?? '{provider} hosts this {kind}. Loading it shares your IP address and device details with {provider}, who may set cookies.'),
78
78
  load: fill(labels.load ?? 'Load {kind}'),
@@ -32,7 +32,7 @@ import Button from '../primitives/Button.astro';
32
32
  import Dialog from '../primitives/Dialog.astro';
33
33
  import Switch from '../primitives/Switch.astro';
34
34
  import Link from '../primitives/Link.astro';
35
- import { consentCategoryPresets, type ConsentCategory } from './lib/consent';
35
+ import { consentCategoryPresets, type ConsentCategory } from './internal/consent';
36
36
  import ConsentManagerScript from './internal/ConsentManagerScript.astro';
37
37
  import ConsentEmbedScript from './internal/ConsentEmbedScript.astro';
38
38
  import { safeHref } from './lib/contact';
@@ -34,7 +34,7 @@ import Placeholder from './internal/Placeholder.astro';
34
34
  import { blockIcons } from './icons';
35
35
  import { contactDefaults, contactHref, lines } from './lib/contact';
36
36
  import { blockIds, PLACEHOLDER_DEFAULT } from './internal/util';
37
- import { tf, tinaField } from './internal/tina';
37
+ import { sf, joinField } from './internal/fields';
38
38
  import './styles/blocks.css';
39
39
  import { renameValue } from '../primitives/lib/deprecate';
40
40
 
@@ -77,7 +77,7 @@ const {
77
77
  scheme,
78
78
  containerSize = 'default',
79
79
  placeholder = PLACEHOLDER_DEFAULT,
80
- tina,
80
+ fieldPath,
81
81
  id,
82
82
  class: className,
83
83
  ...rest
@@ -111,29 +111,29 @@ const wrapperProps = embedded
111
111
 
112
112
  {
113
113
  entries.length === 0 ? (
114
- placeholder && <Placeholder label="Contact card" hint="Add a phone number, email or address." tinaField={tinaField(tina, 'items')} />
114
+ placeholder && <Placeholder label="Contact card" hint="Add a phone number, email or address." field={joinField(fieldPath, 'items')} />
115
115
  ) : (
116
- <Wrapper {...wrapperProps} {...tf(tina)} {...rest}>
116
+ <Wrapper {...wrapperProps} {...sf(fieldPath)} {...rest}>
117
117
  <div class="sinn-contact__card" data-variant={variant} data-columns={columns === 1 ? undefined : columns}>
118
118
  {(eyebrow || hasHeading || description) && (
119
119
  <div class="sinn-contact__header">
120
- {eyebrow && <p class="sinn-block__eyebrow" {...tf(tina, 'eyebrow')}>{eyebrow}</p>}
120
+ {eyebrow && <p class="sinn-block__eyebrow" {...sf(fieldPath, 'eyebrow')}>{eyebrow}</p>}
121
121
  {hasHeading && (
122
- <Heading level={headingLevel} size={embedded ? 'l' : '2xl'} weight="bold" id={headingId} class="sinn-contact__title" {...tf(tina, 'heading')}>
122
+ <Heading level={headingLevel} size={embedded ? 'l' : '2xl'} weight="bold" id={headingId} class="sinn-contact__title" {...sf(fieldPath, 'heading')}>
123
123
  {heading}
124
124
  </Heading>
125
125
  )}
126
- {description && <Text tone="muted" class="sinn-contact__description" {...tf(tina, 'description')}>{description}</Text>}
126
+ {description && <Text tone="muted" class="sinn-contact__description" {...sf(fieldPath, 'description')}>{description}</Text>}
127
127
  </div>
128
128
  )}
129
- <ul class="sinn-contact__list" role="list" {...tf(tina, 'items')}>
129
+ <ul class="sinn-contact__list" role="list" {...sf(fieldPath, 'items')}>
130
130
  {entries.map(({ item, label, icon, href, isExternal, valueLines }, i) => (
131
- <li class="sinn-contact__item" data-type={item.type} {...tf(tina, 'items', i)}>
131
+ <li class="sinn-contact__item" data-type={item.type} {...sf(fieldPath, item.field)}>
132
132
  {icon && <span class="sinn-contact__icon" set:html={icon} />}
133
133
  <div class="sinn-contact__body">
134
- {label && <span class="sinn-contact__label" {...tf(item.tina, 'label')}>{label}</span>}
134
+ {label && <span class="sinn-contact__label" {...sf(fieldPath, item.field, 'label')}>{label}</span>}
135
135
  {item.type === 'address' ? (
136
- <address class="sinn-contact__value" {...tf(item.tina, 'value')}>
136
+ <address class="sinn-contact__value" {...sf(fieldPath, item.field, 'value')}>
137
137
  {valueLines.map((l, k) => (k === 0 ? l : <Fragment><br />{l}</Fragment>))}
138
138
  </address>
139
139
  ) : href ? (
@@ -142,13 +142,13 @@ const wrapperProps = embedded
142
142
  href={href}
143
143
  target={isExternal ? '_blank' : undefined}
144
144
  rel={isExternal ? 'noopener noreferrer' : undefined}
145
- {...tf(item.tina, 'value')}
145
+ {...sf(fieldPath, item.field, 'value')}
146
146
  >
147
147
  {valueLines.join(' ')}
148
148
  {isExternal && <VisuallyHidden> ({newTabLabel})</VisuallyHidden>}
149
149
  </a>
150
150
  ) : (
151
- <span class="sinn-contact__value" {...tf(item.tina, 'value')}>
151
+ <span class="sinn-contact__value" {...sf(fieldPath, item.field, 'value')}>
152
152
  {valueLines.map((l, k) => (k === 0 ? l : <Fragment><br />{l}</Fragment>))}
153
153
  </span>
154
154
  )}
@@ -156,7 +156,7 @@ const wrapperProps = embedded
156
156
  </li>
157
157
  ))}
158
158
  </ul>
159
- {note && <p class="sinn-contact__note" {...tf(tina, 'note')}>{note}</p>}
159
+ {note && <p class="sinn-contact__note" {...sf(fieldPath, 'note')}>{note}</p>}
160
160
  <slot />
161
161
  </div>
162
162
  </Wrapper>
@@ -36,7 +36,7 @@ import BlockShell from './internal/BlockShell.astro';
36
36
  import BlockHeader from './internal/BlockHeader.astro';
37
37
  import { telHref, mailHref } from './lib/contact';
38
38
  import { blockIds } from './internal/util';
39
- import { tf } from './internal/tina';
39
+ import { sf } from './internal/fields';
40
40
  import './styles/blocks.css';
41
41
  import { renameValue } from '../primitives/lib/deprecate';
42
42
 
@@ -116,7 +116,7 @@ const {
116
116
  tone,
117
117
  scheme,
118
118
  containerSize = 'narrow',
119
- tina,
119
+ fieldPath,
120
120
  id,
121
121
  class: className,
122
122
  ...rest
@@ -194,9 +194,9 @@ const hasHeader = !bare && Boolean(heading || description);
194
194
  containerSize={containerSize}
195
195
  labelledby={heading ? headingId : undefined}
196
196
  align={align}
197
- {...tf(tina)}
197
+ {...sf(fieldPath)}
198
198
  >
199
- {hasHeader && <BlockHeader heading={heading} headingId={headingId} headingLevel={headingLevel} description={description} tina={tina} />}
199
+ {hasHeader && <BlockHeader heading={heading} headingId={headingId} headingLevel={headingLevel} description={description} fieldPath={fieldPath} />}
200
200
  <Astro.self
201
201
  bare
202
202
  class={className}
@@ -49,7 +49,7 @@ export interface ErrorPageLink {
49
49
  }
50
50
 
51
51
  type Props = Omit<HTMLAttributes<'section'>, 'title'> &
52
- Omit<BlockProps, 'placeholder' | 'tina'> & {
52
+ Omit<BlockProps, 'placeholder' | 'fieldPath'> & {
53
53
  status?: number;
54
54
  eyebrow?: string;
55
55
  heading?: string;
@@ -30,7 +30,7 @@ import Placeholder from './internal/Placeholder.astro';
30
30
  import RichText from './RichText.astro';
31
31
  import { faqItems } from './lib/faq';
32
32
  import { blockIds, PLACEHOLDER_DEFAULT } from './internal/util';
33
- import { tf, tinaField } from './internal/tina';
33
+ import { sf, joinField } from './internal/fields';
34
34
  import './styles/blocks.css';
35
35
  import './styles/faq.css';
36
36
 
@@ -79,7 +79,7 @@ const {
79
79
  scheme,
80
80
  containerSize = 'default',
81
81
  placeholder = PLACEHOLDER_DEFAULT,
82
- tina,
82
+ fieldPath,
83
83
  id,
84
84
  class: className,
85
85
  ...rest
@@ -95,7 +95,7 @@ const split = layout === 'split' && Boolean(eyebrow || heading || description ||
95
95
 
96
96
  {
97
97
  faqs.length === 0 ? (
98
- placeholder && <Placeholder label="FAQ" hint="Add at least one question with an answer." tinaField={tinaField(tina, 'items')} />
98
+ placeholder && <Placeholder label="FAQ" hint="Add at least one question with an answer." field={joinField(fieldPath, 'items')} />
99
99
  ) : (
100
100
  <BlockShell
101
101
  name="faq"
@@ -109,13 +109,13 @@ const split = layout === 'split' && Boolean(eyebrow || heading || description ||
109
109
  labelledby={hasHeading ? headingId : undefined}
110
110
  align={split ? 'start' : align}
111
111
  data-layout={split ? 'split' : undefined}
112
- {...tf(tina)}
112
+ {...sf(fieldPath)}
113
113
  {...rest}
114
114
  >
115
115
  <div class="sinn-faq__inner">
116
116
  <div class="sinn-faq__intro">
117
- <BlockHeader eyebrow={eyebrow} heading={heading} headingId={headingId} headingLevel={headingLevel} description={description} tina={tina} />
118
- {split && <Actions actions={actions} size="m" class="sinn-faq__actions" tina={tina} />}
117
+ <BlockHeader eyebrow={eyebrow} heading={heading} headingId={headingId} headingLevel={headingLevel} description={description} fieldPath={fieldPath} />
118
+ {split && <Actions actions={actions} size="m" class="sinn-faq__actions" fieldPath={fieldPath} />}
119
119
  </div>
120
120
  <Accordion
121
121
  class="sinn-faq__list"
@@ -124,11 +124,11 @@ const split = layout === 'split' && Boolean(eyebrow || heading || description ||
124
124
  variant={variant}
125
125
  mode={mode}
126
126
  labels={labels}
127
- {...tf(tina, 'items')}
127
+ {...sf(fieldPath, 'items')}
128
128
  >
129
- {(_item: unknown, i: number) => <RichText value={faqs[i].answer} headingLevel={answerTop} resolveImage={resolveImage} class="sinn-faq__answer" />}
129
+ {(_item: unknown, i: number) => <RichText value={faqs[i].answer} headingLevel={answerTop} resolveImage={resolveImage} class="sinn-faq__answer" {...sf(fieldPath, faqs[i].field, 'answer')} />}
130
130
  </Accordion>
131
- {!split && <Actions actions={actions} size="m" class="sinn-block__footer sinn-faq__actions" tina={tina} />}
131
+ {!split && <Actions actions={actions} size="m" class="sinn-block__footer sinn-faq__actions" fieldPath={fieldPath} />}
132
132
  </div>
133
133
  </BlockShell>
134
134
  )
@@ -31,7 +31,7 @@ import BlockHeader from './internal/BlockHeader.astro';
31
31
  import Placeholder from './internal/Placeholder.astro';
32
32
  import { blockIcons } from './icons';
33
33
  import { blockIds, PLACEHOLDER_DEFAULT } from './internal/util';
34
- import { tf, tinaField } from './internal/tina';
34
+ import { sf, joinField } from './internal/fields';
35
35
  import { renameProp, renameValue } from '../primitives/lib/deprecate';
36
36
 
37
37
  type Props = Omit<HTMLAttributes<'section'>, 'title'> &
@@ -78,7 +78,7 @@ const {
78
78
  scheme,
79
79
  containerSize = 'default',
80
80
  placeholder = PLACEHOLDER_DEFAULT,
81
- tina,
81
+ fieldPath,
82
82
  id,
83
83
  class: className,
84
84
  ...rest
@@ -103,7 +103,7 @@ function iconFor(item: FeatureItem): string | undefined {
103
103
 
104
104
  {
105
105
  isEmpty ? (
106
- placeholder && <Placeholder label="Feature grid" hint="Add at least one feature." tinaField={tinaField(tina, 'items')} />
106
+ placeholder && <Placeholder label="Feature grid" hint="Add at least one feature." field={joinField(fieldPath, 'items')} />
107
107
  ) : (
108
108
  <BlockShell
109
109
  name="features"
@@ -120,15 +120,15 @@ function iconFor(item: FeatureItem): string | undefined {
120
120
  data-variant={variant === 'plain' ? undefined : variant}
121
121
  data-layout={layout === 'stacked' ? undefined : layout}
122
122
  data-icon={iconStyle === 'tile' ? undefined : iconStyle}
123
- {...tf(tina)}
123
+ {...sf(fieldPath)}
124
124
  {...rest}
125
125
  >
126
- <BlockHeader eyebrow={eyebrow} heading={heading} headingId={headingId} headingLevel={headingLevel} description={description} tina={tina} />
127
- <ul class="sinn-block__grid" role="list" data-columns={columns} {...tf(tina, 'items')}>
126
+ <BlockHeader eyebrow={eyebrow} heading={heading} headingId={headingId} headingLevel={headingLevel} description={description} fieldPath={fieldPath} />
127
+ <ul class="sinn-block__grid" role="list" data-columns={columns} {...sf(fieldPath, 'items')}>
128
128
  {items.map((item, i) => {
129
129
  const icon = iconFor(item);
130
130
  return (
131
- <li class="sinn-feature" data-linked={item.href ? '' : undefined} {...tf(tina, 'items', i)}>
131
+ <li class="sinn-feature" data-linked={item.href ? '' : undefined} {...sf(fieldPath, item.field)}>
132
132
  {icon && <span class="sinn-feature__icon" aria-hidden="true" set:html={icon} />}
133
133
  <div class="sinn-feature__body">
134
134
  <Heading level={itemLevel} size={titleSize} class="sinn-feature__title">
@@ -36,7 +36,7 @@ import BlockShell from './internal/BlockShell.astro';
36
36
  import Actions from './internal/Actions.astro';
37
37
  import Placeholder from './internal/Placeholder.astro';
38
38
  import { blockIds, PLACEHOLDER_DEFAULT } from './internal/util';
39
- import { tf, tinaField } from './internal/tina';
39
+ import { sf, joinField } from './internal/fields';
40
40
  import { renameProp } from '../primitives/lib/deprecate';
41
41
 
42
42
  type Props = Omit<HTMLAttributes<'section'>, 'title'> &
@@ -92,7 +92,7 @@ const {
92
92
  scheme,
93
93
  containerSize = 'default',
94
94
  placeholder = PLACEHOLDER_DEFAULT,
95
- tina,
95
+ fieldPath,
96
96
  id,
97
97
  class: className,
98
98
  ...rest
@@ -113,7 +113,7 @@ const splitAspect = mediaAspect;
113
113
 
114
114
  {
115
115
  !hasHeading ? (
116
- placeholder && <Placeholder label="Hero" hint="Add a heading to show this section." tinaField={tinaField(tina)} />
116
+ placeholder && <Placeholder label="Hero" hint="Add a heading to show this section." field={joinField(fieldPath)} />
117
117
  ) : (
118
118
  <BlockShell
119
119
  name="hero"
@@ -133,35 +133,35 @@ const splitAspect = mediaAspect;
133
133
  data-min-height={layout === 'media' && minHeight !== 'm' ? minHeight : undefined}
134
134
  data-scrim={effectiveScrim}
135
135
  data-has-media={hasMedia ? '' : undefined}
136
- {...tf(tina)}
136
+ {...sf(fieldPath)}
137
137
  {...rest}
138
138
  >
139
139
  <Fragment slot="bleed">
140
140
  {layout === 'media' && hasMedia && (
141
- <div class="sinn-hero__bg" {...tf(tina, 'image')}>
141
+ <div class="sinn-hero__bg" {...sf(fieldPath, 'image')}>
142
142
  {slots.has('media') ? <slot name="media" /> : image && <Image src={image.src} alt={image.alt} width={image.width} height={image.height} layout="full" priority={imagePriority} sizes="100vw" />}
143
143
  </div>
144
144
  )}
145
145
  </Fragment>
146
146
  <div class="sinn-hero__layout">
147
147
  <div class="sinn-hero__content">
148
- {eyebrow && <p class="sinn-block__eyebrow" {...tf(tina, 'eyebrow')}>{eyebrow}</p>}
149
- <Heading level={headingLevel} size={headingSize} weight="bold" id={headingId} class="sinn-hero__title" {...tf(tina, 'heading')}>
148
+ {eyebrow && <p class="sinn-block__eyebrow" {...sf(fieldPath, 'eyebrow')}>{eyebrow}</p>}
149
+ <Heading level={headingLevel} size={headingSize} weight="bold" id={headingId} class="sinn-hero__title" {...sf(fieldPath, 'heading')}>
150
150
  {slots.has('heading') ? <slot name="heading" /> : heading}
151
151
  </Heading>
152
152
  {(description || slots.has('description')) && (
153
- <Text size="l" tone="muted" class="sinn-hero__description" measure {...tf(tina, 'description')}>
153
+ <Text size="l" tone="muted" class="sinn-hero__description" measure {...sf(fieldPath, 'description')}>
154
154
  {slots.has('description') ? <slot name="description" /> : description}
155
155
  </Text>
156
156
  )}
157
157
  <slot />
158
- <Actions actions={actions} class="sinn-hero__actions" tina={tina}>
158
+ <Actions actions={actions} class="sinn-hero__actions" fieldPath={fieldPath}>
159
159
  {slots.has('actions') && <slot name="actions" />}
160
160
  </Actions>
161
- {(meta || slots.has('meta')) && <p class="sinn-hero__meta" {...tf(tina, 'meta')}>{slots.has('meta') ? <slot name="meta" /> : meta}</p>}
161
+ {(meta || slots.has('meta')) && <p class="sinn-hero__meta" {...sf(fieldPath, 'meta')}>{slots.has('meta') ? <slot name="meta" /> : meta}</p>}
162
162
  </div>
163
163
  {layout === 'split' && hasMedia && (
164
- <div class="sinn-hero__media" {...tf(tina, 'image')}>
164
+ <div class="sinn-hero__media" {...sf(fieldPath, 'image')}>
165
165
  {slots.has('media') ? <slot name="media" /> : image && <Image src={image.src} alt={image.alt} width={image.width} height={image.height} layout="full" aspect={splitAspect} priority={imagePriority} sizes="(min-width: 60rem) 50vw, 100vw" />}
166
166
  </div>
167
167
  )}
@@ -58,7 +58,7 @@ import Placeholder from './internal/Placeholder.astro';
58
58
  import CarouselScript from './internal/CarouselScript.astro';
59
59
  import { uid } from '../primitives/utils';
60
60
  import { blockIds, PLACEHOLDER_DEFAULT } from './internal/util';
61
- import { tf, tinaField } from './internal/tina';
61
+ import { sf, joinField } from './internal/fields';
62
62
  import './styles/blocks.css';
63
63
 
64
64
  type Props = Omit<HTMLAttributes<'section'>, 'title'> &
@@ -113,7 +113,7 @@ const {
113
113
  spacing = 'xl',
114
114
  containerSize = 'default',
115
115
  placeholder = PLACEHOLDER_DEFAULT,
116
- tina,
116
+ fieldPath,
117
117
  id,
118
118
  class: className,
119
119
  ...rest
@@ -133,7 +133,7 @@ const effectiveScrim = scrim === 'gradient' && align === 'start' ? 'gradient' :
133
133
 
134
134
  {
135
135
  total === 0 ? (
136
- placeholder && <Placeholder label="Hero carousel" hint="Add at least one slide with a heading." tinaField={tinaField(tina, 'slides')} />
136
+ placeholder && <Placeholder label="Hero carousel" hint="Add at least one slide with a heading." field={joinField(fieldPath, 'slides')} />
137
137
  ) : (
138
138
  <section
139
139
  id={sectionId}
@@ -150,7 +150,7 @@ const effectiveScrim = scrim === 'gradient' && align === 'start' ? 'gradient' :
150
150
  data-controls={controls === 'split' ? 'split' : undefined}
151
151
  data-scrim={effectiveScrim}
152
152
  data-count={total}
153
- {...tf(tina)}
153
+ {...sf(fieldPath)}
154
154
  {...rest}
155
155
  >
156
156
  {total > 1 && (
@@ -179,7 +179,7 @@ const effectiveScrim = scrim === 'gradient' && align === 'start' ? 'gradient' :
179
179
  </button>
180
180
  </div>
181
181
  )}
182
- <div class="sinn-carousel__track" id={trackId} tabindex={total > 1 ? 0 : undefined} role={total > 1 ? 'group' : undefined} aria-label={total > 1 ? L.strip : undefined} aria-live={total > 1 ? 'polite' : undefined} {...tf(tina, 'slides')}>
182
+ <div class="sinn-carousel__track" id={trackId} tabindex={total > 1 ? 0 : undefined} role={total > 1 ? 'group' : undefined} aria-label={total > 1 ? L.strip : undefined} aria-live={total > 1 ? 'polite' : undefined} {...sf(fieldPath, 'slides')}>
183
183
  {list.map((slide, i) => {
184
184
  const level = headingLevel === 1 && i === 0 ? 1 : 2;
185
185
  return (
@@ -191,23 +191,23 @@ const effectiveScrim = scrim === 'gradient' && align === 'start' ? 'gradient' :
191
191
  aria-label={total > 1 ? fill(L.slide, i + 1) : undefined}
192
192
  data-current={i === 0 ? '' : undefined}
193
193
  data-has-image={slide.image ? '' : undefined}
194
- {...tf(tina, 'slides', i)}
194
+ {...sf(fieldPath, slide.field)}
195
195
  >
196
196
  {slide.image && (
197
- <div class="sinn-carousel__bg" {...tf(slide.tina, 'image')}>
197
+ <div class="sinn-carousel__bg" {...sf(fieldPath, slide.field, 'image')}>
198
198
  <Image src={slide.image.src} alt="" width={slide.image.width} height={slide.image.height} layout="full" sizes="100vw" priority={imagePriority && i === 0} />
199
199
  </div>
200
200
  )}
201
201
  <Container size={containerSize} class="sinn-carousel__container" query={false}>
202
202
  <div class="sinn-carousel__content">
203
- {slide.eyebrow && <p class="sinn-block__eyebrow sinn-carousel__eyebrow" {...tf(slide.tina, 'eyebrow')}>{slide.eyebrow}</p>}
204
- <Heading level={level} size={headingSize} weight="bold" class="sinn-carousel__title" {...tf(slide.tina, 'heading')}>
203
+ {slide.eyebrow && <p class="sinn-block__eyebrow sinn-carousel__eyebrow" {...sf(fieldPath, slide.field, 'eyebrow')}>{slide.eyebrow}</p>}
204
+ <Heading level={level} size={headingSize} weight="bold" class="sinn-carousel__title" {...sf(fieldPath, slide.field, 'heading')}>
205
205
  {slide.heading}
206
206
  </Heading>
207
207
  {slide.description && (
208
- <Text size="l" class="sinn-carousel__description" measure {...tf(slide.tina, 'description')}>{slide.description}</Text>
208
+ <Text size="l" class="sinn-carousel__description" measure {...sf(fieldPath, slide.field, 'description')}>{slide.description}</Text>
209
209
  )}
210
- <Actions actions={slide.actions ?? []} class="sinn-carousel__actions" tina={slide.tina} />
210
+ <Actions actions={slide.actions ?? []} class="sinn-carousel__actions" fieldPath={joinField(fieldPath, slide.field)} />
211
211
  </div>
212
212
  </Container>
213
213
  </div>
@@ -33,7 +33,7 @@ import type { BlockProps, HeadingLevelNumber, HighlightCardItem } from './types'
33
33
  import Actions from './internal/Actions.astro';
34
34
  import Placeholder from './internal/Placeholder.astro';
35
35
  import { blockIds, PLACEHOLDER_DEFAULT } from './internal/util';
36
- import { tf, tinaField } from './internal/tina';
36
+ import { sf, joinField } from './internal/fields';
37
37
  import './styles/blocks.css';
38
38
 
39
39
  type Props = Omit<HTMLAttributes<'section'>, 'title'> &
@@ -60,7 +60,7 @@ const {
60
60
  scheme,
61
61
  containerSize = 'default',
62
62
  placeholder = PLACEHOLDER_DEFAULT,
63
- tina,
63
+ fieldPath,
64
64
  id,
65
65
  class: className,
66
66
  ...rest
@@ -73,7 +73,7 @@ const { sectionId } = blockIds('highlights', anchor, id);
73
73
 
74
74
  {
75
75
  cards.length === 0 ? (
76
- placeholder && <Placeholder label="Highlight cards" hint="Add a heading to at least one card." tinaField={tinaField(tina, 'items')} />
76
+ placeholder && <Placeholder label="Highlight cards" hint="Add a heading to at least one card." field={joinField(fieldPath, 'items')} />
77
77
  ) : (
78
78
  <section
79
79
  id={sectionId}
@@ -85,19 +85,19 @@ const { sectionId } = blockIds('highlights', anchor, id);
85
85
  data-overlap={overlap ? '' : undefined}
86
86
  data-gap={gap}
87
87
  data-count={cards.length}
88
- {...tf(tina)}
88
+ {...sf(fieldPath)}
89
89
  {...rest}
90
90
  >
91
91
  <Container size={containerSize} class="sinn-block__container" query={false}>
92
- <ul class="sinn-highlights__list" role="list" {...tf(tina, 'items')}>
92
+ <ul class="sinn-highlights__list" role="list" {...sf(fieldPath, 'items')}>
93
93
  {cards.map((card, i) => (
94
- <li class="sinn-highlights__card" data-surface="strong" data-tone={card.tone ?? (i % 2 === 0 ? 'accent' : 'neutral')} {...tf(tina, 'items', i)}>
95
- <Heading level={headingLevel} size="xl" weight="regular" class="sinn-highlights__title" {...tf(card.tina, 'heading')}>
94
+ <li class="sinn-highlights__card" data-surface="strong" data-tone={card.tone ?? (i % 2 === 0 ? 'accent' : 'neutral')} {...sf(fieldPath, card.field)}>
95
+ <Heading level={headingLevel} size="xl" weight="regular" class="sinn-highlights__title" {...sf(fieldPath, card.field, 'heading')}>
96
96
  {card.heading}
97
97
  </Heading>
98
- {card.description && <Text class="sinn-highlights__description" {...tf(card.tina, 'description')}>{card.description}</Text>}
99
- {!!card.points?.length && <BulletList items={card.points} marker="dot" gap="3xs" class="sinn-highlights__points" {...tf(card.tina, 'points')} />}
100
- <Actions actions={card.actions ?? []} size="m" class="sinn-highlights__actions" tina={card.tina} />
98
+ {card.description && <Text class="sinn-highlights__description" {...sf(fieldPath, card.field, 'description')}>{card.description}</Text>}
99
+ {!!card.points?.length && <BulletList items={card.points} marker="dot" gap="3xs" class="sinn-highlights__points" {...sf(fieldPath, card.field, 'points')} />}
100
+ <Actions actions={card.actions ?? []} size="m" class="sinn-highlights__actions" fieldPath={joinField(fieldPath, card.field)} />
101
101
  </li>
102
102
  ))}
103
103
  </ul>