@upstart.gg/sdk 0.0.137 → 0.0.138

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 (232) hide show
  1. package/dist/shared/ai/schemas.js +2 -2
  2. package/dist/shared/ai/schemas.js.map +1 -1
  3. package/dist/shared/ai/types.d.ts +2 -2
  4. package/dist/shared/ai/types.d.ts.map +1 -1
  5. package/dist/shared/ajv.js +26 -25
  6. package/dist/shared/ajv.js.map +1 -1
  7. package/dist/shared/attributes.d.ts +8 -0
  8. package/dist/shared/attributes.d.ts.map +1 -1
  9. package/dist/shared/attributes.js +15 -14
  10. package/dist/shared/brick-manifest.js +2 -2
  11. package/dist/shared/bricks/manifests/accordion.manifest.js +8 -7
  12. package/dist/shared/bricks/manifests/all-manifests.js +38 -37
  13. package/dist/shared/bricks/manifests/all-props.d.ts +32 -22
  14. package/dist/shared/bricks/manifests/all-props.d.ts.map +1 -1
  15. package/dist/shared/bricks/manifests/all-props.js +40 -39
  16. package/dist/shared/bricks/manifests/all-props.js.map +1 -1
  17. package/dist/shared/bricks/manifests/box.manifest.js +11 -10
  18. package/dist/shared/bricks/manifests/button.manifest.js +10 -9
  19. package/dist/shared/bricks/manifests/card.manifest.d.ts +2 -0
  20. package/dist/shared/bricks/manifests/card.manifest.d.ts.map +1 -1
  21. package/dist/shared/bricks/manifests/card.manifest.js +13 -12
  22. package/dist/shared/bricks/manifests/carousel.manifest.d.ts +1 -0
  23. package/dist/shared/bricks/manifests/carousel.manifest.d.ts.map +1 -1
  24. package/dist/shared/bricks/manifests/carousel.manifest.js +11 -10
  25. package/dist/shared/bricks/manifests/footer.manifest.d.ts +2 -0
  26. package/dist/shared/bricks/manifests/footer.manifest.d.ts.map +1 -1
  27. package/dist/shared/bricks/manifests/footer.manifest.js +9 -8
  28. package/dist/shared/bricks/manifests/form.manifest.js +9 -8
  29. package/dist/shared/bricks/manifests/hero.manifest.d.ts +2 -4
  30. package/dist/shared/bricks/manifests/hero.manifest.d.ts.map +1 -1
  31. package/dist/shared/bricks/manifests/hero.manifest.js +10 -9
  32. package/dist/shared/bricks/manifests/html.manifest.d.ts +1 -0
  33. package/dist/shared/bricks/manifests/html.manifest.d.ts.map +1 -1
  34. package/dist/shared/bricks/manifests/html.manifest.js +6 -5
  35. package/dist/shared/bricks/manifests/icon.manifest.d.ts.map +1 -1
  36. package/dist/shared/bricks/manifests/icon.manifest.js +9 -8
  37. package/dist/shared/bricks/manifests/image.manifest.d.ts +1 -0
  38. package/dist/shared/bricks/manifests/image.manifest.d.ts.map +1 -1
  39. package/dist/shared/bricks/manifests/image.manifest.js +12 -11
  40. package/dist/shared/bricks/manifests/images-gallery.manifest.d.ts +2 -0
  41. package/dist/shared/bricks/manifests/images-gallery.manifest.d.ts.map +1 -1
  42. package/dist/shared/bricks/manifests/images-gallery.manifest.js +11 -10
  43. package/dist/shared/bricks/manifests/map.manifest.d.ts +1 -0
  44. package/dist/shared/bricks/manifests/map.manifest.d.ts.map +1 -1
  45. package/dist/shared/bricks/manifests/map.manifest.js +9 -8
  46. package/dist/shared/bricks/manifests/navbar.manifest.d.ts +2 -0
  47. package/dist/shared/bricks/manifests/navbar.manifest.d.ts.map +1 -1
  48. package/dist/shared/bricks/manifests/navbar.manifest.js +11 -10
  49. package/dist/shared/bricks/manifests/sidebar.manifest.d.ts.map +1 -1
  50. package/dist/shared/bricks/manifests/sidebar.manifest.js +11 -10
  51. package/dist/shared/bricks/manifests/social-links.manifest.d.ts.map +1 -1
  52. package/dist/shared/bricks/manifests/social-links.manifest.js +10 -9
  53. package/dist/shared/bricks/manifests/spacer.manifest.d.ts.map +1 -1
  54. package/dist/shared/bricks/manifests/spacer.manifest.js +6 -5
  55. package/dist/shared/bricks/manifests/table.manifest.d.ts +1 -0
  56. package/dist/shared/bricks/manifests/table.manifest.d.ts.map +1 -1
  57. package/dist/shared/bricks/manifests/table.manifest.js +10 -9
  58. package/dist/shared/bricks/manifests/tabs.manifest.d.ts +1 -1
  59. package/dist/shared/bricks/manifests/tabs.manifest.d.ts.map +1 -1
  60. package/dist/shared/bricks/manifests/tabs.manifest.js +11 -10
  61. package/dist/shared/bricks/manifests/testimonials.manifest.d.ts +3 -1
  62. package/dist/shared/bricks/manifests/testimonials.manifest.d.ts.map +1 -1
  63. package/dist/shared/bricks/manifests/testimonials.manifest.js +13 -12
  64. package/dist/shared/bricks/manifests/text.manifest.d.ts +2 -5
  65. package/dist/shared/bricks/manifests/text.manifest.d.ts.map +1 -1
  66. package/dist/shared/bricks/manifests/text.manifest.js +10 -9
  67. package/dist/shared/bricks/manifests/timeline.manifest.js +11 -10
  68. package/dist/shared/bricks/manifests/video.manifest.js +9 -8
  69. package/dist/shared/bricks/props/background.d.ts.map +1 -1
  70. package/dist/shared/bricks/props/background.js +1 -1
  71. package/dist/shared/bricks/props/border.js +2 -2
  72. package/dist/shared/bricks/props/color.d.ts.map +1 -1
  73. package/dist/shared/bricks/props/color.js +1 -1
  74. package/dist/shared/bricks/props/common.d.ts.map +1 -1
  75. package/dist/shared/bricks/props/common.js +2 -1
  76. package/dist/shared/bricks/props/grow.d.ts +3 -0
  77. package/dist/shared/bricks/props/grow.d.ts.map +1 -0
  78. package/dist/shared/bricks/props/grow.js +10 -0
  79. package/dist/shared/bricks/props/grow.js.map +1 -0
  80. package/dist/shared/bricks/props/helpers.js +3 -2
  81. package/dist/shared/bricks/props/image.d.ts +1 -0
  82. package/dist/shared/bricks/props/image.d.ts.map +1 -1
  83. package/dist/shared/bricks/props/image.js +1 -1
  84. package/dist/shared/bricks/props/string.d.ts.map +1 -1
  85. package/dist/shared/bricks/props/string.js +1 -1
  86. package/dist/shared/bricks.d.ts +18 -17
  87. package/dist/shared/bricks.d.ts.map +1 -1
  88. package/dist/shared/bricks.js +39 -38
  89. package/dist/shared/chunk-2EOCK66Z.js +19 -0
  90. package/dist/shared/chunk-2EOCK66Z.js.map +1 -0
  91. package/dist/shared/{chunk-XXPSM6UA.js → chunk-2UEPTT5J.js} +5 -9
  92. package/dist/shared/chunk-2UEPTT5J.js.map +1 -0
  93. package/dist/shared/{chunk-DRQKKPTX.js → chunk-2Z5WOCFS.js} +41 -1
  94. package/dist/shared/chunk-2Z5WOCFS.js.map +1 -0
  95. package/dist/shared/{chunk-7U5WPHXB.js → chunk-34IUWNRX.js} +7 -7
  96. package/dist/shared/chunk-57NRTXRA.js +309 -0
  97. package/dist/shared/chunk-57NRTXRA.js.map +1 -0
  98. package/dist/shared/{chunk-T6C3NG2L.js → chunk-5HJT5NJ3.js} +8 -8
  99. package/dist/shared/{chunk-BZTWZC77.js → chunk-5J4Y43RM.js} +37 -179
  100. package/dist/shared/chunk-5J4Y43RM.js.map +1 -0
  101. package/dist/shared/{chunk-KKWT3OXF.js → chunk-5OVOXUFX.js} +3 -2
  102. package/dist/shared/{chunk-KKWT3OXF.js.map → chunk-5OVOXUFX.js.map} +1 -1
  103. package/dist/shared/{chunk-XK2CERPB.js → chunk-5SNSUC6Q.js} +7 -7
  104. package/dist/shared/{chunk-JLDAS3VE.js → chunk-B5T2LFV2.js} +10 -14
  105. package/dist/shared/chunk-B5T2LFV2.js.map +1 -0
  106. package/dist/shared/{chunk-PF75LW33.js → chunk-E3ZW57HF.js} +18 -9
  107. package/dist/shared/chunk-E3ZW57HF.js.map +1 -0
  108. package/dist/shared/{chunk-JSDKK5QN.js → chunk-EUFVTHAG.js} +5 -3
  109. package/dist/shared/chunk-EUFVTHAG.js.map +1 -0
  110. package/dist/shared/{chunk-U4KZUX37.js → chunk-FC52EHCC.js} +8 -8
  111. package/dist/shared/chunk-FC52EHCC.js.map +1 -0
  112. package/dist/shared/{chunk-JW7MQAU4.js → chunk-FVV27R73.js} +9 -94
  113. package/dist/shared/chunk-FVV27R73.js.map +1 -0
  114. package/dist/shared/{chunk-SQXZNGQF.js → chunk-FYGFB5U5.js} +3 -1
  115. package/dist/shared/chunk-FYGFB5U5.js.map +1 -0
  116. package/dist/shared/{chunk-J45LSQT6.js → chunk-GNTJT7MR.js} +2 -2
  117. package/dist/shared/chunk-HHUFGV7J.js +259 -0
  118. package/dist/shared/chunk-HHUFGV7J.js.map +1 -0
  119. package/dist/shared/{chunk-W2RFDII5.js → chunk-IMDOF55E.js} +12 -4
  120. package/dist/shared/chunk-IMDOF55E.js.map +1 -0
  121. package/dist/shared/{chunk-KQH6V22E.js → chunk-IPWYNE6Y.js} +25 -25
  122. package/dist/shared/{chunk-H6TMBELF.js → chunk-J6R3GSKS.js} +46 -34
  123. package/dist/shared/chunk-J6R3GSKS.js.map +1 -0
  124. package/dist/shared/{chunk-TBT2PTGB.js → chunk-KRODRZNS.js} +9 -9
  125. package/dist/shared/chunk-KTA7XES3.js +168 -0
  126. package/dist/shared/chunk-KTA7XES3.js.map +1 -0
  127. package/dist/shared/{chunk-SK2O7GFC.js → chunk-L4W4B2RQ.js} +15 -70
  128. package/dist/shared/chunk-L4W4B2RQ.js.map +1 -0
  129. package/dist/shared/{chunk-MYOLWTB2.js → chunk-NTP6BKRU.js} +9 -9
  130. package/dist/shared/chunk-NTP6BKRU.js.map +1 -0
  131. package/dist/shared/{chunk-JF52BBFD.js → chunk-O53V22BK.js} +18 -10
  132. package/dist/shared/chunk-O53V22BK.js.map +1 -0
  133. package/dist/shared/{chunk-ZVJNRKT4.js → chunk-ORIUCOED.js} +7 -7
  134. package/dist/shared/{chunk-LGDDJJHK.js → chunk-PFZMRSHJ.js} +11 -11
  135. package/dist/shared/{chunk-6AE7UD73.js → chunk-QHKOAIOK.js} +31 -60
  136. package/dist/shared/chunk-QHKOAIOK.js.map +1 -0
  137. package/dist/shared/{chunk-LPAQ47C6.js → chunk-RDOCVLCF.js} +11 -11
  138. package/dist/shared/{chunk-VSLRTXLF.js → chunk-RFH7PEVS.js} +5 -4
  139. package/dist/shared/chunk-RFH7PEVS.js.map +1 -0
  140. package/dist/shared/{chunk-XNRSL6FL.js → chunk-T3UPW5OW.js} +5 -4
  141. package/dist/shared/{chunk-XNRSL6FL.js.map → chunk-T3UPW5OW.js.map} +1 -1
  142. package/dist/shared/{chunk-FUUSAMN3.js → chunk-TGKNA2JS.js} +8 -8
  143. package/dist/shared/{chunk-HY7JOP3J.js → chunk-TZ6X7ZM5.js} +19 -11
  144. package/dist/shared/chunk-TZ6X7ZM5.js.map +1 -0
  145. package/dist/shared/{chunk-VTCHJT4O.js → chunk-UC75KRLX.js} +2 -2
  146. package/dist/shared/{chunk-4KY7OZWD.js → chunk-VMIJ6MG5.js} +13 -13
  147. package/dist/shared/{chunk-SRYBJ6NQ.js → chunk-VYA2FCTY.js} +2 -2
  148. package/dist/shared/{chunk-LGGPCCCY.js → chunk-XYWSIMZ6.js} +3 -3
  149. package/dist/shared/chunk-XYWSIMZ6.js.map +1 -0
  150. package/dist/shared/{chunk-FHA4DFIM.js → chunk-ZYQZUWF7.js} +10 -10
  151. package/dist/shared/{chunk-2O5HVPID.js → chunk-ZZVYD4BG.js} +3 -3
  152. package/dist/shared/context.d.ts +4 -0
  153. package/dist/shared/context.d.ts.map +1 -1
  154. package/dist/shared/context.js +43 -42
  155. package/dist/shared/context.js.map +1 -1
  156. package/dist/shared/page.d.ts +2 -0
  157. package/dist/shared/page.d.ts.map +1 -1
  158. package/dist/shared/page.js +41 -40
  159. package/dist/shared/site.d.ts +7 -0
  160. package/dist/shared/site.d.ts.map +1 -1
  161. package/dist/shared/site.js +43 -42
  162. package/dist/shared/sitemap.js +42 -41
  163. package/dist/shared/utils/schema.d.ts +0 -5
  164. package/dist/shared/utils/schema.d.ts.map +1 -1
  165. package/dist/shared/utils/schema.js +1 -3
  166. package/package.json +2 -2
  167. package/src/shared/ai/schemas.ts +1 -1
  168. package/src/shared/ai/types.ts +2 -2
  169. package/src/shared/bricks/manifests/card.manifest.ts +25 -168
  170. package/src/shared/bricks/manifests/hero.manifest.ts +44 -249
  171. package/src/shared/bricks/manifests/html.manifest.ts +6 -0
  172. package/src/shared/bricks/manifests/icon.manifest.ts +1 -89
  173. package/src/shared/bricks/manifests/image.manifest.ts +0 -4
  174. package/src/shared/bricks/manifests/images-gallery.manifest.ts +8 -0
  175. package/src/shared/bricks/manifests/map.manifest.ts +9 -65
  176. package/src/shared/bricks/manifests/sidebar.manifest.ts +0 -1
  177. package/src/shared/bricks/manifests/social-links.manifest.ts +0 -1
  178. package/src/shared/bricks/manifests/spacer.manifest.ts +0 -1
  179. package/src/shared/bricks/manifests/table.manifest.ts +6 -0
  180. package/src/shared/bricks/manifests/tabs.manifest.ts +12 -429
  181. package/src/shared/bricks/manifests/testimonials.manifest.ts +28 -226
  182. package/src/shared/bricks/manifests/text.manifest.ts +16 -44
  183. package/src/shared/bricks/props/background.ts +2 -1
  184. package/src/shared/bricks/props/color.ts +5 -2
  185. package/src/shared/bricks/props/common.ts +2 -8
  186. package/src/shared/bricks/props/grow.ts +11 -0
  187. package/src/shared/bricks/props/image.ts +40 -0
  188. package/src/shared/bricks/props/string.ts +2 -0
  189. package/src/shared/bricks.ts +33 -23
  190. package/src/shared/page.ts +1 -0
  191. package/src/shared/site.ts +1 -0
  192. package/src/shared/utils/schema.ts +28 -18
  193. package/src/shared/utils/tests/schema.test.ts +211 -4
  194. package/dist/shared/chunk-6AE7UD73.js.map +0 -1
  195. package/dist/shared/chunk-BZTWZC77.js.map +0 -1
  196. package/dist/shared/chunk-DRQKKPTX.js.map +0 -1
  197. package/dist/shared/chunk-H6TMBELF.js.map +0 -1
  198. package/dist/shared/chunk-HUWMIXNN.js +0 -570
  199. package/dist/shared/chunk-HUWMIXNN.js.map +0 -1
  200. package/dist/shared/chunk-HY7JOP3J.js.map +0 -1
  201. package/dist/shared/chunk-JF52BBFD.js.map +0 -1
  202. package/dist/shared/chunk-JLDAS3VE.js.map +0 -1
  203. package/dist/shared/chunk-JSDKK5QN.js.map +0 -1
  204. package/dist/shared/chunk-JW7MQAU4.js.map +0 -1
  205. package/dist/shared/chunk-LGGPCCCY.js.map +0 -1
  206. package/dist/shared/chunk-MYOLWTB2.js.map +0 -1
  207. package/dist/shared/chunk-O24RDXZS.js +0 -505
  208. package/dist/shared/chunk-O24RDXZS.js.map +0 -1
  209. package/dist/shared/chunk-PF75LW33.js.map +0 -1
  210. package/dist/shared/chunk-QEJGPYTB.js +0 -462
  211. package/dist/shared/chunk-QEJGPYTB.js.map +0 -1
  212. package/dist/shared/chunk-SK2O7GFC.js.map +0 -1
  213. package/dist/shared/chunk-SQXZNGQF.js.map +0 -1
  214. package/dist/shared/chunk-U4KZUX37.js.map +0 -1
  215. package/dist/shared/chunk-VSLRTXLF.js.map +0 -1
  216. package/dist/shared/chunk-W2RFDII5.js.map +0 -1
  217. package/dist/shared/chunk-XXPSM6UA.js.map +0 -1
  218. /package/dist/shared/{chunk-7U5WPHXB.js.map → chunk-34IUWNRX.js.map} +0 -0
  219. /package/dist/shared/{chunk-T6C3NG2L.js.map → chunk-5HJT5NJ3.js.map} +0 -0
  220. /package/dist/shared/{chunk-XK2CERPB.js.map → chunk-5SNSUC6Q.js.map} +0 -0
  221. /package/dist/shared/{chunk-J45LSQT6.js.map → chunk-GNTJT7MR.js.map} +0 -0
  222. /package/dist/shared/{chunk-KQH6V22E.js.map → chunk-IPWYNE6Y.js.map} +0 -0
  223. /package/dist/shared/{chunk-TBT2PTGB.js.map → chunk-KRODRZNS.js.map} +0 -0
  224. /package/dist/shared/{chunk-ZVJNRKT4.js.map → chunk-ORIUCOED.js.map} +0 -0
  225. /package/dist/shared/{chunk-LGDDJJHK.js.map → chunk-PFZMRSHJ.js.map} +0 -0
  226. /package/dist/shared/{chunk-LPAQ47C6.js.map → chunk-RDOCVLCF.js.map} +0 -0
  227. /package/dist/shared/{chunk-FUUSAMN3.js.map → chunk-TGKNA2JS.js.map} +0 -0
  228. /package/dist/shared/{chunk-VTCHJT4O.js.map → chunk-UC75KRLX.js.map} +0 -0
  229. /package/dist/shared/{chunk-4KY7OZWD.js.map → chunk-VMIJ6MG5.js.map} +0 -0
  230. /package/dist/shared/{chunk-SRYBJ6NQ.js.map → chunk-VYA2FCTY.js.map} +0 -0
  231. /package/dist/shared/{chunk-FHA4DFIM.js.map → chunk-ZYQZUWF7.js.map} +0 -0
  232. /package/dist/shared/{chunk-2O5HVPID.js.map → chunk-ZZVYD4BG.js.map} +0 -0
