Skip to content

Commit a0dbff1

Browse files
November Release Prep (microsoft#135)
* feat:SubwayNav component added (microsoft#133) * feat:SubwayNav component added * feat:spinbutton (microsoft#134)
1 parent 9f71f10 commit a0dbff1

File tree

185 files changed

+64039
-6739
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+64039
-6739
lines changed

.github/workflows/create-release.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
`${process.env.GITHUB_WORKSPACE}/ResizableTextarea/ResizableTextarea`,
5454
`${process.env.GITHUB_WORKSPACE}/SearchBox/SearchBox`,
5555
`${process.env.GITHUB_WORKSPACE}/Shimmer/Shimmer`,
56+
`${process.env.GITHUB_WORKSPACE}/SpinButton/SpinButton`,
5657
`${process.env.GITHUB_WORKSPACE}/Spinner/Spinner`,
5758
`${process.env.GITHUB_WORKSPACE}/TagList/TagList`,
5859
`${process.env.GITHUB_WORKSPACE}/ThemeGenerator/ThemeGenerator`
@@ -100,7 +101,9 @@ jobs:
100101
- run: npm ci
101102
working-directory: "./Shimmer"
102103
- run: npm ci
103-
working-directory: "./Spinner"
104+
working-directory: "./Spinner"
105+
- run: npm ci
106+
working-directory: "./SubwayNav"
104107
- run: npm ci
105108
working-directory: "./TagList"
106109
- run: npm ci

.github/workflows/pr_validate_all.yml

+2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ jobs:
3030
- "./ProgressIndicator"
3131
- "./ResizableTextarea"
3232
- "./SearchBox"
33+
- "./SpinButton"
3334
- "./Spinner"
3435
- "./Shimmer"
36+
- "./SubwayNav"
3537
- "./TagList"
3638

3739

.vs/VSWorkspaceState.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"ExpandedNodes": [
3+
"",
4+
"\\Icon",
5+
"\\Icon\\Icon"
6+
],
7+
"SelectedNode": "\\Icon\\Icon\\IconComponent.tsx",
8+
"PreviewInSolutionExplorer": false
9+
}

.vs/powercat-code-components/FileContentIndex/read.lock

Whitespace-only changes.

.vs/powercat-code-components/v17/.suo

16 KB
Binary file not shown.
Binary file not shown.

.vs/slnx.sqlite

172 KB
Binary file not shown.

Icon/Icon/ContextExtended.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// This is undocumented - but needed since canvas apps sets non-zero tabindexes
2+
// so we must use the tabindex provided by the context for accessibility purposes
3+
export interface ContextEx {
4+
accessibility: {
5+
assignedTabIndex: number;
6+
assignedTooltip?: string;
7+
};
8+
}

Icon/Icon/IconComponent.tsx

+20-16
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
IPartialTheme,
1111
mergeStyles,
1212
ThemeProvider,
13+
TooltipHost,
1314
} from '@fluentui/react';
1415
import { useAsync } from '@fluentui/react-hooks';
1516

@@ -18,6 +19,7 @@ export interface IconComponentProps {
1819
height?: number;
1920
iconName?: string;
2021
text?: string;
22+
tooltipContent?: string;
2123
onSelected: () => void;
2224
disabled?: boolean;
2325
tabIndex?: number;
@@ -46,7 +48,7 @@ export enum IconRenderType {
4648
}
4749

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

7274
return (
7375
<ThemeProvider applyTo="none" theme={theme} className={getIconContainerStyle(props)}>
74-
{renderType === IconRenderType.Icon && (
75-
<FontIcon aria-label={props.ariaLabel} className={getIconClass(props)} iconName={props.iconName} />
76-
)}
77-
{renderType !== IconRenderType.Icon && (
78-
<RenderButtonAs
79-
componentRef={componentRef}
80-
styles={getButtonStyles(props)}
81-
iconProps={getIconProps(props)}
82-
ariaLabel={ariaLabel}
83-
disabled={disabled}
84-
text={text}
85-
onClick={onSelected}
86-
tabIndex={tabIndex}
87-
/>
88-
)}
76+
<TooltipHost content={tooltipContent}>
77+
{renderType === IconRenderType.Icon && (
78+
<FontIcon aria-label={props.ariaLabel} className={getIconClass(props)} iconName={props.iconName} />
79+
)}
80+
{renderType !== IconRenderType.Icon && (
81+
<RenderButtonAs
82+
componentRef={componentRef}
83+
styles={getButtonStyles(props)}
84+
iconProps={getIconProps(props)}
85+
ariaLabel={ariaLabel}
86+
disabled={disabled}
87+
text={text}
88+
onClick={onSelected}
89+
tabIndex={tabIndex}
90+
/>
91+
)}
92+
</TooltipHost>
8993
</ThemeProvider>
9094
);
9195
});

Icon/Icon/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export class Icon implements ComponentFramework.ReactControl<IInputs, IOutputs>
2727
const allocatedWidth = parseInt(context.mode.allocatedWidth as unknown as string);
2828
const allocatedHeight = parseInt(context.mode.allocatedHeight as unknown as string);
2929
const tabIndex = (context as unknown as ContextEx).accessibility?.assignedTabIndex ?? undefined;
30+
const tooltipContent = (context as unknown as ContextEx).accessibility?.assignedTooltip ?? '';
3031
const inputEvent = context.parameters.InputEvent.raw;
3132
const eventChanged = inputEvent && this.inputEvent !== inputEvent;
3233

@@ -44,6 +45,7 @@ export class Icon implements ComponentFramework.ReactControl<IInputs, IOutputs>
4445
onSelected: this.onSelect,
4546
iconName: defaultIfEmpty(context.parameters.IconName, 'emoji2'),
4647
text: defaultIfEmpty(context.parameters.Text, ''),
48+
tooltipContent: tooltipContent,
4749
justify: TextAlignmentTypes[context.parameters.TextAlignment.raw],
4850
renderType: RenderTypes[context.parameters.IconType.raw],
4951
iconColor: undefinedIfEmpty(context.parameters.IconColor),

Icon/Icon/strings/Icon.1033.resx

+4
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@
153153
<value>Text</value>
154154
<comment/>
155155
</data>
156+
<data name="TooltipContext" xml:space="preserve">
157+
<value>Text</value>
158+
<comment/>
159+
</data>
156160
<data name="TextAlignment" xml:space="preserve">
157161
<value>Text alignment</value>
158162
<comment/>

0 commit comments

Comments
 (0)