From 4021a68a87c53549cd0fbb03bc359757b53e065a Mon Sep 17 00:00:00 2001 From: Khayal Date: Fri, 14 Feb 2025 10:47:28 -0800 Subject: [PATCH] refactor: move stateTerritoryOrMilitaryPostList to @gsa-tts/forms-core for better modularity and reuse TCKT-277 --- .../components/Address/Address.stories.tsx | 68 +------------------ packages/forms/src/index.ts | 1 + 2 files changed, 2 insertions(+), 67 deletions(-) diff --git a/packages/design/src/Form/components/Address/Address.stories.tsx b/packages/design/src/Form/components/Address/Address.stories.tsx index cec97e4ad..a7a9ce98c 100644 --- a/packages/design/src/Form/components/Address/Address.stories.tsx +++ b/packages/design/src/Form/components/Address/Address.stories.tsx @@ -3,73 +3,7 @@ import { FormProvider, useForm } from 'react-hook-form'; import { type Meta, type StoryObj } from '@storybook/react'; import AddressPattern from './index.js'; -// import { stateTerritoryOrMilitaryPostList } from '..'; - -const stateTerritoryOrMilitaryPostList = [ - { abbr: 'AL', label: 'AL - Alabama' }, - { abbr: 'AK', label: 'AK - Alaska' }, - { abbr: 'AS', label: 'AS - American' }, - { abbr: 'AZ', label: 'AZ - Arizona' }, - { abbr: 'AR', label: 'AR - Arkansas' }, - { abbr: 'CA', label: 'CA - California' }, - { abbr: 'CO', label: 'CO - Colorado' }, - { abbr: 'CT', label: 'CT - Connecticut' }, - { abbr: 'DE', label: 'DE - Delaware' }, - { abbr: 'DC', label: 'DC - District' }, - { abbr: 'FL', label: 'FL - Florida' }, - { abbr: 'GA', label: 'GA - Georgia' }, - { abbr: 'GU', label: 'GU - Guam' }, - { abbr: 'HI', label: 'HI - Hawaii' }, - { abbr: 'ID', label: 'ID - Idaho' }, - { abbr: 'IL', label: 'IL - Illinois' }, - { abbr: 'IN', label: 'IN - Indiana' }, - { abbr: 'IA', label: 'IA - Iowa' }, - { abbr: 'KS', label: 'KS - Kansas' }, - { abbr: 'KY', label: 'KY - Kentucky' }, - { abbr: 'LA', label: 'LA - Louisiana' }, - { abbr: 'ME', label: 'ME - Maine' }, - { abbr: 'MD', label: 'MD - Maryland' }, - { abbr: 'MA', label: 'MA - Massachusetts' }, - { abbr: 'MI', label: 'MI - Michigan' }, - { abbr: 'MN', label: 'MN - Minnesota' }, - { abbr: 'MS', label: 'MS - Mississippi' }, - { abbr: 'MO', label: 'MO - Missouri' }, - { abbr: 'MT', label: 'MT - Montana' }, - { abbr: 'NE', label: 'NE - Nebraska' }, - { abbr: 'NV', label: 'NV - Nevada' }, - { abbr: 'NH', label: 'NH - New' }, - { abbr: 'NJ', label: 'NJ - New' }, - { abbr: 'NM', label: 'NM - New' }, - { abbr: 'NY', label: 'NY - New' }, - { abbr: 'NC', label: 'NC - North' }, - { abbr: 'ND', label: 'ND - North' }, - { abbr: 'MP', label: 'MP - Northern' }, - { abbr: 'OH', label: 'OH - Ohio' }, - { abbr: 'OK', label: 'OK - Oklahoma' }, - { abbr: 'OR', label: 'OR - Oregon' }, - { abbr: 'PA', label: 'PA - Pennsylvania' }, - { abbr: 'PR', label: 'PR - Puerto' }, - { abbr: 'RI', label: 'RI - Rhode' }, - { abbr: 'SC', label: 'SC - South' }, - { abbr: 'SD', label: 'SD - South' }, - { abbr: 'TN', label: 'TN - Tennessee' }, - { abbr: 'TX', label: 'TX - Texas' }, - { abbr: 'UM', label: 'UM - United' }, - { abbr: 'UT', label: 'UT - Utah' }, - { abbr: 'VT', label: 'VT - Vermont' }, - { abbr: 'VI', label: 'VI - Virgin' }, - { abbr: 'VA', label: 'VA - Virginia' }, - { abbr: 'WA', label: 'WA - Washington' }, - { abbr: 'WV', label: 'WV - West' }, - { abbr: 'WI', label: 'WI - Wisconsin' }, - { abbr: 'WY', label: 'WY - Wyoming' }, - { abbr: 'AA', label: 'AA - Armed Forces Americas' }, - { abbr: 'AE', label: 'AE - Armed Forces Africa' }, - { abbr: 'AE', label: 'AE - Armed Forces Canada' }, - { abbr: 'AE', label: 'AE - Armed Forces Europe' }, - { abbr: 'AE', label: 'AE - Armed Forces Middle East' }, - { abbr: 'AP', label: 'AP - Armed Forces Pacific' }, -] as const; +import { stateTerritoryOrMilitaryPostList } from '@gsa-tts/forms-core'; const meta: Meta = { title: 'patterns/Address', diff --git a/packages/forms/src/index.ts b/packages/forms/src/index.ts index 9adfe2cd4..dc359170f 100644 --- a/packages/forms/src/index.ts +++ b/packages/forms/src/index.ts @@ -9,6 +9,7 @@ export * from './response.js'; export * from './session.js'; export * from './types.js'; export * from './util/base64.js'; +export * from './patterns/address/jurisdictions.js'; export { type FormService, createFormService } from './services/index.js'; export { defaultFormConfig,