@specglass/theme-default 0.0.10 → 0.0.11

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 (45) hide show
  1. package/dist/__tests__/design-tokens.test.d.ts +1 -0
  2. package/dist/__tests__/design-tokens.test.js +107 -0
  3. package/dist/islands/CopyButton.js +2 -6
  4. package/dist/islands/LanguageToggle.d.ts +16 -0
  5. package/dist/islands/LanguageToggle.js +88 -0
  6. package/dist/islands/SearchPalette.js +57 -8
  7. package/dist/islands/ThemeToggle.js +1 -1
  8. package/dist/scripts/code-block-enhancer.js +6 -3
  9. package/dist/themes/notdiamond-dark.json +168 -0
  10. package/dist/themes/notdiamond-light.json +168 -0
  11. package/dist/ui/command.js +2 -2
  12. package/dist/ui/dialog.js +2 -2
  13. package/dist/utils/shiki.d.ts +1 -1
  14. package/dist/utils/shiki.js +5 -3
  15. package/package.json +5 -3
  16. package/src/components/ApiAuth.astro +31 -4
  17. package/src/components/ApiEndpoint.astro +67 -44
  18. package/src/components/ApiNavigation.astro +8 -11
  19. package/src/components/ApiParameters.astro +113 -162
  20. package/src/components/ApiResponse.astro +1 -1
  21. package/src/components/Callout.astro +59 -18
  22. package/src/components/Card.astro +4 -4
  23. package/src/components/CodeBlock.astro +7 -7
  24. package/src/components/CodeBlockGroup.astro +3 -3
  25. package/src/components/CodeExample.astro +183 -0
  26. package/src/components/EditLink.astro +53 -0
  27. package/src/components/Footer.astro +87 -25
  28. package/src/components/Header.astro +63 -7
  29. package/src/components/Sidebar.astro +43 -11
  30. package/src/components/TableOfContents.astro +5 -5
  31. package/src/components/Tabs.astro +51 -20
  32. package/src/islands/CopyButton.tsx +36 -34
  33. package/src/islands/LanguageToggle.tsx +214 -0
  34. package/src/islands/SearchPalette.tsx +121 -39
  35. package/src/islands/ThemeToggle.tsx +45 -48
  36. package/src/layouts/ApiReferencePage.astro +67 -56
  37. package/src/layouts/DocPage.astro +32 -27
  38. package/src/layouts/LandingPage.astro +348 -27
  39. package/src/scripts/code-block-enhancer.ts +8 -3
  40. package/src/styles/global.css +388 -59
  41. package/src/themes/notdiamond-dark.json +168 -0
  42. package/src/themes/notdiamond-light.json +168 -0
  43. package/src/ui/command.tsx +1 -2
  44. package/src/ui/dialog.tsx +8 -5
  45. package/src/utils/shiki.ts +5 -3