@@ -1,570 +0,0 @@
1
- /*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
2
-
3
- import {
4
- border,
5
- rounding
6
- } from "./chunk-SRYBJ6NQ.js";
7
- import {
8
- defineProps
9
- } from "./chunk-VTCHJT4O.js";
10
- import {
11
- cssLength
12
- } from "./chunk-OJ6KL7FU.js";
13
- import {
14
- loop
15
- } from "./chunk-XFZQGRRL.js";
16
- import {
17
- shadow
18
- } from "./chunk-5RCC2STG.js";
19
- import {
20
- colorPreset
21
- } from "./chunk-IEMCCHM4.js";
22
- import {
23
- defineBrickManifest
24
- } from "./chunk-J45LSQT6.js";
25
- import {
26
- StringEnum
27
- } from "./chunk-GDYCCB3B.js";
28
-
29
- // src/shared/bricks/manifests/tabs.manifest.ts
30
- import { Type } from "@sinclair/typebox";
31
- import { HiOutlineViewColumns } from "react-icons/hi2";
32
- var tabRef = Type.Object({
33
- label: Type.String({
34
- title: "Tab Label",
35
- description: "The text shown on the tab button",
36
- "ai:instructions": "Use a short, descriptive label for the tab"
37
- }),
38
- id: Type.Optional(
39
- Type.String({
40
- title: "Tab ID",
41
- description: "Unique identifier for the tab (auto-generated if not provided)"
42
- })
43
- )
44
- });
45
- var manifest = defineBrickManifest({
46
- type: "tabs",
47
- category: "container",
48
- name: "Tabs",
49
- description: "A tabbed container that displays different content panels based on the selected tab.",
50
- aiInstructions: "Tabs are containers for organizing content into multiple panels. Each tab has a label and contains child bricks. Users can click tab buttons to switch between different content panels. Ideal for organizing related content, settings panels, or product information.",
51
- isContainer: true,
52
- defaultWidth: {
53
- desktop: "100%",
54
- mobile: "100%"
55
- },
56
- defaultHeight: {
57
- desktop: "auto"
58
- },
59
- icon: HiOutlineViewColumns,
60
- props: defineProps({
61
- colorPreset: Type.Optional(
62
- colorPreset({
63
- title: "Color"
64
- })
65
- ),
66
- tabs: Type.Array(tabRef, {
67
- title: "Tabs",
68
- description: "List of tab configurations",
69
- default: [{ label: "Tab 1" }, { label: "Tab 2" }],
70
- "ai:instructions": "Each tab should have a descriptive label. Content for each tab is defined in the $children array.",
71
- examples: [
72
- [{ label: "Overview" }, { label: "Features" }, { label: "Pricing" }],
73
- [{ label: "About" }, { label: "Services" }, { label: "Contact" }]
74
- ]
75
- }),
76
- defaultTab: Type.Optional(
77
- Type.Number({
78
- title: "Default Tab",
79
- description: "Index of the tab to show by default (0-based)",
80
- default: 0,
81
- minimum: 0,
82
- "ai:instructions": "Use 0 for the first tab, 1 for the second tab, etc."
83
- })
84
- ),
85
- tabPosition: Type.Optional(
86
- StringEnum(["top", "bottom"], {
87
- title: "Tab Position",
88
- description: "Position of the tab buttons relative to content",
89
- default: "top",
90
- "ai:instructions": "Use 'top' for tabs above content (most common) or 'bottom' for tabs below content"
91
- })
92
- ),
93
- tabStyle: Type.Optional(
94
- StringEnum(["pills", "underline", "bordered"], {
95
- title: "Tab Style",
96
- description: "Visual style of the tab buttons",
97
- default: "underline",
98
- "ai:instructions": "Pills are rounded buttons, underline shows a line under active tab, bordered shows tabs with borders"
99
- })
100
- ),
101
- fullWidth: Type.Optional(
102
- Type.Boolean({
103
- title: "Full Width Tabs",
104
- description: "Make tab buttons span the full width of the container",
105
- default: false,
106
- "ai:instructions": "Enable this to make tab buttons evenly distribute across the full width"
107
- })
108
- ),
109
- padding: Type.Optional(
110
- cssLength({
111
- default: "1.5rem",
112
- description: "Padding inside each tab panel.",
113
- "ai:instructions": "Use values like '1rem', '1.5rem', or '2rem' for tab content padding",
114
- title: "Content Padding",
115
- "ui:placeholder": "Not specified",
116
- "ui:styleId": "styles:padding"
117
- })
118
- ),
119
- gap: Type.Optional(
120
- cssLength({
121
- title: "Tab Gap",
122
- default: "0.5rem",
123
- description: "Gap between tab buttons.",
124
- "ai:instructions": "Small values like '0.25rem' or '0.5rem' work best for tab spacing",
125
- "ui:placeholder": "Not specified",
126
- "ui:styleId": "styles:gap"
127
- })
128
- ),
129
- rounding: rounding({
130
- default: "rounded-md"
131
- }),
132
- border: Type.Optional(border()),
133
- shadow: Type.Optional(shadow()),
134
- loop: Type.Optional(loop()),
135
- $children: Type.Array(Type.Array(Type.Any()), {
136
- "ui:field": "hidden",
137
- description: "Array of child brick arrays - each sub-array represents the content for one tab",
138
- default: [[], []],
139
- examples: [
140
- [
141
- // Tab 1 content
142
- [
143
- {
144
- type: "text",
145
- props: {
146
- content: "<h3>Overview</h3><p>This is the overview tab content.</p>"
147
- }
148
- }
149
- ],
150
- // Tab 2 content
151
- [
152
- {
153
- type: "text",
154
- props: {
155
- content: "<h3>Features</h3><p>Here are our key features.</p>"
156
- }
157
- },
158
- {
159
- type: "button",
160
- props: {
161
- text: "Learn More",
162
- link: "/features"
163
- }
164
- }
165
- ]
166
- ]
167
- ]
168
- })
169
- })
170
- });
171
- var examples = [
172
- {
173
- description: "Simple tabs with basic content in each panel",
174
- type: "tabs",
175
- props: {
176
- tabs: [{ label: "About" }, { label: "Services" }, { label: "Contact" }],
177
- defaultTab: 0,
178
- tabStyle: "underline",
179
- $children: [
180
- [
181
- {
182
- type: "text",
183
- props: {
184
- content: "<h3>About Us</h3><p>We are a company focused on delivering exceptional results.</p>"
185
- }
186
- }
187
- ],
188
- [
189
- {
190
- type: "text",
191
- props: {
192
- content: "<h3>Our Services</h3><p>We offer a wide range of professional services.</p>"
193
- }
194
- },
195
- {
196
- type: "button",
197
- props: {
198
- text: "View All Services",
199
- link: "/services"
200
- }
201
- }
202
- ],
203
- [
204
- {
205
- type: "text",
206
- props: {
207
- content: "<h3>Contact Information</h3><p>Email: hello@company.com</p><p>Phone: (555) 123-4567</p>"
208
- }
209
- }
210
- ]
211
- ]
212
- }
213
- },
214
- {
215
- description: "Product information tabs with pills style and custom styling",
216
- type: "tabs",
217
- props: {
218
- tabs: [{ label: "Overview" }, { label: "Specifications" }, { label: "Reviews" }, { label: "Support" }],
219
- defaultTab: 0,
220
- tabStyle: "pills",
221
- fullWidth: true,
222
- colorPreset: {
223
- color: "primary-50"
224
- },
225
- border: {
226
- width: "border",
227
- color: "border-primary-200"
228
- },
229
- rounding: "rounded-lg",
230
- padding: "2rem",
231
- $children: [
232
- [
233
- {
234
- type: "text",
235
- props: {
236
- content: "<h3>Product Overview</h3><p>This product revolutionizes the way you work.</p>"
237
- }
238
- },
239
- {
240
- type: "image",
241
- props: {
242
- src: "https://via.placeholder.com/400x200",
243
- alt: "Product image"
244
- }
245
- }
246
- ],
247
- [
248
- {
249
- type: "text",
250
- props: {
251
- content: '<h3>Technical Specifications</h3><ul><li>Weight: 2.5 lbs</li><li>Dimensions: 12" x 8" x 2"</li><li>Battery: 8 hours</li></ul>'
252
- }
253
- }
254
- ],
255
- [
256
- {
257
- type: "text",
258
- props: {
259
- content: '<h3>Customer Reviews</h3><p>\u2605\u2605\u2605\u2605\u2605 "Amazing product, highly recommend!"</p><p>\u2605\u2605\u2605\u2605\u2606 "Great value for money."</p>'
260
- }
261
- }
262
- ],
263
- [
264
- {
265
- type: "text",
266
- props: {
267
- content: "<h3>Support</h3><p>Need help? Contact our support team.</p>"
268
- }
269
- },
270
- {
271
- type: "button",
272
- props: {
273
- text: "Contact Support",
274
- link: "/support"
275
- }
276
- }
277
- ]
278
- ]
279
- }
280
- },
281
- {
282
- description: "Portfolio sections with bordered tabs",
283
- type: "tabs",
284
- props: {
285
- tabs: [{ label: "Web Design" }, { label: "Mobile Apps" }, { label: "Branding" }],
286
- defaultTab: 0,
287
- tabStyle: "bordered",
288
- shadow: "shadow-md",
289
- rounding: "rounded-xl",
290
- $children: [
291
- [
292
- {
293
- type: "text",
294
- props: {
295
- content: "<h3>Web Design Projects</h3><p>Beautiful, responsive websites that convert.</p>"
296
- }
297
- },
298
- {
299
- type: "image",
300
- props: {
301
- src: "https://via.placeholder.com/600x300",
302
- alt: "Web design portfolio"
303
- }
304
- }
305
- ],
306
- [
307
- {
308
- type: "text",
309
- props: {
310
- content: "<h3>Mobile Applications</h3><p>Native and cross-platform mobile solutions.</p>"
311
- }
312
- },
313
- {
314
- type: "image",
315
- props: {
316
- src: "https://via.placeholder.com/300x500",
317
- alt: "Mobile app portfolio"
318
- }
319
- }
320
- ],
321
- [
322
- {
323
- type: "text",
324
- props: {
325
- content: "<h3>Brand Identity</h3><p>Comprehensive branding solutions for modern businesses.</p>"
326
- }
327
- },
328
- {
329
- type: "image",
330
- props: {
331
- src: "https://via.placeholder.com/500x400",
332
- alt: "Branding portfolio"
333
- }
334
- }
335
- ]
336
- ]
337
- }
338
- },
339
- {
340
- description: "FAQ sections with bottom-positioned tabs",
341
- type: "tabs",
342
- props: {
343
- tabs: [{ label: "General" }, { label: "Billing" }, { label: "Technical" }],
344
- defaultTab: 0,
345
- tabPosition: "bottom",
346
- tabStyle: "underline",
347
- padding: "1.5rem",
348
- $children: [
349
- [
350
- {
351
- type: "text",
352
- props: {
353
- content: "<h3>General Questions</h3><p><strong>What is your company about?</strong></p><p>We provide excellent services to our customers.</p><p><strong>Where are you located?</strong></p><p>We have offices worldwide.</p>"
354
- }
355
- }
356
- ],
357
- [
358
- {
359
- type: "text",
360
- props: {
361
- content: "<h3>Billing Questions</h3><p><strong>How does billing work?</strong></p><p>We bill monthly based on usage.</p><p><strong>Can I change my plan?</strong></p><p>Yes, you can upgrade or downgrade anytime.</p>"
362
- }
363
- }
364
- ],
365
- [
366
- {
367
- type: "text",
368
- props: {
369
- content: "<h3>Technical Support</h3><p><strong>How do I reset my password?</strong></p><p>Use the forgot password link on the login page.</p><p><strong>Is there an API?</strong></p><p>Yes, we have a comprehensive REST API.</p>"
370
- }
371
- }
372
- ]
373
- ]
374
- }
375
- },
376
- {
377
- description: "Team member profiles using teamMembers query with dynamic tabs",
378
- type: "tabs",
379
- props: {
380
- loop: {
381
- over: "teamMembers"
382
- },
383
- tabs: [{ label: "{{teamMembers.name}}" }],
384
- tabStyle: "pills",
385
- fullWidth: false,
386
- colorPreset: {
387
- color: "secondary-100"
388
- },
389
- padding: "2rem",
390
- $children: [
391
- [
392
- {
393
- type: "image",
394
- props: {
395
- src: "{{teamMembers.photo}}",
396
- alt: "{{teamMembers.name}}"
397
- }
398
- },
399
- {
400
- type: "text",
401
- props: {
402
- content: "<h3>{{teamMembers.name}}</h3><p><strong>{{teamMembers.position}}</strong></p><p>{{teamMembers.bio}}</p><p>Email: {{teamMembers.email}}</p>"
403
- }
404
- }
405
- ]
406
- ]
407
- }
408
- },
409
- {
410
- description: "Product categories using productCategories query",
411
- type: "tabs",
412
- props: {
413
- loop: {
414
- over: "productCategories"
415
- },
416
- tabs: [{ label: "{{productCategories.categoryName}}" }],
417
- tabStyle: "bordered",
418
- fullWidth: true,
419
- border: {
420
- width: "border-2",
421
- color: "border-primary-300"
422
- },
423
- rounding: "rounded-lg",
424
- shadow: "shadow-lg",
425
- $children: [
426
- [
427
- {
428
- type: "text",
429
- props: {
430
- content: "<h3>{{productCategories.categoryName}}</h3><p>{{productCategories.description}}</p><p>{{productCategories.productCount}} products available</p>"
431
- }
432
- },
433
- {
434
- type: "button",
435
- props: {
436
- text: "Browse {{productCategories.categoryName}}",
437
- link: "/products/{{productCategories.slug}}"
438
- }
439
- }
440
- ]
441
- ]
442
- }
443
- },
444
- {
445
- description: "Service packages with pricing information",
446
- type: "tabs",
447
- props: {
448
- tabs: [{ label: "Basic" }, { label: "Professional" }, { label: "Enterprise" }],
449
- defaultTab: 1,
450
- tabStyle: "pills",
451
- fullWidth: true,
452
- colorPreset: {
453
- color: "accent-50"
454
- },
455
- border: {
456
- width: "border",
457
- color: "border-accent-200"
458
- },
459
- rounding: "rounded-xl",
460
- shadow: "shadow-md",
461
- padding: "2.5rem",
462
- $children: [
463
- [
464
- {
465
- type: "text",
466
- props: {
467
- content: "<h3>Basic Package</h3><p><strong>$99/month</strong></p><ul><li>5 Projects</li><li>10GB Storage</li><li>Email Support</li></ul>"
468
- }
469
- },
470
- {
471
- type: "button",
472
- props: {
473
- text: "Choose Basic",
474
- link: "/pricing/basic"
475
- }
476
- }
477
- ],
478
- [
479
- {
480
- type: "text",
481
- props: {
482
- content: "<h3>Professional Package</h3><p><strong>$199/month</strong></p><ul><li>25 Projects</li><li>100GB Storage</li><li>Priority Support</li><li>Advanced Analytics</li></ul>"
483
- }
484
- },
485
- {
486
- type: "button",
487
- props: {
488
- text: "Choose Professional",
489
- link: "/pricing/professional"
490
- }
491
- }
492
- ],
493
- [
494
- {
495
- type: "text",
496
- props: {
497
- content: "<h3>Enterprise Package</h3><p><strong>$499/month</strong></p><ul><li>Unlimited Projects</li><li>1TB Storage</li><li>24/7 Phone Support</li><li>Custom Integrations</li><li>Dedicated Account Manager</li></ul>"
498
- }
499
- },
500
- {
501
- type: "button",
502
- props: {
503
- text: "Contact Sales",
504
- link: "/contact/enterprise"
505
- }
506
- }
507
- ]
508
- ]
509
- }
510
- },
511
- {
512
- description: "Documentation sections with technical content",
513
- type: "tabs",
514
- props: {
515
- tabs: [
516
- { label: "Getting Started" },
517
- { label: "API Reference" },
518
- { label: "Examples" },
519
- { label: "Troubleshooting" }
520
- ],
521
- defaultTab: 0,
522
- tabStyle: "underline",
523
- tabPosition: "top",
524
- padding: "1.5rem",
525
- colorPreset: {
526
- color: "neutral-50"
527
- },
528
- $children: [
529
- [
530
- {
531
- type: "text",
532
- props: {
533
- content: "<h3>Getting Started</h3><p>Welcome to our platform! Here's how to get started:</p><ol><li>Create an account</li><li>Set up your first project</li><li>Invite team members</li></ol>"
534
- }
535
- }
536
- ],
537
- [
538
- {
539
- type: "text",
540
- props: {
541
- content: "<h3>API Reference</h3><p>Our REST API provides programmatic access to all features:</p><pre>GET /api/v1/projects</pre><pre>POST /api/v1/projects</pre>"
542
- }
543
- }
544
- ],
545
- [
546
- {
547
- type: "text",
548
- props: {
549
- content: "<h3>Code Examples</h3><p>Here are some common use cases:</p><pre>curl -X GET https://api.example.com/projects</pre>"
550
- }
551
- }
552
- ],
553
- [
554
- {
555
- type: "text",
556
- props: {
557
- content: "<h3>Troubleshooting</h3><p><strong>Issue:</strong> Cannot connect to API</p><p><strong>Solution:</strong> Check your API key and network connection.</p>"
558
- }
559
- }
560
- ]
561
- ]
562
- }
563
- }
564
- ];
565
-
566
- export {
567
- manifest,
568
- examples
569
- };
570
- //# sourceMappingURL=chunk-HUWMIXNN.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/shared/bricks/manifests/tabs.manifest.ts"],"sourcesContent":["import { defineBrickManifest } from \"~/shared/brick-manifest\";\nimport { defineProps } from \"../props/helpers\";\nimport { Type } from \"@sinclair/typebox\";\nimport { border, rounding } from \"../props/border\";\nimport { shadow } from \"../props/effects\";\nimport type { BrickProps } from \"../props/types\";\nimport { cssLength } from \"../props/css-length\";\nimport { HiOutlineViewColumns } from \"react-icons/hi2\";\nimport { colorPreset } from \"../props/color-preset\";\nimport { loop } from \"../props/dynamic\";\nimport { StringEnum } from \"~/shared/utils/string-enum\";\nimport type { BrickExample } from \"./_types\";\n\n// Tab configuration schema\nconst tabRef = Type.Object({\n label: Type.String({\n title: \"Tab Label\",\n description: \"The text shown on the tab button\",\n \"ai:instructions\": \"Use a short, descriptive label for the tab\",\n }),\n id: Type.Optional(\n Type.String({\n title: \"Tab ID\",\n description: \"Unique identifier for the tab (auto-generated if not provided)\",\n }),\n ),\n});\n\nexport const manifest = defineBrickManifest({\n type: \"tabs\",\n category: \"container\",\n name: \"Tabs\",\n description: \"A tabbed container that displays different content panels based on the selected tab.\",\n aiInstructions:\n \"Tabs are containers for organizing content into multiple panels. Each tab has a label and contains child bricks. Users can click tab buttons to switch between different content panels. Ideal for organizing related content, settings panels, or product information.\",\n isContainer: true,\n defaultWidth: {\n desktop: \"100%\",\n mobile: \"100%\",\n },\n defaultHeight: {\n desktop: \"auto\",\n },\n icon: HiOutlineViewColumns,\n props: defineProps({\n colorPreset: Type.Optional(\n colorPreset({\n title: \"Color\",\n }),\n ),\n tabs: Type.Array(tabRef, {\n title: \"Tabs\",\n description: \"List of tab configurations\",\n default: [{ label: \"Tab 1\" }, { label: \"Tab 2\" }],\n \"ai:instructions\":\n \"Each tab should have a descriptive label. Content for each tab is defined in the $children array.\",\n examples: [\n [{ label: \"Overview\" }, { label: \"Features\" }, { label: \"Pricing\" }],\n [{ label: \"About\" }, { label: \"Services\" }, { label: \"Contact\" }],\n ],\n }),\n defaultTab: Type.Optional(\n Type.Number({\n title: \"Default Tab\",\n description: \"Index of the tab to show by default (0-based)\",\n default: 0,\n minimum: 0,\n \"ai:instructions\": \"Use 0 for the first tab, 1 for the second tab, etc.\",\n }),\n ),\n tabPosition: Type.Optional(\n StringEnum([\"top\", \"bottom\"], {\n title: \"Tab Position\",\n description: \"Position of the tab buttons relative to content\",\n default: \"top\",\n \"ai:instructions\":\n \"Use 'top' for tabs above content (most common) or 'bottom' for tabs below content\",\n }),\n ),\n tabStyle: Type.Optional(\n StringEnum([\"pills\", \"underline\", \"bordered\"], {\n title: \"Tab Style\",\n description: \"Visual style of the tab buttons\",\n default: \"underline\",\n \"ai:instructions\":\n \"Pills are rounded buttons, underline shows a line under active tab, bordered shows tabs with borders\",\n }),\n ),\n fullWidth: Type.Optional(\n Type.Boolean({\n title: \"Full Width Tabs\",\n description: \"Make tab buttons span the full width of the container\",\n default: false,\n \"ai:instructions\": \"Enable this to make tab buttons evenly distribute across the full width\",\n }),\n ),\n padding: Type.Optional(\n cssLength({\n default: \"1.5rem\",\n description: \"Padding inside each tab panel.\",\n \"ai:instructions\": \"Use values like '1rem', '1.5rem', or '2rem' for tab content padding\",\n title: \"Content Padding\",\n \"ui:placeholder\": \"Not specified\",\n \"ui:styleId\": \"styles:padding\",\n }),\n ),\n gap: Type.Optional(\n cssLength({\n title: \"Tab Gap\",\n default: \"0.5rem\",\n description: \"Gap between tab buttons.\",\n \"ai:instructions\": \"Small values like '0.25rem' or '0.5rem' work best for tab spacing\",\n \"ui:placeholder\": \"Not specified\",\n \"ui:styleId\": \"styles:gap\",\n }),\n ),\n rounding: rounding({\n default: \"rounded-md\",\n }),\n border: Type.Optional(border()),\n shadow: Type.Optional(shadow()),\n loop: Type.Optional(loop()),\n $children: Type.Array(Type.Array(Type.Any()), {\n \"ui:field\": \"hidden\",\n description: \"Array of child brick arrays - each sub-array represents the content for one tab\",\n default: [[], []],\n examples: [\n [\n // Tab 1 content\n [\n {\n type: \"text\",\n props: {\n content: \"<h3>Overview</h3><p>This is the overview tab content.</p>\",\n },\n },\n ],\n // Tab 2 content\n [\n {\n type: \"text\",\n props: {\n content: \"<h3>Features</h3><p>Here are our key features.</p>\",\n },\n },\n {\n type: \"button\",\n props: {\n text: \"Learn More\",\n link: \"/features\",\n },\n },\n ],\n ],\n ],\n }),\n }),\n});\n\nexport type Manifest = typeof manifest;\n\nexport const examples: BrickExample<Manifest>[] = [\n {\n description: \"Simple tabs with basic content in each panel\",\n type: \"tabs\",\n props: {\n tabs: [{ label: \"About\" }, { label: \"Services\" }, { label: \"Contact\" }],\n defaultTab: 0,\n tabStyle: \"underline\",\n $children: [\n [\n {\n type: \"text\",\n props: {\n content: \"<h3>About Us</h3><p>We are a company focused on delivering exceptional results.</p>\",\n },\n },\n ],\n [\n {\n type: \"text\",\n props: {\n content: \"<h3>Our Services</h3><p>We offer a wide range of professional services.</p>\",\n },\n },\n {\n type: \"button\",\n props: {\n text: \"View All Services\",\n link: \"/services\",\n },\n },\n ],\n [\n {\n type: \"text\",\n props: {\n content:\n \"<h3>Contact Information</h3><p>Email: hello@company.com</p><p>Phone: (555) 123-4567</p>\",\n },\n },\n ],\n ],\n },\n },\n {\n description: \"Product information tabs with pills style and custom styling\",\n type: \"tabs\",\n props: {\n tabs: [{ label: \"Overview\" }, { label: \"Specifications\" }, { label: \"Reviews\" }, { label: \"Support\" }],\n defaultTab: 0,\n tabStyle: \"pills\",\n fullWidth: true,\n colorPreset: {\n color: \"primary-50\",\n },\n border: {\n width: \"border\",\n color: \"border-primary-200\",\n },\n rounding: \"rounded-lg\",\n padding: \"2rem\",\n $children: [\n [\n {\n type: \"text\",\n props: {\n content: \"<h3>Product Overview</h3><p>This product revolutionizes the way you work.</p>\",\n },\n },\n {\n type: \"image\",\n props: {\n src: \"https://via.placeholder.com/400x200\",\n alt: \"Product image\",\n },\n },\n ],\n [\n {\n type: \"text\",\n props: {\n content:\n '<h3>Technical Specifications</h3><ul><li>Weight: 2.5 lbs</li><li>Dimensions: 12\" x 8\" x 2\"</li><li>Battery: 8 hours</li></ul>',\n },\n },\n ],\n [\n {\n type: \"text\",\n props: {\n content:\n '<h3>Customer Reviews</h3><p>★★★★★ \"Amazing product, highly recommend!\"</p><p>★★★★☆ \"Great value for money.\"</p>',\n },\n },\n ],\n [\n {\n type: \"text\",\n props: {\n content: \"<h3>Support</h3><p>Need help? Contact our support team.</p>\",\n },\n },\n {\n type: \"button\",\n props: {\n text: \"Contact Support\",\n link: \"/support\",\n },\n },\n ],\n ],\n },\n },\n {\n description: \"Portfolio sections with bordered tabs\",\n type: \"tabs\",\n props: {\n tabs: [{ label: \"Web Design\" }, { label: \"Mobile Apps\" }, { label: \"Branding\" }],\n defaultTab: 0,\n tabStyle: \"bordered\",\n shadow: \"shadow-md\",\n rounding: \"rounded-xl\",\n $children: [\n [\n {\n type: \"text\",\n props: {\n content: \"<h3>Web Design Projects</h3><p>Beautiful, responsive websites that convert.</p>\",\n },\n },\n {\n type: \"image\",\n props: {\n src: \"https://via.placeholder.com/600x300\",\n alt: \"Web design portfolio\",\n },\n },\n ],\n [\n {\n type: \"text\",\n props: {\n content: \"<h3>Mobile Applications</h3><p>Native and cross-platform mobile solutions.</p>\",\n },\n },\n {\n type: \"image\",\n props: {\n src: \"https://via.placeholder.com/300x500\",\n alt: \"Mobile app portfolio\",\n },\n },\n ],\n [\n {\n type: \"text\",\n props: {\n content:\n \"<h3>Brand Identity</h3><p>Comprehensive branding solutions for modern businesses.</p>\",\n },\n },\n {\n type: \"image\",\n props: {\n src: \"https://via.placeholder.com/500x400\",\n alt: \"Branding portfolio\",\n },\n },\n ],\n ],\n },\n },\n {\n description: \"FAQ sections with bottom-positioned tabs\",\n type: \"tabs\",\n props: {\n tabs: [{ label: \"General\" }, { label: \"Billing\" }, { label: \"Technical\" }],\n defaultTab: 0,\n tabPosition: \"bottom\",\n tabStyle: \"underline\",\n padding: \"1.5rem\",\n $children: [\n [\n {\n type: \"text\",\n props: {\n content:\n \"<h3>General Questions</h3><p><strong>What is your company about?</strong></p><p>We provide excellent services to our customers.</p><p><strong>Where are you located?</strong></p><p>We have offices worldwide.</p>\",\n },\n },\n ],\n [\n {\n type: \"text\",\n props: {\n content:\n \"<h3>Billing Questions</h3><p><strong>How does billing work?</strong></p><p>We bill monthly based on usage.</p><p><strong>Can I change my plan?</strong></p><p>Yes, you can upgrade or downgrade anytime.</p>\",\n },\n },\n ],\n [\n {\n type: \"text\",\n props: {\n content:\n \"<h3>Technical Support</h3><p><strong>How do I reset my password?</strong></p><p>Use the forgot password link on the login page.</p><p><strong>Is there an API?</strong></p><p>Yes, we have a comprehensive REST API.</p>\",\n },\n },\n ],\n ],\n },\n },\n {\n description: \"Team member profiles using teamMembers query with dynamic tabs\",\n type: \"tabs\",\n props: {\n loop: {\n over: \"teamMembers\",\n },\n tabs: [{ label: \"{{teamMembers.name}}\" }],\n tabStyle: \"pills\",\n fullWidth: false,\n colorPreset: {\n color: \"secondary-100\",\n },\n padding: \"2rem\",\n $children: [\n [\n {\n type: \"image\",\n props: {\n src: \"{{teamMembers.photo}}\",\n alt: \"{{teamMembers.name}}\",\n },\n },\n {\n type: \"text\",\n props: {\n content:\n \"<h3>{{teamMembers.name}}</h3><p><strong>{{teamMembers.position}}</strong></p><p>{{teamMembers.bio}}</p><p>Email: {{teamMembers.email}}</p>\",\n },\n },\n ],\n ],\n },\n },\n {\n description: \"Product categories using productCategories query\",\n type: \"tabs\",\n props: {\n loop: {\n over: \"productCategories\",\n },\n tabs: [{ label: \"{{productCategories.categoryName}}\" }],\n tabStyle: \"bordered\",\n fullWidth: true,\n border: {\n width: \"border-2\",\n color: \"border-primary-300\",\n },\n rounding: \"rounded-lg\",\n shadow: \"shadow-lg\",\n $children: [\n [\n {\n type: \"text\",\n props: {\n content:\n \"<h3>{{productCategories.categoryName}}</h3><p>{{productCategories.description}}</p><p>{{productCategories.productCount}} products available</p>\",\n },\n },\n {\n type: \"button\",\n props: {\n text: \"Browse {{productCategories.categoryName}}\",\n link: \"/products/{{productCategories.slug}}\",\n },\n },\n ],\n ],\n },\n },\n {\n description: \"Service packages with pricing information\",\n type: \"tabs\",\n props: {\n tabs: [{ label: \"Basic\" }, { label: \"Professional\" }, { label: \"Enterprise\" }],\n defaultTab: 1,\n tabStyle: \"pills\",\n fullWidth: true,\n colorPreset: {\n color: \"accent-50\",\n },\n border: {\n width: \"border\",\n color: \"border-accent-200\",\n },\n rounding: \"rounded-xl\",\n shadow: \"shadow-md\",\n padding: \"2.5rem\",\n $children: [\n [\n {\n type: \"text\",\n props: {\n content:\n \"<h3>Basic Package</h3><p><strong>$99/month</strong></p><ul><li>5 Projects</li><li>10GB Storage</li><li>Email Support</li></ul>\",\n },\n },\n {\n type: \"button\",\n props: {\n text: \"Choose Basic\",\n link: \"/pricing/basic\",\n },\n },\n ],\n [\n {\n type: \"text\",\n props: {\n content:\n \"<h3>Professional Package</h3><p><strong>$199/month</strong></p><ul><li>25 Projects</li><li>100GB Storage</li><li>Priority Support</li><li>Advanced Analytics</li></ul>\",\n },\n },\n {\n type: \"button\",\n props: {\n text: \"Choose Professional\",\n link: \"/pricing/professional\",\n },\n },\n ],\n [\n {\n type: \"text\",\n props: {\n content:\n \"<h3>Enterprise Package</h3><p><strong>$499/month</strong></p><ul><li>Unlimited Projects</li><li>1TB Storage</li><li>24/7 Phone Support</li><li>Custom Integrations</li><li>Dedicated Account Manager</li></ul>\",\n },\n },\n {\n type: \"button\",\n props: {\n text: \"Contact Sales\",\n link: \"/contact/enterprise\",\n },\n },\n ],\n ],\n },\n },\n {\n description: \"Documentation sections with technical content\",\n type: \"tabs\",\n props: {\n tabs: [\n { label: \"Getting Started\" },\n { label: \"API Reference\" },\n { label: \"Examples\" },\n { label: \"Troubleshooting\" },\n ],\n defaultTab: 0,\n tabStyle: \"underline\",\n tabPosition: \"top\",\n padding: \"1.5rem\",\n colorPreset: {\n color: \"neutral-50\",\n },\n $children: [\n [\n {\n type: \"text\",\n props: {\n content:\n \"<h3>Getting Started</h3><p>Welcome to our platform! Here's how to get started:</p><ol><li>Create an account</li><li>Set up your first project</li><li>Invite team members</li></ol>\",\n },\n },\n ],\n [\n {\n type: \"text\",\n props: {\n content:\n \"<h3>API Reference</h3><p>Our REST API provides programmatic access to all features:</p><pre>GET /api/v1/projects</pre><pre>POST /api/v1/projects</pre>\",\n },\n },\n ],\n [\n {\n type: \"text\",\n props: {\n content:\n \"<h3>Code Examples</h3><p>Here are some common use cases:</p><pre>curl -X GET https://api.example.com/projects</pre>\",\n },\n },\n ],\n [\n {\n type: \"text\",\n props: {\n content:\n \"<h3>Troubleshooting</h3><p><strong>Issue:</strong> Cannot connect to API</p><p><strong>Solution:</strong> Check your API key and network connection.</p>\",\n },\n },\n ],\n ],\n },\n },\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,YAAY;AAKrB,SAAS,4BAA4B;AAOrC,IAAM,SAAS,KAAK,OAAO;AAAA,EACzB,OAAO,KAAK,OAAO;AAAA,IACjB,OAAO;AAAA,IACP,aAAa;AAAA,IACb,mBAAmB;AAAA,EACrB,CAAC;AAAA,EACD,IAAI,KAAK;AAAA,IACP,KAAK,OAAO;AAAA,MACV,OAAO;AAAA,MACP,aAAa;AAAA,IACf,CAAC;AAAA,EACH;AACF,CAAC;AAEM,IAAM,WAAW,oBAAoB;AAAA,EAC1C,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM;AAAA,EACN,aAAa;AAAA,EACb,gBACE;AAAA,EACF,aAAa;AAAA,EACb,cAAc;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AAAA,E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AAM;AAAA,YACN,OAAO;AAAA,cACL,SACE;AAAA,YACJ;AAAA,UACF;AAAA,UACA;AAAA,YACE,MAAM;AAAA,YACN,OAAO;AAAA,cACL,MAAM;AAAA,cACN,MAAM;AAAA,YACR;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,aAAa;AAAA,IACb,MAAM;AAAA,IACN,OAAO;AAAA,MACL,MAAM;AAAA,QACJ,EAAE,OAAO,kBAAkB;AAAA,QAC3B,EAAE,OAAO,gBAAgB;AAAA,QACzB,EAAE,OAAO,WAAW;AAAA,QACpB,EAAE,OAAO,kBAAkB;AAAA,MAC7B;AAAA,MACA,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,aAAa;AAAA,MACb,SAAS;AAAA,MACT,aAAa;AAAA,QACX,OAAO;AAAA,MACT;AAAA,MACA,WAAW;AAAA,QACT;AAAA,UACE;AAAA,YACE,MAAM;AAAA,YACN,OAAO;AAAA,cACL,SACE;AAAA,YACJ;AAAA,UACF;AAAA,QACF;AAAA,QACA;AAAA,UACE;AAAA,YACE,MAAM;AAAA,YACN,OAAO;AAAA,cACL,SACE;AAAA,YACJ;AAAA,UACF;AAAA,QACF;AAAA,QACA;AAAA,UACE;AAAA,YACE,MAAM;AAAA,YACN,OAAO;AAAA,cACL,SACE;AAAA,YACJ;AAAA,UACF;AAAA,QACF;AAAA,QACA;AAAA,UACE;AAAA,YACE,MAAM;AAAA,YACN,OAAO;AAAA,cACL,SACE;AAAA,YACJ;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/shared/utils/schema.ts"],"sourcesContent":["import { type TArray, type TObject, type TSchema, Kind, type Static } from \"@sinclair/typebox\";\nimport { Value } from \"@sinclair/typebox/value\";\nimport type { PageAttributes } from \"../attributes\";\nimport { defaultsDeep as applyDefaultsDeep, merge } from \"lodash-es\";\nimport { FormatRegistry } from \"@sinclair/typebox\";\nimport { DefaultErrorFunction, SetErrorFunction, ValueErrorType } from \"@sinclair/typebox/errors\";\n// export const jsonStringsSupportedFormats = [\"date-time\", \"date\", \"email\", \"url\"] as const;\n\n// import string enum for its side effects\nimport \"./string-enum\";\n\nconst urlValidator = (value: string) => {\n try {\n const url = new URL(value);\n return url.protocol === \"http:\" || url.protocol === \"https:\";\n } catch {\n return false;\n }\n};\n\nconst noCheck = (value: string) => true;\n\nFormatRegistry.Set(\"uuid\", (value) =>\n /^[0-9a-f]{8}-[0-9a-f]{4}-[1-7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value),\n);\n// Allow different lengths for nanoid\nFormatRegistry.Set(\"nanoid\", (value) => /^[A-Za-z0-9_-]{7,32}$/.test(value));\nFormatRegistry.Set(\"slug\", (value) => /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(value));\n// Simple format checks for richtext, markdown, multiline, password, image, file\nFormatRegistry.Set(\"richtext\", noCheck);\nFormatRegistry.Set(\"markdown\", noCheck);\nFormatRegistry.Set(\"multiline\", noCheck);\nFormatRegistry.Set(\"password\", noCheck);\nFormatRegistry.Set(\"image\", urlValidator);\nFormatRegistry.Set(\"file\", urlValidator);\n\nSetErrorFunction((error) => {\n if (error.errorType === ValueErrorType.Kind) {\n if (\n error.schema.type === \"string\" &&\n typeof error.value === \"string\" &&\n error.schema.enum &&\n !error.schema.enum.includes(error.value)\n ) {\n return `Must include valid value: [${error.schema.enum.join(\", \")}]`;\n }\n }\n\n return DefaultErrorFunction(error);\n});\n\nexport function normalizeSchemaEnum(schema: TSchema): Array<{ const: string; title: string }> {\n if (!(\"enum\" in schema)) {\n return schema.anyOf ?? schema.oneOf;\n }\n const {\n enum: enumValues,\n enumNames,\n \"ui:icons\": icons,\n } = schema as unknown as { enum: string[]; enumNames?: string[]; \"ui:icons\"?: string[] };\n // combine to key-value pairs\n return enumValues.map((value, index) => ({\n const: value,\n title: enumNames ? enumNames[index] : value,\n \"ui:icon\": icons ? icons[index] : undefined,\n }));\n}\n\nexport function getSchemaDefaults<T extends TObject | TArray>(\n schema: T,\n mode?: \"mobile\" | \"desktop\",\n): Static<T> {\n // Handle object schemas\n if (schema.type === \"object\" && \"properties\" in schema) {\n const objectSchema = schema as TObject;\n const defaults: Static<T> = {};\n\n for (const [key, propertySchema] of Object.entries(objectSchema.properties)) {\n const defaultValue = getNestedDefaults(propertySchema as TSchema, mode);\n\n // Only include properties that have explicit defaults\n if (defaultValue !== undefined) {\n defaults[key] = defaultValue;\n }\n }\n\n return defaults as Static<T>;\n }\n\n // Handle array schemas\n if (schema.type === \"array\" && \"items\" in schema) {\n const arraySchema = schema as TArray;\n\n if (mode && typeof arraySchema[`default:${mode}`] !== \"undefined\") {\n return arraySchema[`default:${mode}`];\n }\n\n // If the array itself has an explicit default, return it\n if (arraySchema.default) {\n return arraySchema.default;\n }\n\n // Otherwise return empty array\n return [];\n }\n\n throw new Error(\"Schema must be either TObject or TArray\");\n}\n\n// Helper function for nested schema processing\nfunction getNestedDefaults(schema: TSchema, mode?: \"mobile\" | \"desktop\"): unknown {\n if (mode && typeof schema[`default:${mode}`] !== \"undefined\") {\n return schema[`default:${mode}`];\n }\n // Handle schemas with explicit default values\n if (\"default\" in schema && schema.default !== undefined) {\n return schema.default;\n }\n\n // Handle nested object schemas\n if (schema.type === \"object\" && \"properties\" in schema) {\n const objectSchema = schema as TObject;\n const defaults: Record<string, unknown> = {};\n\n for (const [key, propertySchema] of Object.entries(objectSchema.properties)) {\n const defaultValue = getNestedDefaults(propertySchema as TSchema, mode);\n\n // Only include properties that have explicit defaults\n if (defaultValue !== undefined) {\n defaults[key] = defaultValue;\n }\n }\n\n return Object.keys(defaults).length > 0 ? defaults : undefined;\n }\n\n // Handle nested array schemas\n if (schema.type === \"array\" && \"items\" in schema) {\n // Arrays only contribute defaults if explicitly set\n return undefined;\n }\n\n // No implicit defaults for any type\n return undefined;\n}\n\nexport type FieldFilter<\n T extends TSchema = TSchema,\n P extends Record<string, unknown> = Record<string, unknown>,\n> = (propsSchema: T, formData: P, pageAttributes: PageAttributes) => boolean;\n\nexport function filterSchemaProperties(schema: TObject, filter: (prop: TSchema) => boolean) {\n function extractProperties(schema: TObject): Record<string, TSchema> {\n const props: Record<string, TSchema> = {};\n for (const [key, prop] of Object.entries(schema.properties)) {\n if (filter(prop)) {\n props[key] = prop;\n } else if (prop.type === \"object\" && prop.properties) {\n const nestedContentProps = extractProperties(prop as TObject);\n if (Object.keys(nestedContentProps).length > 0) {\n Object.assign(props, nestedContentProps);\n }\n }\n }\n return props;\n }\n return extractProperties(schema);\n}\n\n/**\n * Resolves a JSON schema by following $ref references recursively.\n * Handles nested objects, arrays, and complex schema structures.\n */\nexport function resolveSchema<T extends TSchema = TSchema>(schema: T): T {\n console.warn(\"resolveSchema is deprecated, use resolveSchemaRecursive instead\");\n return schema;\n}\n\nexport function validate<T extends TSchema>(schema: TSchema, data: unknown): Static<T> {\n try {\n const valid = Value.Check(schema, data);\n if (!valid) {\n let finalError = \"\";\n for (const error of Value.Errors(schema, data)) {\n finalError += `Error at ${error.path} with value ${error.value}: ${error.message}\\n`;\n }\n console.error(\"Validation errors:\\n\", finalError);\n throw new Error(finalError);\n }\n } catch (e) {\n console.error(\"Validation exception:\", e);\n console.dir(e, { depth: null });\n throw e;\n }\n\n // Mutate data with defaults\n const defaults = getSchemaDefaults(schema as TObject | TArray);\n const finalObject = applyDefaultsDeep({}, data, defaults);\n\n return finalObject as Static<T>;\n}\n"],"mappings":";;;;AACA,SAAS,aAAa;AAEtB,SAAS,gBAAgB,yBAAgC;AACzD,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB,kBAAkB,sBAAsB;AAMvE,IAAM,eAAe,CAAC,UAAkB;AACtC,MAAI;AACF,UAAM,MAAM,IAAI,IAAI,KAAK;AACzB,WAAO,IAAI,aAAa,WAAW,IAAI,aAAa;AAAA,EACtD,QAAQ;AACN,WAAO;AAAA,EACT;A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