@treeseed/core 0.10.22 → 0.11.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 (108) hide show
  1. package/README.md +69 -125
  2. package/dist/dev-watch.js +2 -1
  3. package/dist/dev.d.ts +1 -1
  4. package/dist/dev.js +51 -35
  5. package/dist/pages/404.astro +1 -1
  6. package/dist/pages/[slug].astro +4 -4
  7. package/dist/pages/agents/[slug].astro +3 -3
  8. package/dist/pages/agents/index.astro +3 -3
  9. package/dist/pages/books/[slug].astro +3 -3
  10. package/dist/pages/books/index.astro +3 -3
  11. package/dist/pages/contact.astro +2 -2
  12. package/dist/pages/decisions/[slug].astro +3 -3
  13. package/dist/pages/decisions/index.astro +3 -3
  14. package/dist/pages/docs-runtime/[...slug].astro +3 -3
  15. package/dist/pages/docs-runtime/index.astro +3 -3
  16. package/dist/pages/index.astro +11 -11
  17. package/dist/pages/notes/[slug].astro +3 -3
  18. package/dist/pages/notes/index.astro +3 -3
  19. package/dist/pages/objectives/[slug].astro +3 -3
  20. package/dist/pages/objectives/index.astro +3 -3
  21. package/dist/pages/people/[slug].astro +3 -3
  22. package/dist/pages/people/index.astro +3 -3
  23. package/dist/pages/proposals/[slug].astro +3 -3
  24. package/dist/pages/proposals/index.astro +3 -3
  25. package/dist/pages/questions/[slug].astro +3 -3
  26. package/dist/pages/questions/index.astro +3 -3
  27. package/dist/pages/ui/index.astro +23 -23
  28. package/dist/platform-resources.js +5 -1
  29. package/dist/scripts/build-dist.js +2 -0
  30. package/dist/scripts/release-verify.js +24 -2
  31. package/dist/scripts/workspace-bootstrap.js +3 -0
  32. package/dist/site.js +49 -11
  33. package/dist/styles/global.css +5 -5
  34. package/package.json +3 -45
  35. package/templates/github/deploy-web.workflow.yml +36 -2
  36. package/dist/components/DevWatchReload.astro +0 -45
  37. package/dist/components/SiteTitle.astro +0 -51
  38. package/dist/components/content/ContentStatusLegend.astro +0 -18
  39. package/dist/components/content/StatusBadge.astro +0 -11
  40. package/dist/components/docs/BookFontControls.astro +0 -180
  41. package/dist/components/docs/DesktopSidebarToggle.astro +0 -88
  42. package/dist/components/docs/DownloadBook.astro +0 -34
  43. package/dist/components/docs/Footer.astro +0 -112
  44. package/dist/components/docs/Header.astro +0 -157
  45. package/dist/components/docs/PageFrame.astro +0 -260
  46. package/dist/components/docs/PageSidebar.astro +0 -63
  47. package/dist/components/docs/PageTitle.astro +0 -39
  48. package/dist/components/docs/Sidebar.astro +0 -41
  49. package/dist/components/docs/ThemeSelect.astro +0 -5
  50. package/dist/components/forms/ContactForm.astro +0 -233
  51. package/dist/components/forms/FooterSubscribeForm.astro +0 -188
  52. package/dist/components/site/BookList.astro +0 -27
  53. package/dist/components/site/CTASection.astro +0 -24
  54. package/dist/components/site/ChronicleList.astro +0 -33
  55. package/dist/components/site/Hero.astro +0 -18
  56. package/dist/components/site/NotesList.astro +0 -29
  57. package/dist/components/site/PathCard.astro +0 -16
  58. package/dist/components/site/ProfileList.astro +0 -30
  59. package/dist/components/site/PublishedContentBody.astro +0 -5
  60. package/dist/components/site/RouteNotFound.astro +0 -25
  61. package/dist/components/site/SectionIntro.astro +0 -9
  62. package/dist/components/site/StageBanner.astro +0 -8
  63. package/dist/components/site/TrustCallout.astro +0 -9
  64. package/dist/components/starlight.js +0 -6
  65. package/dist/components/ui/data/ActionList.astro +0 -51
  66. package/dist/components/ui/data/Badge.astro +0 -19
  67. package/dist/components/ui/data/DataTable.astro +0 -51
  68. package/dist/components/ui/data/KeyValueList.astro +0 -28
  69. package/dist/components/ui/data/MetricCard.astro +0 -25
  70. package/dist/components/ui/data/MetricGrid.astro +0 -27
  71. package/dist/components/ui/data/StatusPill.astro +0 -20
  72. package/dist/components/ui/forms/Button.astro +0 -59
  73. package/dist/components/ui/forms/Field.astro +0 -39
  74. package/dist/components/ui/forms/FormActions.astro +0 -12
  75. package/dist/components/ui/forms/PasswordMeter.astro +0 -80
  76. package/dist/components/ui/forms/RadioGroup.astro +0 -55
  77. package/dist/components/ui/forms/Select.astro +0 -47
  78. package/dist/components/ui/forms/TextInput.astro +0 -58
  79. package/dist/components/ui/forms/Textarea.astro +0 -45
  80. package/dist/components/ui/layout/PageHeader.astro +0 -45
  81. package/dist/components/ui/shell/AppShell.astro +0 -130
  82. package/dist/components/ui/shell/BottomNav.astro +0 -42
  83. package/dist/components/ui/shell/ProjectHeader.astro +0 -66
  84. package/dist/components/ui/shell/PublicFooter.astro +0 -39
  85. package/dist/components/ui/shell/PublicShell.astro +0 -184
  86. package/dist/components/ui/shell/RailNav.astro +0 -42
  87. package/dist/components/ui/shell/ShellIconLink.astro +0 -30
  88. package/dist/components/ui/shell/TopBar.astro +0 -52
  89. package/dist/components/ui/surface/Card.astro +0 -46
  90. package/dist/components/ui/surface/EmptyState.astro +0 -45
  91. package/dist/components/ui/surface/Panel.astro +0 -54
  92. package/dist/components/ui/theme/ThemeMenu.astro +0 -58
  93. package/dist/components/ui/theme/ThemePreviewSwatch.astro +0 -18
  94. package/dist/components/ui/theme/ThemeScript.astro +0 -112
  95. package/dist/components/ui/theme/ThemeSelector.astro +0 -202
  96. package/dist/components/ui/types.js +0 -0
  97. package/dist/layouts/AuthoredEntryLayout.astro +0 -195
  98. package/dist/layouts/BookLayout.astro +0 -35
  99. package/dist/layouts/BridgeLayout.astro +0 -11
  100. package/dist/layouts/ContentLayout.astro +0 -24
  101. package/dist/layouts/MainLayout.astro +0 -76
  102. package/dist/layouts/NoteLayout.astro +0 -26
  103. package/dist/layouts/ProfileLayout.astro +0 -85
  104. package/dist/styles/app-shell.css +0 -626
  105. package/dist/styles/forms.css +0 -274
  106. package/dist/styles/theme.css +0 -198
  107. package/dist/styles/tokens.css +0 -65
  108. package/dist/styles/ui.css +0 -551
