@opensite/ui 1.7.2 → 1.7.3

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.
@@ -2,7 +2,7 @@
2
2
  import * as React from 'react';
3
3
  import React__default from 'react';
4
4
  import { useForm, Form, Field } from '@page-speed/forms';
5
- import { TextInput as TextInput$1, TextArea as TextArea$1 } from '@page-speed/forms/inputs';
5
+ import { TextInput, TextArea } from '@page-speed/forms/inputs';
6
6
  import { clsx } from 'clsx';
7
7
  import { twMerge } from 'tailwind-merge';
8
8
  import { cva } from 'class-variance-authority';
@@ -11,8 +11,6 @@ import * as LabelPrimitive from '@radix-ui/react-label';
11
11
  import { serializeForRails, deserializeErrors } from '@page-speed/forms/integration';
12
12
 
13
13
  // components/blocks/contact/contact-dark.tsx
14
- var TextInput = TextInput$1;
15
- var TextArea = TextArea$1;
16
14
  function cn(...inputs) {
17
15
  return twMerge(clsx(inputs));
18
16
  }
@@ -1072,7 +1070,6 @@ function ContactDark({
1072
1070
  socialLinks,
1073
1071
  socialLinksSlot,
1074
1072
  className,
1075
- containerClassName,
1076
1073
  headerClassName,
1077
1074
  headingClassName,
1078
1075
  descriptionClassName,
@@ -1083,10 +1080,11 @@ function ContactDark({
1083
1080
  infoPanelClassName,
1084
1081
  contactOptionsClassName,
1085
1082
  socialLinksClassName,
1086
- background = "white",
1087
- spacing = "xl",
1083
+ background,
1084
+ spacing = "py-8 md:py-32",
1085
+ containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
1088
1086
  pattern,
1089
- patternOpacity = 0.1,
1087
+ patternOpacity,
1090
1088
  formConfig,
1091
1089
  onSubmit,
1092
1090
  onSuccess,
@@ -1143,7 +1141,14 @@ function ContactDark({
1143
1141
  if (actionsSlot) return actionsSlot;
1144
1142
  if (actions && actions.length > 0) {
1145
1143
  return actions.map((action, index) => {
1146
- const { label, icon, iconAfter, children, className: actionClassName, ...pressableProps } = action;
1144
+ const {
1145
+ label,
1146
+ icon,
1147
+ iconAfter,
1148
+ children,
1149
+ className: actionClassName,
1150
+ ...pressableProps
1151
+ } = action;
1147
1152
  return /* @__PURE__ */ jsx(
1148
1153
  Pressable,
1149
1154
  {
@@ -1209,103 +1214,140 @@ function ContactDark({
1209
1214
  spacing,
1210
1215
  pattern,
1211
1216
  patternOpacity,
1212
- className: cn("py-12", className),
1213
- children: /* @__PURE__ */ jsxs("div", { className: cn("mx-auto w-full max-w-4xl px-4", containerClassName), children: [
1217
+ className,
1218
+ containerClassName,
1219
+ children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
1214
1220
  /* @__PURE__ */ jsxs("div", { className: cn("mb-10 text-center", headerClassName), children: [
1215
- heading && (typeof heading === "string" ? /* @__PURE__ */ jsx("h2", { className: cn("mb-3 text-3xl font-bold tracking-tight", headingClassName), children: heading }) : /* @__PURE__ */ jsx("div", { className: headingClassName, children: heading })),
1216
- description && (typeof description === "string" ? /* @__PURE__ */ jsx("p", { className: cn("leading-relaxed text-muted-foreground", descriptionClassName), children: description }) : /* @__PURE__ */ jsx("div", { className: descriptionClassName, children: description }))
1217
- ] }),
1218
- /* @__PURE__ */ jsxs(Card, { className: cn("grid gap-0 overflow-hidden lg:grid-cols-2", cardClassName), children: [
1219
- /* @__PURE__ */ jsx("div", { className: cn("p-6 lg:p-8", formPanelClassName), children: /* @__PURE__ */ jsxs(
1220
- Form,
1221
+ heading && (typeof heading === "string" ? /* @__PURE__ */ jsx(
1222
+ "h2",
1221
1223
  {
1222
- form,
1223
- action: formConfig?.endpoint,
1224
- method: formMethod,
1225
- className: cn("space-y-6", formClassName),
1226
- children: [
1227
- /* @__PURE__ */ jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [
1228
- /* @__PURE__ */ jsx(Field, { name: "firstName", children: ({ field, meta }) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
1229
- /* @__PURE__ */ jsx(Label, { htmlFor: "first-name", children: "First Name" }),
1230
- /* @__PURE__ */ jsx(
1231
- TextInput,
1224
+ className: cn(
1225
+ "mb-3 text-3xl font-bold tracking-tight",
1226
+ headingClassName
1227
+ ),
1228
+ children: heading
1229
+ }
1230
+ ) : /* @__PURE__ */ jsx("div", { className: headingClassName, children: heading })),
1231
+ description && (typeof description === "string" ? /* @__PURE__ */ jsx("p", { className: cn("leading-relaxed ", descriptionClassName), children: description }) : /* @__PURE__ */ jsx("div", { className: descriptionClassName, children: description }))
1232
+ ] }),
1233
+ /* @__PURE__ */ jsxs(
1234
+ Card,
1235
+ {
1236
+ className: cn(
1237
+ "grid gap-0 overflow-hidden lg:grid-cols-2",
1238
+ cardClassName
1239
+ ),
1240
+ children: [
1241
+ /* @__PURE__ */ jsx("div", { className: cn("p-6 lg:p-8", formPanelClassName), children: /* @__PURE__ */ jsxs(
1242
+ Form,
1243
+ {
1244
+ form,
1245
+ action: formConfig?.endpoint,
1246
+ method: formMethod,
1247
+ className: cn("space-y-6", formClassName),
1248
+ children: [
1249
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [
1250
+ /* @__PURE__ */ jsx(Field, { name: "firstName", children: ({ field, meta }) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
1251
+ /* @__PURE__ */ jsx(Label, { htmlFor: "first-name", children: "First Name" }),
1252
+ /* @__PURE__ */ jsx(
1253
+ TextInput,
1254
+ {
1255
+ ...field,
1256
+ id: "first-name",
1257
+ placeholder: "John",
1258
+ error: meta.touched && !!meta.error,
1259
+ "aria-label": "First Name"
1260
+ }
1261
+ )
1262
+ ] }) }),
1263
+ /* @__PURE__ */ jsx(Field, { name: "lastName", children: ({ field, meta }) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
1264
+ /* @__PURE__ */ jsx(Label, { htmlFor: "last-name", children: "Last Name" }),
1265
+ /* @__PURE__ */ jsx(
1266
+ TextInput,
1267
+ {
1268
+ ...field,
1269
+ id: "last-name",
1270
+ placeholder: "Doe",
1271
+ error: meta.touched && !!meta.error,
1272
+ "aria-label": "Last Name"
1273
+ }
1274
+ )
1275
+ ] }) })
1276
+ ] }),
1277
+ /* @__PURE__ */ jsx(Field, { name: "email", children: ({ field, meta }) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
1278
+ /* @__PURE__ */ jsx(Label, { htmlFor: "email", children: "Email Address" }),
1279
+ /* @__PURE__ */ jsx(
1280
+ TextInput,
1281
+ {
1282
+ ...field,
1283
+ id: "email",
1284
+ type: "email",
1285
+ placeholder: "john@example.com",
1286
+ error: meta.touched && !!meta.error,
1287
+ "aria-label": "Email Address"
1288
+ }
1289
+ )
1290
+ ] }) }),
1291
+ /* @__PURE__ */ jsx(Field, { name: "message", children: ({ field, meta }) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
1292
+ /* @__PURE__ */ jsx(Label, { htmlFor: "message", children: "Message" }),
1293
+ /* @__PURE__ */ jsx(
1294
+ TextArea,
1295
+ {
1296
+ ...field,
1297
+ id: "message",
1298
+ placeholder: "Tell us how we can help...",
1299
+ rows: 4,
1300
+ error: meta.touched && !!meta.error,
1301
+ "aria-label": "Message"
1302
+ }
1303
+ )
1304
+ ] }) }),
1305
+ actionsSlot || actions && actions.length > 0 ? actionsContent : /* @__PURE__ */ jsxs(
1306
+ Pressable,
1232
1307
  {
1233
- ...field,
1234
- id: "first-name",
1235
- placeholder: "John",
1236
- error: meta.touched && !!meta.error,
1237
- "aria-label": "First Name"
1308
+ componentType: "button",
1309
+ type: "submit",
1310
+ className: cn("w-full", submitClassName),
1311
+ asButton: true,
1312
+ disabled: form.isSubmitting,
1313
+ children: [
1314
+ buttonIcon,
1315
+ buttonText
1316
+ ]
1238
1317
  }
1239
1318
  )
1240
- ] }) }),
1241
- /* @__PURE__ */ jsx(Field, { name: "lastName", children: ({ field, meta }) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
1242
- /* @__PURE__ */ jsx(Label, { htmlFor: "last-name", children: "Last Name" }),
1319
+ ]
1320
+ }
1321
+ ) }),
1322
+ /* @__PURE__ */ jsxs(
1323
+ "div",
1324
+ {
1325
+ className: cn(
1326
+ "flex flex-col justify-between bg-primary p-6 text-primary-foreground lg:p-8",
1327
+ infoPanelClassName
1328
+ ),
1329
+ children: [
1330
+ /* @__PURE__ */ jsxs("div", { children: [
1331
+ contactHeading && (typeof contactHeading === "string" ? /* @__PURE__ */ jsx("h3", { className: "mb-3 text-xl font-semibold", children: contactHeading }) : /* @__PURE__ */ jsx("div", { className: "mb-3", children: contactHeading })),
1332
+ contactDescription && (typeof contactDescription === "string" ? /* @__PURE__ */ jsx("p", { className: "mb-8 text-sm text-primary-foreground/80", children: contactDescription }) : /* @__PURE__ */ jsx("div", { className: "mb-8", children: contactDescription })),
1333
+ /* @__PURE__ */ jsx("div", { className: cn("space-y-4", contactOptionsClassName), children: contactOptionsContent })
1334
+ ] }),
1243
1335
  /* @__PURE__ */ jsx(
1244
- TextInput,
1336
+ "div",
1245
1337
  {
1246
- ...field,
1247
- id: "last-name",
1248
- placeholder: "Doe",
1249
- error: meta.touched && !!meta.error,
1250
- "aria-label": "Last Name"
1338
+ className: cn(
1339
+ "mt-8 flex items-center gap-4",
1340
+ socialLinksClassName
1341
+ ),
1342
+ children: socialLinksContent
1251
1343
  }
1252
1344
  )
1253
- ] }) })
1254
- ] }),
1255
- /* @__PURE__ */ jsx(Field, { name: "email", children: ({ field, meta }) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
1256
- /* @__PURE__ */ jsx(Label, { htmlFor: "email", children: "Email Address" }),
1257
- /* @__PURE__ */ jsx(
1258
- TextInput,
1259
- {
1260
- ...field,
1261
- id: "email",
1262
- type: "email",
1263
- placeholder: "john@example.com",
1264
- error: meta.touched && !!meta.error,
1265
- "aria-label": "Email Address"
1266
- }
1267
- )
1268
- ] }) }),
1269
- /* @__PURE__ */ jsx(Field, { name: "message", children: ({ field, meta }) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
1270
- /* @__PURE__ */ jsx(Label, { htmlFor: "message", children: "Message" }),
1271
- /* @__PURE__ */ jsx(
1272
- TextArea,
1273
- {
1274
- ...field,
1275
- id: "message",
1276
- placeholder: "Tell us how we can help...",
1277
- rows: 4,
1278
- error: meta.touched && !!meta.error,
1279
- "aria-label": "Message"
1280
- }
1281
- )
1282
- ] }) }),
1283
- actionsSlot || actions && actions.length > 0 ? actionsContent : /* @__PURE__ */ jsxs(
1284
- Pressable,
1285
- {
1286
- componentType: "button",
1287
- type: "submit",
1288
- className: cn("w-full", submitClassName),
1289
- asButton: true,
1290
- disabled: form.isSubmitting,
1291
- children: [
1292
- buttonIcon,
1293
- buttonText
1294
- ]
1295
- }
1296
- )
1297
- ]
1298
- }
1299
- ) }),
1300
- /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col justify-between bg-primary p-6 text-primary-foreground lg:p-8", infoPanelClassName), children: [
1301
- /* @__PURE__ */ jsxs("div", { children: [
1302
- contactHeading && (typeof contactHeading === "string" ? /* @__PURE__ */ jsx("h3", { className: "mb-3 text-xl font-semibold", children: contactHeading }) : /* @__PURE__ */ jsx("div", { className: "mb-3", children: contactHeading })),
1303
- contactDescription && (typeof contactDescription === "string" ? /* @__PURE__ */ jsx("p", { className: "mb-8 text-sm text-primary-foreground/80", children: contactDescription }) : /* @__PURE__ */ jsx("div", { className: "mb-8", children: contactDescription })),
1304
- /* @__PURE__ */ jsx("div", { className: cn("space-y-4", contactOptionsClassName), children: contactOptionsContent })
1305
- ] }),
1306
- /* @__PURE__ */ jsx("div", { className: cn("mt-8 flex items-center gap-4", socialLinksClassName), children: socialLinksContent })
1307
- ] })
1308
- ] })
1345
+ ]
1346
+ }
1347
+ )
1348
+ ]
1349
+ }
1350
+ )
1309
1351
  ] })
