Skip to content

Commit

Permalink
Fix a path issue in the ComponentDesignTokens component
Browse files Browse the repository at this point in the history
  • Loading branch information
bradmering committed Sep 17, 2024
1 parent 02be5b2 commit 780e94d
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dist/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ var showHelp = function () {
* Show the help message
*/
var showVersion = function () {
cliError('Handoff App - 0.13.0', 2);
cliError('Handoff App - 0.13.1', 2);
};
/**
* Define a CLI error
Expand Down
1 change: 1 addition & 0 deletions dist/transformers/integration/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="node" />
import archiver from 'archiver';
import * as stream from 'node:stream';
import { DocumentationObject } from '../../types';
Expand Down
10 changes: 8 additions & 2 deletions dist/transformers/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,20 @@ export declare const formatComponentCodeBlockComment: (component: ComponentInsta
* @param options
* @returns
*/
export declare const formatTokenName: (tokenType: TokenType, componentName: string, componentVariantProps: [string, string][], part: string, property: string, options?: IntegrationObjectComponentOptions) => string;
export declare const formatTokenName: (tokenType: TokenType, componentName: string, componentVariantProps: [
string,
string
][], part: string, property: string, options?: IntegrationObjectComponentOptions) => string;
/**
* Returns the token name segments
* @param component
* @param options
* @returns
*/
export declare const getTokenNameSegments: (componentName: string, componentVariantProps: [string, string][], part: string, property: string, options?: IntegrationObjectComponentOptions) => string[];
export declare const getTokenNameSegments: (componentName: string, componentVariantProps: [
string,
string
][], part: string, property: string, options?: IntegrationObjectComponentOptions) => string[];
/**
* Normalizes the token name variable (specifier) by considering if the value should be replaced
* with some other value based replace rules defined in the transformer options of the component
Expand Down
23 changes: 17 additions & 6 deletions src/app/components/AnchorNavLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,25 @@ export const AnchorNavLink: React.FC<AnchorNavLinkProps> = ({ to, children }) =>

useEffect(() => {
setOffset(document.getElementById('site-header')?.clientHeight ?? 0);
}, [])
}, []);

return (
<Link href="#" activeClass='is-selected' smooth spy to={to} offset={offset * -1.5} onClick={() => {
history.pushState ? history.pushState(null, '', `#${to}`) : location.hash = `#${to}`;
}}>
{children}
</Link>
<>
{/* @ts-ignore */}
<Link
href="#"
activeClass="is-selected"
smooth
spy
to={to}
offset={offset * -1.5}
onClick={() => {
history.pushState ? history.pushState(null, '', `#${to}`) : (location.hash = `#${to}`);
}}
>
{children}
</Link>
</>
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/app/components/ComponentDesignTokens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { useEffect } from 'react';
import Icon from './Icon';
import { transformComponentTokensToScssVariables } from '@handoff/transformers/scss/component';
import { ComponentInstance } from '@handoff/exporters/components/types';
import { IntegrationObjectComponentOptions } from '../../types/config';
import { IntegrationObjectComponentOptions } from '@handoff/types/config';

const PropertyIconPathMap = {
'border-width': 'token-border-width',
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import '../sass/main.scss';
function MyApp({ Component, pageProps }: AppProps) {
return (
<>
{/* @ts-ignore */}
<Component {...pageProps} />

</>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const showHelp = () => {
* Show the help message
*/
const showVersion = () => {
cliError('Handoff App - 0.13.0', 2);
cliError('Handoff App - 0.13.1', 2);
};

/**
Expand Down

0 comments on commit 780e94d

Please sign in to comment.