southpaw 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/README.md +51 -0
  2. package/api/client.ts +83 -0
  3. package/api/helpers/fs.ts +98 -0
  4. package/api/helpers/stream.ts +6 -0
  5. package/api/index.ts +50 -0
  6. package/api/server.ts +566 -0
  7. package/constants/fonts.ts +1583 -0
  8. package/constants/icons.ts +2124 -0
  9. package/constants/langs.ts +2592 -0
  10. package/constants/ssr-loading.tsx +17 -0
  11. package/contexts/dev.tsx +124 -0
  12. package/hooks/useDebounceCb.ts +21 -0
  13. package/modules/app.tsx +102 -0
  14. package/modules/behaviors.ts +161 -0
  15. package/modules/component.tsx +483 -0
  16. package/modules/config/index.ts +8 -0
  17. package/modules/database.ts +25 -0
  18. package/modules/document.tsx +23 -0
  19. package/modules/error.tsx +16 -0
  20. package/modules/page/autozoom.tsx +92 -0
  21. package/modules/page/browser.tsx +166 -0
  22. package/modules/page/index.tsx +327 -0
  23. package/modules/page/insert-modal.tsx +225 -0
  24. package/modules/page/inspect/index.tsx +237 -0
  25. package/modules/page/inspect/wrapper.tsx +88 -0
  26. package/modules/page/knobs/action.tsx +58 -0
  27. package/modules/page/knobs/color.tsx +78 -0
  28. package/modules/page/knobs/helpers.ts +71 -0
  29. package/modules/page/knobs/icon.tsx +85 -0
  30. package/modules/page/knobs/linker.tsx +188 -0
  31. package/modules/page/knobs/list-json.tsx +149 -0
  32. package/modules/page/knobs/list-text.tsx +129 -0
  33. package/modules/page/knobs/number.tsx +84 -0
  34. package/modules/page/knobs/segmented.tsx +81 -0
  35. package/modules/page/knobs/select.tsx +89 -0
  36. package/modules/page/knobs/size.tsx +106 -0
  37. package/modules/page/knobs/switch.tsx +75 -0
  38. package/modules/page/knobs/text.tsx +93 -0
  39. package/modules/page/left-tabs.tsx +36 -0
  40. package/modules/page/right-tabs.tsx +31 -0
  41. package/modules/page/seo.tsx +69 -0
  42. package/modules/page/tree.tsx +860 -0
  43. package/modules/state.ts +787 -0
  44. package/modules/store.ts +37 -0
  45. package/modules/theme.ts +105 -0
  46. package/modules/translations.ts +15 -0
  47. package/package.json +68 -0
  48. package/scripts/bin.js +607 -0
  49. package/scripts/test.js +145 -0
  50. package/themes/base.tsx +8962 -0
  51. package/themes/index.ts +4 -0
  52. package/themes/m2.ts +39 -0
  53. package/themes/newspaper.ts +39 -0
  54. package/types/api.ts +57 -0
  55. package/types/fiber_node.ts +69 -0
  56. package/types/react_element.ts +14 -0
  57. package/ui/accordion.tsx +70 -0
  58. package/ui/actionicon.tsx +41 -0
  59. package/ui/affix.tsx +14 -0
  60. package/ui/alert.tsx +37 -0
  61. package/ui/anchor.tsx +52 -0
  62. package/ui/arrow.tsx +116 -0
  63. package/ui/aspectratio.tsx +21 -0
  64. package/ui/autocomplete.tsx +34 -0
  65. package/ui/avatar.tsx +36 -0
  66. package/ui/backgroundimage.tsx +16 -0
  67. package/ui/badge.tsx +28 -0
  68. package/ui/blockquote.tsx +15 -0
  69. package/ui/blocks/faq.tsx +145 -0
  70. package/ui/blocks/features.tsx +167 -0
  71. package/ui/blocks/footer.tsx +182 -0
  72. package/ui/blocks/herobanner.tsx +391 -0
  73. package/ui/blocks/index.ts +44 -0
  74. package/ui/blocks/leftnav.tsx +141 -0
  75. package/ui/blocks/pricing.tsx +210 -0
  76. package/ui/blocks/testimonials.tsx +149 -0
  77. package/ui/blocks/uidocs.tsx +1429 -0
  78. package/ui/box.tsx +27 -0
  79. package/ui/breadcrumbs.tsx +33 -0
  80. package/ui/burger.tsx +23 -0
  81. package/ui/button.tsx +85 -0
  82. package/ui/card.tsx +28 -0
  83. package/ui/center.tsx +26 -0
  84. package/ui/checkbox.tsx +35 -0
  85. package/ui/chip.tsx +32 -0
  86. package/ui/closebutton.tsx +15 -0
  87. package/ui/code.tsx +104 -0
  88. package/ui/collapse.tsx +16 -0
  89. package/ui/colorinput.tsx +32 -0
  90. package/ui/colorpicker.tsx +26 -0
  91. package/ui/colorswatch.tsx +17 -0
  92. package/ui/combobox.tsx +80 -0
  93. package/ui/container.tsx +27 -0
  94. package/ui/dialog.tsx +15 -0
  95. package/ui/divider.tsx +58 -0
  96. package/ui/drawer.tsx +28 -0
  97. package/ui/fieldset.tsx +15 -0
  98. package/ui/filebutton.tsx +23 -0
  99. package/ui/fileinput.tsx +36 -0
  100. package/ui/flex.tsx +139 -0
  101. package/ui/focustrap.tsx +15 -0
  102. package/ui/form.tsx +26 -0
  103. package/ui/grid.tsx +69 -0
  104. package/ui/highlight.tsx +15 -0
  105. package/ui/hoverable.tsx +66 -0
  106. package/ui/hovercard.tsx +45 -0
  107. package/ui/icon.tsx +76 -0
  108. package/ui/image.tsx +32 -0
  109. package/ui/index.ts +1355 -0
  110. package/ui/indicator.tsx +42 -0
  111. package/ui/infobox.tsx +200 -0
  112. package/ui/input.tsx +18 -0
  113. package/ui/inviewport.tsx +23 -0
  114. package/ui/jsoninput.tsx +35 -0
  115. package/ui/kbd.tsx +20 -0
  116. package/ui/list.tsx +33 -0
  117. package/ui/loader.tsx +26 -0
  118. package/ui/loadingoverlay.tsx +22 -0
  119. package/ui/mark.tsx +15 -0
  120. package/ui/menu.tsx +89 -0
  121. package/ui/modal.tsx +27 -0
  122. package/ui/multiselect.tsx +42 -0
  123. package/ui/nativeselect.tsx +17 -0
  124. package/ui/navlink.tsx +40 -0
  125. package/ui/notification.tsx +25 -0
  126. package/ui/numberformatter.tsx +15 -0
  127. package/ui/numberinput.tsx +37 -0
  128. package/ui/overlay.tsx +15 -0
  129. package/ui/pagination.tsx +21 -0
  130. package/ui/paper.tsx +33 -0
  131. package/ui/passwordinput.tsx +36 -0
  132. package/ui/pill.tsx +17 -0
  133. package/ui/pillsinput.tsx +37 -0
  134. package/ui/pininput.tsx +30 -0
  135. package/ui/popover.tsx +43 -0
  136. package/ui/portal.tsx +15 -0
  137. package/ui/progress.tsx +49 -0
  138. package/ui/props.ts +91 -0
  139. package/ui/propsDef.ts +38 -0
  140. package/ui/radio.tsx +30 -0
  141. package/ui/rating.tsx +25 -0
  142. package/ui/ringprogress.tsx +17 -0
  143. package/ui/scrollarea.tsx +27 -0
  144. package/ui/segmentedcontrol.tsx +38 -0
  145. package/ui/select.tsx +43 -0
  146. package/ui/simplegrid.tsx +23 -0
  147. package/ui/skeleton.tsx +15 -0
  148. package/ui/slider.tsx +31 -0
  149. package/ui/space.tsx +19 -0
  150. package/ui/spoiler.tsx +23 -0
  151. package/ui/stepper.tsx +63 -0
  152. package/ui/switch.tsx +29 -0
  153. package/ui/table.tsx +93 -0
  154. package/ui/tabs.tsx +80 -0
  155. package/ui/tagsinput.tsx +19 -0
  156. package/ui/terminal.tsx +44 -0
  157. package/ui/text.tsx +168 -0
  158. package/ui/textarea.tsx +36 -0
  159. package/ui/textinput.tsx +34 -0
  160. package/ui/timeline.tsx +30 -0
  161. package/ui/title.tsx +42 -0
  162. package/ui/tooltip.tsx +32 -0
  163. package/ui/transition.tsx +21 -0
  164. package/ui/tree.tsx +42 -0
  165. package/ui/typographystylesprovider.tsx +20 -0
  166. package/ui/unstyledbutton.tsx +18 -0
  167. package/ui/video.tsx +16 -0
  168. package/ui/visuallyhidden.tsx +15 -0
  169. package/utils/index.ts +76 -0
