@ossy/types 0.2.1 → 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.
package/build/index.d.ts CHANGED
@@ -1,13 +1,158 @@
1
1
  interface Field {
2
- label: string;
2
+ label?: string;
3
3
  name: string;
4
4
  type: string;
5
- description: string;
5
+ description?: string;
6
6
  placeholder?: string;
7
- required: boolean;
7
+ required?: boolean;
8
8
  options?: string[];
9
9
  }
10
10
 
11
+ /**
12
+ * CSS value - any valid CSS string (color, gradient, length, etc.)
13
+ */
14
+ type CssValue = string;
15
+ /**
16
+ * Recursive structure for CSS variable groups.
17
+ * Keys are CSS property names (kebab-case or camelCase).
18
+ * Values are either CSS strings or nested groups.
19
+ */
20
+ type CssStyleGroup = {
21
+ [key: string]: CssValue | CssStyleGroup | undefined;
22
+ };
23
+ /**
24
+ * Surface variant - used for [data-surface="..."] blocks.
25
+ * Supports background, foreground, separator, backdropFilter, and state variants.
26
+ */
27
+ interface SurfaceVariant extends CssStyleGroup {
28
+ background?: CssValue;
29
+ 'background-hover'?: CssValue;
30
+ 'background-active'?: CssValue;
31
+ foreground?: CssValue;
32
+ 'foreground-hover'?: CssValue;
33
+ 'foreground-active'?: CssValue;
34
+ separator?: CssValue;
35
+ backdropFilter?: CssValue;
36
+ }
37
+ /**
38
+ * Space scale - spacing tokens used throughout the design system.
39
+ */
40
+ interface SpaceScale {
41
+ none?: CssValue;
42
+ xxs?: CssValue;
43
+ xs?: CssValue;
44
+ s?: CssValue;
45
+ m?: CssValue;
46
+ l?: CssValue;
47
+ xl?: CssValue;
48
+ xxl?: CssValue;
49
+ [key: string]: CssValue | undefined;
50
+ }
51
+ /**
52
+ * Max width scale - responsive container widths.
53
+ */
54
+ interface MaxWidthScale {
55
+ xxs?: CssValue;
56
+ xs?: CssValue;
57
+ s?: CssValue;
58
+ m?: CssValue;
59
+ l?: CssValue;
60
+ xl?: CssValue;
61
+ xxl?: CssValue;
62
+ full?: CssValue;
63
+ [key: string]: CssValue | undefined;
64
+ }
65
+ /**
66
+ * Color palette - foreground, accent, and semantic colors.
67
+ * Cloud themes use either flat (Standard) or nested (CloudDark) structure.
68
+ */
69
+ interface ColorPalette {
70
+ /** Flat structure (Standard, CloudLight) */
71
+ base?: CssValue;
72
+ primary?: CssValue;
73
+ secondary?: CssValue;
74
+ accent?: CssValue;
75
+ info?: CssValue;
76
+ danger?: CssValue;
77
+ 'alt-primary'?: CssValue;
78
+ 'alt-secondary'?: CssValue;
79
+ /** Nested structure (CloudDark) */
80
+ foreground?: {
81
+ primary?: CssValue;
82
+ secondary?: CssValue;
83
+ };
84
+ [key: string]: CssValue | {
85
+ primary?: CssValue;
86
+ secondary?: CssValue;
87
+ } | undefined;
88
+ }
89
+ /**
90
+ * Surface definitions - base surface colors and gradients.
91
+ */
92
+ interface SurfaceDefinitions {
93
+ primary?: CssValue;
94
+ secondary?: CssValue;
95
+ base?: CssValue;
96
+ accent?: CssValue;
97
+ 'radial-gradient'?: CssValue;
98
+ 'linear-gradient'?: CssValue;
99
+ decorated?: CssValue;
100
+ [key: string]: CssValue | undefined;
101
+ }
102
+ /**
103
+ * Surfaces - named surface variants for components.
104
+ * Keys map to data-surface attribute values.
105
+ */
106
+ interface SurfacesMap {
107
+ base?: SurfaceVariant;
108
+ primary?: SurfaceVariant;
109
+ secondary?: SurfaceVariant;
110
+ decorated?: SurfaceVariant;
111
+ 'alt-primary'?: SurfaceVariant;
112
+ 'alt-secondary'?: SurfaceVariant;
113
+ 'radial-gradient'?: SurfaceVariant;
114
+ 'linear-gradient'?: SurfaceVariant;
115
+ 'alt-glass'?: SurfaceVariant;
116
+ info?: SurfaceVariant;
117
+ danger?: SurfaceVariant;
118
+ accent?: SurfaceVariant;
119
+ [key: string]: SurfaceVariant | undefined;
120
+ }
121
+ /**
122
+ * Theme - the complete design system theme structure.
123
+ * Based on cloud-light and cloud-dark (the canonical themes).
124
+ */
125
+ interface Theme {
126
+ /** Spacing scale - maps to --space-* CSS variables */
127
+ space: SpaceScale;
128
+ /** Max width scale - maps to --max-width-* CSS variables */
129
+ 'max-width': MaxWidthScale;
130
+ /** Color palette */
131
+ color?: ColorPalette;
132
+ /** Base surface definitions - maps to --surface-* */
133
+ surface: SurfaceDefinitions;
134
+ /** Surface variants - maps to [data-surface="key"] blocks */
135
+ surfaces: SurfacesMap;
136
+ /** Separator colors */
137
+ separator: CssStyleGroup;
138
+ /** Title/heading styles */
139
+ title: CssStyleGroup;
140
+ /** Body text styles */
141
+ text: CssStyleGroup;
142
+ /** Button variant styles */
143
+ button: CssStyleGroup;
144
+ /** Card variant styles */
145
+ card: CssStyleGroup;
146
+ /** Resume-specific styles */
147
+ resume?: CssStyleGroup;
148
+ /** Additional theme sections - allows extensibility */
149
+ [key: string]: SpaceScale | MaxWidthScale | CssStyleGroup | SurfacesMap | ColorPalette | SurfaceDefinitions | undefined;
150
+ }
151
+ /**
152
+ * Theme identifier - the canonical theme names.
153
+ */
154
+ type ThemeId = 'cloud-light' | 'cloud-dark';
155
+
11
156
  interface Resource<T = any> {
12
157
  id: string;
13
158
  name: string;
@@ -23,8 +168,8 @@ interface Resource<T = any> {
23
168
  interface ResourceTemplate {
24
169
  id: string;
25
170
  name: string;
26
- description: string;
27
- icon: string;
171
+ description?: string;
172
+ icon?: string;
28
173
  fields: Field[];
29
174
  }
30
175
 
@@ -72,4 +217,4 @@ interface Job {
72
217
  }
73
218
 
74
219
  export { JobStatus, Jobs };
75
- export type { Action, Field, Job, JobStatusType, JobType, Resource, ResourceTemplate, SDKConfig, Workspace };
220
+ export type { Action, ColorPalette, CssStyleGroup, CssValue, Field, Job, JobStatusType, JobType, MaxWidthScale, Resource, ResourceTemplate, SDKConfig, SpaceScale, SurfaceDefinitions, SurfaceVariant, SurfacesMap, Theme, ThemeId, Workspace };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Renders a TypeScript interface from ts2doc doc.json format as a table.
3
+ */
4
+ export function InterfaceTable({ doc }: {
5
+ doc: any;
6
+ }): React.JSX.Element | null;
7
+ import React from 'react';
@@ -1,9 +1,9 @@
1
1
  export interface Field {
2
- label: string;
2
+ label?: string;
3
3
  name: string;
4
4
  type: string;
5
- description: string;
5
+ description?: string;
6
6
  placeholder?: string;
7
- required: boolean;
7
+ required?: boolean;
8
8
  options?: string[];
9
9
  }
@@ -2,7 +2,7 @@ import { Field } from "./Field";
2
2
  export interface ResourceTemplate {
3
3
  id: string;
4
4
  name: string;
5
- description: string;
6
- icon: string;
5
+ description?: string;
6
+ icon?: string;
7
7
  fields: Field[];
8
8
  }
@@ -0,0 +1,144 @@
1
+ /**
2
+ * CSS value - any valid CSS string (color, gradient, length, etc.)
3
+ */
4
+ export type CssValue = string;
5
+ /**
6
+ * Recursive structure for CSS variable groups.
7
+ * Keys are CSS property names (kebab-case or camelCase).
8
+ * Values are either CSS strings or nested groups.
9
+ */
10
+ export type CssStyleGroup = {
11
+ [key: string]: CssValue | CssStyleGroup | undefined;
12
+ };
13
+ /**
14
+ * Surface variant - used for [data-surface="..."] blocks.
15
+ * Supports background, foreground, separator, backdropFilter, and state variants.
16
+ */
17
+ export interface SurfaceVariant extends CssStyleGroup {
18
+ background?: CssValue;
19
+ 'background-hover'?: CssValue;
20
+ 'background-active'?: CssValue;
21
+ foreground?: CssValue;
22
+ 'foreground-hover'?: CssValue;
23
+ 'foreground-active'?: CssValue;
24
+ separator?: CssValue;
25
+ backdropFilter?: CssValue;
26
+ }
27
+ /**
28
+ * Space scale - spacing tokens used throughout the design system.
29
+ */
30
+ export interface SpaceScale {
31
+ none?: CssValue;
32
+ xxs?: CssValue;
33
+ xs?: CssValue;
34
+ s?: CssValue;
35
+ m?: CssValue;
36
+ l?: CssValue;
37
+ xl?: CssValue;
38
+ xxl?: CssValue;
39
+ [key: string]: CssValue | undefined;
40
+ }
41
+ /**
42
+ * Max width scale - responsive container widths.
43
+ */
44
+ export interface MaxWidthScale {
45
+ xxs?: CssValue;
46
+ xs?: CssValue;
47
+ s?: CssValue;
48
+ m?: CssValue;
49
+ l?: CssValue;
50
+ xl?: CssValue;
51
+ xxl?: CssValue;
52
+ full?: CssValue;
53
+ [key: string]: CssValue | undefined;
54
+ }
55
+ /**
56
+ * Color palette - foreground, accent, and semantic colors.
57
+ * Cloud themes use either flat (Standard) or nested (CloudDark) structure.
58
+ */
59
+ export interface ColorPalette {
60
+ /** Flat structure (Standard, CloudLight) */
61
+ base?: CssValue;
62
+ primary?: CssValue;
63
+ secondary?: CssValue;
64
+ accent?: CssValue;
65
+ info?: CssValue;
66
+ danger?: CssValue;
67
+ 'alt-primary'?: CssValue;
68
+ 'alt-secondary'?: CssValue;
69
+ /** Nested structure (CloudDark) */
70
+ foreground?: {
71
+ primary?: CssValue;
72
+ secondary?: CssValue;
73
+ };
74
+ [key: string]: CssValue | {
75
+ primary?: CssValue;
76
+ secondary?: CssValue;
77
+ } | undefined;
78
+ }
79
+ /**
80
+ * Surface definitions - base surface colors and gradients.
81
+ */
82
+ export interface SurfaceDefinitions {
83
+ primary?: CssValue;
84
+ secondary?: CssValue;
85
+ base?: CssValue;
86
+ accent?: CssValue;
87
+ 'radial-gradient'?: CssValue;
88
+ 'linear-gradient'?: CssValue;
89
+ decorated?: CssValue;
90
+ [key: string]: CssValue | undefined;
91
+ }
92
+ /**
93
+ * Surfaces - named surface variants for components.
94
+ * Keys map to data-surface attribute values.
95
+ */
96
+ export interface SurfacesMap {
97
+ base?: SurfaceVariant;
98
+ primary?: SurfaceVariant;
99
+ secondary?: SurfaceVariant;
100
+ decorated?: SurfaceVariant;
101
+ 'alt-primary'?: SurfaceVariant;
102
+ 'alt-secondary'?: SurfaceVariant;
103
+ 'radial-gradient'?: SurfaceVariant;
104
+ 'linear-gradient'?: SurfaceVariant;
105
+ 'alt-glass'?: SurfaceVariant;
106
+ info?: SurfaceVariant;
107
+ danger?: SurfaceVariant;
108
+ accent?: SurfaceVariant;
109
+ [key: string]: SurfaceVariant | undefined;
110
+ }
111
+ /**
112
+ * Theme - the complete design system theme structure.
113
+ * Based on cloud-light and cloud-dark (the canonical themes).
114
+ */
115
+ export interface Theme {
116
+ /** Spacing scale - maps to --space-* CSS variables */
117
+ space: SpaceScale;
118
+ /** Max width scale - maps to --max-width-* CSS variables */
119
+ 'max-width': MaxWidthScale;
120
+ /** Color palette */
121
+ color?: ColorPalette;
122
+ /** Base surface definitions - maps to --surface-* */
123
+ surface: SurfaceDefinitions;
124
+ /** Surface variants - maps to [data-surface="key"] blocks */
125
+ surfaces: SurfacesMap;
126
+ /** Separator colors */
127
+ separator: CssStyleGroup;
128
+ /** Title/heading styles */
129
+ title: CssStyleGroup;
130
+ /** Body text styles */
131
+ text: CssStyleGroup;
132
+ /** Button variant styles */
133
+ button: CssStyleGroup;
134
+ /** Card variant styles */
135
+ card: CssStyleGroup;
136
+ /** Resume-specific styles */
137
+ resume?: CssStyleGroup;
138
+ /** Additional theme sections - allows extensibility */
139
+ [key: string]: SpaceScale | MaxWidthScale | CssStyleGroup | SurfacesMap | ColorPalette | SurfaceDefinitions | undefined;
140
+ }
141
+ /**
142
+ * Theme identifier - the canonical theme names.
143
+ */
144
+ export type ThemeId = 'cloud-light' | 'cloud-dark';
@@ -1,4 +1,5 @@
1
1
  export type { Field } from './Field';
2
+ export type { Theme, ThemeId, CssValue, CssStyleGroup, SurfaceVariant, SpaceScale, MaxWidthScale, ColorPalette, SurfaceDefinitions, SurfacesMap } from './Theme';
2
3
  export type { Resource } from './Resource';
3
4
  export type { ResourceTemplate } from './ResourceTemplate';
4
5
  export type { Workspace } from './Workspace';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ossy/types",
3
3
  "description": "Shared TypeScript types for all packages",
4
- "version": "0.2.1",
4
+ "version": "0.3.0",
5
5
  "url": "git://github.com/ossy-se/packages/types",
6
6
  "source": "src/index.ts",
7
7
  "module": "build/index.js",
@@ -26,5 +26,5 @@
26
26
  "/build",
27
27
  "README.md"
28
28
  ],
29
- "gitHead": "009330a43cf08e0cab806434b5f654401924af95"
29
+ "gitHead": "3019a8da590435ba6f10d7d861addeba011baf5d"
30
30
  }
File without changes
File without changes