Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/automated-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jobs:
# This is a temporary fix to allow the workflow continue providing
# autofixes while these errors are being addressed.
continue-on-error: true
- run: pnpm run prettier
name: Running prettier
- run: pnpm run fmt
name: Running formatter

- name: Push changes
id: push-changes
uses: EndBug/add-and-commit@v9
with:
message: "Automated linting/prettier update"
message: "Automated linting/formatter update"
add: "*"
push: true
pull: --rebase --autostash
Expand All @@ -42,7 +42,7 @@ jobs:
uses: actions/github-script@v3
with:
script: |
core.setFailed('Linting/Prettier changes were made. A new commit with autofixes was pushed.')
core.setFailed('Linting/formatter changes were made. A new commit with autofixes was pushed.')
- name: Fail job on linting error
if: steps.oxlint.outcome == 'failure'
uses: actions/github-script@v3
Expand Down
3 changes: 3 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"trailingComma": "es5"
}
12 changes: 2 additions & 10 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
{
"rules": {
"no-unused-vars": [
"error",
{ "caughtErrorsIgnorePattern": "^_", "argsIgnorePattern": "^_" }
]
"no-unused-vars": ["error", { "caughtErrorsIgnorePattern": "^_", "argsIgnorePattern": "^_" }]
},
"ignorePatterns": [
"**/*/dist",
"!.storybook",
"**/*/storybook-static/**",
"test-sites/**"
]
"ignorePatterns": ["**/*/dist", "!.storybook", "**/*/storybook-static/**", "test-sites/**"]
}
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"scripts": {
"build": "pnpm -r run build",
"test": "pnpm -r run test",
"prettier": "prettier --write --cache .",
"fmt": "oxfmt",
"lint": "oxlint --fix",
"autofix": "npm run lint && npm run prettier",
"autofix": "npm run lint && npm run fmt",
"generate-notices": "generate-license-file --input package.json --output ./THIRD-PARTY-NOTICES --overwrite",
"ci-verify-publish": "tsx scripts/verifyPublish.ts",
"release": "tsx scripts/release.ts"
Expand All @@ -23,19 +23,19 @@
"generate-license-file": "^2.0.0",
"lint-staged": "^13.2.3",
"minimist": "^1.2.8",
"oxlint": "^1.26.0",
"oxfmt": "^0.21.0",
"oxlint": "^1.36.0",
"picocolors": "^1.0.0",
"prettier": "^3.2.5",
"prompts": "^2.4.2",
"semver": "^7.5.4",
"tsx": "^4.19.3"
},
"engines": {
"node": ">=14.0.0"
},
"packageManager": "pnpm@9.12.3",
"lint-staged": {
"*": "prettier --write --cache --ignore-unknown",
"*": "oxfmt",
"*.{ts,js,tsx,jsx}": "oxlint --fix"
}
},
"engines": {
"node": "^20 || ^22 || ^24"
},
"packageManager": "pnpm@9.12.3"
}
5 changes: 3 additions & 2 deletions packages/pages-components/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ const preview: Preview = {
// Store the real DateTime
const originalLuxonSettings = useRef(Settings);

const mockedLuxonDateTimeFromParams = context.parameters
.mockedLuxonDateTime as DateTime | undefined;
const mockedLuxonDateTimeFromParams = context.parameters.mockedLuxonDateTime as
| DateTime
| undefined;

const overrideDateTime = useCallback(() => {
if (mockedLuxonDateTimeFromParams) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { Page } from "playwright-core";
import {
TestRunnerConfig,
waitForPageReady,
TestContext,
} from "@storybook/test-runner";
import { TestRunnerConfig, waitForPageReady, TestContext } from "@storybook/test-runner";
import { toMatchImageSnapshot } from "jest-image-snapshot";

const customSnapshotsDir = `${process.cwd()}/.storybook/snapshots/__snapshots__`;
Expand Down
16 changes: 8 additions & 8 deletions packages/pages-components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

##### New Features

* swap to tsup for builds ([#139](https://github.com/yext/js/pull/139)) ([43a77a0b](https://github.com/yext/js/commit/43a77a0bec7554670c0ccb525d05b4de4dc9f1ad))
* support React 19 ([#138](https://github.com/yext/js/pull/138)) ([5f5bfaf3](https://github.com/yext/js/commit/5f5bfaf3b711d8f28e4a4500e40d030da4e40495))
- swap to tsup for builds ([#139](https://github.com/yext/js/pull/139)) ([43a77a0b](https://github.com/yext/js/commit/43a77a0bec7554670c0ccb525d05b4de4dc9f1ad))
- support React 19 ([#138](https://github.com/yext/js/pull/138)) ([5f5bfaf3](https://github.com/yext/js/commit/5f5bfaf3b711d8f28e4a4500e40d030da4e40495))

##### Bug Fixes

* storybook env parsing vulnerability ([#140](https://github.com/yext/js/pull/140)) ([c69d6912](https://github.com/yext/js/commit/c69d69126157a17e5944037e19bc0187e91d1328))
* exports resolution ([#136](https://github.com/yext/js/pull/136)) ([80f77284](https://github.com/yext/js/commit/80f77284ab5243fb8112377441083566a60d6b23))
* release script ([00f0f279](https://github.com/yext/js/commit/00f0f279e42e0678ec51a9438a520fb68c5ffe74))
- storybook env parsing vulnerability ([#140](https://github.com/yext/js/pull/140)) ([c69d6912](https://github.com/yext/js/commit/c69d69126157a17e5944037e19bc0187e91d1328))
- exports resolution ([#136](https://github.com/yext/js/pull/136)) ([80f77284](https://github.com/yext/js/commit/80f77284ab5243fb8112377441083566a60d6b23))
- release script ([00f0f279](https://github.com/yext/js/commit/00f0f279e42e0678ec51a9438a520fb68c5ffe74))

##### Other Changes

* drop Node 18 support ([#137](https://github.com/yext/js/pull/137)) ([69a1ec05](https://github.com/yext/js/commit/69a1ec05d40869a812bfc89c88f3963632597bfc))
* drop support for React 17 ([#134](https://github.com/yext/js/pull/134)) ([1e812b55](https://github.com/yext/js/commit/1e812b55d12a6324d987c814724d9af7e309b2a9))
* drop LexicalRichText and LegacyRichText ([#133](https://github.com/yext/js/pull/133)) ([57eb25e6](https://github.com/yext/js/commit/57eb25e69b1a1b5bf81cabebcb0b942932c1162d))
- drop Node 18 support ([#137](https://github.com/yext/js/pull/137)) ([69a1ec05](https://github.com/yext/js/commit/69a1ec05d40869a812bfc89c88f3963632597bfc))
- drop support for React 17 ([#134](https://github.com/yext/js/pull/134)) ([1e812b55](https://github.com/yext/js/commit/1e812b55d12a6324d987c814724d9af7e309b2a9))
- drop LexicalRichText and LegacyRichText ([#133](https://github.com/yext/js/pull/133)) ([57eb25e6](https://github.com/yext/js/commit/57eb25e69b1a1b5bf81cabebcb0b942932c1162d))

#### 1.2.3 (2025-12-22)

Expand Down
44 changes: 22 additions & 22 deletions packages/pages-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,26 @@
"name": "@yext/pages-components",
"version": "2.0.0",
"description": "A React component library that supports Yext Pages development",
"author": "sumo@yext.com",
"license": "BSD-3-Clause",
"keywords": [
"Yext",
"React"
"React",
"Yext"
],
"license": "BSD-3-Clause",
"author": "sumo@yext.com",
"repository": {
"type": "git",
"url": "https://github.com/yext/js.git"
},
"sideEffects": [
"**/*.css"
],
"type": "module",
"files": [
"dist",
"THIRD-PARTY-NOTICES"
],
"type": "module",
"sideEffects": [
"**/*.css"
],
"module": "./dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
Expand All @@ -29,10 +30,6 @@
},
"./style.css": "./dist/index.css"
},
"types": "dist/index.d.ts",
"engines": {
"node": "^20 || ^22 || ^24"
},
"scripts": {
"dev": "pnpm run storybook",
"build:vite": "tsc && vite build",
Expand All @@ -46,11 +43,11 @@
"prepare": "pnpm build",
"update-snapshots": "test-storybook -c .storybook/snapshots -u"
},
"peerDependencies": {
"lexical": "~0.38.2",
"mapbox-gl": "^2.9.2",
"react": "^18.2.0 || ^19.2.3",
"react-dom": "^18.2.0 || ^19.2.3"
"dependencies": {
"@yext/analytics": "^1.0.0",
"browser-or-node": "^3.0.0",
"classnames": "^2.5.1",
"luxon": "^3.7.2"
},
"devDependencies": {
"@playwright/test": "^1.55.1",
Expand Down Expand Up @@ -95,10 +92,13 @@
"vite-tsconfig-paths": "^4.2.2",
"vitest": "^3.0.5"
},
"dependencies": {
"@yext/analytics": "^1.0.0",
"browser-or-node": "^3.0.0",
"classnames": "^2.5.1",
"luxon": "^3.7.2"
"peerDependencies": {
"lexical": "~0.38.2",
"mapbox-gl": "^2.9.2",
"react": "^18.2.0 || ^19.2.3",
"react-dom": "^18.2.0 || ^19.2.3"
},
"engines": {
"node": "^20 || ^22 || ^24"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ const meta: Meta<typeof AddressComponent> = {

export default meta;

const Template: StoryFn<typeof AddressComponent> = (args) => (
<AddressComponent {...args} />
);
const Template: StoryFn<typeof AddressComponent> = (args) => <AddressComponent {...args} />;

// Address in the United States

Expand All @@ -35,77 +33,63 @@ Address.args = {

// Address to Yext Arlington Office

export const Address_Arlington: StoryFn<typeof AddressComponent> =
Template.bind({});
export const Address_Arlington: StoryFn<typeof AddressComponent> = Template.bind({});

Address_Arlington.args = {
address: Arlington,
};

// Address to Yext Berlin Office

export const Address_Berlin: StoryFn<typeof AddressComponent> = Template.bind(
{}
);
export const Address_Berlin: StoryFn<typeof AddressComponent> = Template.bind({});

Address_Berlin.args = {
address: Berlin,
};

// Address to Yext Chicago Office

export const Address_Chicago: StoryFn<typeof AddressComponent> = Template.bind(
{}
);
export const Address_Chicago: StoryFn<typeof AddressComponent> = Template.bind({});

Address_Chicago.args = {
address: Chicago,
};

// Address to Yext London Office

export const Address_London: StoryFn<typeof AddressComponent> = Template.bind(
{}
);
export const Address_London: StoryFn<typeof AddressComponent> = Template.bind({});

Address_London.args = {
address: London,
};

// Address to Yext Miami Office

export const Address_Miami: StoryFn<typeof AddressComponent> = Template.bind(
{}
);
export const Address_Miami: StoryFn<typeof AddressComponent> = Template.bind({});

Address_Miami.args = {
address: Miami,
};

// Address to Yext New York Office

export const Address_NewYork: StoryFn<typeof AddressComponent> = Template.bind(
{}
);
export const Address_NewYork: StoryFn<typeof AddressComponent> = Template.bind({});

Address_NewYork.args = {
address: NewYork,
};

// Address to Yext Paris Office

export const Address_Paris: StoryFn<typeof AddressComponent> = Template.bind(
{}
);
export const Address_Paris: StoryFn<typeof AddressComponent> = Template.bind({});

Address_Paris.args = {
address: Paris,
};

// Address to Yext San Francisco Office

export const Address_SanFrancisco: StoryFn<typeof AddressComponent> =
Template.bind({});
export const Address_SanFrancisco: StoryFn<typeof AddressComponent> = Template.bind({});

Address_SanFrancisco.args = {
address: SanFrancisco,
Expand Down
30 changes: 6 additions & 24 deletions packages/pages-components/src/components/address/address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,10 @@ import "./address.css";
*
* @public
*/
export const Address = ({
address,
lines,
separator = ",",
...props
}: AddressProps) => {
const renderedLines = (lines || localeAddressFormat(address.countryCode)).map(
(line) => (
<AddressLine
key={line.toString()}
address={address}
line={line}
separator={separator}
/>
)
);
export const Address = ({ address, lines, separator = ",", ...props }: AddressProps) => {
const renderedLines = (lines || localeAddressFormat(address.countryCode)).map((line) => (
<AddressLine key={line.toString()} address={address} line={line} separator={separator} />
));

return (
<div {...props} key={address.toString()}>
Expand All @@ -44,19 +32,13 @@ export const Address = ({
);
};

const AddressLine = ({
address,
line,
separator,
}: AddressLineProps): React.ReactElement => {
const AddressLine = ({ address, line, separator }: AddressLineProps): React.ReactElement => {
const addressDOM: React.ReactElement[] = [];
let separatorCount = 0;

for (const field of line) {
if (field === ",") {
addressDOM.push(
<span key={`separator-${separatorCount++}`}>{separator}</span>
);
addressDOM.push(<span key={`separator-${separatorCount++}`}>{separator}</span>);
continue;
}

Expand Down
Loading
Loading