@upstart.gg/sdk 0.0.104 → 0.0.105

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 (225) hide show
  1. package/dist/shared/ajv.js +1 -1
  2. package/dist/shared/attributes.js +1 -1
  3. package/dist/shared/bricks/manifests/accordion.manifest.js +1 -1
  4. package/dist/shared/bricks/manifests/all-manifests.js +1 -1
  5. package/dist/shared/bricks/manifests/button.manifest.js +1 -1
  6. package/dist/shared/bricks/manifests/card.manifest.js +1 -1
  7. package/dist/shared/bricks/manifests/carousel.manifest.js +1 -1
  8. package/dist/shared/bricks/manifests/container.manifest.js +1 -1
  9. package/dist/shared/bricks/manifests/divider.manifest.js +1 -1
  10. package/dist/shared/bricks/manifests/footer.manifest.js +1 -1
  11. package/dist/shared/bricks/manifests/form.manifest.js +1 -1
  12. package/dist/shared/bricks/manifests/hero.manifest.js +1 -1
  13. package/dist/shared/bricks/manifests/icon.manifest.js +1 -1
  14. package/dist/shared/bricks/manifests/image.manifest.js +1 -1
  15. package/dist/shared/bricks/manifests/images-gallery.manifest.js +1 -1
  16. package/dist/shared/bricks/manifests/map.manifest.js +1 -1
  17. package/dist/shared/bricks/manifests/navbar.manifest.js +1 -1
  18. package/dist/shared/bricks/manifests/sidebar.manifest.js +1 -1
  19. package/dist/shared/bricks/manifests/social-links.manifest.js +1 -1
  20. package/dist/shared/bricks/manifests/testimonials.manifest.js +1 -1
  21. package/dist/shared/bricks/manifests/text.manifest.js +1 -1
  22. package/dist/shared/bricks/manifests/timeline.manifest.js +1 -1
  23. package/dist/shared/bricks/manifests/video.manifest.js +1 -1
  24. package/dist/shared/bricks.js +1 -1
  25. package/dist/shared/chunk-245ZLDVB.js +3 -0
  26. package/dist/shared/{chunk-QALNFBY7.js → chunk-2D6ZEIDX.js} +1 -1
  27. package/dist/shared/{chunk-CW5FWW5W.js → chunk-4BLCQRF5.js} +1 -1
  28. package/dist/shared/{chunk-TEPFFY32.js → chunk-5MGYT6FI.js} +1 -1
  29. package/dist/shared/{chunk-HQQYIKTE.js → chunk-CS5N4UQU.js} +1 -1
  30. package/dist/shared/{chunk-5IEGQ7YT.js → chunk-FRWB3BF3.js} +1 -1
  31. package/dist/shared/{chunk-I5S2MPPR.js → chunk-HYXCHFS5.js} +1 -1
  32. package/dist/shared/{chunk-TCZBR3ZU.js → chunk-IKSRCRZZ.js} +1 -1
  33. package/dist/shared/{chunk-LJQXN32B.js → chunk-ISF6EBPX.js} +1 -1
  34. package/dist/shared/{chunk-UK6H3FDX.js → chunk-JDBVMPSI.js} +1 -1
  35. package/dist/shared/{chunk-UISES3HA.js → chunk-M3Z3XDUC.js} +1 -1
  36. package/dist/shared/{chunk-22KRCQK5.js → chunk-MWP5IU33.js} +1 -1
  37. package/dist/shared/{chunk-7L3UOEMR.js → chunk-NCSLTHKN.js} +1 -1
  38. package/dist/shared/{chunk-O22VV7YR.js → chunk-OWON727Q.js} +1 -1
  39. package/dist/shared/{chunk-CEXHD4BO.js → chunk-P5RC56CL.js} +2 -2
  40. package/dist/shared/{chunk-ZFTWLZ3G.js → chunk-QI3BZDXL.js} +1 -1
  41. package/dist/shared/{chunk-F6MLW6DO.js → chunk-RDSK2G6V.js} +1 -1
  42. package/dist/shared/{chunk-I43NIQ2K.js → chunk-RXRPFXDF.js} +1 -1
  43. package/dist/shared/{chunk-POYVTV5F.js → chunk-VFGMOA4M.js} +1 -1
  44. package/dist/shared/{chunk-VDHLON5R.js → chunk-VPD626ML.js} +1 -1
  45. package/dist/shared/{chunk-WCNVFVDK.js → chunk-VROOAFFW.js} +1 -1
  46. package/dist/shared/{chunk-E2EBTWJI.js → chunk-WB4PGCZQ.js} +1 -1
  47. package/dist/shared/chunk-X2RJL33B.js +3 -0
  48. package/dist/shared/{chunk-OQIFFJ7I.js → chunk-X4ZBUWUL.js} +1 -1
  49. package/dist/shared/datasources/external/rss/fetcher.d.ts +1 -1
  50. package/dist/shared/datasources/external/rss/fetcher.d.ts.map +1 -1
  51. package/dist/shared/page.js +1 -1
  52. package/dist/shared/site.js +1 -1
  53. package/package.json +5 -9
  54. package/dist/shared/chunk-GPKRRX3D.js +0 -3
  55. package/dist/shared/chunk-JFDOR3UH.js +0 -3
  56. package/src/node/cli/api.ts +0 -101
  57. package/src/node/cli/commands/cmd-build.ts +0 -64
  58. package/src/node/cli/commands/login/cmd-login.ts +0 -111
  59. package/src/node/cli/commands/logout/cmd-logout.ts +0 -11
  60. package/src/node/cli/commands/publish/cmd-publish.ts +0 -135
  61. package/src/node/cli/commands/publish/parse-gitignore.ts +0 -278
  62. package/src/node/cli/commands/publish/uploader.ts +0 -333
  63. package/src/node/cli/constants.ts +0 -14
  64. package/src/node/cli/is-logged-in.ts +0 -28
  65. package/src/node/cli/program.ts +0 -77
  66. package/src/node/cli/store.ts +0 -64
  67. package/src/node/cli/tests/api.test.ts +0 -161
  68. package/src/node/cli/types.ts +0 -34
  69. package/src/node/cli/utils.ts +0 -20
  70. package/src/node/shared/config.ts +0 -69
  71. package/src/node/shared/logger.ts +0 -44
  72. package/src/shared/ajv.ts +0 -103
  73. package/src/shared/analytics/init.ts +0 -14
  74. package/src/shared/analytics/track.ts +0 -21
  75. package/src/shared/analytics/types.ts +0 -13
  76. package/src/shared/attributes.ts +0 -211
  77. package/src/shared/brick-manifest.ts +0 -110
  78. package/src/shared/bricks/manifests/accordion.manifest.ts +0 -179
  79. package/src/shared/bricks/manifests/all-manifests.ts +0 -92
  80. package/src/shared/bricks/manifests/button.manifest.ts +0 -145
  81. package/src/shared/bricks/manifests/card.manifest.ts +0 -269
  82. package/src/shared/bricks/manifests/carousel.manifest.ts +0 -106
  83. package/src/shared/bricks/manifests/container.manifest.ts +0 -357
  84. package/src/shared/bricks/manifests/divider.manifest.ts +0 -121
  85. package/src/shared/bricks/manifests/footer.manifest.ts +0 -487
  86. package/src/shared/bricks/manifests/form.manifest.ts +0 -112
  87. package/src/shared/bricks/manifests/hero.manifest.ts +0 -132
  88. package/src/shared/bricks/manifests/icon.manifest.ts +0 -130
  89. package/src/shared/bricks/manifests/image.manifest.ts +0 -203
  90. package/src/shared/bricks/manifests/images-gallery.manifest.ts +0 -227
  91. package/src/shared/bricks/manifests/map.manifest.ts +0 -75
  92. package/src/shared/bricks/manifests/navbar.manifest.ts +0 -344
  93. package/src/shared/bricks/manifests/sidebar.manifest.ts +0 -90
  94. package/src/shared/bricks/manifests/social-links.manifest.ts +0 -370
  95. package/src/shared/bricks/manifests/testimonials.manifest.ts +0 -397
  96. package/src/shared/bricks/manifests/tests/header.manifest.test.ts +0 -10
  97. package/src/shared/bricks/manifests/text.manifest.ts +0 -164
  98. package/src/shared/bricks/manifests/timeline.manifest.ts +0 -456
  99. package/src/shared/bricks/manifests/video.manifest.ts +0 -59
  100. package/src/shared/bricks/props/_style-presets.ts +0 -352
  101. package/src/shared/bricks/props/align.ts +0 -59
  102. package/src/shared/bricks/props/background.ts +0 -118
  103. package/src/shared/bricks/props/boolean.ts +0 -11
  104. package/src/shared/bricks/props/border.ts +0 -84
  105. package/src/shared/bricks/props/color.ts +0 -24
  106. package/src/shared/bricks/props/common.ts +0 -37
  107. package/src/shared/bricks/props/container.ts +0 -356
  108. package/src/shared/bricks/props/css-length.ts +0 -25
  109. package/src/shared/bricks/props/datasource.ts +0 -60
  110. package/src/shared/bricks/props/date.ts +0 -24
  111. package/src/shared/bricks/props/effects.ts +0 -123
  112. package/src/shared/bricks/props/enum.ts +0 -42
  113. package/src/shared/bricks/props/file.ts +0 -12
  114. package/src/shared/bricks/props/geolocation.ts +0 -30
  115. package/src/shared/bricks/props/helpers.ts +0 -101
  116. package/src/shared/bricks/props/image.ts +0 -90
  117. package/src/shared/bricks/props/number.ts +0 -16
  118. package/src/shared/bricks/props/padding.ts +0 -21
  119. package/src/shared/bricks/props/position.ts +0 -27
  120. package/src/shared/bricks/props/preset.ts +0 -136
  121. package/src/shared/bricks/props/string.ts +0 -56
  122. package/src/shared/bricks/props/tests/align.test.ts +0 -37
  123. package/src/shared/bricks/props/tests/background.test.ts +0 -102
  124. package/src/shared/bricks/props/tests/border.test.ts +0 -38
  125. package/src/shared/bricks/props/tests/effects.test.ts +0 -37
  126. package/src/shared/bricks/props/tests/helpers.test.ts +0 -133
  127. package/src/shared/bricks/props/tests/image.test.ts +0 -71
  128. package/src/shared/bricks/props/tests/padding.ts +0 -12
  129. package/src/shared/bricks/props/tests/string.test.ts +0 -79
  130. package/src/shared/bricks/props/text.ts +0 -66
  131. package/src/shared/bricks/props/types.ts +0 -57
  132. package/src/shared/bricks.ts +0 -232
  133. package/src/shared/context.ts +0 -39
  134. package/src/shared/datarecords/external/airtable/handler.ts +0 -21
  135. package/src/shared/datarecords/external/airtable/options.ts +0 -22
  136. package/src/shared/datarecords/external/generic-webhook/handler.ts +0 -10
  137. package/src/shared/datarecords/external/generic-webhook/options.ts +0 -13
  138. package/src/shared/datarecords/external/google/oauth/config.ts +0 -30
  139. package/src/shared/datarecords/external/google/sheets/handler.ts +0 -26
  140. package/src/shared/datarecords/external/google/sheets/options.ts +0 -9
  141. package/src/shared/datarecords/types.ts +0 -120
  142. package/src/shared/datarecords.ts +0 -5
  143. package/src/shared/datasources/README.md +0 -3
  144. package/src/shared/datasources/external/facebook/posts/fetcher.ts +0 -52
  145. package/src/shared/datasources/external/facebook/posts/sample.ts +0 -35
  146. package/src/shared/datasources/external/facebook/posts/schema.ts +0 -33
  147. package/src/shared/datasources/external/facebook/posts/tests/fetcher.test.ts +0 -73
  148. package/src/shared/datasources/external/http-json/fetcher.ts +0 -28
  149. package/src/shared/datasources/external/http-json/options.ts +0 -12
  150. package/src/shared/datasources/external/http-json/schema.ts +0 -6
  151. package/src/shared/datasources/external/http-json/tests/fetcher.test.ts +0 -70
  152. package/src/shared/datasources/external/instagram/feed/fetcher.ts +0 -33
  153. package/src/shared/datasources/external/instagram/feed/sample.ts +0 -22
  154. package/src/shared/datasources/external/instagram/feed/schema.ts +0 -23
  155. package/src/shared/datasources/external/instagram/feed/tests/fetcher.test.ts +0 -64
  156. package/src/shared/datasources/external/mastodon/account/fetcher.ts +0 -24
  157. package/src/shared/datasources/external/mastodon/account/sample.ts +0 -33
  158. package/src/shared/datasources/external/mastodon/account/schema.ts +0 -45
  159. package/src/shared/datasources/external/mastodon/account/tests/fetcher.test.ts +0 -47
  160. package/src/shared/datasources/external/mastodon/options.ts +0 -11
  161. package/src/shared/datasources/external/mastodon/status/fetcher.ts +0 -35
  162. package/src/shared/datasources/external/mastodon/status/sample.array.ts +0 -59
  163. package/src/shared/datasources/external/mastodon/status/sample.single.ts +0 -55
  164. package/src/shared/datasources/external/mastodon/status/schema.ts +0 -130
  165. package/src/shared/datasources/external/mastodon/status/tests/fetcher.test.ts +0 -74
  166. package/src/shared/datasources/external/meta/oauth/config.ts +0 -16
  167. package/src/shared/datasources/external/meta/options.ts +0 -11
  168. package/src/shared/datasources/external/rss/fetcher.ts +0 -29
  169. package/src/shared/datasources/external/rss/options.ts +0 -11
  170. package/src/shared/datasources/external/rss/sample.ts +0 -22
  171. package/src/shared/datasources/external/rss/schema.ts +0 -42
  172. package/src/shared/datasources/external/threads/media/fetcher.ts +0 -53
  173. package/src/shared/datasources/external/threads/media/sample.ts +0 -44
  174. package/src/shared/datasources/external/threads/media/schema.ts +0 -37
  175. package/src/shared/datasources/external/tiktok/oauth/config.ts +0 -17
  176. package/src/shared/datasources/external/tiktok/video/fetcher.ts +0 -39
  177. package/src/shared/datasources/external/tiktok/video/options.ts +0 -12
  178. package/src/shared/datasources/external/tiktok/video/sample.ts +0 -26
  179. package/src/shared/datasources/external/tiktok/video/schema.ts +0 -27
  180. package/src/shared/datasources/external/youtube/list/fetcher.ts +0 -37
  181. package/src/shared/datasources/external/youtube/list/options.ts +0 -15
  182. package/src/shared/datasources/external/youtube/list/sample.ts +0 -33
  183. package/src/shared/datasources/external/youtube/list/schema.ts +0 -38
  184. package/src/shared/datasources/external/youtube/oauth/config.ts +0 -15
  185. package/src/shared/datasources/fetcher.ts +0 -17
  186. package/src/shared/datasources/internal/blog/schema.ts +0 -69
  187. package/src/shared/datasources/internal/changelog/schema.ts +0 -48
  188. package/src/shared/datasources/internal/contact-info/schema.ts +0 -20
  189. package/src/shared/datasources/internal/cv/schema.ts +0 -217
  190. package/src/shared/datasources/internal/faq/schema.ts +0 -27
  191. package/src/shared/datasources/internal/job-board/schema.ts +0 -228
  192. package/src/shared/datasources/internal/links/schema.ts +0 -15
  193. package/src/shared/datasources/internal/recipes/schema.ts +0 -42
  194. package/src/shared/datasources/internal/restaurant/schema.ts +0 -225
  195. package/src/shared/datasources/provider-options.ts +0 -7
  196. package/src/shared/datasources/samples.ts +0 -26
  197. package/src/shared/datasources/schemas.ts +0 -45
  198. package/src/shared/datasources/types.ts +0 -276
  199. package/src/shared/datasources/utils.ts +0 -16
  200. package/src/shared/datasources.ts +0 -42
  201. package/src/shared/env.ts +0 -23
  202. package/src/shared/errors.ts +0 -1
  203. package/src/shared/images.ts +0 -44
  204. package/src/shared/index.ts +0 -3
  205. package/src/shared/layout-constants.ts +0 -25
  206. package/src/shared/manifest.ts +0 -50
  207. package/src/shared/oauth.ts +0 -16
  208. package/src/shared/page.ts +0 -61
  209. package/src/shared/prompt.ts +0 -9
  210. package/src/shared/responsive.ts +0 -5
  211. package/src/shared/site.ts +0 -97
  212. package/src/shared/sitemap.ts +0 -66
  213. package/src/shared/social-icons.ts +0 -307
  214. package/src/shared/tests/attributes.test.ts +0 -37
  215. package/src/shared/theme.ts +0 -245
  216. package/src/shared/themes/README.md +0 -34
  217. package/src/shared/themes/color-system.ts +0 -127
  218. package/src/shared/utils/canvas-data-uri.ts +0 -2
  219. package/src/shared/utils/invariant.ts +0 -25
  220. package/src/shared/utils/json-date.ts +0 -8
  221. package/src/shared/utils/merge.ts +0 -12
  222. package/src/shared/utils/object-hash.ts +0 -7
  223. package/src/shared/utils/schema.ts +0 -35
  224. package/src/shared/utils/try-catch.ts +0 -12
  225. package/src/shared/utils/typed-ref.ts +0 -41