@@ -1,66 +0,0 @@
1
- ---
2
- import Badge from '../data/Badge.astro';
3
- import Button from '../forms/Button.astro';
4
- import type { ButtonAction } from '../types.js';
5
-
6
- interface TabItem {
7
- label: string;
8
- href: string;
9
- }
10
-
11
- interface Props {
12
- title: string;
13
- description?: string;
14
- badges?: string[];
15
- actions?: ButtonAction[];
16
- tabs?: TabItem[];
17
- currentPath?: string;
18
- class?: string;
19
- }
20
-
21
- const {
22
- title,
23
- description,
24
- badges = [],
25
- actions = [],
26
- tabs = [],
27
- currentPath = '',
28
- class: className,
29
- } = Astro.props as Props;
30
- ---
31
-
32
- <section class:list={['ts-project-header', className]}>
33
- <div class="ts-project-header__main">
34
- {badges.length > 0 ? (
35
- <div class="ts-project-header__badges">
36
- {badges.map((badge) => <Badge>{badge}</Badge>)}
37
- </div>
38
- ) : null}
39
- <h2>{title}</h2>
40
- {description ? <p>{description}</p> : null}
41
- </div>
42
- {actions.length > 0 || Astro.slots.has('actions') ? (
43
- <div class="ts-project-header__actions">
44
- {actions.map((action) => (
45
- <Button
46
- href={action.href}
47
- type={action.type}
48
- variant={action.variant ?? 'secondary'}
49
- ariaLabel={action.ariaLabel}
50
- disabled={action.disabled}
51
- size="sm"
52
- >
53
- {action.label}
54
- </Button>
55
- ))}
56
- <slot name="actions" />
57
- </div>
58
- ) : null}
59
- {tabs.length > 0 ? (
60
- <nav class="ts-shell-tabs" aria-label="Project">
61
- {tabs.map((tab) => (
62
- <a class="ts-shell-tab" href={tab.href} aria-current={currentPath === tab.href ? 'page' : undefined}>{tab.label}</a>
63
- ))}
64
- </nav>
65
- ) : null}
66
- </section>
@@ -1,39 +0,0 @@
1
- ---
2
- import FooterSubscribeForm from '../../forms/FooterSubscribeForm.astro';
3
- import { PROJECT_STAGE } from '../../../utils/content-status';
4
- import { SITE } from '../../../utils/seo';
5
- import { SITE_FOOTER_MENU } from '../../../utils/site-config';
6
-
7
- interface Props {
8
- currentPath?: string;
9
- }
10
-
11
- const { currentPath = Astro.url.pathname } = Astro.props as Props;
12
- ---
13
-
14
- <footer class="ts-public-footer">
15
- <div class="ts-public-footer__inner">
16
- <div class="ts-public-footer__grid">
17
- <div class="ts-public-footer__column">
18
- <p class="ts-public-footer__title">{SITE.name}</p>
19
- <p class="ts-public-footer__copy">{SITE.summary}</p>
20
- </div>
21
- <div class="ts-public-footer__column">
22
- <p class="ts-public-footer__heading">Project stage</p>
23
- <p class="ts-public-footer__column-title">{PROJECT_STAGE.label}</p>
24
- <p class="ts-public-footer__copy">{PROJECT_STAGE.description}</p>
25
- </div>
26
- {SITE_FOOTER_MENU.map((group) => (
27
- <div class="ts-public-footer__column">
28
- <p class="ts-public-footer__heading">{group.label}</p>
29
- <div class="ts-public-footer__links">
30
- {group.items.map((item) => (
31
- <a href={item.href}>{item.label}</a>
32
- ))}
33
- </div>
34
- </div>
35
- ))}
36
- </div>
37
- <FooterSubscribeForm currentPath={currentPath} />
38
- </div>
39
- </footer>
@@ -1,184 +0,0 @@
1
- ---
2
- import '../../../styles/tokens.css';
3
- import '../../../styles/theme.css';
4
- import '../../../styles/ui.css';
5
- import '../../../styles/forms.css';
6
- import '../../../styles/app-shell.css';
7
- import { ClientRouter } from 'astro:transitions';
8
- import ThemeScript from '../theme/ThemeScript.astro';
9
- import ThemeMenu from '../theme/ThemeMenu.astro';
10
- import TopBar from './TopBar.astro';
11
- import Button from '../forms/Button.astro';
12
- import PublicFooter from './PublicFooter.astro';
13
- import DevWatchReload from '../../DevWatchReload.astro';
14
- import type { ButtonAction } from '../types.js';
15
- import type { ThemePreference } from '../../../utils/theme.js';
16
-
17
- interface Brand {
18
- name: string;
19
- tag?: string;
20
- href: string;
21
- logoSrc?: string;
22
- logoAlt?: string;
23
- mark?: string;
24
- }
25
-
26
- interface NavItem {
27
- label: string;
28
- href: string;
29
- ariaLabel?: string;
30
- }
31
-
32
- interface NavGroup {
33
- label: string;
34
- items: NavItem[];
35
- }
36
-
37
- interface Props {
38
- title: string;
39
- description: string;
40
- currentPath: string;
41
- appearance: ThemePreference;
42
- brand: Brand;
43
- navItems: NavItem[];
44
- navGroups?: NavGroup[];
45
- actions?: ButtonAction[];
46
- showAppearanceControl?: boolean;
47
- preferServerAppearance?: boolean;
48
- contentWidth?: 'shell' | 'content';
49
- }
50
-
51
- const {
52
- title,
53
- description,
54
- currentPath,
55
- appearance,
56
- brand,
57
- navItems,
58
- navGroups = [],
59
- actions = [],
60
- showAppearanceControl = true,
61
- preferServerAppearance = false,
62
- contentWidth = 'shell',
63
- } = Astro.props as Props;
64
-
65
- function isCurrentPath(href: string) {
66
- if (href === '/') return currentPath === '/';
67
- return currentPath === href || currentPath.startsWith(href);
68
- }
69
- ---
70
-
71
- <!doctype html>
72
- <html lang="en">
73
- <head>
74
- <meta charset="utf-8" />
75
- <meta name="viewport" content="width=device-width, initial-scale=1" />
76
- <title>{title}</title>
77
- <meta name="description" content={description} />
78
- <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
79
- <link rel="shortcut icon" href="/favicon.svg" type="image/svg+xml" />
80
- <ThemeScript
81
- defaultScheme={appearance.scheme}
82
- defaultMode={appearance.mode}
83
- preferDefaultPreference={preferServerAppearance}
84
- />
85
- <ClientRouter />
86
- <slot name="head" />
87
- </head>
88
- <body>
89
- <a class="ts-skip-link" href="#main-content">Skip to content</a>
90
- <div class:list={['ts-public-shell', contentWidth === 'content' && 'ts-public-shell--content']}>
91
- <header class="ts-public-shell__header">
92
- <TopBar brand={brand}>
93
- <Fragment slot="actions">
94
- <nav class="ts-public-shell__nav" aria-label="Primary" data-ts-public-nav>
95
- {navGroups.length > 0 ? (
96
- navGroups.map((group) => (
97
- <details class="ts-public-shell__nav-group" data-ts-public-nav-group>
98
- <summary
99
- class:list={[
100
- 'ts-public-shell__link ts-public-shell__summary',
101
- group.items.some((item) => isCurrentPath(item.href)) && 'ts-public-shell__summary--active',
102
- ]}
103
- >
104
- {group.label}
105
- <span aria-hidden="true">▾</span>
106
- </summary>
107
- <div class="ts-public-shell__menu">
108
- {group.items.map((item) => (
109
- <a
110
- class="ts-public-shell__menu-link"
111
- href={item.href}
112
- aria-label={item.ariaLabel}
113
- aria-current={isCurrentPath(item.href) ? 'page' : undefined}
114
- >
115
- {item.label}
116
- </a>
117
- ))}
118
- </div>
119
- </details>
120
- ))
121
- ) : (
122
- navItems.map((item) => (
123
- <a class="ts-public-shell__link" href={item.href} aria-label={item.ariaLabel} aria-current={isCurrentPath(item.href) ? 'page' : undefined}>
124
- {item.label}
125
- </a>
126
- ))
127
- )}
128
- </nav>
129
- {showAppearanceControl ? <ThemeMenu selectedScheme={appearance.scheme} selectedMode={appearance.mode} /> : null}
130
- {actions.map((action) => (
131
- <Button
132
- href={action.href}
133
- type={action.type}
134
- variant={action.variant ?? 'secondary'}
135
- ariaLabel={action.ariaLabel}
136
- disabled={action.disabled}
137
- reload={action.reload}
138
- size="sm"
139
- >
140
- {action.label}
141
- </Button>
142
- ))}
143
- <slot name="actions" />
144
- </Fragment>
145
- </TopBar>
146
- </header>
147
- <main class="ts-public-shell__main" id="main-content">
148
- <slot />
149
- </main>
150
- {Astro.slots.has('footer') ? <slot name="footer" /> : <PublicFooter currentPath={currentPath} />}
151
- <slot name="afterFooter" />
152
- </div>
153
- <DevWatchReload />
154
- <script>
155
- const publicNav = document.querySelector('[data-ts-public-nav]');
156
- const navGroups = document.querySelectorAll<HTMLDetailsElement>('[data-ts-public-nav-group]');
157
-
158
- navGroups.forEach((group) => {
159
- group.addEventListener('toggle', () => {
160
- if (!group.open) return;
161
- navGroups.forEach((otherGroup) => {
162
- if (otherGroup !== group) otherGroup.open = false;
163
- });
164
- });
165
- });
166
-
167
- document.addEventListener('click', (event) => {
168
- if (!(publicNav instanceof HTMLElement)) return;
169
- if (event.target instanceof Node && publicNav.contains(event.target)) return;
170
- navGroups.forEach((group) => {
171
- group.open = false;
172
- });
173
- });
174
-
175
- publicNav?.addEventListener('click', (event) => {
176
- const target = event.target;
177
- if (!(target instanceof HTMLElement) || !target.closest('a')) return;
178
- navGroups.forEach((group) => {
179
- group.open = false;
180
- });
181
- });
182
- </script>
183
- </body>
184
- </html>
@@ -1,42 +0,0 @@
1
- ---
2
- interface NavItem {
3
- label: string;
4
- href: string;
5
- ariaLabel?: string;
6
- }
7
-
8
- interface Props {
9
- items: NavItem[];
10
- currentPath: string;
11
- label?: string;
12
- class?: string;
13
- }
14
-
15
- const {
16
- items,
17
- currentPath,
18
- label = 'Application',
19
- class: className,
20
- } = Astro.props as Props;
21
-
22
- function normalizePath(path: string) {
23
- if (path.length <= 1) return path;
24
- return path.replace(/\/+$/u, '');
25
- }
26
-
27
- function isCurrentPath(href: string) {
28
- const current = normalizePath(currentPath);
29
- const target = normalizePath(href);
30
- if (target === '/') return current === '/';
31
- if (target === '/app') return current === '/app';
32
- return current === target || current.startsWith(`${target}/`);
33
- }
34
- ---
35
-
36
- <nav class:list={['ts-rail-nav', className]} aria-label={label}>
37
- {items.map((item) => (
38
- <a class="ts-rail-nav__link" href={item.href} aria-label={item.ariaLabel} aria-current={isCurrentPath(item.href) ? 'page' : undefined}>
39
- <span>{item.label}</span>
40
- </a>
41
- ))}
42
- </nav>
@@ -1,30 +0,0 @@
1
- ---
2
- interface Props {
3
- href: string;
4
- label: string;
5
- icon: 'book' | 'manager';
6
- }
7
-
8
- const { href, label, icon } = Astro.props as Props;
9
- ---
10
-
11
- <a
12
- href={href}
13
- aria-label={label}
14
- title={label}
15
- class="ts-public-shell__icon-link ts-public-shell__icon-link--stroke"
16
- >
17
- {icon === 'manager' ? (
18
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
19
- <path d="M12 15.25a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5Z" />
20
- <path d="M19.43 12.98c.04-.32.07-.65.07-.98s-.02-.66-.07-.98l2.05-1.6-2-3.46-2.42.98a7.65 7.65 0 0 0-1.7-.98L15 3.38h-4l-.36 2.58c-.6.24-1.17.57-1.7.98l-2.42-.98-2 3.46 2.05 1.6c-.04.32-.07.65-.07.98s.02.66.07.98l-2.05 1.6 2 3.46 2.42-.98c.52.41 1.09.74 1.7.98l.36 2.58h4l.36-2.58c.6-.24 1.17-.57 1.7-.98l2.42.98 2-3.46-2.05-1.6Z" />
21
- </svg>
22
- ) : (
23
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
24
- <path d="M4.75 5.75A2.75 2.75 0 0 1 7.5 3h11.75v16.25H7.5a2.75 2.75 0 0 0-2.75 2.75V5.75Z" />
25
- <path d="M7.5 19.25h11.75" />
26
- <path d="M8.25 7.25h7.5" />
27
- <path d="M8.25 10.75h6" />
28
- </svg>
29
- )}
30
- </a>
@@ -1,52 +0,0 @@
1
- ---
2
- import Button from '../forms/Button.astro';
3
- import type { ButtonAction } from '../types.js';
4
-
5
- interface Brand {
6
- name: string;
7
- tag?: string;
8
- href: string;
9
- logoSrc?: string;
10
- logoAlt?: string;
11
- mark?: string;
12
- }
13
-
14
- interface Props {
15
- brand: Brand;
16
- actions?: ButtonAction[];
17
- class?: string;
18
- }
19
-
20
- const {
21
- brand,
22
- actions = [],
23
- class: className,
24
- } = Astro.props as Props;
25
- ---
26
-
27
- <div class:list={['ts-top-bar', className]}>
28
- <a class="ts-shell-brand" href={brand.href}>
29
- <span class="ts-shell-brand__mark">
30
- {brand.logoSrc ? <img src={brand.logoSrc} alt={brand.logoAlt ?? ''} width="60" height="60" loading="eager" /> : brand.mark}
31
- </span>
32
- <span class="ts-shell-brand__text">
33
- <span class="ts-shell-brand__name">{brand.name}</span>
34
- {brand.tag ? <span class="ts-shell-brand__tag">{brand.tag}</span> : null}
35
- </span>
36
- </a>
37
- <div class="ts-top-bar__actions">
38
- <slot name="actions" />
39
- {actions.map((action) => (
40
- <Button
41
- href={action.href}
42
- type={action.type}
43
- variant={action.variant ?? 'secondary'}
44
- ariaLabel={action.ariaLabel}
45
- disabled={action.disabled}
46
- size="sm"
47
- >
48
- {action.label}
49
- </Button>
50
- ))}
51
- </div>
52
- </div>
@@ -1,46 +0,0 @@
1
- ---
2
- import type { Tone } from '../types.js';
3
-
4
- interface Props {
5
- href?: string;
6
- eyebrow?: string;
7
- title?: string;
8
- description?: string;
9
- tone?: Tone;
10
- interactive?: boolean;
11
- class?: string;
12
- }
13
-
14
- const {
15
- href,
16
- eyebrow,
17
- title,
18
- description,
19
- tone = 'default',
20
- interactive = false,
21
- class: className,
22
- } = Astro.props as Props;
23
-
24
- const classes = ['ts-card', className].filter(Boolean).join(' ');
25
- const isInteractive = href || interactive;
26
- ---
27
-
28
- {
29
- href ? (
30
- <a href={href} class={classes} data-tone={tone} data-interactive="true">
31
- {eyebrow ? <p class="ts-card__eyebrow">{eyebrow}</p> : null}
32
- {title ? <h3 class="ts-card__title">{title}</h3> : null}
33
- {description ? <p class="ts-card__description">{description}</p> : null}
34
- <div class="ts-card__body"><slot /></div>
35
- <slot name="footer" />
36
- </a>
37
- ) : (
38
- <article class={classes} data-tone={tone} data-interactive={isInteractive ? 'true' : undefined}>
39
- {eyebrow ? <p class="ts-card__eyebrow">{eyebrow}</p> : null}
40
- {title ? <h3 class="ts-card__title">{title}</h3> : null}
41
- {description ? <p class="ts-card__description">{description}</p> : null}
42
- <div class="ts-card__body"><slot /></div>
43
- <slot name="footer" />
44
- </article>
45
- )
46
- }
@@ -1,45 +0,0 @@
1
- ---
2
- import Button from '../forms/Button.astro';
3
- import type { ButtonAction } from '../types.js';
4
-
5
- interface Props {
6
- eyebrow?: string;
7
- title: string;
8
- description?: string;
9
- actions?: ButtonAction[];
10
- class?: string;
11
- }
12
-
13
- const {
14
- eyebrow,
15
- title,
16
- description,
17
- actions = [],
18
- class: className,
19
- } = Astro.props as Props;
20
- ---
21
-
22
- <section class:list={['ts-empty-state', className]}>
23
- {eyebrow ? <p class="ts-empty-state__eyebrow">{eyebrow}</p> : null}
24
- <h2 class="ts-empty-state__title">{title}</h2>
25
- {description ? <p class="ts-empty-state__description">{description}</p> : null}
26
- <div class="ts-empty-state__body">
27
- <slot />
28
- </div>
29
- {actions.length > 0 || Astro.slots.has('actions') ? (
30
- <div class="ts-empty-state__actions">
31
- {actions.map((action) => (
32
- <Button
33
- href={action.href}
34
- type={action.type}
35
- variant={action.variant ?? 'secondary'}
36
- ariaLabel={action.ariaLabel}
37
- disabled={action.disabled}
38
- >
39
- {action.label}
40
- </Button>
41
- ))}
42
- <slot name="actions" />
43
- </div>
44
- ) : null}
45
- </section>
@@ -1,54 +0,0 @@
1
- ---
2
- import Button from '../forms/Button.astro';
3
- import type { ButtonAction, Tone } from '../types.js';
4
-
5
- interface Props {
6
- eyebrow?: string;
7
- title?: string;
8
- description?: string;
9
- tone?: Tone;
10
- actions?: ButtonAction[];
11
- class?: string;
12
- }
13
-
14
- const {
15
- eyebrow,
16
- title,
17
- description,
18
- tone = 'default',
19
- actions = [],
20
- class: className,
21
- } = Astro.props as Props;
22
- ---
23
-
24
- <section class:list={['ts-panel', className]} data-tone={tone}>
25
- {eyebrow || title || description || actions.length > 0 || Astro.slots.has('actions') ? (
26
- <header class="ts-panel__header">
27
- <div class="ts-panel__heading">
28
- {eyebrow ? <p class="ts-panel__eyebrow">{eyebrow}</p> : null}
29
- {title ? <h2 class="ts-panel__title">{title}</h2> : null}
30
- {description ? <p class="ts-panel__description">{description}</p> : null}
31
- </div>
32
- {actions.length > 0 || Astro.slots.has('actions') ? (
33
- <div class="ts-panel__actions">
34
- {actions.map((action) => (
35
- <Button
36
- href={action.href}
37
- type={action.type}
38
- variant={action.variant ?? 'secondary'}
39
- ariaLabel={action.ariaLabel}
40
- disabled={action.disabled}
41
- size="sm"
42
- >
43
- {action.label}
44
- </Button>
45
- ))}
46
- <slot name="actions" />
47
- </div>
48
- ) : null}
49
- </header>
50
- ) : null}
51
- <div class="ts-panel__body">
52
- <slot />
53
- </div>
54
- </section>
@@ -1,58 +0,0 @@
1
- ---
2
- import ThemeSelector from './ThemeSelector.astro';
3
- import type { ThemePreference } from '../../../utils/theme.js';
4
-
5
- interface Props {
6
- selectedScheme?: ThemePreference['scheme'];
7
- selectedMode?: ThemePreference['mode'];
8
- label?: string;
9
- }
10
-
11
- const {
12
- selectedScheme,
13
- selectedMode,
14
- label = 'Appearance',
15
- } = Astro.props as Props;
16
- ---
17
-
18
- <details class="ts-theme-menu" data-ts-theme-menu>
19
- <summary class="ts-theme-menu__trigger" aria-label={label} title={label}>
20
- <svg aria-hidden="true" viewBox="0 0 24 24" focusable="false">
21
- <path d="M12 3.25a8.75 8.75 0 0 0 0 17.5h1.1a2.05 2.05 0 0 0 1.46-3.49 0.55 0.55 0 0 1 .39-.94h1.45a4.35 4.35 0 0 0 4.35-4.35A8.72 8.72 0 0 0 12 3.25Zm-4.1 9.1a1.35 1.35 0 1 1 0-2.7 1.35 1.35 0 0 1 0 2.7Zm2.3-4.1a1.35 1.35 0 1 1 0-2.7 1.35 1.35 0 0 1 0 2.7Zm3.9 0a1.35 1.35 0 1 1 0-2.7 1.35 1.35 0 0 1 0 2.7Zm2.6 4.1a1.35 1.35 0 1 1 0-2.7 1.35 1.35 0 0 1 0 2.7Z" />
22
- </svg>
23
- </summary>
24
- <div class="ts-theme-menu__panel">
25
- <ThemeSelector
26
- label={label}
27
- selectedScheme={selectedScheme}
28
- selectedMode={selectedMode}
29
- compact={false}
30
- />
31
- </div>
32
- </details>
33
-
34
- <script is:inline>
35
- (() => {
36
- const bindingKey = '__treeseedThemeMenuDismissBound';
37
- if (window[bindingKey]) return;
38
- window[bindingKey] = true;
39
-
40
- function themeMenuForTarget(target) {
41
- return target instanceof Element ? target.closest('[data-ts-theme-menu]') : null;
42
- }
43
-
44
- function closeOpenMenus(except = null) {
45
- document.querySelectorAll('[data-ts-theme-menu][open]').forEach((menu) => {
46
- if (menu !== except) menu.removeAttribute('open');
47
- });
48
- }
49
-
50
- document.addEventListener('pointerdown', (event) => {
51
- closeOpenMenus(themeMenuForTarget(event.target));
52
- }, true);
53
-
54
- document.addEventListener('keydown', (event) => {
55
- if (event.key === 'Escape') closeOpenMenus();
56
- });
57
- })();
58
- </script>
@@ -1,18 +0,0 @@
1
- ---
2
- interface Props {
3
- swatches: string[];
4
- label?: string;
5
- }
6
-
7
- const { swatches, label = 'Color scheme preview' } = Astro.props as Props;
8
- const visibleSwatches = swatches.slice(0, 4);
9
- const swatchStyle = visibleSwatches
10
- .map((swatch, index) => `--ts-preview-swatch-${index + 1}: ${swatch}`)
11
- .join('; ');
12
- ---
13
-
14
- <span class="ts-theme-swatch" style={swatchStyle} role="img" aria-label={label}>
15
- {visibleSwatches.map((_, index) => (
16
- <span class="ts-theme-swatch__dot" data-swatch-index={index + 1} aria-hidden="true"></span>
17
- ))}
18
- </span>