Skip to content

Commit

Permalink
November Release Prep (#135)
Browse files Browse the repository at this point in the history
* feat:SubwayNav component added (#133)

* feat:SubwayNav component added

* feat:spinbutton (#134)
  • Loading branch information
Ramakrishnan24689 authored Dec 2, 2022
1 parent 9f71f10 commit a0dbff1
Show file tree
Hide file tree
Showing 185 changed files with 64,039 additions and 6,739 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
`${process.env.GITHUB_WORKSPACE}/ResizableTextarea/ResizableTextarea`,
`${process.env.GITHUB_WORKSPACE}/SearchBox/SearchBox`,
`${process.env.GITHUB_WORKSPACE}/Shimmer/Shimmer`,
`${process.env.GITHUB_WORKSPACE}/SpinButton/SpinButton`,
`${process.env.GITHUB_WORKSPACE}/Spinner/Spinner`,
`${process.env.GITHUB_WORKSPACE}/TagList/TagList`,
`${process.env.GITHUB_WORKSPACE}/ThemeGenerator/ThemeGenerator`
Expand Down Expand Up @@ -100,7 +101,9 @@ jobs:
- run: npm ci
working-directory: "./Shimmer"
- run: npm ci
working-directory: "./Spinner"
working-directory: "./Spinner"
- run: npm ci
working-directory: "./SubwayNav"
- run: npm ci
working-directory: "./TagList"
- run: npm ci
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr_validate_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ jobs:
- "./ProgressIndicator"
- "./ResizableTextarea"
- "./SearchBox"
- "./SpinButton"
- "./Spinner"
- "./Shimmer"
- "./SubwayNav"
- "./TagList"


Expand Down
9 changes: 9 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"ExpandedNodes": [
"",
"\\Icon",
"\\Icon\\Icon"
],
"SelectedNode": "\\Icon\\Icon\\IconComponent.tsx",
"PreviewInSolutionExplorer": false
}
Binary file not shown.
Empty file.
Binary file added .vs/powercat-code-components/v17/.suo
Binary file not shown.
Binary file not shown.
Binary file added .vs/slnx.sqlite
Binary file not shown.
8 changes: 8 additions & 0 deletions Icon/Icon/ContextExtended.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// This is undocumented - but needed since canvas apps sets non-zero tabindexes
// so we must use the tabindex provided by the context for accessibility purposes
export interface ContextEx {
accessibility: {
assignedTabIndex: number;
assignedTooltip?: string;
};
}
36 changes: 20 additions & 16 deletions Icon/Icon/IconComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
IPartialTheme,
mergeStyles,
ThemeProvider,
TooltipHost,
} from '@fluentui/react';
import { useAsync } from '@fluentui/react-hooks';

Expand All @@ -18,6 +19,7 @@ export interface IconComponentProps {
height?: number;
iconName?: string;
text?: string;
tooltipContent?: string;
onSelected: () => void;
disabled?: boolean;
tabIndex?: number;
Expand Down Expand Up @@ -46,7 +48,7 @@ export enum IconRenderType {
}

export const IconComponent = React.memo((props: IconComponentProps) => {
const { text, disabled, onSelected, tabIndex, ariaLabel, setFocus, themeJSON, renderType } = props;
const { text, tooltipContent, disabled, onSelected, tabIndex, ariaLabel, setFocus, themeJSON, renderType } = props;
const theme = React.useMemo(() => {
try {
return themeJSON ? createTheme(JSON.parse(themeJSON) as IPartialTheme) : undefined;
Expand All @@ -71,21 +73,23 @@ export const IconComponent = React.memo((props: IconComponentProps) => {

return (
<ThemeProvider applyTo="none" theme={theme} className={getIconContainerStyle(props)}>
{renderType === IconRenderType.Icon && (
<FontIcon aria-label={props.ariaLabel} className={getIconClass(props)} iconName={props.iconName} />
)}
{renderType !== IconRenderType.Icon && (
<RenderButtonAs
componentRef={componentRef}
styles={getButtonStyles(props)}
iconProps={getIconProps(props)}
ariaLabel={ariaLabel}
disabled={disabled}
text={text}
onClick={onSelected}
tabIndex={tabIndex}
/>
)}
<TooltipHost content={tooltipContent}>
{renderType === IconRenderType.Icon && (
<FontIcon aria-label={props.ariaLabel} className={getIconClass(props)} iconName={props.iconName} />
)}
{renderType !== IconRenderType.Icon && (
<RenderButtonAs
componentRef={componentRef}
styles={getButtonStyles(props)}
iconProps={getIconProps(props)}
ariaLabel={ariaLabel}
disabled={disabled}
text={text}
onClick={onSelected}
tabIndex={tabIndex}
/>
)}
</TooltipHost>
</ThemeProvider>
);
});
Expand Down
2 changes: 2 additions & 0 deletions Icon/Icon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class Icon implements ComponentFramework.ReactControl<IInputs, IOutputs>
const allocatedWidth = parseInt(context.mode.allocatedWidth as unknown as string);
const allocatedHeight = parseInt(context.mode.allocatedHeight as unknown as string);
const tabIndex = (context as unknown as ContextEx).accessibility?.assignedTabIndex ?? undefined;
const tooltipContent = (context as unknown as ContextEx).accessibility?.assignedTooltip ?? '';
const inputEvent = context.parameters.InputEvent.raw;
const eventChanged = inputEvent && this.inputEvent !== inputEvent;

Expand All @@ -44,6 +45,7 @@ export class Icon implements ComponentFramework.ReactControl<IInputs, IOutputs>
onSelected: this.onSelect,
iconName: defaultIfEmpty(context.parameters.IconName, 'emoji2'),
text: defaultIfEmpty(context.parameters.Text, ''),
tooltipContent: tooltipContent,
justify: TextAlignmentTypes[context.parameters.TextAlignment.raw],
renderType: RenderTypes[context.parameters.IconType.raw],
iconColor: undefinedIfEmpty(context.parameters.IconColor),
Expand Down
4 changes: 4 additions & 0 deletions Icon/Icon/strings/Icon.1033.resx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@
<value>Text</value>
<comment/>
</data>
<data name="TooltipContext" xml:space="preserve">
<value>Text</value>
<comment/>
</data>
<data name="TextAlignment" xml:space="preserve">
<value>Text alignment</value>
<comment/>
Expand Down
Loading

0 comments on commit a0dbff1

Please sign in to comment.