@@ -1,352 +0,0 @@
1
- import { Type, type Static } from "@sinclair/typebox";
2
- import type { BorderSettings } from "./border";
3
- import type { ColorSettings } from "./color";
4
- import type { BackgroundSettings } from "./background";
5
- import type { ShadowSettings } from "./effects";
6
-
7
- export type StyleProperties = {
8
- color?: ColorSettings;
9
- background: BackgroundSettings;
10
- border?: Partial<BorderSettings>;
11
- shadow?: ShadowSettings;
12
- };
13
-
14
- export const stylePreset = Type.Optional(
15
- Type.Object(
16
- {
17
- style: Type.Union([
18
- Type.Literal("ghost", {
19
- title: "Ghost",
20
- description: "Minimal style with transparent background and no border",
21
- }),
22
- Type.Literal("plain", {
23
- title: "Plain",
24
- description: "Simple style with solid dark background and basic border",
25
- }),
26
- Type.Literal("plain2", {
27
- title: "Plain 2",
28
- description: "Simple style with solid dark background and basic border",
29
- }),
30
- Type.Literal("plain3", {
31
- title: "Plain 3",
32
- description: "Simple style with solid dark background and basic border",
33
- }),
34
- Type.Literal("modern", {
35
- title: "Modern",
36
- description: "Bold borders with generous spacing and sharp corners",
37
- }),
38
- Type.Literal("modern2", {
39
- title: "Modern 2",
40
- description: "Bold borders with generous spacing and sharp corners",
41
- }),
42
- Type.Literal("soft", {
43
- title: "Soft",
44
- description: "Gentle curves and muted colors for a comfortable feel",
45
- }),
46
- Type.Literal("glass", {
47
- title: "Glass",
48
- description: "Translucent backdrop with blur effect for depth",
49
- }),
50
- Type.Literal("elevated", {
51
- title: "Elevated",
52
- description: "Floating appearance with shadow depth and no borders",
53
- }),
54
- Type.Literal("outlined", {
55
- title: "Outlined",
56
- description: "Simple outline with hover effect and no background",
57
- }),
58
- Type.Literal("paper", {
59
- title: "Paper",
60
- description: "Subtle texture and slight rotation for a paper-like appearance",
61
- }),
62
- Type.Literal("gradient", {
63
- title: "Gradient",
64
- description: "Smooth color gradients background with soft edges",
65
- }),
66
- Type.Literal("gradient2", {
67
- title: "Gradient 2",
68
- description: "Smooth color gradients background with soft edges",
69
- }),
70
- Type.Literal("gradient3", {
71
- title: "Gradient 3",
72
- description: "Smooth color gradients background with soft edges",
73
- }),
74
- Type.Literal("gradient4", {
75
- title: "Gradient 4",
76
- description: "Smooth color gradients background with soft edges",
77
- }),
78
- Type.Literal("gradient5", {
79
- title: "Gradient 5",
80
- description: "Smooth color gradients background with soft edges",
81
- }),
82
- Type.Literal("gradient6", {
83
- title: "Gradient 6",
84
- description: "Smooth color gradients background with soft edges",
85
- }),
86
- Type.Literal("callout", {
87
- title: "Callout",
88
- description: "Prominent style for important information or CTAs",
89
- }),
90
- ]),
91
- variant: Type.Union([
92
- Type.Literal("primary", {
93
- title: "Primary",
94
- description: "Uses the theme primary color as the main color",
95
- }),
96
- Type.Literal("secondary", {
97
- title: "Secondary",
98
- description: "Uses the theme secondary color as the main color",
99
- }),
100
- Type.Literal("neutral", {
101
- title: "Neutral",
102
- description: "Uses the theme neutral color as the main color",
103
- }),
104
- ]),
105
- },
106
- {
107
- "ui:field": "hidden",
108
- },
109
- ),
110
- );
111
-
112
- export type StylePreset = Static<typeof stylePreset>;
113
-
114
- export function getPresetStyles({ style, variant }: StylePreset): StyleProperties {
115
- // Variant-specific color mappings
116
- const variantColors = {
117
- primary: {
118
- bg: "bg-primary-50",
119
- border: "border-primary-200",
120
- text: "text-primary-900",
121
- shadow: "shadow-primary-200/50",
122
- },
123
- secondary: {
124
- bg: "bg-secondary-50",
125
- border: "border-secondary-200",
126
- text: "text-secondary-900",
127
- shadow: "shadow-secondary-200/50",
128
- },
129
- accent: {
130
- bg: "bg-accent-50",
131
- border: "border-accent-200",
132
- hover: "hover:border-accent-300",
133
- text: "text-accent-900",
134
- shadow: "shadow-accent-200/50",
135
- },
136
- neutral: {
137
- bg: "bg-neutral-50",
138
- border: "border-neutral-200",
139
- hover: "hover:border-neutral-300",
140
- text: "text-neutral-900",
141
- shadow: "shadow-neutral-200/50",
142
- },
143
- };
144
-
145
- function getOtherVariantColor(variant: StylePreset["variant"], alt = false) {
146
- switch (variant) {
147
- case "primary":
148
- return alt ? "accent" : "secondary";
149
- case "secondary":
150
- return alt ? "primary" : "accent";
151
- case "neutral":
152
- return alt ? "primary" : "accent";
153
- }
154
- }
155
-
156
- const styleProperties: Record<StylePreset["style"], StyleProperties> = {
157
- ghost: {
158
- background: {
159
- color: "transparent",
160
- },
161
- border: {
162
- width: "border-0",
163
- },
164
- color: `text-${variant}-900`,
165
- },
166
- plain: {
167
- background: {
168
- color: `bg-${variant}-600`,
169
- },
170
- border: {
171
- color: `border-${variant}-900`,
172
- style: "border-solid",
173
- width: "border",
174
- },
175
- shadow: "shadow-sm",
176
- color: variant === "neutral" ? "text-neutral-800" : `text-${variant}-50`,
177
- },
178
- plain2: {
179
- background: {
180
- color: `bg-${variant}-400`,
181
- },
182
- border: {
183
- color: `border-${variant}-700`,
184
- style: "border-solid",
185
- width: "border",
186
- },
187
- shadow: "shadow-sm",
188
- color: variant === "neutral" ? "text-neutral-800" : `text-${variant}-900`,
189
- },
190
- plain3: {
191
- background: {
192
- color: `bg-${variant}-200`,
193
- },
194
- border: {
195
- color: `border-${variant}-500`,
196
- style: "border-solid",
197
- width: "border",
198
- },
199
- shadow: "shadow-sm",
200
- color: variant === "neutral" ? "text-neutral-800" : `text-${variant}-900`,
201
- },
202
- callout: {
203
- background: {
204
- color: `bg-${variant}-100`,
205
- },
206
- border: {
207
- color: `border-${variant}-400`,
208
- style: "border-solid",
209
- width: "border",
210
- },
211
- color: `text-${variant}-900`,
212
- },
213
- elevated: {
214
- background: {
215
- color: `bg-${variant}-100`,
216
- },
217
- shadow: "shadow-lg",
218
- color: `text-${variant}-900`,
219
- },
220
- glass: {
221
- background: {
222
- color: `bg-${variant}-50`,
223
- },
224
- border: {
225
- color: variantColors[variant].border,
226
- style: "border-solid",
227
- width: "border",
228
- },
229
- shadow: "shadow-sm",
230
- color: `text-${variant}-900`,
231
- },
232
- modern: {
233
- background: {
234
- color: `bg-${variant}-100`,
235
- },
236
- border: {
237
- color: `border-${variant}-700`,
238
- style: "border-solid",
239
- width: "border",
240
- },
241
- color: `text-${variant}-900`,
242
- },
243
- modern2: {
244
- background: {
245
- color: `bg-${variant}-300`,
246
- },
247
- border: {
248
- color: `border-${variant}-700`,
249
- style: "border-solid",
250
- width: "border",
251
- },
252
- color: `text-${variant}-900`,
253
- },
254
- soft: {
255
- background: {
256
- color: `bg-${variant}-50`,
257
- },
258
- border: {
259
- color: `border-${variant}-300`,
260
- style: "border-solid",
261
- width: "border",
262
- },
263
- color: `text-${variant}-800`,
264
- },
265
- gradient: {
266
- background: {
267
- color: `bg-gradient-to-tr from-${variant}-200 to-${variant}-50`,
268
- },
269
- border: {
270
- color: `border-${variant}-200`,
271
- style: "border-solid",
272
- width: "border",
273
- },
274
- color: "text-neutral-900",
275
- },
276
- gradient2: {
277
- background: {
278
- color: `bg-gradient-to-tr from-${variant}-200 ${variant === "neutral" ? "to-neutral-100" : `to-${getOtherVariantColor(variant)}-200`}`,
279
- },
280
- border: {
281
- color: `border-${variant}-200`,
282
- style: "border-solid",
283
- width: "border",
284
- },
285
- color: "text-neutral-900",
286
- },
287
- gradient3: {
288
- background: {
289
- color: `bg-gradient-to-tr from-${variant}-200 ${variant === "neutral" ? "to-neutral-100" : `to-${getOtherVariantColor(variant, true)}-200`}`,
290
- },
291
- border: {
292
- color: `border-${variant}-200`,
293
- style: "border-solid",
294
- width: "border",
295
- },
296
- color: "text-neutral-900",
297
- },
298
- gradient4: {
299
- background: {
300
- color: `bg-gradient-to-tr from-${variant}-400 to-${variant}-100`,
301
- },
302
- border: {
303
- color: `border-${variant}-200`,
304
- style: "border-solid",
305
- width: "border",
306
- },
307
- color: "text-neutral-900",
308
- },
309
- gradient5: {
310
- background: {
311
- color: `bg-gradient-to-tr from-${variant}-400 ${variant === "neutral" ? "to-neutral-200" : `to-${getOtherVariantColor(variant)}-400`}`,
312
- },
313
- border: {
314
- color: `border-${variant}-200`,
315
- style: "border-solid",
316
- width: "border",
317
- },
318
- color: "text-neutral-900",
319
- },
320
- gradient6: {
321
- background: {
322
- color: `bg-gradient-to-tr from-${variant}-400 ${variant === "neutral" ? "to-neutral-200" : `to-${getOtherVariantColor(variant, true)}-400`}`,
323
- },
324
- border: {
325
- color: `border-${variant}-200`,
326
- style: "border-solid",
327
- width: "border",
328
- },
329
- color: "text-neutral-900",
330
- },
331
- paper: {
332
- background: {
333
- color: `bg-${variant}-50`,
334
- },
335
- color: `text-${variant}-800`,
336
- shadow: "shadow-md",
337
- },
338
- outlined: {
339
- background: {
340
- color: "bg-transparent",
341
- },
342
- border: {
343
- color: `border-${variant}-600`,
344
- style: "border-solid",
345
- width: "border-2",
346
- },
347
- color: `text-${variant}-800`,
348
- },
349
- };
350
-
351
- return styleProperties[style];
352
- }
@@ -1,59 +0,0 @@
1
- import { type SchemaOptions, Type, type Static } from "@sinclair/typebox";
2
- import { optional, prop } from "./helpers";
3
- import { typedRef } from "~/shared/utils/typed-ref";
4
-
5
- type AlignBasicOptions = {
6
- title?: string;
7
- defaultValue?: {
8
- horizontal: string;
9
- vertical: string;
10
- };
11
- };
12
-
13
- export function basicAlign(opts: AlignBasicOptions = {}) {
14
- const { title = "Align", defaultValue = { horizontal: "justify-start", vertical: "items-center" } } = opts;
15
- return prop({
16
- title,
17
- schema: Type.Object(
18
- {
19
- horizontal: optional(
20
- Type.Union(
21
- [
22
- Type.Literal("justify-start", { title: "Left" }),
23
- Type.Literal("justify-center", { title: "Center" }),
24
- Type.Literal("justify-end", { title: "Right" }),
25
- ],
26
- {
27
- title: "Horizontal",
28
- },
29
- ),
30
- ),
31
- vertical: optional(
32
- Type.Union(
33
- [
34
- Type.Literal("items-start", { title: "Top" }),
35
- Type.Literal("items-center", { title: "Center" }),
36
- Type.Literal("items-end", { title: "Bottom" }),
37
- ],
38
- {
39
- title: "Vertical",
40
- },
41
- ),
42
- ),
43
- },
44
- {
45
- $id: "styles:basicAlign",
46
- "ui:responsive": true,
47
- "ui:field": "align-basic",
48
- "ui:styleId": "#styles:basicAlign",
49
- default: defaultValue,
50
- },
51
- ),
52
- });
53
- }
54
-
55
- export type AlignBasicSettings = Static<ReturnType<typeof basicAlign>>;
56
-
57
- export function basicAlignRef(options: SchemaOptions = {}) {
58
- return typedRef("styles:basicAlign", options);
59
- }
@@ -1,118 +0,0 @@
1
- import { type SchemaOptions, Type, type Static } from "@sinclair/typebox";
2
- import { prop } from "./helpers";
3
- import type { ElementColorType } from "~/shared/themes/color-system";
4
- import { typedRef } from "~/shared/utils/typed-ref";
5
-
6
- type BackgroundOptions = {
7
- title?: string;
8
- defaultValue?: {
9
- color?: string;
10
- image?: string;
11
- size?: string;
12
- repeat?: string;
13
- };
14
- colorType?: ElementColorType;
15
- };
16
-
17
- export function background(opts: BackgroundOptions = {}) {
18
- const { title = "Background", defaultValue, colorType = "background" } = opts;
19
- return prop({
20
- title,
21
- schema: Type.Object(
22
- {
23
- color: Type.Optional(
24
- Type.String({
25
- default: defaultValue?.color,
26
- title: "Color",
27
- description:
28
- "Use `bg-<variant>-<shade>`, variants being 'primary', 'secondary', 'accent' and 'neutral', and shades between 50 and 900. Can also be a gradient using 'bg-gradient-to-<direction> from-<color> to-<color>'",
29
- examples: ["bg-primary", "bg-base-100", "bg-primary-50", "bg-primary-500", "bg-accent-900"],
30
- }),
31
- ),
32
- image: Type.Optional(
33
- Type.String({
34
- title: "Image",
35
- description: "The background image. Can be a URL or a data URI",
36
- examples: [
37
- "https://example.com/image.png",
38
- "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA...",
39
- ],
40
- }),
41
- ),
42
- size: Type.Optional(
43
- Type.Union(
44
- [
45
- Type.Literal("auto", { title: "Auto" }),
46
- Type.Literal("cover", { title: "Cover" }),
47
- Type.Literal("contain", { title: "Contain" }),
48
- ],
49
- {
50
- default: defaultValue?.size ?? "auto",
51
- "ai:instructions": "Only use this when the image is set.",
52
- },
53
- ),
54
- ),
55
- repeat: Type.Optional(
56
- Type.Union(
57
- [
58
- Type.Literal("no-repeat", { title: "No repeat" }),
59
- Type.Literal("repeat", { title: "Repeat" }),
60
- Type.Literal("repeat-x", { title: "Repeat horizontally" }),
61
- Type.Literal("repeat-y", { title: "Repeat vertically" }),
62
- Type.Literal("space", { title: "Space" }),
63
- Type.Literal("round", { title: "Round" }),
64
- ],
65
- {
66
- default: defaultValue?.repeat ?? "no-repeat",
67
- "ai:instructions": "Only use this when the image is set.",
68
- },
69
- ),
70
- ),
71
- },
72
- {
73
- $id: "styles:background",
74
- "ui:styleId": "#styles:background",
75
- "ui:field": "background",
76
- "ui:group": "background",
77
- "ui:group:title": "Background",
78
- "ui:color-type": colorType,
79
- // disable for now
80
- // "ui:show-img-search": true,
81
- default: defaultValue
82
- ? {
83
- color: defaultValue.color,
84
- size: defaultValue.size,
85
- repeat: defaultValue.repeat,
86
- }
87
- : undefined,
88
- },
89
- ),
90
- });
91
- }
92
-
93
- export type BackgroundSettings = Static<ReturnType<typeof background>>;
94
-
95
- export function backgroundRef(options: SchemaOptions = {}) {
96
- return typedRef("styles:background", options);
97
- }
98
-
99
- export function backgroundColor(defaultValue?: string, title = "Background color") {
100
- return prop({
101
- title,
102
- schema: Type.String({
103
- $id: "styles:backgroundColor",
104
- "ai:instructions":
105
- "Can be set to transparent, hex/rgb/rgba color, or classes like `bg-<variant>-<shade>`, variants being primary, secondary, accent and neutral, and shades between 100 and 900. Use bg-<variant>-<shade> classes as much as possible.",
106
- default: defaultValue,
107
- "ui:field": "color",
108
- "ui:color-type": "background",
109
- "ui:styleId": "#styles:backgroundColor",
110
- }),
111
- });
112
- }
113
-
114
- export type BackgroundColorSettings = Static<ReturnType<typeof backgroundColor>>;
115
-
116
- export function backgroundColorRef(options: SchemaOptions = {}) {
117
- return typedRef("styles:backgroundColor", { ...options, "ui:styleId": "#styles:backgroundColor" });
118
- }
@@ -1,11 +0,0 @@
1
- import { Type } from "@sinclair/typebox";
2
- import { prop } from "./helpers";
3
-
4
- type BooleanOptions = Record<string, unknown>;
5
-
6
- export function boolean(title: string, defaultValue?: boolean, options: BooleanOptions = {}) {
7
- return prop({
8
- title,
9
- schema: Type.Boolean({ default: defaultValue ?? false, ...options }),
10
- });
11
- }
@@ -1,84 +0,0 @@
1
- import { Type, type Static } from "@sinclair/typebox";
2
- import { group, optional, prop } from "./helpers";
3
- import { StringEnum } from "~/shared/utils/schema";
4
- import { typedRef } from "~/shared/utils/typed-ref";
5
-
6
- export function border(title = "Border") {
7
- return group({
8
- title,
9
- options: {
10
- "ui:styleId": "#styles:border",
11
- $id: "styles:border",
12
- },
13
- children: {
14
- rounding: optional(
15
- StringEnum(
16
- [
17
- "rounded-auto",
18
- "rounded-none",
19
- "rounded-sm",
20
- "rounded-md",
21
- "rounded-lg",
22
- "rounded-xl",
23
- "rounded-2xl",
24
- "rounded-3xl",
25
- "rounded-full",
26
- ],
27
- {
28
- title: "Corner rounding",
29
- enumNames: ["Auto", "None", "Small", "Medium", "Large", "Extra large", "2xl", "3xl", "Full"],
30
- "ui:placeholder": "Not specified",
31
- "ui:field": "enum",
32
- "ui:display": "select",
33
- },
34
- ),
35
- ),
36
- width: optional(
37
- StringEnum(["border-0", "border", "border-2", "border-4", "border-8"], {
38
- title: "Width",
39
- enumNames: ["None", "S", "M", "L", "XL"],
40
- "ai:instructions": "Don't specify width if you want no border.",
41
- "ui:field": "enum",
42
- "ui:placeholder": "None",
43
- }),
44
- ),
45
- color: Type.Optional(
46
- Type.String({
47
- // default: defaultValue?.color,
48
- title: "Color",
49
- "ai:instructions":
50
- "Can be set to transparent, hex/rgb/rgba color, or classes like `border-<variant>-<shade>`, variants being primary, secondary, accent and neutral, and shades between 50 and 900",
51
- "ui:field": "color",
52
- "ui:color-type": "border",
53
- }),
54
- ),
55
- sides: Type.Optional(
56
- Type.Array(
57
- StringEnum(["border-l", "border-t", "border-r", "border-b"], {
58
- title: "Sides",
59
- enumNames: ["Left", "Top", "Right", "Bottom"],
60
- description:
61
- "The specific sides where to apply the border. Not specifying sides will apply the border to all sides.",
62
- "ui:field": "border-side",
63
- "ai:instructions":
64
- "Use this to apply the border to specific sides. Not specifying sides will apply the border to all sides.",
65
- }),
66
- ),
67
- ),
68
- style: optional(
69
- StringEnum(["border-solid", "border-dashed", "border-dotted"], {
70
- title: "Style",
71
- description: "The brick border style",
72
- enumNames: ["Solid", "Dashed", "Dotted"],
73
- "ai:instructions": "Use only when width is different than border-0.",
74
- "ui:field": "enum",
75
- "ui:display": "button-group",
76
- }),
77
- ),
78
- },
79
- });
80
- }
81
-
82
- export const borderRef = typedRef("styles:border", { "ui:styleId": "#styles:border" });
83
-
84
- export type BorderSettings = Static<ReturnType<typeof border>>;
@@ -1,24 +0,0 @@
1
- import { type SchemaOptions, type Static, Type } from "@sinclair/typebox";
2
- import { prop } from "./helpers";
3
- import { typedRef } from "~/shared/utils/typed-ref";
4
-
5
- export function color(defaultValue?: string, title = "Text color") {
6
- return prop({
7
- title,
8
- schema: Type.String({
9
- $id: "styles:color",
10
- "ai:instructions":
11
- "hex/rgb/rgba color or classes like `text-<variant>-<shade>`, variants being `primary`, `secondary`, `accent` and `neutral`, and shades between 50 and 900",
12
- default: defaultValue,
13
- "ui:styleId": "#styles:color",
14
- "ui:field": "color",
15
- "ui:color-type": "text",
16
- }),
17
- });
18
- }
19
-
20
- export type ColorSettings = Static<ReturnType<typeof color>>;
21
-
22
- export function colorRef(options: SchemaOptions = {}) {
23
- return typedRef("styles:color", { ...options, "ui:styleId": "#styles:color" });
24
- }
@@ -1,37 +0,0 @@
1
- import { Type } from "@sinclair/typebox";
2
- import { preset, presetRef } from "./preset";
3
- import { typedRef } from "~/shared/utils/typed-ref";
4
-
5
- export function hidden() {
6
- return Type.Object(
7
- {
8
- desktop: Type.Boolean(),
9
- mobile: Type.Boolean(),
10
- },
11
- {
12
- $id: "styles:hidden",
13
- title: "Hidden",
14
- description: "Used to hide the brick on desktop or mobile.",
15
- "ui:field": "hidden",
16
- },
17
- );
18
- }
19
-
20
- export const commonProps = {
21
- lastTouched: Type.Optional(
22
- Type.Number({
23
- default: 0,
24
- "ui:field": "hidden",
25
- "ai:hidden": true,
26
- }),
27
- ),
28
- hidden: Type.Optional(typedRef("styles:hidden")),
29
- editable: Type.Optional(
30
- Type.Boolean({
31
- description: "Do not use. It is used internally by the editor.",
32
- "ui:field": "hidden",
33
- "ai:hidden": true,
34
- }),
35
- ),
36
- preset: Type.Optional(presetRef),
37
- };