1310
1352
  }
1311
1353
  );
@@ -33,8 +33,6 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
33
33
  var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
34
34
 
35
35
  // components/blocks/contact/contact-faq.tsx
36
- var TextInput = inputs.TextInput;
37
- var TextArea = inputs.TextArea;
38
36
  function cn(...inputs) {
39
37
  return tailwindMerge.twMerge(clsx.clsx(inputs));
40
38
  }
@@ -994,7 +992,6 @@ function ContactFaq({
994
992
  actions,
995
993
  actionsSlot,
996
994
  className,
997
- containerClassName,
998
995
  headerClassName,
999
996
  headingClassName,
1000
997
  descriptionClassName,
@@ -1003,10 +1000,11 @@ function ContactFaq({
1003
1000
  formHeadingClassName,
1004
1001
  formClassName,
1005
1002
  submitClassName,
1006
- background = "white",
1007
- spacing = "xl",
1003
+ background,
1004
+ spacing = "py-8 md:py-32",
1005
+ containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
1008
1006
  pattern,
1009
- patternOpacity = 0.1,
1007
+ patternOpacity,
1010
1008
  formConfig,
1011
1009
  onSubmit,
1012
1010
  onSuccess,
@@ -1063,7 +1061,14 @@ function ContactFaq({
1063
1061
  if (actionsSlot) return actionsSlot;
1064
1062
  if (actions && actions.length > 0) {
1065
1063
  return actions.map((action, index) => {
1066
- const { label, icon, iconAfter, children, className: actionClassName, ...pressableProps } = action;
1064
+ const {
1065
+ label,
1066
+ icon,
1067
+ iconAfter,
1068
+ children,
1069
+ className: actionClassName,
1070
+ ...pressableProps
1071
+ } = action;
1067
1072
  return /* @__PURE__ */ jsxRuntime.jsx(
1068
1073
  Pressable,
1069
1074
  {
@@ -1089,14 +1094,42 @@ function ContactFaq({
1089
1094
  spacing,
1090
1095
  pattern,
1091
1096
  patternOpacity,
1092
- className: cn("py-12", className),
1093
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("mx-auto max-w-4xl px-4", containerClassName), children: [
1097
+ className,
1098
+ containerClassName,
1099
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
1094
1100
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("mb-10 text-center", headerClassName), children: [
1095
- heading && (typeof heading === "string" ? /* @__PURE__ */ jsxRuntime.jsx("h2", { className: cn("mb-3 text-3xl font-bold tracking-tight", headingClassName), children: heading }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: headingClassName, children: heading })),
1096
- description && (typeof description === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("leading-relaxed text-muted-foreground", descriptionClassName), children: description }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: descriptionClassName, children: description }))
1101
+ heading && (typeof heading === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
1102
+ "h2",
1103
+ {
1104
+ className: cn(
1105
+ "mb-3 text-3xl font-bold tracking-tight text-balance",
1106
+ headingClassName
1107
+ ),
1108
+ children: heading
1109
+ }
1110
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: headingClassName, children: heading })),
1111
+ description && (typeof description === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
1112
+ "p",
1113
+ {
1114
+ className: cn(
1115
+ "leading-relaxed text-balance",
1116
+ descriptionClassName
1117
+ ),
1118
+ children: description
1119
+ }
1120
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: descriptionClassName, children: description }))
1097
1121
  ] }),
1098
1122
  /* @__PURE__ */ jsxRuntime.jsx(Card, { className: cn("mx-auto max-w-xl", cardClassName), children: /* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: cn("p-6 lg:p-8", cardContentClassName), children: [
1099
- formHeading && (typeof formHeading === "string" ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: cn("mb-6 text-xl font-semibold", formHeadingClassName), children: formHeading }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: formHeadingClassName, children: formHeading })),
1123
+ formHeading && (typeof formHeading === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
1124
+ "h3",
1125
+ {
1126
+ className: cn(
1127
+ "mb-6 text-xl font-semibold",
1128
+ formHeadingClassName
1129
+ ),
1130
+ children: formHeading
1131
+ }
1132
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: formHeadingClassName, children: formHeading })),
1100
1133
  /* @__PURE__ */ jsxRuntime.jsxs(
1101
1134
  forms.Form,
1102
1135
  {
@@ -1109,7 +1142,7 @@ function ContactFaq({
1109
1142
  /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "name", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
1110
1143
  /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "name", children: "Name" }),
1111
1144
  /* @__PURE__ */ jsxRuntime.jsx(
1112
- TextInput,
1145
+ inputs.TextInput,
1113
1146
  {
1114
1147
  ...field,
1115
1148
  id: "name",
@@ -1122,7 +1155,7 @@ function ContactFaq({
1122
1155
  /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "email", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
1123
1156
  /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "email", children: "Email" }),
1124
1157
  /* @__PURE__ */ jsxRuntime.jsx(
1125
- TextInput,
1158
+ inputs.TextInput,
1126
1159
  {
1127
1160
  ...field,
1128
1161
  id: "email",
@@ -1137,7 +1170,7 @@ function ContactFaq({
1137
1170
  /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "subject", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
1138
1171
  /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "subject", children: "Subject" }),
1139
1172
  /* @__PURE__ */ jsxRuntime.jsx(
1140
- TextInput,
1173
+ inputs.TextInput,
1141
1174
  {
1142
1175
  ...field,
1143
1176
  id: "subject",
@@ -1150,7 +1183,7 @@ function ContactFaq({
1150
1183
  /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "message", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
1151
1184
  /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "message", children: "Message" }),
1152
1185
  /* @__PURE__ */ jsxRuntime.jsx(
1153
- TextArea,
1186
+ inputs.TextArea,
1154
1187
  {
1155
1188
  ...field,
1156
1189
  id: "message",