@@ -0,0 +1,168 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/shikijs/textmate-grammars-themes/main/packages/tm-themes/themes/dark-plus.json",
3
+ "name": "notdiamond-dark",
4
+ "displayName": "Not Diamond Dark",
5
+ "type": "dark",
6
+ "colors": {
7
+ "editor.background": "#0a0a0b",
8
+ "editor.foreground": "#e4e4e7",
9
+ "editorLineNumber.foreground": "#3f3f46",
10
+ "editorLineNumber.activeForeground": "#71717a",
11
+ "editor.selectionBackground": "#77e54430",
12
+ "editor.lineHighlightBackground": "#18181b"
13
+ },
14
+ "tokenColors": [
15
+ {
16
+ "scope": ["comment", "punctuation.definition.comment"],
17
+ "settings": {
18
+ "foreground": "#71717a",
19
+ "fontStyle": "italic"
20
+ }
21
+ },
22
+ {
23
+ "scope": ["keyword", "storage.type", "storage.modifier"],
24
+ "settings": {
25
+ "foreground": "#77e544"
26
+ }
27
+ },
28
+ {
29
+ "scope": ["keyword.operator", "keyword.operator.assignment"],
30
+ "settings": {
31
+ "foreground": "#a1a1aa"
32
+ }
33
+ },
34
+ {
35
+ "scope": ["keyword.control.import", "keyword.control.export", "keyword.control.from"],
36
+ "settings": {
37
+ "foreground": "#77e544"
38
+ }
39
+ },
40
+ {
41
+ "scope": ["string", "string.quoted"],
42
+ "settings": {
43
+ "foreground": "#f38b32"
44
+ }
45
+ },
46
+ {
47
+ "scope": ["string.template", "punctuation.definition.string.template"],
48
+ "settings": {
49
+ "foreground": "#f38b32"
50
+ }
51
+ },
52
+ {
53
+ "scope": ["constant.numeric"],
54
+ "settings": {
55
+ "foreground": "#a78bfa"
56
+ }
57
+ },
58
+ {
59
+ "scope": ["constant.language"],
60
+ "settings": {
61
+ "foreground": "#a78bfa"
62
+ }
63
+ },
64
+ {
65
+ "scope": ["variable", "variable.other"],
66
+ "settings": {
67
+ "foreground": "#e4e4e7"
68
+ }
69
+ },
70
+ {
71
+ "scope": ["variable.parameter"],
72
+ "settings": {
73
+ "foreground": "#fca5a5"
74
+ }
75
+ },
76
+ {
77
+ "scope": ["entity.name.function", "support.function"],
78
+ "settings": {
79
+ "foreground": "#38bdf8"
80
+ }
81
+ },
82
+ {
83
+ "scope": ["entity.name.type", "entity.name.class", "support.type", "support.class"],
84
+ "settings": {
85
+ "foreground": "#67e8f9"
86
+ }
87
+ },
88
+ {
89
+ "scope": ["entity.name.tag"],
90
+ "settings": {
91
+ "foreground": "#77e544"
92
+ }
93
+ },
94
+ {
95
+ "scope": ["entity.other.attribute-name"],
96
+ "settings": {
97
+ "foreground": "#f38b32"
98
+ }
99
+ },
100
+ {
101
+ "scope": ["punctuation"],
102
+ "settings": {
103
+ "foreground": "#a1a1aa"
104
+ }
105
+ },
106
+ {
107
+ "scope": ["meta.brace"],
108
+ "settings": {
109
+ "foreground": "#a1a1aa"
110
+ }
111
+ },
112
+ {
113
+ "scope": ["punctuation.definition.tag"],
114
+ "settings": {
115
+ "foreground": "#71717a"
116
+ }
117
+ },
118
+ {
119
+ "scope": ["support.type.property-name"],
120
+ "settings": {
121
+ "foreground": "#38bdf8"
122
+ }
123
+ },
124
+ {
125
+ "scope": ["meta.object-literal.key"],
126
+ "settings": {
127
+ "foreground": "#e4e4e7"
128
+ }
129
+ },
130
+ {
131
+ "scope": ["variable.other.property"],
132
+ "settings": {
133
+ "foreground": "#e4e4e7"
134
+ }
135
+ },
136
+ {
137
+ "scope": ["markup.heading"],
138
+ "settings": {
139
+ "foreground": "#77e544",
140
+ "fontStyle": "bold"
141
+ }
142
+ },
143
+ {
144
+ "scope": ["markup.bold"],
145
+ "settings": {
146
+ "fontStyle": "bold"
147
+ }
148
+ },
149
+ {
150
+ "scope": ["markup.italic"],
151
+ "settings": {
152
+ "fontStyle": "italic"
153
+ }
154
+ },
155
+ {
156
+ "scope": ["markup.inline.raw"],
157
+ "settings": {
158
+ "foreground": "#f38b32"
159
+ }
160
+ },
161
+ {
162
+ "scope": ["markup.list"],
163
+ "settings": {
164
+ "foreground": "#a1a1aa"
165
+ }
166
+ }
167
+ ]
168
+ }
@@ -0,0 +1,168 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/shikijs/textmate-grammars-themes/main/packages/tm-themes/themes/light-plus.json",
3
+ "name": "notdiamond-light",
4
+ "displayName": "Not Diamond Light",
5
+ "type": "light",
6
+ "colors": {
7
+ "editor.background": "#fafafa",
8
+ "editor.foreground": "#18181b",
9
+ "editorLineNumber.foreground": "#a1a1aa",
10
+ "editorLineNumber.activeForeground": "#52525b",
11
+ "editor.selectionBackground": "#77e54430",
12
+ "editor.lineHighlightBackground": "#f4f4f5"
13
+ },
14
+ "tokenColors": [
15
+ {
16
+ "scope": ["comment", "punctuation.definition.comment"],
17
+ "settings": {
18
+ "foreground": "#71717a",
19
+ "fontStyle": "italic"
20
+ }
21
+ },
22
+ {
23
+ "scope": ["keyword", "storage.type", "storage.modifier"],
24
+ "settings": {
25
+ "foreground": "#16a34a"
26
+ }
27
+ },
28
+ {
29
+ "scope": ["keyword.operator", "keyword.operator.assignment"],
30
+ "settings": {
31
+ "foreground": "#52525b"
32
+ }
33
+ },
34
+ {
35
+ "scope": ["keyword.control.import", "keyword.control.export", "keyword.control.from"],
36
+ "settings": {
37
+ "foreground": "#16a34a"
38
+ }
39
+ },
40
+ {
41
+ "scope": ["string", "string.quoted"],
42
+ "settings": {
43
+ "foreground": "#c2410c"
44
+ }
45
+ },
46
+ {
47
+ "scope": ["string.template", "punctuation.definition.string.template"],
48
+ "settings": {
49
+ "foreground": "#c2410c"
50
+ }
51
+ },
52
+ {
53
+ "scope": ["constant.numeric"],
54
+ "settings": {
55
+ "foreground": "#7c3aed"
56
+ }
57
+ },
58
+ {
59
+ "scope": ["constant.language"],
60
+ "settings": {
61
+ "foreground": "#7c3aed"
62
+ }
63
+ },
64
+ {
65
+ "scope": ["variable", "variable.other"],
66
+ "settings": {
67
+ "foreground": "#18181b"
68
+ }
69
+ },
70
+ {
71
+ "scope": ["variable.parameter"],
72
+ "settings": {
73
+ "foreground": "#dc2626"
74
+ }
75
+ },
76
+ {
77
+ "scope": ["entity.name.function", "support.function"],
78
+ "settings": {
79
+ "foreground": "#0284c7"
80
+ }
81
+ },
82
+ {
83
+ "scope": ["entity.name.type", "entity.name.class", "support.type", "support.class"],
84
+ "settings": {
85
+ "foreground": "#0891b2"
86
+ }
87
+ },
88
+ {
89
+ "scope": ["entity.name.tag"],
90
+ "settings": {
91
+ "foreground": "#16a34a"
92
+ }
93
+ },
94
+ {
95
+ "scope": ["entity.other.attribute-name"],
96
+ "settings": {
97
+ "foreground": "#b45309"
98
+ }
99
+ },
100
+ {
101
+ "scope": ["punctuation"],
102
+ "settings": {
103
+ "foreground": "#52525b"
104
+ }
105
+ },
106
+ {
107
+ "scope": ["meta.brace"],
108
+ "settings": {
109
+ "foreground": "#52525b"
110
+ }
111
+ },
112
+ {
113
+ "scope": ["punctuation.definition.tag"],
114
+ "settings": {
115
+ "foreground": "#71717a"
116
+ }
117
+ },
118
+ {
119
+ "scope": ["support.type.property-name"],
120
+ "settings": {
121
+ "foreground": "#0284c7"
122
+ }
123
+ },
124
+ {
125
+ "scope": ["meta.object-literal.key"],
126
+ "settings": {
127
+ "foreground": "#18181b"
128
+ }
129
+ },
130
+ {
131
+ "scope": ["variable.other.property"],
132
+ "settings": {
133
+ "foreground": "#18181b"
134
+ }
135
+ },
136
+ {
137
+ "scope": ["markup.heading"],
138
+ "settings": {
139
+ "foreground": "#16a34a",
140
+ "fontStyle": "bold"
141
+ }
142
+ },
143
+ {
144
+ "scope": ["markup.bold"],
145
+ "settings": {
146
+ "fontStyle": "bold"
147
+ }
148
+ },
149
+ {
150
+ "scope": ["markup.italic"],
151
+ "settings": {
152
+ "fontStyle": "italic"
153
+ }
154
+ },
155
+ {
156
+ "scope": ["markup.inline.raw"],
157
+ "settings": {
158
+ "foreground": "#c2410c"
159
+ }
160
+ },
161
+ {
162
+ "scope": ["markup.list"],
163
+ "settings": {
164
+ "foreground": "#52525b"
165
+ }
166
+ }
167
+ ]
168
+ }
@@ -42,7 +42,6 @@ const CommandDialog = ({
42
42
  className={cn(
43
43
  "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-text-muted",
44
44
  "[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2",
45
- "[&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5",
46
45
  "[&_[cmdk-input]]:h-12",
47
46
  "[&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3",
48
47
  "[&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",
@@ -79,7 +78,7 @@ const CommandInput = React.forwardRef<
79
78
  <CommandPrimitive.Input
80
79
  ref={ref}
81
80
  className={cn(
82
- "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-text-muted disabled:cursor-not-allowed disabled:opacity-50",
81
+ "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none focus-visible:outline-none placeholder:text-text-muted disabled:cursor-not-allowed disabled:opacity-50",
83
82
  className,
84
83
  )}
85
84
  {...props}
package/src/ui/dialog.tsx CHANGED
@@ -18,7 +18,7 @@ const DialogOverlay = React.forwardRef<
18
18
  <DialogPrimitive.Overlay
19
19
  ref={ref}
20
20
  className={cn(
21
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
21
+ "fixed inset-0 z-50 bg-black/60 backdrop-blur-sm transition-opacity duration-150 data-[state=open]:opacity-100 data-[state=closed]:opacity-0",
22
22
  className,
23
23
  )}
24
24
  {...props}
@@ -35,17 +35,20 @@ const DialogContent = React.forwardRef<
35
35
  <DialogPrimitive.Content
36
36
  ref={ref}
37
37
  className={cn(
38
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-surface p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
38
+ "fixed left-[50%] top-[20%] z-50 grid w-full max-w-lg translate-x-[-50%] gap-4 border border-border bg-surface p-6 shadow-2xl sm:rounded-xl",
39
+ "transition-all duration-150 ease-out",
40
+ "data-[state=open]:opacity-100 data-[state=open]:scale-100",
41
+ "data-[state=closed]:opacity-0 data-[state=closed]:scale-[0.98]",
39
42
  className,
40
43
  )}
41
44
  {...props}
42
45
  >
43
46
  {children}
44
- <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-surface transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-hover-bg data-[state=open]:text-text-muted">
47
+ <DialogPrimitive.Close className="absolute right-3 top-3 rounded-sm opacity-70 ring-offset-surface transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-hover-bg data-[state=open]:text-text-muted">
45
48
  <svg
46
49
  xmlns="http://www.w3.org/2000/svg"
47
- width="16"
48
- height="16"
50
+ width="14"
51
+ height="14"
49
52
  viewBox="0 0 24 24"
50
53
  fill="none"
51
54
  stroke="currentColor"
@@ -10,6 +10,8 @@
10
10
  */
11
11
 
12
12
  import { createHighlighter, type Highlighter } from "shiki";
13
+ import notdiamondDark from "../themes/notdiamond-dark.json";
14
+ import notdiamondLight from "../themes/notdiamond-light.json";
13
15
 
14
16
  let highlighter: Highlighter | null = null;
15
17
 
@@ -34,7 +36,7 @@ const LANG_ALIASES: Record<string, string> = {
34
36
  };
35
37
 
36
38
  /**
37
- * Syntax-highlight `code` using Shiki dual-theme (github-light / github-dark).
39
+ * Syntax-highlight `code` using Shiki dual-theme (notdiamond-light / notdiamond-dark).
38
40
  * Returns raw HTML string with CSS variable tokens — ready for `set:html`.
39
41
  */
40
42
  export async function highlight(
@@ -44,7 +46,7 @@ export async function highlight(
44
46
  ): Promise<string> {
45
47
  if (!highlighter) {
46
48
  highlighter = await createHighlighter({
47
- themes: ["github-light", "github-dark"],
49
+ themes: [notdiamondLight as never, notdiamondDark as never],
48
50
  langs: [
49
51
  "typescript",
50
52
  "javascript",
@@ -92,7 +94,7 @@ export async function highlight(
92
94
 
93
95
  return highlighter.codeToHtml(code, {
94
96
  lang,
95
- themes: { light: "github-light", dark: "github-dark" },
97
+ themes: { light: "notdiamond-light", dark: "notdiamond-dark" },
96
98
  defaultColor: false,
97
99
  ...(decorations?.length ? { decorations } : {}),
98
100
  });