@openpkg-ts/ui 0.1.6 → 0.1.7

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.
@@ -0,0 +1,232 @@
1
+ /**
2
+ * Design tokens for Supabase/Stripe-style API documentation.
3
+ * Rose Pine inspired syntax highlighting with dark theme.
4
+ */
5
+
6
+ :root {
7
+ /* Background colors (dark-first) */
8
+ --openpkg-bg-root: #0c0c0c;
9
+ --openpkg-bg-primary: #0f0f0f;
10
+ --openpkg-bg-secondary: #171717;
11
+ --openpkg-bg-tertiary: #1c1c1c;
12
+ --openpkg-bg-code: #0f0f18;
13
+ --openpkg-bg-code-header: #141420;
14
+ --openpkg-bg-badge: #262626;
15
+ --openpkg-bg-chip: transparent;
16
+ --openpkg-bg-chip-active: transparent;
17
+ --openpkg-bg-collapsible: #161616;
18
+ --openpkg-bg-details: #141414;
19
+
20
+ /* Text colors */
21
+ --openpkg-text-primary: #ededed;
22
+ --openpkg-text-secondary: #a0a0a0;
23
+ --openpkg-text-muted: #666666;
24
+ --openpkg-text-code: #e4e4e7;
25
+
26
+ /* Syntax highlighting - Rose Pine */
27
+ --openpkg-syn-keyword: #c4a7e7;
28
+ --openpkg-syn-string: #9ccfd8;
29
+ --openpkg-syn-function: #ebbcba;
30
+ --openpkg-syn-property: #c4a7e7;
31
+ --openpkg-syn-variable: #e4e4e7;
32
+ --openpkg-syn-punctuation: #6e6a86;
33
+ --openpkg-syn-number: #f6c177;
34
+ --openpkg-syn-boolean: #eb6f92;
35
+ --openpkg-syn-comment: #6e6a86;
36
+
37
+ /* Accent colors */
38
+ --openpkg-accent-green: #3ecf8e;
39
+ --openpkg-accent-blue: #6cb6ff;
40
+ --openpkg-accent-purple: #c4a7e7;
41
+ --openpkg-accent-link: #6cb6ff;
42
+
43
+ /* Border colors */
44
+ --openpkg-border-subtle: #262626;
45
+ --openpkg-border-medium: #333333;
46
+ --openpkg-border-chip: #333333;
47
+ --openpkg-border-chip-active: #666666;
48
+
49
+ /* Typography */
50
+ --openpkg-font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;
51
+ --openpkg-font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
52
+
53
+ /* Border radius */
54
+ --openpkg-radius-sm: 4px;
55
+ --openpkg-radius-md: 6px;
56
+ --openpkg-radius-lg: 8px;
57
+ --openpkg-radius-full: 9999px;
58
+
59
+ /* Animations */
60
+ --openpkg-transition-fast: 150ms ease;
61
+ --openpkg-transition-normal: 200ms ease;
62
+ --openpkg-transition-slow: 300ms ease;
63
+
64
+ /* Responsive breakpoints (for reference) */
65
+ --openpkg-breakpoint-sm: 640px;
66
+ --openpkg-breakpoint-md: 768px;
67
+ --openpkg-breakpoint-lg: 1024px;
68
+ --openpkg-breakpoint-xl: 1280px;
69
+ --openpkg-breakpoint-2xl: 1536px;
70
+ }
71
+
72
+ /* =============================================================================
73
+ Dark Mode - Explicit .dark class
74
+ ============================================================================= */
75
+ .dark,
76
+ [data-theme="dark"] {
77
+ --openpkg-bg-root: #0c0c0c;
78
+ --openpkg-bg-primary: #0f0f0f;
79
+ --openpkg-bg-secondary: #171717;
80
+ --openpkg-bg-tertiary: #1c1c1c;
81
+ --openpkg-bg-code: #0f0f18;
82
+ --openpkg-bg-code-header: #141420;
83
+ --openpkg-bg-badge: #262626;
84
+ --openpkg-bg-collapsible: #161616;
85
+ --openpkg-bg-details: #141414;
86
+ --openpkg-text-primary: #ededed;
87
+ --openpkg-text-secondary: #a0a0a0;
88
+ --openpkg-text-muted: #666666;
89
+ --openpkg-text-code: #e4e4e7;
90
+ --openpkg-border-subtle: #262626;
91
+ --openpkg-border-medium: #333333;
92
+ --openpkg-border-chip: #333333;
93
+ --openpkg-border-chip-active: #666666;
94
+ }
95
+
96
+ /* =============================================================================
97
+ Light Mode - Explicit .light class
98
+ ============================================================================= */
99
+ .light,
100
+ [data-theme="light"] {
101
+ --openpkg-bg-root: #ffffff;
102
+ --openpkg-bg-primary: #fafafa;
103
+ --openpkg-bg-secondary: #f5f5f5;
104
+ --openpkg-bg-tertiary: #eeeeee;
105
+ --openpkg-bg-code: #f8f8fc;
106
+ --openpkg-bg-code-header: #f0f0f8;
107
+ --openpkg-bg-badge: #e5e5e5;
108
+ --openpkg-bg-collapsible: #f8f8f8;
109
+ --openpkg-bg-details: #fafafa;
110
+ --openpkg-text-primary: #1a1a1a;
111
+ --openpkg-text-secondary: #525252;
112
+ --openpkg-text-muted: #737373;
113
+ --openpkg-text-code: #1a1a1a;
114
+ --openpkg-border-subtle: #e5e5e5;
115
+ --openpkg-border-medium: #d4d4d4;
116
+ --openpkg-border-chip: #d4d4d4;
117
+ --openpkg-border-chip-active: #a3a3a3;
118
+
119
+ /* Light mode syntax - adjust for readability */
120
+ --openpkg-syn-keyword: #8b5cf6;
121
+ --openpkg-syn-string: #059669;
122
+ --openpkg-syn-function: #dc2626;
123
+ --openpkg-syn-property: #7c3aed;
124
+ --openpkg-syn-variable: #1a1a1a;
125
+ --openpkg-syn-punctuation: #6b7280;
126
+ --openpkg-syn-number: #d97706;
127
+ --openpkg-syn-boolean: #be185d;
128
+ --openpkg-syn-comment: #9ca3af;
129
+ }
130
+
131
+ /* =============================================================================
132
+ System Preference (when no explicit class)
133
+ ============================================================================= */
134
+ @media (prefers-color-scheme: light) {
135
+ :root:not(.dark):not([data-theme="dark"]) {
136
+ --openpkg-bg-root: #ffffff;
137
+ --openpkg-bg-primary: #fafafa;
138
+ --openpkg-bg-secondary: #f5f5f5;
139
+ --openpkg-bg-tertiary: #eeeeee;
140
+ --openpkg-bg-code: #f8f8fc;
141
+ --openpkg-bg-code-header: #f0f0f8;
142
+ --openpkg-bg-badge: #e5e5e5;
143
+ --openpkg-bg-collapsible: #f8f8f8;
144
+ --openpkg-bg-details: #fafafa;
145
+ --openpkg-text-primary: #1a1a1a;
146
+ --openpkg-text-secondary: #525252;
147
+ --openpkg-text-muted: #737373;
148
+ --openpkg-text-code: #1a1a1a;
149
+ --openpkg-border-subtle: #e5e5e5;
150
+ --openpkg-border-medium: #d4d4d4;
151
+ --openpkg-border-chip: #d4d4d4;
152
+ --openpkg-border-chip-active: #a3a3a3;
153
+ --openpkg-syn-keyword: #8b5cf6;
154
+ --openpkg-syn-string: #059669;
155
+ --openpkg-syn-function: #dc2626;
156
+ --openpkg-syn-property: #7c3aed;
157
+ --openpkg-syn-variable: #1a1a1a;
158
+ --openpkg-syn-punctuation: #6b7280;
159
+ --openpkg-syn-number: #d97706;
160
+ --openpkg-syn-boolean: #be185d;
161
+ --openpkg-syn-comment: #9ca3af;
162
+ }
163
+ }
164
+
165
+ /* =============================================================================
166
+ Animation Keyframes
167
+ ============================================================================= */
168
+ @keyframes openpkg-fade-in {
169
+ from {
170
+ opacity: 0;
171
+ }
172
+ to {
173
+ opacity: 1;
174
+ }
175
+ }
176
+
177
+ @keyframes openpkg-slide-down {
178
+ from {
179
+ opacity: 0;
180
+ transform: translateY(-4px);
181
+ }
182
+ to {
183
+ opacity: 1;
184
+ transform: translateY(0);
185
+ }
186
+ }
187
+
188
+ @keyframes openpkg-slide-up {
189
+ from {
190
+ opacity: 0;
191
+ transform: translateY(4px);
192
+ }
193
+ to {
194
+ opacity: 1;
195
+ transform: translateY(0);
196
+ }
197
+ }
198
+
199
+ @keyframes openpkg-expand {
200
+ from {
201
+ opacity: 0;
202
+ height: 0;
203
+ }
204
+ to {
205
+ opacity: 1;
206
+ height: var(--radix-collapsible-content-height);
207
+ }
208
+ }
209
+
210
+ @keyframes openpkg-collapse {
211
+ from {
212
+ opacity: 1;
213
+ height: var(--radix-collapsible-content-height);
214
+ }
215
+ to {
216
+ opacity: 0;
217
+ height: 0;
218
+ }
219
+ }
220
+
221
+ /* Utility classes for animations */
222
+ .openpkg-animate-fade-in {
223
+ animation: openpkg-fade-in var(--openpkg-transition-normal) ease-out;
224
+ }
225
+
226
+ .openpkg-animate-slide-down {
227
+ animation: openpkg-slide-down var(--openpkg-transition-normal) ease-out;
228
+ }
229
+
230
+ .openpkg-animate-slide-up {
231
+ animation: openpkg-slide-up var(--openpkg-transition-normal) ease-out;
232
+ }
@@ -1,114 +0,0 @@
1
- import { ReactNode as ReactNode2 } from "react";
2
- interface CodeTab {
3
- /** Tab label */
4
- label: string;
5
- /** Tab content (code block) */
6
- content: ReactNode2;
7
- /** Raw code for copy button */
8
- code: string;
9
- }
10
- interface CodeTabsProps {
11
- /** Array of tabs */
12
- tabs: CodeTab[];
13
- /** Default selected tab index */
14
- defaultIndex?: number;
15
- /** Enable sticky positioning for the header */
16
- sticky?: boolean;
17
- /** Custom className */
18
- className?: string;
19
- }
20
- /**
21
- * Tabbed code block wrapper with copy button per tab.
22
- * Uses docskit --dk-* CSS variables for consistent theming.
23
- */
24
- declare function CodeTabs({ tabs, defaultIndex, sticky, className }: CodeTabsProps): React.ReactNode2;
25
- import * as React2 from "react";
26
- type ExportKind = "function" | "type" | "variable" | "class" | "interface" | "enum";
27
- /**
28
- * Kind badge variants for export cards.
29
- */
30
- declare const kindBadgeVariants: (props?: {
31
- kind?: ExportKind | null;
32
- className?: string;
33
- }) => string;
34
- interface ExportCardProps extends React2.AnchorHTMLAttributes<HTMLAnchorElement> {
35
- /** Export name */
36
- name: string;
37
- /** Description snippet */
38
- description?: string;
39
- /** Link to detail page */
40
- href: string;
41
- /** Export kind */
42
- kind?: ExportKind | null;
43
- /** Custom link component (for Next.js Link) */
44
- as?: React2.ElementType;
45
- }
46
- /**
47
- * Card component for displaying exports in an index grid.
48
- * Features function name styling, description, kind badge, and hover effects.
49
- */
50
- declare const ExportCard: React2.ForwardRefExoticComponent<ExportCardProps & React2.RefAttributes<HTMLAnchorElement>>;
51
- interface ImportSectionProps {
52
- /** Import statement text */
53
- importStatement: string;
54
- /** Custom className */
55
- className?: string;
56
- }
57
- /**
58
- * Displays a copyable import statement with one-click copy.
59
- * Monospace styling with copy button.
60
- */
61
- declare function ImportSection({ importStatement, className }: ImportSectionProps): React.ReactNode;
62
- interface ParameterSchema {
63
- /** Type name (e.g., "string", "number", "object") */
64
- type?: string;
65
- /** Formatted type string for display */
66
- typeString?: string;
67
- /** Description of the parameter/property */
68
- description?: string;
69
- /** Nested properties for object types */
70
- properties?: Record<string, ParameterSchema>;
71
- /** Required property names */
72
- required?: string[];
73
- }
74
- interface ParameterItemProps {
75
- /** Parameter name */
76
- name: string;
77
- /** Parameter schema */
78
- schema: ParameterSchema;
79
- /** Whether this parameter is required */
80
- required?: boolean;
81
- /** Description (overrides schema.description) */
82
- description?: string;
83
- /** Nesting depth for indentation */
84
- depth?: number;
85
- /** Custom className */
86
- className?: string;
87
- }
88
- /**
89
- * Single parameter with expand capability for nested objects.
90
- * Features expandable nested params, type annotations, and required/optional badges.
91
- */
92
- declare function ParameterItem({ name, schema, required: isRequired, description, depth, className }: ParameterItemProps): React.ReactNode;
93
- import * as React3 from "react";
94
- type TypeColor = "string" | "number" | "boolean" | "null" | "undefined" | "object" | "array" | "function" | "union" | "generic" | "default";
95
- /**
96
- * Type coloring for syntax display.
97
- * Follows Stripe-style: consistent colors for primitives vs complex types.
98
- */
99
- declare const typeBadgeVariants: (props?: {
100
- typeColor?: TypeColor | null;
101
- className?: string;
102
- }) => string;
103
- interface TypeBadgeProps extends React3.HTMLAttributes<HTMLSpanElement> {
104
- /** Type string to display */
105
- type: string;
106
- /** Override color detection */
107
- typeColor?: TypeColor | null;
108
- }
109
- /**
110
- * Inline type display with syntax coloring.
111
- * Automatically detects type category and applies appropriate color.
112
- */
113
- declare const TypeBadge: React3.ForwardRefExoticComponent<TypeBadgeProps & React3.RefAttributes<HTMLSpanElement>>;
114
- export { typeBadgeVariants, kindBadgeVariants, TypeBadgeProps, TypeBadge, ParameterSchema, ParameterItemProps, ParameterItem, ImportSectionProps, ImportSection, ExportKind, ExportCardProps, ExportCard, CodeTabsProps, CodeTabs, CodeTab };