@@ -0,0 +1,210 @@
1
+ import { create_component } from "southpaw/modules/component";
2
+ import { UI } from "..";
3
+
4
+ type PricingPlan = {
5
+ name: string;
6
+ price: string;
7
+ period: string;
8
+ description: string;
9
+ features: string[];
10
+ cta: string;
11
+ highlighted?: boolean;
12
+ };
13
+
14
+ type Props = {
15
+ title?: string;
16
+ subtitle?: string;
17
+ description?: string;
18
+ plans?: PricingPlan[];
19
+ backgroundColor?: string;
20
+ textColor?: string;
21
+ accentColor?: string;
22
+ py?: number;
23
+ };
24
+
25
+ const Component = create_component({
26
+ name: "Pricing",
27
+ description: "A premium pricing section with tiered plans and feature lists",
28
+ props: {
29
+ title: "Simple, transparent pricing",
30
+ subtitle: "Pricing",
31
+ accentColor: "primary",
32
+ description:
33
+ "Choose the perfect plan for your project's needs. No hidden fees, just straightforward pricing.",
34
+ py: 120,
35
+ plans: [
36
+ {
37
+ name: "Starter",
38
+ price: "$0",
39
+ period: "/mo",
40
+ description: "Perfect for small personal projects and experiments.",
41
+ features: [
42
+ "1 Project",
43
+ "Basic Analytics",
44
+ "Unlimited Users",
45
+ "Free Community Support",
46
+ ],
47
+ cta: "Get Started Free",
48
+ highlighted: false,
49
+ },
50
+ {
51
+ name: "Pro",
52
+ price: "$49",
53
+ period: "/mo",
54
+ description:
55
+ "Best for growing teams and production-ready applications.",
56
+ features: [
57
+ "Unlimited Projects",
58
+ "Advanced Analytics",
59
+ "Custom Domain Support",
60
+ "Priority 24/7 Support",
61
+ ],
62
+ cta: "Go Pro Now",
63
+ highlighted: true,
64
+ },
65
+ {
66
+ name: "Enterprise",
67
+ price: "$199",
68
+ period: "/mo",
69
+ description: "Custom solutions for large-scale operations and teams.",
70
+ features: [
71
+ "Custom Security Policies",
72
+ "Dedicated Infrastructure",
73
+ "SLA Support",
74
+ "Advanced API Access",
75
+ ],
76
+ cta: "Contact Sales",
77
+ highlighted: false,
78
+ },
79
+ ],
80
+ } as Props,
81
+ propsDef: {
82
+ title: { type: "text", label: "Main Title" },
83
+ subtitle: { type: "text", label: "Subtitle" },
84
+ description: { type: "text", label: "Description" },
85
+ backgroundColor: { type: "color", label: "Background Color" },
86
+ textColor: { type: "color", label: "Text Color" },
87
+ accentColor: { type: "color", label: "Accent Color" },
88
+ py: { type: "number", label: "Vertical Padding" },
89
+ plans: { type: "list-json", label: "Plans (JSON List)" },
90
+ },
91
+ render() {
92
+ const {
93
+ title,
94
+ subtitle,
95
+ description,
96
+ plans,
97
+ backgroundColor,
98
+ textColor,
99
+ accentColor,
100
+ py,
101
+ } = this.props as Required<Props>;
102
+
103
+ return (
104
+ <UI.box py={py} px={40} style={{ backgroundColor }}>
105
+ <UI.container size="lg">
106
+ <UI.flex direction="column" align="center" gap={16} mb={80}>
107
+ {subtitle && (
108
+ <UI.badge
109
+ variant="light"
110
+ color={accentColor}
111
+ radius="xl"
112
+ size="lg"
113
+ >
114
+ {subtitle}
115
+ </UI.badge>
116
+ )}
117
+ <UI.title
118
+ text={title}
119
+ order={2}
120
+ fz={42}
121
+ fw={800}
122
+ ta="center"
123
+ c={textColor}
124
+ />
125
+ <UI.text
126
+ text={description}
127
+ size="lg"
128
+ ta="center"
129
+ maw={700}
130
+ c={textColor}
131
+ opacity={0.7}
132
+ />
133
+ </UI.flex>
134
+
135
+ <UI.simplegrid cols={{ base: 1, sm: 2, md: 3 }} spacing={32}>
136
+ {plans?.map((plan, index) => (
137
+ <UI.card
138
+ key={index}
139
+ p={40}
140
+ radius="xl"
141
+ shadow={plan.highlighted ? "xl" : "sm"}
142
+ withBorder
143
+ style={{
144
+ height: "100%",
145
+ display: "flex",
146
+ flexDirection: "column",
147
+ borderColor: plan.highlighted
148
+ ? `var(--mantine-color-${accentColor?.split(".")[0] || "blue"}-6)`
149
+ : undefined,
150
+ borderWidth: plan.highlighted ? 2 : 1,
151
+ transform: plan.highlighted ? "scale(1.05)" : undefined,
152
+ zIndex: plan.highlighted ? 1 : 0,
153
+ }}
154
+ >
155
+ <UI.flex direction="column" gap={12} mb={32}>
156
+ <UI.text
157
+ text={plan.name}
158
+ fw={700}
159
+ fz="sm"
160
+ tt="uppercase"
161
+ lts={1.5}
162
+ c={plan.highlighted ? accentColor : "gray.6"}
163
+ />
164
+ <UI.flex align="flex-end" gap={4}>
165
+ <UI.text text={plan.price} fz={42} fw={800} c={textColor} />
166
+ <UI.text
167
+ text={plan.period}
168
+ fz="lg"
169
+ fw={500}
170
+ c="gray.6"
171
+ mb={8}
172
+ />
173
+ </UI.flex>
174
+ <UI.text text={plan.description} fz="sm" c="gray.7" />
175
+ </UI.flex>
176
+
177
+ <UI.flex
178
+ direction="column"
179
+ gap={12}
180
+ mb={40}
181
+ style={{ flex: 1 }}
182
+ >
183
+ {plan.features.map((feature, fIndex) => (
184
+ <UI.flex key={fIndex} align="center" gap={8} opacity={0.8}>
185
+ <UI.icon icon="check_circle" c={accentColor} fz={18} />
186
+ <UI.text text={feature} fz="sm" c={textColor} />
187
+ </UI.flex>
188
+ ))}
189
+ </UI.flex>
190
+
191
+ <UI.button
192
+ variant={plan.highlighted ? "filled" : "outline"}
193
+ color={accentColor}
194
+ fullWidth
195
+ size="md"
196
+ radius="md"
197
+ fw={600}
198
+ >
199
+ {plan.cta}
200
+ </UI.button>
201
+ </UI.card>
202
+ ))}
203
+ </UI.simplegrid>
204
+ </UI.container>
205
+ </UI.box>
206
+ );
207
+ },
208
+ });
209
+
210
+ export default Component;
@@ -0,0 +1,149 @@
1
+ import { create_component } from "southpaw/modules/component";
2
+ import { UI } from "..";
3
+
4
+ type Testimonial = {
5
+ quote: string;
6
+ author: string;
7
+ role: string;
8
+ avatar: string;
9
+ company?: string;
10
+ };
11
+
12
+ type Props = {
13
+ title?: string;
14
+ subtitle?: string;
15
+ testimonials?: Testimonial[];
16
+ backgroundColor?: string;
17
+ textColor?: string;
18
+ accentColor?: string;
19
+ py?: number;
20
+ };
21
+
22
+ const Component = create_component({
23
+ name: "Testimonials",
24
+ description: "A section for customer testimonials and success stories",
25
+ props: {
26
+ title: "Trusted by developers worldwide",
27
+ subtitle: "Testimonials",
28
+ accentColor: "primary",
29
+ py: 120,
30
+ testimonials: [
31
+ {
32
+ quote:
33
+ "Southpaw has completely transformed our development process. Building UI has never been this fast and intuitive.",
34
+ author: "Sarah Jenkins",
35
+ role: "Senior Frontend Engineer",
36
+ avatar: "https://i.pravatar.cc/150?u=sarah",
37
+ company: "TechFlow",
38
+ },
39
+ {
40
+ quote:
41
+ "The visual editor combined with the power of TypeScript is a game changer. Our designers and developers can now collaborate seamlessly.",
42
+ author: "Michael Chen",
43
+ role: "Product Designer",
44
+ avatar: "https://i.pravatar.cc/150?u=michael",
45
+ company: "DesignCo",
46
+ },
47
+ {
48
+ quote:
49
+ "I've never seen a framework that handles state and styling so elegantly while still giving you full control over the code.",
50
+ author: "Emma Rodriguez",
51
+ role: "CTO",
52
+ avatar: "https://i.pravatar.cc/150?u=emma",
53
+ company: "StartupInc",
54
+ },
55
+ ],
56
+ } as Props,
57
+ propsDef: {
58
+ title: { type: "text", label: "Main Title" },
59
+ subtitle: { type: "text", label: "Subtitle" },
60
+ backgroundColor: { type: "color", label: "Background Color" },
61
+ textColor: { type: "color", label: "Text Color" },
62
+ accentColor: { type: "color", label: "Accent Color" },
63
+ py: { type: "number", label: "Vertical Padding" },
64
+ testimonials: { type: "list-text", label: "Testimonials (JSON List)" },
65
+ },
66
+ render() {
67
+ const {
68
+ title,
69
+ subtitle,
70
+ testimonials,
71
+ backgroundColor,
72
+ textColor,
73
+ accentColor,
74
+ py,
75
+ } = this.props as Required<Props>;
76
+
77
+ return (
78
+ <UI.box py={py} px={40} style={{ backgroundColor }}>
79
+ <UI.container size="lg">
80
+ <UI.flex direction="column" align="center" gap={16} mb={80}>
81
+ {subtitle && (
82
+ <UI.badge
83
+ variant="light"
84
+ color={accentColor}
85
+ radius="xl"
86
+ size="lg"
87
+ >
88
+ {subtitle}
89
+ </UI.badge>
90
+ )}
91
+ <UI.title
92
+ text={title}
93
+ order={2}
94
+ fz={42}
95
+ fw={800}
96
+ ta="center"
97
+ c={textColor}
98
+ />
99
+ </UI.flex>
100
+
101
+ <UI.simplegrid cols={{ base: 1, md: 3 }} spacing={40}>
102
+ {testimonials?.map((testimonial, index) => (
103
+ <UI.card
104
+ key={index}
105
+ p={40}
106
+ radius="xl"
107
+ shadow="md"
108
+ withBorder={false}
109
+ style={{
110
+ height: "100%",
111
+ display: "flex",
112
+ flexDirection: "column",
113
+ }}
114
+ >
115
+ <UI.flex gap={4} mb={24}>
116
+ {[1, 2, 3, 4, 5].map((_, starIndex) => (
117
+ <UI.icon key={starIndex} icon="star" c="yellow.6" fz={18} />
118
+ ))}
119
+ </UI.flex>
120
+ <UI.text
121
+ text={`"${testimonial.quote}"`}
122
+ fz="lg"
123
+ fw={500}
124
+ fs="italic"
125
+ lh={1.6}
126
+ mb={32}
127
+ style={{ flex: 1 }}
128
+ />
129
+ <UI.flex align="center" gap={16}>
130
+ <UI.avatar src={testimonial.avatar} radius="xl" size="md" />
131
+ <UI.flex direction="column">
132
+ <UI.text text={testimonial.author} fw={700} fz="sm" />
133
+ <UI.text
134
+ text={`${testimonial.role} at ${testimonial.company}`}
135
+ fz="xs"
136
+ c="gray.6"
137
+ />
138
+ </UI.flex>
139
+ </UI.flex>
140
+ </UI.card>
141
+ ))}
142
+ </UI.simplegrid>
143
+ </UI.container>
144
+ </UI.box>
145
+ );
146
+ },
147
+ });
148
+
149
+ export default Component;