From 6840fb1cd5ef090b60c7f96b6195b0fc0f02ca35 Mon Sep 17 00:00:00 2001 From: Daniel Naab Date: Wed, 27 Mar 2024 10:47:59 -0500 Subject: [PATCH] Rename forms/element.ts to forms/pattern.ts --- packages/forms/src/components.ts | 6 +++--- packages/forms/src/index.ts | 4 ++-- packages/forms/src/{element.ts => pattern.ts} | 0 packages/forms/src/patterns/fieldset.ts | 8 ++------ packages/forms/src/patterns/form-summary.ts | 2 +- packages/forms/src/patterns/index.ts | 3 ++- packages/forms/src/patterns/input.ts | 2 +- packages/forms/src/patterns/paragraph.ts | 2 +- packages/forms/src/patterns/sequence.ts | 2 +- packages/forms/src/session.ts | 2 +- 10 files changed, 14 insertions(+), 17 deletions(-) rename packages/forms/src/{element.ts => pattern.ts} (100%) diff --git a/packages/forms/src/components.ts b/packages/forms/src/components.ts index d61061e5..0baf6568 100644 --- a/packages/forms/src/components.ts +++ b/packages/forms/src/components.ts @@ -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<{ diff --git a/packages/forms/src/index.ts b/packages/forms/src/index.ts index 0c23cf93..dc51a817 100644 --- a/packages/forms/src/index.ts +++ b/packages/forms/src/index.ts @@ -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'; diff --git a/packages/forms/src/element.ts b/packages/forms/src/pattern.ts similarity index 100% rename from packages/forms/src/element.ts rename to packages/forms/src/pattern.ts diff --git a/packages/forms/src/patterns/fieldset.ts b/packages/forms/src/patterns/fieldset.ts index 487445de..21c6cf35 100644 --- a/packages/forms/src/patterns/fieldset.ts +++ b/packages/forms/src/patterns/fieldset.ts @@ -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<{ diff --git a/packages/forms/src/patterns/form-summary.ts b/packages/forms/src/patterns/form-summary.ts index 8bd0917c..ec54c9e2 100644 --- a/packages/forms/src/patterns/form-summary.ts +++ b/packages/forms/src/patterns/form-summary.ts @@ -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'; diff --git a/packages/forms/src/patterns/index.ts b/packages/forms/src/patterns/index.ts index cf3e03c2..65327fea 100644 --- a/packages/forms/src/patterns/index.ts +++ b/packages/forms/src/patterns/index.ts @@ -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'; diff --git a/packages/forms/src/patterns/input.ts b/packages/forms/src/patterns/input.ts index 97230865..250322d4 100644 --- a/packages/forms/src/patterns/input.ts +++ b/packages/forms/src/patterns/input.ts @@ -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'; diff --git a/packages/forms/src/patterns/paragraph.ts b/packages/forms/src/patterns/paragraph.ts index ebe9997d..cd0b950a 100644 --- a/packages/forms/src/patterns/paragraph.ts +++ b/packages/forms/src/patterns/paragraph.ts @@ -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'; diff --git a/packages/forms/src/patterns/sequence.ts b/packages/forms/src/patterns/sequence.ts index b35ac62b..8a6162c8 100644 --- a/packages/forms/src/patterns/sequence.ts +++ b/packages/forms/src/patterns/sequence.ts @@ -5,7 +5,7 @@ import { type PatternConfig, type PatternId, getPattern, -} from '../element'; +} from '../pattern'; import { createPromptForElement } from '../components'; import { safeZodParse } from '../util/zod'; diff --git a/packages/forms/src/session.ts b/packages/forms/src/session.ts index 0ee5f0ed..4771771e 100644 --- a/packages/forms/src/session.ts +++ b/packages/forms/src/session.ts @@ -10,7 +10,7 @@ import { type PatternId, type PatternValue, type PatternValueMap, -} from './element'; +} from './pattern'; type ErrorMap = Record;