Skip to content

Commit

Permalink
Rename forms/element.ts to forms/pattern.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnaab committed Mar 27, 2024
1 parent b62da46 commit 6840fb1
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 17 deletions.
6 changes: 3 additions & 3 deletions packages/forms/src/components.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getRootPattern } from '..';
import {
type FormConfig,
type Pattern,
type PatternId,
getRootPattern,
} from '..';
import { getPatternConfig } from './element';
getPatternConfig,
} from './pattern';
import { type FormSession, nullSession, sessionIsComplete } from './session';

export type TextInputProps = PatternProps<{
Expand Down
4 changes: 2 additions & 2 deletions packages/forms/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import {
type PatternMap,
getPatternMap,
getPatternConfig,
} from './element';
} from './pattern';

export * from './builder';
export * from './components';
export * from './config';
export * from './documents';
export * from './element';
export * from './pattern';
export * from './response';
export * from './session';

Expand Down
File renamed without changes.
8 changes: 2 additions & 6 deletions packages/forms/src/patterns/fieldset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ import {
type PatternConfig,
type PatternId,
getPattern,
} from '../element';
import {
type FieldsetProps,
type PatternProps,
createPromptForElement,
} from '../components';
} from '../pattern';
import { type FieldsetProps, createPromptForElement } from '../components';
import { safeZodParse } from '../util/zod';

export type FieldsetElement = Pattern<{
Expand Down
2 changes: 1 addition & 1 deletion packages/forms/src/patterns/form-summary.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as z from 'zod';

import { type Pattern, type PatternConfig } from '../element';
import { type Pattern, type PatternConfig } from '../pattern';
import { type FormSummaryProps } from '../components';
import { safeZodParse } from '../util/zod';

Expand Down
3 changes: 2 additions & 1 deletion packages/forms/src/patterns/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { FormConfig } from '../element';
import { type FormConfig } from '../pattern';

import { fieldsetConfig } from './fieldset';
import { inputConfig } from './input';
import { paragraphConfig } from './paragraph';
Expand Down
2 changes: 1 addition & 1 deletion packages/forms/src/patterns/input.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as z from 'zod';

import { type Pattern, type PatternConfig, validateElement } from '../element';
import { type Pattern, type PatternConfig, validateElement } from '../pattern';
import { type TextInputProps } from '../components';
import { getFormSessionValue } from '../session';
import { safeZodParse } from '../util/zod';
Expand Down
2 changes: 1 addition & 1 deletion packages/forms/src/patterns/paragraph.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as z from 'zod';

import { type Pattern, type PatternConfig } from '../element';
import { type Pattern, type PatternConfig } from '../pattern';
import { type ParagraphProps } from '../components';
import { safeZodParse } from '../util/zod';

Expand Down
2 changes: 1 addition & 1 deletion packages/forms/src/patterns/sequence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
type PatternConfig,
type PatternId,
getPattern,
} from '../element';
} from '../pattern';
import { createPromptForElement } from '../components';
import { safeZodParse } from '../util/zod';

Expand Down
2 changes: 1 addition & 1 deletion packages/forms/src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
type PatternId,
type PatternValue,
type PatternValueMap,
} from './element';
} from './pattern';

type ErrorMap = Record<PatternId, string>;

Expand Down

0 comments on commit 6840fb1

Please sign in to comment.