swoop-common 2.1.7 → 2.1.9

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.
@@ -1 +1,16 @@
1
- export {};
1
+ import React from 'react';
2
+ interface Props {
3
+ data: Record<string, string>;
4
+ onChange: (stage: string, value: string) => void;
5
+ enabled: boolean;
6
+ label: string;
7
+ getError?: (field: string) => any;
8
+ }
9
+ interface Props {
10
+ data: Record<string, string>;
11
+ onChange: (stage: string, value: string) => void;
12
+ enabled: boolean;
13
+ label: string;
14
+ }
15
+ declare const FormStagedText: React.FC<Props>;
16
+ export default FormStagedText;
@@ -1,14 +1,25 @@
1
1
  import React from 'react';
2
- import { Paper, Typography, TextField } from '@mui/material';
2
+ import { Paper, Typography, TextareaAutosize } from '@mui/material';
3
3
  import { useLocalErrors } from '../hooks/errors';
4
4
  import { ComponentPool } from '../registry/types';
5
5
  import { registerComponent } from '../registry/components';
6
6
  const stages = ['website', 'quote', 'finalItinerary'];
7
7
  const FormStagedText = ({ data, onChange, enabled, label }) => {
8
- return (React.createElement(Paper, { component: "form", sx: { display: 'flex', flexDirection: 'column', gap: 2, p: 2, mb: 1 }, noValidate: true, autoComplete: "off" },
8
+ return (React.createElement(Paper, { component: "form", sx: { display: "flex", flexDirection: "column", gap: 2, p: 2, mb: 1 }, noValidate: true, autoComplete: "off" },
9
9
  React.createElement(Typography, { variant: "h6" }, label),
10
- stages.map((stage) => (React.createElement(TextField, { key: stage, label: stage.replace(/([A-Z])/g, ' $1'), value: data[stage] || '', onChange: (e) => onChange(stage, e.target.value), multiline: true, rows: 3, disabled: !enabled })))));
10
+ stages.map((stage) => (React.createElement("div", { key: stage },
11
+ React.createElement(Typography, { variant: "subtitle2", sx: { mb: 0.5, color: "text.secondary" } }, stage.replace(/([A-Z])/g, " $1")),
12
+ React.createElement(TextareaAutosize, { minRows: 3, disabled: !enabled, value: data[stage] || "", onChange: (e) => onChange(stage, e.target.value), style: {
13
+ width: "100%",
14
+ fontSize: "1rem",
15
+ padding: "8.5px 14px",
16
+ borderRadius: 4,
17
+ border: "1px solid rgba(0,0,0,0.23)",
18
+ fontFamily: "inherit",
19
+ backgroundColor: enabled ? "inherit" : "#f5f5f5",
20
+ } }))))));
11
21
  };
22
+ export default FormStagedText;
12
23
  const FormRendererStagedText = ({ data, handleChange, path, label, enabled }) => {
13
24
  const safeData = data || { website: '', quote: '', finalItinerary: '' };
14
25
  const getError = useLocalErrors(path);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swoop-common",
3
- "version": "2.1.7",
3
+ "version": "2.1.9",
4
4
  "main": "dist/api/index.js",
5
5
  "types": "dist/api/index.d.ts",
6
6
  "exports": {