Private
Public Access
1
0

feat: Fluent UI Outlook Lite + connections mockup

This commit is contained in:
2026-04-14 18:52:25 +00:00
parent 1199eff6c3
commit dfa4010406
34820 changed files with 1003813 additions and 205 deletions

1166
node_modules/@fluentui/react-infolabel/CHANGELOG.md generated vendored Normal file

File diff suppressed because it is too large Load Diff

15
node_modules/@fluentui/react-infolabel/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,15 @@
@fluentui/react-infolabel-preview
Copyright (c) Microsoft Corporation
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Note: Usage of the fonts and icons referenced in Fluent UI React is subject to the terms listed at https://aka.ms/fluentui-assets-license

13
node_modules/@fluentui/react-infolabel/README.md generated vendored Normal file
View File

@@ -0,0 +1,13 @@
# @fluentui/react-infolabel
**React Infolabel components for [Fluent UI React](https://react.fluentui.dev/)**
To use InfoLabel import InfoLabel like this:
```jsx
import { InfoLabel } from '@fluentui/react-components';
const InfoLabelExample = () => {
return <InfoLabel info="Sample information">Sample label</InfoLabel>;
};
```

142
node_modules/@fluentui/react-infolabel/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,142 @@
import type { ComponentProps } from '@fluentui/react-utilities';
import type { ComponentState } from '@fluentui/react-utilities';
import { ForwardRefComponent } from '@fluentui/react-utilities';
import type { JSXElement } from '@fluentui/react-utilities';
import { Label } from '@fluentui/react-label';
import type { PopoverProps } from '@fluentui/react-popover';
import type { PopoverSurface } from '@fluentui/react-popover';
import * as React_2 from 'react';
import type { Slot } from '@fluentui/react-utilities';
import type { SlotClassNames } from '@fluentui/react-utilities';
/**
* InfoButtons provide a way to display additional information about a form field or an area in the UI.
*/
export declare const InfoButton: ForwardRefComponent<InfoButtonProps>;
export declare const infoButtonClassNames: SlotClassNames<InfoButtonSlots>;
/**
* InfoButton Props
*/
export declare type InfoButtonProps = Omit<ComponentProps<Partial<InfoButtonSlots>>, 'disabled' | 'popover'> & {
/**
* Size of the InfoButton.
*
* @default medium
*/
size?: 'small' | 'medium' | 'large';
/**
* Whether the InfoButton should be rendered inline or on a Portal.
*
* @default true
*/
inline?: boolean;
/**
* The Popover element that wraps the info and root slots. Use this slot to pass props to the Popover.
*/
popover?: InfoButtonSlots['popover'];
};
export declare type InfoButtonSlots = {
root: NonNullable<Slot<'button'>>;
/**
* The Popover element that wraps the info and root slots. Use this slot to pass props to the Popover.
*/
popover: NonNullable<Slot<Partial<Omit<PopoverProps, 'openOnHover'>>>>;
/**
* The information to be displayed in the PopoverSurface when the button is pressed.
*/
info: NonNullable<Slot<typeof PopoverSurface>>;
};
/**
* State used in rendering InfoButton
*/
export declare type InfoButtonState = ComponentState<InfoButtonSlots> & Required<Pick<InfoButtonProps, 'inline' | 'size'>>;
/**
* InfoLabel component
*/
export declare const InfoLabel: ForwardRefComponent<InfoLabelProps>;
export declare const infoLabelClassNames: SlotClassNames<InfoLabelSlots>;
/**
* InfoLabel Props
*/
export declare type InfoLabelProps = ComponentProps<Partial<InfoLabelSlots>, 'label'> & {
/**
* The content of the InfoButton's popover.
*/
info?: InfoButtonProps['info'];
};
export declare type InfoLabelSlots = {
root: NonNullable<Slot<'span'>>;
/**
* The Label component.
*
* It is not typically necessary to use this prop. The label text is the child of the `<InfoLabel>`, and other props
* such as `size` and `required` should be set directly on the `InfoLabel`.
*
* This is the PRIMARY slot: all native properties specified directly on `<InfoLabel>` will be applied to this slot,
* except `className` and `style`, which remain on the root slot.
*/
label: NonNullable<Slot<typeof Label>>;
/**
* The InfoButton component.
*
* It is not typically necessary to use this prop. The content can be set using the `info` prop of the InfoLabel.
*/
infoButton: Slot<typeof InfoButton>;
};
/**
* State used in rendering InfoLabel
*/
export declare type InfoLabelState = ComponentState<InfoLabelSlots> & Pick<InfoLabelProps, 'size'>;
/**
* Render the final JSX of InfoButton
*/
export declare const renderInfoButton_unstable: (state: InfoButtonState) => JSXElement;
/**
* Render the final JSX of InfoLabel
*/
export declare const renderInfoLabel_unstable: (state: InfoLabelState) => JSXElement;
/**
* Create the state required to render InfoButton.
*
* The returned state can be modified with hooks such as useInfoButtonStyles_unstable,
* before being passed to renderInfoButton_unstable.
*
* @param props - props from this instance of InfoButton
* @param ref - reference to root HTMLButtonElement of InfoButton
*/
export declare const useInfoButton_unstable: (props: InfoButtonProps, ref: React_2.Ref<HTMLButtonElement>) => InfoButtonState;
/**
* Apply styling to the InfoButton slots based on the state
*/
export declare const useInfoButtonStyles_unstable: (state: InfoButtonState) => InfoButtonState;
/**
* Create the state required to render InfoLabel.
*
* The returned state can be modified with hooks such as useInfoLabelStyles_unstable,
* before being passed to renderInfoLabel_unstable.
*
* @param props - props from this instance of InfoLabel
* @param ref - reference to label element of InfoLabel
*/
export declare const useInfoLabel_unstable: (props: InfoLabelProps, ref: React_2.Ref<HTMLLabelElement>) => InfoLabelState;
/**
* Apply styling to the InfoLabel slots based on the state
*/
export declare const useInfoLabelStyles_unstable: (state: InfoLabelState) => InfoLabelState;
export { }

View File

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
InfoButton: function() {
return _index.InfoButton;
},
infoButtonClassNames: function() {
return _index.infoButtonClassNames;
},
renderInfoButton_unstable: function() {
return _index.renderInfoButton_unstable;
},
useInfoButtonStyles_unstable: function() {
return _index.useInfoButtonStyles_unstable;
},
useInfoButton_unstable: function() {
return _index.useInfoButton_unstable;
}
});
const _index = require("./components/InfoButton/index");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/InfoButton.ts"],"sourcesContent":["export type { InfoButtonProps, InfoButtonSlots, InfoButtonState } from './components/InfoButton/index';\nexport {\n InfoButton,\n infoButtonClassNames,\n renderInfoButton_unstable,\n useInfoButtonStyles_unstable,\n useInfoButton_unstable,\n} from './components/InfoButton/index';\n"],"names":["InfoButton","infoButtonClassNames","renderInfoButton_unstable","useInfoButtonStyles_unstable","useInfoButton_unstable"],"mappings":";;;;;;;;;;;;eAEEA,iBAAU;;;eACVC,2BAAoB;;;eACpBC,gCAAyB;;;eACzBC,mCAA4B;;;eAC5BC,6BAAsB;;;uBACjB,gCAAgC"}

View File

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
InfoLabel: function() {
return _index.InfoLabel;
},
infoLabelClassNames: function() {
return _index.infoLabelClassNames;
},
renderInfoLabel_unstable: function() {
return _index.renderInfoLabel_unstable;
},
useInfoLabelStyles_unstable: function() {
return _index.useInfoLabelStyles_unstable;
},
useInfoLabel_unstable: function() {
return _index.useInfoLabel_unstable;
}
});
const _index = require("./components/InfoLabel/index");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/InfoLabel.ts"],"sourcesContent":["export type { InfoLabelProps, InfoLabelSlots, InfoLabelState } from './components/InfoLabel/index';\nexport {\n InfoLabel,\n infoLabelClassNames,\n renderInfoLabel_unstable,\n useInfoLabelStyles_unstable,\n useInfoLabel_unstable,\n} from './components/InfoLabel/index';\n"],"names":["InfoLabel","infoLabelClassNames","renderInfoLabel_unstable","useInfoLabelStyles_unstable","useInfoLabel_unstable"],"mappings":";;;;;;;;;;;;eAEEA,gBAAS;;;eACTC,0BAAmB;;;eACnBC,+BAAwB;;;eACxBC,kCAA2B;;;eAC3BC,4BAAqB;;;uBAChB,+BAA+B"}

View File

@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
DefaultInfoButtonIcon12: function() {
return DefaultInfoButtonIcon12;
},
DefaultInfoButtonIcon16: function() {
return DefaultInfoButtonIcon16;
},
DefaultInfoButtonIcon20: function() {
return DefaultInfoButtonIcon20;
}
});
const _reacticons = require("@fluentui/react-icons");
const DefaultInfoButtonIcon12 = (0, _reacticons.bundleIcon)(_reacticons.Info12Filled, _reacticons.Info12Regular);
const DefaultInfoButtonIcon16 = (0, _reacticons.bundleIcon)(_reacticons.Info16Filled, _reacticons.Info16Regular);
const DefaultInfoButtonIcon20 = (0, _reacticons.bundleIcon)(_reacticons.Info20Filled, _reacticons.Info20Regular);

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoButton/DefaultInfoButtonIcons.tsx"],"sourcesContent":["import {\n Info12Regular,\n Info12Filled,\n Info16Regular,\n Info16Filled,\n Info20Regular,\n Info20Filled,\n bundleIcon,\n} from '@fluentui/react-icons';\n\nexport const DefaultInfoButtonIcon12 = bundleIcon(Info12Filled, Info12Regular);\nexport const DefaultInfoButtonIcon16 = bundleIcon(Info16Filled, Info16Regular);\nexport const DefaultInfoButtonIcon20 = bundleIcon(Info20Filled, Info20Regular);\n"],"names":["Info12Regular","Info12Filled","Info16Regular","Info16Filled","Info20Regular","Info20Filled","bundleIcon","DefaultInfoButtonIcon12","DefaultInfoButtonIcon16","DefaultInfoButtonIcon20"],"mappings":";;;;;;;;;;;IAUaO,uBAAAA;;;2BACAC;;;2BACAC;;;;4BAJN,wBAAwB;AAExB,oCAAgCH,sBAAAA,EAAWL,wBAAAA,EAAcD,yBAAAA,EAAe;AACxE,MAAMQ,8BAA0BF,sBAAAA,EAAWH,wBAAAA,EAAcD,yBAAAA,EAAe;AACxE,MAAMO,8BAA0BH,sBAAAA,EAAWD,wBAAAA,EAAcD,yBAAAA,EAAe"}

View File

@@ -0,0 +1,24 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "InfoButton", {
enumerable: true,
get: function() {
return InfoButton;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const _renderInfoButton = require("./renderInfoButton");
const _useInfoButton = require("./useInfoButton");
const _useInfoButtonStylesstyles = require("./useInfoButtonStyles.styles");
const InfoButton = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useInfoButton.useInfoButton_unstable)(props, ref);
(0, _useInfoButtonStylesstyles.useInfoButtonStyles_unstable)(state);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useInfoButtonStyles_unstable')(state);
return (0, _renderInfoButton.renderInfoButton_unstable)(state);
});
InfoButton.displayName = 'InfoButton';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoButton/InfoButton.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { renderInfoButton_unstable } from './renderInfoButton';\nimport { useInfoButton_unstable } from './useInfoButton';\nimport { useInfoButtonStyles_unstable } from './useInfoButtonStyles.styles';\nimport type { InfoButtonProps } from './InfoButton.types';\n\n/**\n * InfoButtons provide a way to display additional information about a form field or an area in the UI.\n */\nexport const InfoButton: ForwardRefComponent<InfoButtonProps> = React.forwardRef((props, ref) => {\n const state = useInfoButton_unstable(props, ref);\n\n useInfoButtonStyles_unstable(state);\n useCustomStyleHook_unstable('useInfoButtonStyles_unstable')(state);\n\n return renderInfoButton_unstable(state);\n});\n\nInfoButton.displayName = 'InfoButton';\n"],"names":["React","useCustomStyleHook_unstable","renderInfoButton_unstable","useInfoButton_unstable","useInfoButtonStyles_unstable","InfoButton","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;qCACa,kCAAkC;kCAEpC,qBAAqB;+BACxB,kBAAkB;2CACZ,+BAA+B;AAMrE,MAAMK,aAAAA,WAAAA,GAAmDL,OAAMM,UAAU,CAAC,CAACC,OAAOC;IACvF,MAAMC,YAAQN,qCAAAA,EAAuBI,OAAOC;QAE5CJ,uDAAAA,EAA6BK;QAC7BR,gDAAAA,EAA4B,gCAAgCQ;IAE5D,WAAOP,2CAAAA,EAA0BO;AACnC,GAAG;AAEHJ,WAAWK,WAAW,GAAG"}

View File

@@ -0,0 +1,6 @@
/**
* State used in rendering InfoButton
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoButton/InfoButton.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { PopoverProps, PopoverSurface } from '@fluentui/react-popover';\n\nexport type InfoButtonSlots = {\n root: NonNullable<Slot<'button'>>;\n\n /**\n * The Popover element that wraps the info and root slots. Use this slot to pass props to the Popover.\n */\n popover: NonNullable<Slot<Partial<Omit<PopoverProps, 'openOnHover'>>>>;\n\n /**\n * The information to be displayed in the PopoverSurface when the button is pressed.\n */\n info: NonNullable<Slot<typeof PopoverSurface>>;\n};\n\n/**\n * InfoButton Props\n */\nexport type InfoButtonProps = Omit<ComponentProps<Partial<InfoButtonSlots>>, 'disabled' | 'popover'> & {\n /**\n * Size of the InfoButton.\n *\n * @default medium\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Whether the InfoButton should be rendered inline or on a Portal.\n *\n * @default true\n */\n inline?: boolean;\n\n /**\n * The Popover element that wraps the info and root slots. Use this slot to pass props to the Popover.\n */\n popover?: InfoButtonSlots['popover'];\n};\n\n/**\n * State used in rendering InfoButton\n */\nexport type InfoButtonState = ComponentState<InfoButtonSlots> & Required<Pick<InfoButtonProps, 'inline' | 'size'>>;\n"],"names":[],"mappings":"AAyCA;;CAEC,GACD,WAAmH"}

View File

@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
InfoButton: function() {
return _InfoButton.InfoButton;
},
infoButtonClassNames: function() {
return _useInfoButtonStylesstyles.infoButtonClassNames;
},
renderInfoButton_unstable: function() {
return _renderInfoButton.renderInfoButton_unstable;
},
useInfoButtonStyles_unstable: function() {
return _useInfoButtonStylesstyles.useInfoButtonStyles_unstable;
},
useInfoButton_unstable: function() {
return _useInfoButton.useInfoButton_unstable;
}
});
const _InfoButton = require("./InfoButton");
const _renderInfoButton = require("./renderInfoButton");
const _useInfoButton = require("./useInfoButton");
const _useInfoButtonStylesstyles = require("./useInfoButtonStyles.styles");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoButton/index.ts"],"sourcesContent":["export { InfoButton } from './InfoButton';\nexport type { InfoButtonProps, InfoButtonSlots, InfoButtonState } from './InfoButton.types';\nexport { renderInfoButton_unstable } from './renderInfoButton';\nexport { useInfoButton_unstable } from './useInfoButton';\nexport { infoButtonClassNames, useInfoButtonStyles_unstable } from './useInfoButtonStyles.styles';\n"],"names":["InfoButton","renderInfoButton_unstable","useInfoButton_unstable","infoButtonClassNames","useInfoButtonStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,sBAAU;;;eAIVG,+CAAoB;;;eAFpBF,2CAAyB;;;eAEHG,uDAA4B;;;eADlDF,qCAAsB;;;4BAHJ,eAAe;kCAEA,qBAAqB;+BACxB,kBAAkB;2CACU,+BAA+B"}

View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "renderInfoButton_unstable", {
enumerable: true,
get: function() {
return renderInfoButton_unstable;
}
});
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
const _reactutilities = require("@fluentui/react-utilities");
const _reactpopover = require("@fluentui/react-popover");
const renderInfoButton_unstable = (state)=>{
(0, _reactutilities.assertSlots)(state);
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.popover, {
children: [
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reactpopover.PopoverTrigger, {
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {})
}),
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.info, {})
]
});
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoButton/renderInfoButton.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { PopoverTrigger } from '@fluentui/react-popover';\nimport type { InfoButtonState, InfoButtonSlots } from './InfoButton.types';\n\n/**\n * Render the final JSX of InfoButton\n */\nexport const renderInfoButton_unstable = (state: InfoButtonState): JSXElement => {\n assertSlots<InfoButtonSlots>(state);\n\n return (\n <state.popover>\n <PopoverTrigger>\n <state.root />\n </PopoverTrigger>\n <state.info />\n </state.popover>\n );\n};\n"],"names":["assertSlots","PopoverTrigger","renderInfoButton_unstable","state","popover","root","info"],"mappings":";;;;+BAWaE;;;;;;4BAVb,iCAAiD;gCAErB,4BAA4B;8BAEzB,0BAA0B;AAMlD,kCAAkC,CAACC;QACxCH,2BAAAA,EAA6BG;IAE7B,OAAA,WAAA,OACE,gBAAA,EAACA,MAAMC,OAAO,EAAA;;0BACZ,mBAAA,EAACH,4BAAAA,EAAAA;0BACC,WAAA,OAAA,eAAA,EAACE,MAAME,IAAI,EAAA,CAAA;;8BAEb,eAAA,EAACF,MAAMG,IAAI,EAAA,CAAA;;;AAGjB,EAAE"}

View File

@@ -0,0 +1,83 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useInfoButton_unstable", {
enumerable: true,
get: function() {
return useInfoButton_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _DefaultInfoButtonIcons = require("./DefaultInfoButtonIcons");
const _reactutilities = require("@fluentui/react-utilities");
const _reactpopover = require("@fluentui/react-popover");
const infoButtonIconMap = {
small: /*#__PURE__*/ _react.createElement(_DefaultInfoButtonIcons.DefaultInfoButtonIcon12, null),
medium: /*#__PURE__*/ _react.createElement(_DefaultInfoButtonIcons.DefaultInfoButtonIcon16, null),
large: /*#__PURE__*/ _react.createElement(_DefaultInfoButtonIcons.DefaultInfoButtonIcon20, null)
};
const popoverSizeMap = {
small: 'small',
medium: 'small',
large: 'medium'
};
const useInfoButton_unstable = (props, ref)=>{
const { size = 'medium', inline = true, popover, info, ...rest } = props;
const rootRef = (0, _reactutilities.useMergedRefs)(ref);
const state = {
inline,
size,
components: {
root: 'button',
popover: _reactpopover.Popover,
info: _reactpopover.PopoverSurface
},
root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('button', {
children: infoButtonIconMap[size],
type: 'button',
'aria-label': 'information',
...rest,
ref: rootRef
}), {
elementType: 'button'
}),
popover: _reactutilities.slot.always(popover, {
defaultProps: {
inline,
positioning: 'above-start',
size: popoverSizeMap[size],
withArrow: true
},
elementType: _reactpopover.Popover
}),
info: _reactutilities.slot.always(info, {
defaultProps: {
role: 'note',
tabIndex: -1
},
elementType: _reactpopover.PopoverSurface
})
};
const [popoverOpen, setPopoverOpen] = (0, _reactutilities.useControllableState)({
state: state.popover.open,
defaultState: state.popover.defaultOpen,
initialState: false
});
state.popover.open = popoverOpen;
state.popover.onOpenChange = (0, _reactutilities.mergeCallbacks)(state.popover.onOpenChange, (e, data)=>setPopoverOpen(data.open));
const infoRef = (0, _reactutilities.useMergedRefs)(state.info.ref);
state.info.ref = infoRef;
// Hide the popover when focus moves out of the button and popover
const onBlurButtonOrInfo = (e)=>{
const nextFocused = e.relatedTarget;
if (nextFocused && rootRef.current !== nextFocused && !(0, _reactutilities.elementContains)(infoRef.current, nextFocused)) {
setPopoverOpen(false);
}
};
state.root.onBlur = (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(state.root.onBlur, onBlurButtonOrInfo));
state.info.onBlurCapture = (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(state.info.onBlurCapture, onBlurButtonOrInfo));
return state;
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,334 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
infoButtonClassNames: function() {
return infoButtonClassNames;
},
useInfoButtonStyles_unstable: function() {
return useInfoButtonStyles_unstable;
}
});
const _react = require("@griffel/react");
const infoButtonClassNames = {
root: 'fui-InfoButton',
// this className won't be used, but it's needed to satisfy the type checker
popover: 'fui-InfoButton__popover',
info: 'fui-InfoButton__info'
};
/**
* Styles for the root slot
*/ const useButtonStyles = /*#__PURE__*/ (0, _react.__styles)({
base: {
Bt984gj: "f122n59",
B7ck84d: "f1ewtqcl",
mc9l5x: "ftuwxu6",
Brf1p80: "f4d9j23",
w71qe1: "f1iuv45f",
ha4doy: "fmrv4ls",
qhf8xq: "f10pi13n",
De3pzq: "f1c21dwh",
sj55zd: "fkfq4zb",
icvyot: "f1ern45e",
vrafjx: [
"f1n71otn",
"f1deefiw"
],
oivjwe: "f1h8hb77",
wvpqe5: [
"f1deefiw",
"f1n71otn"
],
Beyfa6y: 0,
Bbmb7ep: 0,
Btl43ni: 0,
B7oj6ja: 0,
Dimara: "ft85np5",
jrapky: 0,
Frg6f3: 0,
t21cq0: 0,
B6of3ja: 0,
B74szlk: "f1s184ao",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f16d74zd",
D0sxk3: "f16u1re",
t6yez3: "f1rw4040",
Jwef8y: "fjxutwb",
Bi91k9c: "f139oj5f",
eoavqd: "f8491dx",
Bk3fhr4: "f1jpd6y0",
Bmfj8id: "fuxngvv",
iro3zm: "fwiml72",
B2d53fq: "f1fg1p5m"
},
selected: {
De3pzq: "f1q9pm1r",
sj55zd: "f1qj7y59",
D0sxk3: "fgzdkf0",
t6yez3: "f15q0o9g",
By8wz76: "f1nz3ub2",
B7iucu3: "f1205bnn"
},
highContrast: {
B7iucu3: "fslfhp6",
Bfsdueo: "f11s1vgy",
pb71ee: "f12b7wpn",
ik86qs: "f1u668rv"
},
focusIndicator: {
Brovlpu: "ftqa4ok",
B486eqv: "f2hkw1w",
B8q5s1w: "f8hki3x",
Bci5o5g: [
"f1d2448m",
"ffh67wi"
],
n8qw10: "f1bjia2o",
Bdrgwmp: [
"ffh67wi",
"f1d2448m"
],
Bqhya38: "f1j6vpng",
Bwxa6fj: [
"f1pniga2",
"f1ffjurs"
],
Bdhvstf: "f987i1v",
B7zbvrb: [
"f1ffjurs",
"f1pniga2"
],
Bm4h7ae: "f15bsgw9",
B7ys5i9: "f14e48fq",
Busjfv9: "f18yb2kv",
Bhk32uz: "fd6o370",
f6g5ot: 0,
Boxcth7: 0,
Bhdgwq3: 0,
hgwjuy: 0,
Bshpdp8: 0,
Bsom6fd: 0,
Blkhhs4: 0,
Bonggc9: 0,
Ddfuxk: 0,
i03rao: 0,
kclons: 0,
clg4pj: 0,
Bpqj9nj: 0,
B6dhp37: 0,
Bf4ptjt: 0,
Bqtpl0w: 0,
i4rwgc: "ffwy5si",
Dah5zi: 0,
B1tsrr9: 0,
qqdqy8: 0,
Bkh64rk: 0,
e3fwne: "f3znvyf",
J0r882: "f57olzd",
Bule8hv: [
"f4stah7",
"fs1por5"
],
Bjwuhne: "f480a47",
Ghsupd: [
"fs1por5",
"f4stah7"
]
},
large: {
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f1kx978o"
}
}, {
d: [
".f122n59{align-items:center;}",
".f1ewtqcl{box-sizing:border-box;}",
".ftuwxu6{display:inline-flex;}",
".f4d9j23{justify-content:center;}",
".f1iuv45f{text-decoration-line:none;}",
".fmrv4ls{vertical-align:middle;}",
".f10pi13n{position:relative;}",
".f1c21dwh{background-color:var(--colorTransparentBackground);}",
".fkfq4zb{color:var(--colorNeutralForeground2);}",
".f1ern45e{border-top-style:none;}",
".f1n71otn{border-right-style:none;}",
".f1deefiw{border-left-style:none;}",
".f1h8hb77{border-bottom-style:none;}",
[
".ft85np5{border-radius:var(--borderRadiusMedium);}",
{
p: -1
}
],
[
".f1s184ao{margin:0;}",
{
p: -1
}
],
[
".f16d74zd{padding:var(--spacingVerticalXS) var(--spacingHorizontalXS);}",
{
p: -1
}
],
".f16u1re .fui-Icon-filled{display:none;}",
".f1rw4040 .fui-Icon-regular{display:inline-flex;}",
".f1q9pm1r{background-color:var(--colorTransparentBackgroundSelected);}",
".f1qj7y59{color:var(--colorNeutralForeground2BrandSelected);}",
".fgzdkf0 .fui-Icon-filled{display:inline-flex;}",
".f15q0o9g .fui-Icon-regular{display:none;}",
".f8hki3x[data-fui-focus-visible]{border-top-color:transparent;}",
".f1d2448m[data-fui-focus-visible]{border-right-color:transparent;}",
".ffh67wi[data-fui-focus-visible]{border-left-color:transparent;}",
".f1bjia2o[data-fui-focus-visible]{border-bottom-color:transparent;}",
".f15bsgw9[data-fui-focus-visible]::after{content:\"\";}",
".f14e48fq[data-fui-focus-visible]::after{position:absolute;}",
".f18yb2kv[data-fui-focus-visible]::after{pointer-events:none;}",
".fd6o370[data-fui-focus-visible]::after{z-index:1;}",
[
".ffwy5si[data-fui-focus-visible]::after{border:2px solid var(--colorStrokeFocus2);}",
{
p: -2
}
],
[
".f3znvyf[data-fui-focus-visible]::after{border-radius:var(--borderRadiusMedium);}",
{
p: -1
}
],
".f57olzd[data-fui-focus-visible]::after{top:calc(2px * -1);}",
".f4stah7[data-fui-focus-visible]::after{right:calc(2px * -1);}",
".fs1por5[data-fui-focus-visible]::after{left:calc(2px * -1);}",
".f480a47[data-fui-focus-visible]::after{bottom:calc(2px * -1);}",
[
".f1kx978o{padding:var(--spacingVerticalXXS) var(--spacingVerticalXXS);}",
{
p: -1
}
]
],
h: [
".fjxutwb:hover{background-color:var(--colorTransparentBackgroundHover);}",
".f139oj5f:hover{color:var(--colorNeutralForeground2BrandHover);}",
".f8491dx:hover{cursor:pointer;}",
".f1jpd6y0:hover .fui-Icon-filled{display:inline-flex;}",
".fuxngvv:hover .fui-Icon-regular{display:none;}",
".fwiml72:hover:active{background-color:var(--colorTransparentBackgroundPressed);}",
".f1fg1p5m:hover:active{color:var(--colorNeutralForeground2BrandPressed);}"
],
m: [
[
"@media (forced-colors: active){.f1nz3ub2{background-color:Highlight;}}",
{
m: "(forced-colors: active)"
}
],
[
"@media (forced-colors: active){.f1205bnn{color:Canvas;}}",
{
m: "(forced-colors: active)"
}
],
[
"@media (forced-colors: active){.fslfhp6{color:CanvasText;}}",
{
m: "(forced-colors: active)"
}
],
[
"@media (forced-colors: active){.f11s1vgy:hover,.f11s1vgy:hover:active{forced-color-adjust:none;}}",
{
m: "(forced-colors: active)"
}
],
[
"@media (forced-colors: active){.f12b7wpn:hover,.f12b7wpn:hover:active{background-color:Highlight;}}",
{
m: "(forced-colors: active)"
}
],
[
"@media (forced-colors: active){.f1u668rv:hover,.f1u668rv:hover:active{color:Canvas;}}",
{
m: "(forced-colors: active)"
}
],
[
"@media (forced-colors: active){.f1j6vpng[data-fui-focus-visible]::after{border-top-color:Highlight;}}",
{
m: "(forced-colors: active)"
}
],
[
"@media (forced-colors: active){.f1ffjurs[data-fui-focus-visible]::after{border-left-color:Highlight;}.f1pniga2[data-fui-focus-visible]::after{border-right-color:Highlight;}}",
{
m: "(forced-colors: active)"
}
],
[
"@media (forced-colors: active){.f987i1v[data-fui-focus-visible]::after{border-bottom-color:Highlight;}}",
{
m: "(forced-colors: active)"
}
]
],
f: [
".ftqa4ok:focus{outline-style:none;}"
],
i: [
".f2hkw1w:focus-visible{outline-style:none;}"
]
});
const usePopoverSurfaceStyles = /*#__PURE__*/ (0, _react.__styles)({
base: {
B2u0y6b: "f1qmtlvf"
},
smallMedium: {
Bahqtrf: "fk6fouc",
Be2twd7: "fy9rknc",
Bhrd7zp: "figsok6",
Bg96gwp: "fwrc4pm"
},
large: {
Bahqtrf: "fk6fouc",
Be2twd7: "fkhj508",
Bhrd7zp: "figsok6",
Bg96gwp: "f1i3iumi"
}
}, {
d: [
".f1qmtlvf{max-width:264px;}",
".fk6fouc{font-family:var(--fontFamilyBase);}",
".fy9rknc{font-size:var(--fontSizeBase200);}",
".figsok6{font-weight:var(--fontWeightRegular);}",
".fwrc4pm{line-height:var(--lineHeightBase200);}",
".fkhj508{font-size:var(--fontSizeBase300);}",
".f1i3iumi{line-height:var(--lineHeightBase300);}"
]
});
const useInfoButtonStyles_unstable = (state)=>{
'use no memo';
const { size } = state;
const { open } = state.popover;
const buttonStyles = useButtonStyles();
const popoverSurfaceStyles = usePopoverSurfaceStyles();
state.info.className = (0, _react.mergeClasses)(infoButtonClassNames.info, popoverSurfaceStyles.base, size === 'large' ? popoverSurfaceStyles.large : popoverSurfaceStyles.smallMedium, state.info.className);
state.root.className = (0, _react.mergeClasses)(infoButtonClassNames.root, buttonStyles.base, buttonStyles.highContrast, buttonStyles.focusIndicator, open && buttonStyles.selected, size === 'large' && buttonStyles.large, state.root.className);
return state;
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,114 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
infoButtonClassNames: function() {
return infoButtonClassNames;
},
useInfoButtonStyles_unstable: function() {
return useInfoButtonStyles_unstable;
}
});
const _reacttabster = require("@fluentui/react-tabster");
const _reacticons = require("@fluentui/react-icons");
const _react = require("@griffel/react");
const _reacttheme = require("@fluentui/react-theme");
const infoButtonClassNames = {
root: 'fui-InfoButton',
// this className won't be used, but it's needed to satisfy the type checker
popover: 'fui-InfoButton__popover',
info: 'fui-InfoButton__info'
};
/**
* Styles for the root slot
*/ const useButtonStyles = (0, _react.makeStyles)({
base: {
alignItems: 'center',
boxSizing: 'border-box',
display: 'inline-flex',
justifyContent: 'center',
textDecorationLine: 'none',
verticalAlign: 'middle',
position: 'relative',
backgroundColor: _reacttheme.tokens.colorTransparentBackground,
color: _reacttheme.tokens.colorNeutralForeground2,
..._react.shorthands.borderStyle('none'),
borderRadius: _reacttheme.tokens.borderRadiusMedium,
margin: '0',
padding: `${_reacttheme.tokens.spacingVerticalXS} ${_reacttheme.tokens.spacingHorizontalXS}`,
[`& .${_reacticons.iconFilledClassName}`]: {
display: 'none'
},
[`& .${_reacticons.iconRegularClassName}`]: {
display: 'inline-flex'
},
':hover': {
backgroundColor: _reacttheme.tokens.colorTransparentBackgroundHover,
color: _reacttheme.tokens.colorNeutralForeground2BrandHover,
cursor: 'pointer',
[`& .${_reacticons.iconFilledClassName}`]: {
display: 'inline-flex'
},
[`& .${_reacticons.iconRegularClassName}`]: {
display: 'none'
}
},
':hover:active': {
backgroundColor: _reacttheme.tokens.colorTransparentBackgroundPressed,
color: _reacttheme.tokens.colorNeutralForeground2BrandPressed
}
},
selected: {
backgroundColor: _reacttheme.tokens.colorTransparentBackgroundSelected,
color: _reacttheme.tokens.colorNeutralForeground2BrandSelected,
[`& .${_reacticons.iconFilledClassName}`]: {
display: 'inline-flex'
},
[`& .${_reacticons.iconRegularClassName}`]: {
display: 'none'
},
'@media (forced-colors: active)': {
backgroundColor: 'Highlight',
color: 'Canvas'
}
},
highContrast: {
'@media (forced-colors: active)': {
color: 'CanvasText',
':hover,:hover:active': {
forcedColorAdjust: 'none',
backgroundColor: 'Highlight',
color: 'Canvas'
}
}
},
focusIndicator: (0, _reacttabster.createFocusOutlineStyle)(),
large: {
padding: `${_reacttheme.tokens.spacingVerticalXXS} ${_reacttheme.tokens.spacingVerticalXXS}`
}
});
const usePopoverSurfaceStyles = (0, _react.makeStyles)({
base: {
maxWidth: '264px'
},
smallMedium: _reacttheme.typographyStyles.caption1,
large: _reacttheme.typographyStyles.body1
});
const useInfoButtonStyles_unstable = (state)=>{
'use no memo';
const { size } = state;
const { open } = state.popover;
const buttonStyles = useButtonStyles();
const popoverSurfaceStyles = usePopoverSurfaceStyles();
state.info.className = (0, _react.mergeClasses)(infoButtonClassNames.info, popoverSurfaceStyles.base, size === 'large' ? popoverSurfaceStyles.large : popoverSurfaceStyles.smallMedium, state.info.className);
state.root.className = (0, _react.mergeClasses)(infoButtonClassNames.root, buttonStyles.base, buttonStyles.highContrast, buttonStyles.focusIndicator, open && buttonStyles.selected, size === 'large' && buttonStyles.large, state.root.className);
return state;
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,24 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "InfoLabel", {
enumerable: true,
get: function() {
return InfoLabel;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const _renderInfoLabel = require("./renderInfoLabel");
const _useInfoLabel = require("./useInfoLabel");
const _useInfoLabelStylesstyles = require("./useInfoLabelStyles.styles");
const InfoLabel = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useInfoLabel.useInfoLabel_unstable)(props, ref);
(0, _useInfoLabelStylesstyles.useInfoLabelStyles_unstable)(state);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useInfoLabelStyles_unstable')(state);
return (0, _renderInfoLabel.renderInfoLabel_unstable)(state);
});
InfoLabel.displayName = 'InfoLabel';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoLabel/InfoLabel.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { InfoLabelProps } from './InfoLabel.types';\nimport { renderInfoLabel_unstable } from './renderInfoLabel';\nimport { useInfoLabel_unstable } from './useInfoLabel';\nimport { useInfoLabelStyles_unstable } from './useInfoLabelStyles.styles';\n\n/**\n * InfoLabel component\n */\nexport const InfoLabel: ForwardRefComponent<InfoLabelProps> = React.forwardRef((props, ref) => {\n const state = useInfoLabel_unstable(props, ref);\n\n useInfoLabelStyles_unstable(state);\n useCustomStyleHook_unstable('useInfoLabelStyles_unstable')(state);\n\n return renderInfoLabel_unstable(state);\n});\n\nInfoLabel.displayName = 'InfoLabel';\n"],"names":["React","useCustomStyleHook_unstable","renderInfoLabel_unstable","useInfoLabel_unstable","useInfoLabelStyles_unstable","InfoLabel","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;qCAEa,kCAAkC;iCAGrC,oBAAoB;8BACvB,iBAAiB;0CACX,8BAA8B;AAKnE,MAAMK,YAAAA,WAAAA,GAAiDL,OAAMM,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,YAAQN,mCAAAA,EAAsBI,OAAOC;QAE3CJ,qDAAAA,EAA4BK;QAC5BR,gDAAAA,EAA4B,+BAA+BQ;IAE3D,WAAOP,yCAAAA,EAAyBO;AAClC,GAAG;AAEHJ,UAAUK,WAAW,GAAG"}

View File

@@ -0,0 +1,6 @@
/**
* State used in rendering InfoLabel
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoLabel/InfoLabel.types.ts"],"sourcesContent":["import { Label } from '@fluentui/react-label';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { InfoButton } from '../InfoButton';\nimport type { InfoButtonProps } from '../InfoButton';\n\nexport type InfoLabelSlots = {\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The Label component.\n *\n * It is not typically necessary to use this prop. The label text is the child of the `<InfoLabel>`, and other props\n * such as `size` and `required` should be set directly on the `InfoLabel`.\n *\n * This is the PRIMARY slot: all native properties specified directly on `<InfoLabel>` will be applied to this slot,\n * except `className` and `style`, which remain on the root slot.\n */\n label: NonNullable<Slot<typeof Label>>;\n\n /**\n * The InfoButton component.\n *\n * It is not typically necessary to use this prop. The content can be set using the `info` prop of the InfoLabel.\n */\n infoButton: Slot<typeof InfoButton>;\n};\n\n/**\n * InfoLabel Props\n */\nexport type InfoLabelProps = ComponentProps<Partial<InfoLabelSlots>, 'label'> & {\n /**\n * The content of the InfoButton's popover.\n */\n info?: InfoButtonProps['info'];\n};\n\n/**\n * State used in rendering InfoLabel\n */\nexport type InfoLabelState = ComponentState<InfoLabelSlots> & Pick<InfoLabelProps, 'size'>;\n"],"names":[],"mappings":"AAqCA;;CAEC,GACD,WAA2F"}

View File

@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
InfoLabel: function() {
return _InfoLabel.InfoLabel;
},
infoLabelClassNames: function() {
return _useInfoLabelStylesstyles.infoLabelClassNames;
},
renderInfoLabel_unstable: function() {
return _renderInfoLabel.renderInfoLabel_unstable;
},
useInfoLabelStyles_unstable: function() {
return _useInfoLabelStylesstyles.useInfoLabelStyles_unstable;
},
useInfoLabel_unstable: function() {
return _useInfoLabel.useInfoLabel_unstable;
}
});
const _InfoLabel = require("./InfoLabel");
const _renderInfoLabel = require("./renderInfoLabel");
const _useInfoLabel = require("./useInfoLabel");
const _useInfoLabelStylesstyles = require("./useInfoLabelStyles.styles");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoLabel/index.ts"],"sourcesContent":["export { InfoLabel } from './InfoLabel';\nexport type { InfoLabelProps, InfoLabelSlots, InfoLabelState } from './InfoLabel.types';\nexport { renderInfoLabel_unstable } from './renderInfoLabel';\nexport { useInfoLabel_unstable } from './useInfoLabel';\nexport { infoLabelClassNames, useInfoLabelStyles_unstable } from './useInfoLabelStyles.styles';\n"],"names":["InfoLabel","renderInfoLabel_unstable","useInfoLabel_unstable","infoLabelClassNames","useInfoLabelStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,oBAAS;;;eAITG,6CAAmB;;;eAFnBF,yCAAwB;;;eAEHG,qDAA2B;;;eADhDF,mCAAqB;;;2BAHJ,cAAc;iCAEC,oBAAoB;8BACvB,iBAAiB;0CACU,8BAA8B"}

View File

@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "renderInfoLabel_unstable", {
enumerable: true,
get: function() {
return renderInfoLabel_unstable;
}
});
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
const _reactutilities = require("@fluentui/react-utilities");
const renderInfoLabel_unstable = (state)=>{
(0, _reactutilities.assertSlots)(state);
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
children: [
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.label, {}),
state.infoButton && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.infoButton, {})
]
});
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoLabel/renderInfoLabel.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { InfoLabelSlots, InfoLabelState } from './InfoLabel.types';\n\n/**\n * Render the final JSX of InfoLabel\n */\nexport const renderInfoLabel_unstable = (state: InfoLabelState): JSXElement => {\n assertSlots<InfoLabelSlots>(state);\n\n return (\n <state.root>\n <state.label />\n {state.infoButton && <state.infoButton />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderInfoLabel_unstable","state","root","label","infoButton"],"mappings":";;;;+BAUaC;;;;;;4BATb,iCAAiD;gCAErB,4BAA4B;AAOjD,iCAAiC,CAACC;QACvCF,2BAAAA,EAA4BE;IAE5B,OAAA,WAAA,OACE,gBAAA,EAACA,MAAMC,IAAI,EAAA;;8BACT,eAAA,EAACD,MAAME,KAAK,EAAA,CAAA;YACXF,MAAMG,UAAU,IAAA,WAAA,OAAI,eAAA,EAACH,MAAMG,UAAU,EAAA,CAAA;;;AAG5C,EAAE"}

View File

@@ -0,0 +1,83 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useInfoLabel_unstable", {
enumerable: true,
get: function() {
return useInfoLabel_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactlabel = require("@fluentui/react-label");
const _reactutilities = require("@fluentui/react-utilities");
const _InfoButton = require("../InfoButton/InfoButton");
const useInfoLabel_unstable = (props, ref)=>{
const { root: rootShorthand, label: labelShorthand, infoButton: infoButtonShorthand, info, size, className, style, ...labelProps } = props;
const baseId = (0, _reactutilities.useId)('infolabel-');
const [open, setOpen] = _react.useState(false);
const root = _reactutilities.slot.always(rootShorthand, {
defaultProps: {
className,
style
},
elementType: 'span'
});
const label = _reactutilities.slot.always(labelShorthand, {
defaultProps: {
id: baseId + '__label',
ref,
size,
...labelProps
},
elementType: _reactlabel.Label
});
const infoButton = _reactutilities.slot.optional(infoButtonShorthand, {
renderByDefault: !!info,
defaultProps: {
id: baseId + '__infoButton',
size,
info
},
elementType: _InfoButton.InfoButton
});
const infoButtonPopover = _reactutilities.slot.always(infoButton === null || infoButton === void 0 ? void 0 : infoButton.popover, {
elementType: 'div'
});
infoButtonPopover.onOpenChange = (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(infoButtonPopover.onOpenChange, (_, data)=>{
setOpen(data.open);
}));
if (infoButton) {
var _infoButton, _arialabelledby;
infoButton.popover = infoButtonPopover;
const infoPopupId = baseId + '__info'; // used as a self-referencing aria-labelledby to name the popup
infoButton.info = _reactutilities.slot.optional(infoButton === null || infoButton === void 0 ? void 0 : infoButton.info, {
defaultProps: {
id: infoPopupId,
'aria-labelledby': infoPopupId
},
elementType: 'div'
});
var _;
(_ = (_infoButton = infoButton)[_arialabelledby = 'aria-labelledby']) !== null && _ !== void 0 ? _ : _infoButton[_arialabelledby] = `${label.id} ${infoButton.id}`;
if (open) {
var _infoButton_info;
var _root, _ariaowns;
var _1;
(_1 = (_root = root)[_ariaowns = 'aria-owns']) !== null && _1 !== void 0 ? _1 : _root[_ariaowns] = (_infoButton_info = infoButton.info) === null || _infoButton_info === void 0 ? void 0 : _infoButton_info.id;
}
}
return {
size,
components: {
root: 'span',
label: _reactlabel.Label,
infoButton: _InfoButton.InfoButton
},
root,
label,
infoButton
};
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoLabel/useInfoLabel.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { Label } from '@fluentui/react-label';\nimport { mergeCallbacks, useId, slot, useEventCallback } from '@fluentui/react-utilities';\nimport { InfoButton } from '../InfoButton/InfoButton';\nimport type { InfoLabelProps, InfoLabelState } from './InfoLabel.types';\n\n/**\n * Create the state required to render InfoLabel.\n *\n * The returned state can be modified with hooks such as useInfoLabelStyles_unstable,\n * before being passed to renderInfoLabel_unstable.\n *\n * @param props - props from this instance of InfoLabel\n * @param ref - reference to label element of InfoLabel\n */\nexport const useInfoLabel_unstable = (props: InfoLabelProps, ref: React.Ref<HTMLLabelElement>): InfoLabelState => {\n const {\n root: rootShorthand,\n label: labelShorthand,\n infoButton: infoButtonShorthand,\n info,\n size,\n className,\n style,\n ...labelProps\n } = props;\n const baseId = useId('infolabel-');\n const [open, setOpen] = React.useState(false);\n\n const root = slot.always(rootShorthand, {\n defaultProps: {\n className,\n style,\n },\n elementType: 'span',\n });\n\n const label = slot.always(labelShorthand, {\n defaultProps: {\n id: baseId + '__label',\n ref,\n size,\n ...labelProps,\n },\n elementType: Label,\n });\n\n const infoButton = slot.optional(infoButtonShorthand, {\n renderByDefault: !!info,\n defaultProps: {\n id: baseId + '__infoButton',\n size,\n info,\n },\n elementType: InfoButton,\n });\n\n const infoButtonPopover = slot.always(infoButton?.popover, {\n elementType: 'div',\n });\n infoButtonPopover.onOpenChange = useEventCallback(\n mergeCallbacks(infoButtonPopover.onOpenChange, (_, data) => {\n setOpen(data.open);\n }),\n );\n\n if (infoButton) {\n infoButton.popover = infoButtonPopover;\n const infoPopupId = baseId + '__info'; // used as a self-referencing aria-labelledby to name the popup\n infoButton.info = slot.optional(infoButton?.info, {\n defaultProps: {\n id: infoPopupId,\n 'aria-labelledby': infoPopupId,\n },\n elementType: 'div',\n });\n\n infoButton['aria-labelledby'] ??= `${label.id} ${infoButton.id}`;\n\n if (open) {\n root['aria-owns'] ??= infoButton.info?.id;\n }\n }\n\n return {\n size,\n components: {\n root: 'span',\n label: Label,\n infoButton: InfoButton,\n },\n root,\n label,\n infoButton,\n };\n};\n"],"names":["React","Label","mergeCallbacks","useId","slot","useEventCallback","InfoButton","useInfoLabel_unstable","props","ref","root","rootShorthand","label","labelShorthand","infoButton","infoButtonShorthand","info","size","className","style","labelProps","baseId","open","setOpen","useState","always","defaultProps","elementType","id","optional","renderByDefault","infoButtonPopover","popover","onOpenChange","_","data","infoPopupId","components"],"mappings":"AAAA;;;;;+BAkBaO;;;;;;;iEAhBU,QAAQ;4BAET,wBAAwB;gCACgB,4BAA4B;4BAC/D,2BAA2B;AAY/C,8BAA8B,CAACC,OAAuBC;IAC3D,MAAM,EACJC,MAAMC,aAAa,EACnBC,OAAOC,cAAc,EACrBC,YAAYC,mBAAmB,EAC/BC,IAAI,EACJC,IAAI,EACJC,SAAS,EACTC,KAAK,EACL,GAAGC,YACJ,GAAGZ;IACJ,MAAMa,aAASlB,qBAAAA,EAAM;IACrB,MAAM,CAACmB,MAAMC,QAAQ,GAAGvB,OAAMwB,QAAQ,CAAC;IAEvC,MAAMd,OAAON,oBAAAA,CAAKqB,MAAM,CAACd,eAAe;QACtCe,cAAc;YACZR;YACAC;QACF;QACAQ,aAAa;IACf;IAEA,MAAMf,QAAQR,oBAAAA,CAAKqB,MAAM,CAACZ,gBAAgB;QACxCa,cAAc;YACZE,IAAIP,SAAS;YACbZ;YACAQ;YACA,GAAGG,UAAU;QACf;QACAO,aAAa1B,iBAAAA;IACf;IAEA,MAAMa,aAAaV,oBAAAA,CAAKyB,QAAQ,CAACd,qBAAqB;QACpDe,iBAAiB,CAAC,CAACd;QACnBU,cAAc;YACZE,IAAIP,SAAS;YACbJ;YACAD;QACF;QACAW,aAAarB,sBAAAA;IACf;IAEA,MAAMyB,oBAAoB3B,oBAAAA,CAAKqB,MAAM,CAACX,eAAAA,QAAAA,eAAAA,KAAAA,IAAAA,KAAAA,IAAAA,WAAYkB,OAAO,EAAE;QACzDL,aAAa;IACf;IACAI,kBAAkBE,YAAY,OAAG5B,gCAAAA,MAC/BH,8BAAAA,EAAe6B,kBAAkBE,YAAY,EAAE,CAACC,GAAGC;QACjDZ,QAAQY,KAAKb,IAAI;IACnB;IAGF,IAAIR,YAAY;YAWdA,aAAW;QAVXA,WAAWkB,OAAO,GAAGD;QACrB,MAAMK,cAAcf,SAAS,UAAU,+DAA+D;QACtGP,WAAWE,IAAI,GAAGZ,oBAAAA,CAAKyB,QAAQ,CAACf,eAAAA,QAAAA,eAAAA,KAAAA,IAAAA,KAAAA,IAAAA,WAAYE,IAAI,EAAE;YAChDU,cAAc;gBACZE,IAAIQ;gBACJ,mBAAmBA;YACrB;YACAT,aAAa;QACf;;QAEAb,CAAAA,IAAAA,CAAAA,cAAAA,UAAAA,CAAU,CAAC,kBAAA,kBAAA,AAAkB,MAAA,QAAA,MAAA,KAAA,IAAA,IAA7BA,WAAU,CAAC,gBAAkB,GAAK,GAAGF,MAAMgB,EAAE,CAAC,CAAC,EAAEd,WAAWc,EAAE,EAAE;QAEhE,IAAIN,MAAM;gBACcR;gBAAtBJ,OAAK;;YAALA,CAAAA,KAAAA,CAAAA,QAAAA,IAAAA,CAAI,CAAC,YAAA,YAAA,AAAY,MAAA,QAAA,OAAA,KAAA,IAAA,KAAjBA,KAAI,CAAC,UAAY,GAAA,CAAKI,mBAAAA,WAAWE,IAAI,AAAJA,MAAI,QAAfF,qBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,iBAAiBc,EAAE;QAC3C;IACF;IAEA,OAAO;QACLX;QACAoB,YAAY;YACV3B,MAAM;YACNE,OAAOX,iBAAAA;YACPa,YAAYR,sBAAAA;QACd;QACAI;QACAE;QACAE;IACF;AACF,EAAE"}

View File

@@ -0,0 +1,68 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
infoLabelClassNames: function() {
return infoLabelClassNames;
},
useInfoLabelStyles_unstable: function() {
return useInfoLabelStyles_unstable;
}
});
const _react = require("@griffel/react");
const infoLabelClassNames = {
root: 'fui-InfoLabel',
label: 'fui-InfoLabel__label',
infoButton: 'fui-InfoLabel__infoButton'
};
const useLabelStyles = /*#__PURE__*/ (0, _react.__styles)({
base: {
ha4doy: "f12kltsn",
Bceei9c: "fpo1scq",
sj55zd: "f1ym3bx4"
}
}, {
d: [
".f12kltsn{vertical-align:top;}",
".fpo1scq{cursor:inherit;}",
".f1ym3bx4{color:inherit;}"
]
});
const useInfoButtonStyles = /*#__PURE__*/ (0, _react.__styles)({
base: {
ha4doy: "f12kltsn",
B6of3ja: "f1bmzb36",
jrapky: "f1nyzk09"
},
large: {
B6of3ja: "fkrn0sh",
jrapky: "fmxx68s"
}
}, {
d: [
".f12kltsn{vertical-align:top;}",
".f1bmzb36{margin-top:calc(0px - var(--spacingVerticalXXS));}",
".f1nyzk09{margin-bottom:calc(0px - var(--spacingVerticalXXS));}",
".fkrn0sh{margin-top:-1px;}",
".fmxx68s{margin-bottom:-1px;}"
]
});
const useInfoLabelStyles_unstable = (state)=>{
'use no memo';
state.root.className = (0, _react.mergeClasses)(infoLabelClassNames.root, state.root.className);
const labelStyles = useLabelStyles();
state.label.className = (0, _react.mergeClasses)(infoLabelClassNames.label, labelStyles.base, state.label.className);
const infoButtonStyles = useInfoButtonStyles();
if (state.infoButton) {
state.infoButton.className = (0, _react.mergeClasses)(infoLabelClassNames.infoButton, infoButtonStyles.base, state.size === 'large' && infoButtonStyles.large, state.infoButton.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["useInfoLabelStyles.styles.js"],"sourcesContent":["'use client';\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nexport const infoLabelClassNames = {\n root: 'fui-InfoLabel',\n label: 'fui-InfoLabel__label',\n infoButton: 'fui-InfoLabel__infoButton'\n};\nconst useLabelStyles = makeStyles({\n base: {\n verticalAlign: 'top',\n cursor: 'inherit',\n color: 'inherit'\n }\n});\nconst useInfoButtonStyles = makeStyles({\n base: {\n verticalAlign: 'top',\n // Negative margin to align with the text\n marginTop: `calc(0px - ${tokens.spacingVerticalXXS})`,\n marginBottom: `calc(0px - ${tokens.spacingVerticalXXS})`\n },\n large: {\n // Negative margin to align with the text\n marginTop: '-1px',\n marginBottom: '-1px'\n }\n});\n/**\n * Apply styling to the InfoLabel slots based on the state\n */ export const useInfoLabelStyles_unstable = (state)=>{\n 'use no memo';\n state.root.className = mergeClasses(infoLabelClassNames.root, state.root.className);\n const labelStyles = useLabelStyles();\n state.label.className = mergeClasses(infoLabelClassNames.label, labelStyles.base, state.label.className);\n const infoButtonStyles = useInfoButtonStyles();\n if (state.infoButton) {\n state.infoButton.className = mergeClasses(infoLabelClassNames.infoButton, infoButtonStyles.base, state.size === 'large' && infoButtonStyles.large, state.infoButton.className);\n }\n return state;\n};\n"],"names":["tokens","__styles","mergeClasses","infoLabelClassNames","root","label","infoButton","useLabelStyles","base","ha4doy","Bceei9c","sj55zd","d","useInfoButtonStyles","B6of3ja","jrapky","large","useInfoLabelStyles_unstable","state","className","labelStyles","infoButtonStyles","size"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAGCG,mBAAmB;;;IA2Bfc,2BAA2B;;;;uBA5BH,gBAAgB;AAClD,4BAA4B;IAC/Bb,IAAI,EAAE,eAAe;IACrBC,KAAK,EAAE,sBAAsB;IAC7BC,UAAU,EAAE;AAChB,CAAC;AACD,MAAMC,cAAc,GAAA,WAAA,OAAGN,eAAA,EAAA;IAAAO,IAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;IAAA;AAAA,GAAA;IAAAC,CAAA,EAAA;QAAA;QAAA;QAAA;KAAA;AAAA,CAMtB,CAAC;AACF,MAAMC,mBAAmB,GAAA,WAAA,GAAGZ,mBAAA,EAAA;IAAAO,IAAA,EAAA;QAAAC,MAAA,EAAA;QAAAK,OAAA,EAAA;QAAAC,MAAA,EAAA;IAAA;IAAAC,KAAA,EAAA;QAAAF,OAAA,EAAA;QAAAC,MAAA,EAAA;IAAA;AAAA,GAAA;IAAAH,CAAA,EAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;AAAA,CAY3B,CAAC;AAGS,oCAAqCM,KAAK,IAAG;IACpD,aAAa;IACbA,KAAK,CAACd,IAAI,CAACe,SAAS,GAAGjB,uBAAY,EAACC,mBAAmB,CAACC,IAAI,EAAEc,KAAK,CAACd,IAAI,CAACe,SAAS,CAAC;IACnF,MAAMC,WAAW,GAAGb,cAAc,CAAC,CAAC;IACpCW,KAAK,CAACb,KAAK,CAACc,SAAS,OAAGjB,mBAAY,EAACC,mBAAmB,CAACE,KAAK,EAAEe,WAAW,CAACZ,IAAI,EAAEU,KAAK,CAACb,KAAK,CAACc,SAAS,CAAC;IACxG,MAAME,gBAAgB,GAAGR,mBAAmB,CAAC,CAAC;IAC9C,IAAIK,KAAK,CAACZ,UAAU,EAAE;QAClBY,KAAK,CAACZ,UAAU,CAACa,SAAS,OAAGjB,mBAAY,EAACC,mBAAmB,CAACG,UAAU,EAAEe,gBAAgB,CAACb,IAAI,EAAEU,KAAK,CAACI,IAAI,KAAK,OAAO,IAAID,gBAAgB,CAACL,KAAK,EAAEE,KAAK,CAACZ,UAAU,CAACa,SAAS,CAAC;IAClL;IACA,OAAOD,KAAK;AAChB,CAAC"}

View File

@@ -0,0 +1,57 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
infoLabelClassNames: function() {
return infoLabelClassNames;
},
useInfoLabelStyles_unstable: function() {
return useInfoLabelStyles_unstable;
}
});
const _reacttheme = require("@fluentui/react-theme");
const _react = require("@griffel/react");
const infoLabelClassNames = {
root: 'fui-InfoLabel',
label: 'fui-InfoLabel__label',
infoButton: 'fui-InfoLabel__infoButton'
};
const useLabelStyles = (0, _react.makeStyles)({
base: {
verticalAlign: 'top',
cursor: 'inherit',
color: 'inherit'
}
});
const useInfoButtonStyles = (0, _react.makeStyles)({
base: {
verticalAlign: 'top',
// Negative margin to align with the text
marginTop: `calc(0px - ${_reacttheme.tokens.spacingVerticalXXS})`,
marginBottom: `calc(0px - ${_reacttheme.tokens.spacingVerticalXXS})`
},
large: {
// Negative margin to align with the text
marginTop: '-1px',
marginBottom: '-1px'
}
});
const useInfoLabelStyles_unstable = (state)=>{
'use no memo';
state.root.className = (0, _react.mergeClasses)(infoLabelClassNames.root, state.root.className);
const labelStyles = useLabelStyles();
state.label.className = (0, _react.mergeClasses)(infoLabelClassNames.label, labelStyles.base, state.label.className);
const infoButtonStyles = useInfoButtonStyles();
if (state.infoButton) {
state.infoButton.className = (0, _react.mergeClasses)(infoLabelClassNames.infoButton, infoButtonStyles.base, state.size === 'large' && infoButtonStyles.large, state.infoButton.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoLabel/useInfoLabelStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { InfoLabelSlots, InfoLabelState } from './InfoLabel.types';\n\nexport const infoLabelClassNames: SlotClassNames<InfoLabelSlots> = {\n root: 'fui-InfoLabel',\n label: 'fui-InfoLabel__label',\n infoButton: 'fui-InfoLabel__infoButton',\n};\n\nconst useLabelStyles = makeStyles({\n base: {\n verticalAlign: 'top',\n cursor: 'inherit',\n color: 'inherit',\n },\n});\n\nconst useInfoButtonStyles = makeStyles({\n base: {\n verticalAlign: 'top',\n\n // Negative margin to align with the text\n marginTop: `calc(0px - ${tokens.spacingVerticalXXS})`,\n marginBottom: `calc(0px - ${tokens.spacingVerticalXXS})`,\n },\n\n large: {\n // Negative margin to align with the text\n marginTop: '-1px',\n marginBottom: '-1px',\n },\n});\n\n/**\n * Apply styling to the InfoLabel slots based on the state\n */\nexport const useInfoLabelStyles_unstable = (state: InfoLabelState): InfoLabelState => {\n 'use no memo';\n\n state.root.className = mergeClasses(infoLabelClassNames.root, state.root.className);\n\n const labelStyles = useLabelStyles();\n state.label.className = mergeClasses(infoLabelClassNames.label, labelStyles.base, state.label.className);\n\n const infoButtonStyles = useInfoButtonStyles();\n if (state.infoButton) {\n state.infoButton.className = mergeClasses(\n infoLabelClassNames.infoButton,\n infoButtonStyles.base,\n state.size === 'large' && infoButtonStyles.large,\n state.infoButton.className,\n );\n }\n\n return state;\n};\n"],"names":["tokens","makeStyles","mergeClasses","infoLabelClassNames","root","label","infoButton","useLabelStyles","base","verticalAlign","cursor","color","useInfoButtonStyles","marginTop","spacingVerticalXXS","marginBottom","large","useInfoLabelStyles_unstable","state","className","labelStyles","infoButtonStyles","size"],"mappings":"AAAA;;;;;;;;;;;;IAOaG,mBAAAA;;;+BAiCAc;;;;4BAtCU,wBAAwB;uBAEN,iBAAiB;AAGnD,4BAA4D;IACjEb,MAAM;IACNC,OAAO;IACPC,YAAY;AACd,EAAE;AAEF,MAAMC,qBAAiBN,iBAAAA,EAAW;IAChCO,MAAM;QACJC,eAAe;QACfC,QAAQ;QACRC,OAAO;IACT;AACF;AAEA,MAAMC,0BAAsBX,iBAAAA,EAAW;IACrCO,MAAM;QACJC,eAAe;QAEf,yCAAyC;QACzCI,WAAW,CAAC,WAAW,EAAEb,kBAAAA,CAAOc,kBAAkB,CAAC,CAAC,CAAC;QACrDC,cAAc,CAAC,WAAW,EAAEf,kBAAAA,CAAOc,kBAAkB,CAAC,CAAC,CAAC;IAC1D;IAEAE,OAAO;QACL,yCAAyC;QACzCH,WAAW;QACXE,cAAc;IAChB;AACF;AAKO,MAAME,8BAA8B,CAACC;IAC1C;IAEAA,MAAMd,IAAI,CAACe,SAAS,GAAGjB,uBAAAA,EAAaC,oBAAoBC,IAAI,EAAEc,MAAMd,IAAI,CAACe,SAAS;IAElF,MAAMC,cAAcb;IACpBW,MAAMb,KAAK,CAACc,SAAS,GAAGjB,uBAAAA,EAAaC,oBAAoBE,KAAK,EAAEe,YAAYZ,IAAI,EAAEU,MAAMb,KAAK,CAACc,SAAS;IAEvG,MAAME,mBAAmBT;IACzB,IAAIM,MAAMZ,UAAU,EAAE;QACpBY,MAAMZ,UAAU,CAACa,SAAS,OAAGjB,mBAAAA,EAC3BC,oBAAoBG,UAAU,EAC9Be,iBAAiBb,IAAI,EACrBU,MAAMI,IAAI,KAAK,WAAWD,iBAAiBL,KAAK,EAChDE,MAAMZ,UAAU,CAACa,SAAS;IAE9B;IAEA,OAAOD;AACT,EAAE"}

View File

@@ -0,0 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
InfoButton: function() {
return _InfoButton.InfoButton;
},
InfoLabel: function() {
return _InfoLabel.InfoLabel;
},
infoButtonClassNames: function() {
return _InfoButton.infoButtonClassNames;
},
infoLabelClassNames: function() {
return _InfoLabel.infoLabelClassNames;
},
renderInfoButton_unstable: function() {
return _InfoButton.renderInfoButton_unstable;
},
renderInfoLabel_unstable: function() {
return _InfoLabel.renderInfoLabel_unstable;
},
useInfoButtonStyles_unstable: function() {
return _InfoButton.useInfoButtonStyles_unstable;
},
useInfoButton_unstable: function() {
return _InfoButton.useInfoButton_unstable;
},
useInfoLabelStyles_unstable: function() {
return _InfoLabel.useInfoLabelStyles_unstable;
},
useInfoLabel_unstable: function() {
return _InfoLabel.useInfoLabel_unstable;
}
});
const _InfoLabel = require("./InfoLabel");
const _InfoButton = require("./InfoButton");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n InfoLabel,\n infoLabelClassNames,\n renderInfoLabel_unstable,\n useInfoLabelStyles_unstable,\n useInfoLabel_unstable,\n} from './InfoLabel';\nexport type { InfoLabelProps, InfoLabelSlots, InfoLabelState } from './InfoLabel';\n\nexport {\n InfoButton,\n infoButtonClassNames,\n renderInfoButton_unstable,\n useInfoButtonStyles_unstable,\n useInfoButton_unstable,\n} from './InfoButton';\nexport type { InfoButtonProps, InfoButtonSlots, InfoButtonState } from './InfoButton';\n"],"names":["InfoLabel","infoLabelClassNames","renderInfoLabel_unstable","useInfoLabelStyles_unstable","useInfoLabel_unstable","InfoButton","infoButtonClassNames","renderInfoButton_unstable","useInfoButtonStyles_unstable","useInfoButton_unstable"],"mappings":";;;;;;;;;;;IAUEK;qCAAU;;;eATVL,oBAAS;;IAUTM,oBAAoB;;;;eATpBL,8BAAmB;;;eAUnBM,qCAAyB;;;eATzBL,mCAAwB;;;eAUxBM,wCAA4B;;;eAC5BC,kCAAsB;;IAVtBN,2BAA2B;;;;eAC3BC,gCAAqB;;;2BAChB,cAAc;4BASd,eAAe"}

View File

@@ -0,0 +1 @@
export { InfoButton, infoButtonClassNames, renderInfoButton_unstable, useInfoButtonStyles_unstable, useInfoButton_unstable } from './components/InfoButton/index';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/InfoButton.ts"],"sourcesContent":["export type { InfoButtonProps, InfoButtonSlots, InfoButtonState } from './components/InfoButton/index';\nexport {\n InfoButton,\n infoButtonClassNames,\n renderInfoButton_unstable,\n useInfoButtonStyles_unstable,\n useInfoButton_unstable,\n} from './components/InfoButton/index';\n"],"names":["InfoButton","infoButtonClassNames","renderInfoButton_unstable","useInfoButtonStyles_unstable","useInfoButton_unstable"],"mappings":"AACA,SACEA,UAAU,EACVC,oBAAoB,EACpBC,yBAAyB,EACzBC,4BAA4B,EAC5BC,sBAAsB,QACjB,gCAAgC"}

View File

@@ -0,0 +1 @@
export { InfoLabel, infoLabelClassNames, renderInfoLabel_unstable, useInfoLabelStyles_unstable, useInfoLabel_unstable } from './components/InfoLabel/index';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/InfoLabel.ts"],"sourcesContent":["export type { InfoLabelProps, InfoLabelSlots, InfoLabelState } from './components/InfoLabel/index';\nexport {\n InfoLabel,\n infoLabelClassNames,\n renderInfoLabel_unstable,\n useInfoLabelStyles_unstable,\n useInfoLabel_unstable,\n} from './components/InfoLabel/index';\n"],"names":["InfoLabel","infoLabelClassNames","renderInfoLabel_unstable","useInfoLabelStyles_unstable","useInfoLabel_unstable"],"mappings":"AACA,SACEA,SAAS,EACTC,mBAAmB,EACnBC,wBAAwB,EACxBC,2BAA2B,EAC3BC,qBAAqB,QAChB,+BAA+B"}

View File

@@ -0,0 +1,4 @@
import { Info12Regular, Info12Filled, Info16Regular, Info16Filled, Info20Regular, Info20Filled, bundleIcon } from '@fluentui/react-icons';
export const DefaultInfoButtonIcon12 = bundleIcon(Info12Filled, Info12Regular);
export const DefaultInfoButtonIcon16 = bundleIcon(Info16Filled, Info16Regular);
export const DefaultInfoButtonIcon20 = bundleIcon(Info20Filled, Info20Regular);

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoButton/DefaultInfoButtonIcons.tsx"],"sourcesContent":["import {\n Info12Regular,\n Info12Filled,\n Info16Regular,\n Info16Filled,\n Info20Regular,\n Info20Filled,\n bundleIcon,\n} from '@fluentui/react-icons';\n\nexport const DefaultInfoButtonIcon12 = bundleIcon(Info12Filled, Info12Regular);\nexport const DefaultInfoButtonIcon16 = bundleIcon(Info16Filled, Info16Regular);\nexport const DefaultInfoButtonIcon20 = bundleIcon(Info20Filled, Info20Regular);\n"],"names":["Info12Regular","Info12Filled","Info16Regular","Info16Filled","Info20Regular","Info20Filled","bundleIcon","DefaultInfoButtonIcon12","DefaultInfoButtonIcon16","DefaultInfoButtonIcon20"],"mappings":"AAAA,SACEA,aAAa,EACbC,YAAY,EACZC,aAAa,EACbC,YAAY,EACZC,aAAa,EACbC,YAAY,EACZC,UAAU,QACL,wBAAwB;AAE/B,OAAO,MAAMC,0BAA0BD,WAAWL,cAAcD,eAAe;AAC/E,OAAO,MAAMQ,0BAA0BF,WAAWH,cAAcD,eAAe;AAC/E,OAAO,MAAMO,0BAA0BH,WAAWD,cAAcD,eAAe"}

View File

@@ -0,0 +1,15 @@
'use client';
import * as React from 'react';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
import { renderInfoButton_unstable } from './renderInfoButton';
import { useInfoButton_unstable } from './useInfoButton';
import { useInfoButtonStyles_unstable } from './useInfoButtonStyles.styles';
/**
* InfoButtons provide a way to display additional information about a form field or an area in the UI.
*/ export const InfoButton = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useInfoButton_unstable(props, ref);
useInfoButtonStyles_unstable(state);
useCustomStyleHook_unstable('useInfoButtonStyles_unstable')(state);
return renderInfoButton_unstable(state);
});
InfoButton.displayName = 'InfoButton';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoButton/InfoButton.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { renderInfoButton_unstable } from './renderInfoButton';\nimport { useInfoButton_unstable } from './useInfoButton';\nimport { useInfoButtonStyles_unstable } from './useInfoButtonStyles.styles';\nimport type { InfoButtonProps } from './InfoButton.types';\n\n/**\n * InfoButtons provide a way to display additional information about a form field or an area in the UI.\n */\nexport const InfoButton: ForwardRefComponent<InfoButtonProps> = React.forwardRef((props, ref) => {\n const state = useInfoButton_unstable(props, ref);\n\n useInfoButtonStyles_unstable(state);\n useCustomStyleHook_unstable('useInfoButtonStyles_unstable')(state);\n\n return renderInfoButton_unstable(state);\n});\n\nInfoButton.displayName = 'InfoButton';\n"],"names":["React","useCustomStyleHook_unstable","renderInfoButton_unstable","useInfoButton_unstable","useInfoButtonStyles_unstable","InfoButton","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,4BAA4B,QAAQ,+BAA+B;AAG5E;;CAEC,GACD,OAAO,MAAMC,2BAAmDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACvF,MAAMC,QAAQN,uBAAuBI,OAAOC;IAE5CJ,6BAA6BK;IAC7BR,4BAA4B,gCAAgCQ;IAE5D,OAAOP,0BAA0BO;AACnC,GAAG;AAEHJ,WAAWK,WAAW,GAAG"}

View File

@@ -0,0 +1,3 @@
/**
* State used in rendering InfoButton
*/ export { };

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoButton/InfoButton.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { PopoverProps, PopoverSurface } from '@fluentui/react-popover';\n\nexport type InfoButtonSlots = {\n root: NonNullable<Slot<'button'>>;\n\n /**\n * The Popover element that wraps the info and root slots. Use this slot to pass props to the Popover.\n */\n popover: NonNullable<Slot<Partial<Omit<PopoverProps, 'openOnHover'>>>>;\n\n /**\n * The information to be displayed in the PopoverSurface when the button is pressed.\n */\n info: NonNullable<Slot<typeof PopoverSurface>>;\n};\n\n/**\n * InfoButton Props\n */\nexport type InfoButtonProps = Omit<ComponentProps<Partial<InfoButtonSlots>>, 'disabled' | 'popover'> & {\n /**\n * Size of the InfoButton.\n *\n * @default medium\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Whether the InfoButton should be rendered inline or on a Portal.\n *\n * @default true\n */\n inline?: boolean;\n\n /**\n * The Popover element that wraps the info and root slots. Use this slot to pass props to the Popover.\n */\n popover?: InfoButtonSlots['popover'];\n};\n\n/**\n * State used in rendering InfoButton\n */\nexport type InfoButtonState = ComponentState<InfoButtonSlots> & Required<Pick<InfoButtonProps, 'inline' | 'size'>>;\n"],"names":[],"mappings":"AAyCA;;CAEC,GACD,WAAmH"}

View File

@@ -0,0 +1,4 @@
export { InfoButton } from './InfoButton';
export { renderInfoButton_unstable } from './renderInfoButton';
export { useInfoButton_unstable } from './useInfoButton';
export { infoButtonClassNames, useInfoButtonStyles_unstable } from './useInfoButtonStyles.styles';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoButton/index.ts"],"sourcesContent":["export { InfoButton } from './InfoButton';\nexport type { InfoButtonProps, InfoButtonSlots, InfoButtonState } from './InfoButton.types';\nexport { renderInfoButton_unstable } from './renderInfoButton';\nexport { useInfoButton_unstable } from './useInfoButton';\nexport { infoButtonClassNames, useInfoButtonStyles_unstable } from './useInfoButtonStyles.styles';\n"],"names":["InfoButton","renderInfoButton_unstable","useInfoButton_unstable","infoButtonClassNames","useInfoButtonStyles_unstable"],"mappings":"AAAA,SAASA,UAAU,QAAQ,eAAe;AAE1C,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,oBAAoB,EAAEC,4BAA4B,QAAQ,+BAA+B"}

View File

@@ -0,0 +1,16 @@
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
import { assertSlots } from '@fluentui/react-utilities';
import { PopoverTrigger } from '@fluentui/react-popover';
/**
* Render the final JSX of InfoButton
*/ export const renderInfoButton_unstable = (state)=>{
assertSlots(state);
return /*#__PURE__*/ _jsxs(state.popover, {
children: [
/*#__PURE__*/ _jsx(PopoverTrigger, {
children: /*#__PURE__*/ _jsx(state.root, {})
}),
/*#__PURE__*/ _jsx(state.info, {})
]
});
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoButton/renderInfoButton.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { PopoverTrigger } from '@fluentui/react-popover';\nimport type { InfoButtonState, InfoButtonSlots } from './InfoButton.types';\n\n/**\n * Render the final JSX of InfoButton\n */\nexport const renderInfoButton_unstable = (state: InfoButtonState): JSXElement => {\n assertSlots<InfoButtonSlots>(state);\n\n return (\n <state.popover>\n <PopoverTrigger>\n <state.root />\n </PopoverTrigger>\n <state.info />\n </state.popover>\n );\n};\n"],"names":["assertSlots","PopoverTrigger","renderInfoButton_unstable","state","popover","root","info"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAExD,SAASC,cAAc,QAAQ,0BAA0B;AAGzD;;CAEC,GACD,OAAO,MAAMC,4BAA4B,CAACC;IACxCH,YAA6BG;IAE7B,qBACE,MAACA,MAAMC,OAAO;;0BACZ,KAACH;0BACC,cAAA,KAACE,MAAME,IAAI;;0BAEb,KAACF,MAAMG,IAAI;;;AAGjB,EAAE"}

View File

@@ -0,0 +1,80 @@
'use client';
import * as React from 'react';
import { DefaultInfoButtonIcon12, DefaultInfoButtonIcon16, DefaultInfoButtonIcon20 } from './DefaultInfoButtonIcons';
import { getIntrinsicElementProps, mergeCallbacks, useControllableState, slot, useMergedRefs, elementContains, useEventCallback } from '@fluentui/react-utilities';
import { Popover, PopoverSurface } from '@fluentui/react-popover';
const infoButtonIconMap = {
small: /*#__PURE__*/ React.createElement(DefaultInfoButtonIcon12, null),
medium: /*#__PURE__*/ React.createElement(DefaultInfoButtonIcon16, null),
large: /*#__PURE__*/ React.createElement(DefaultInfoButtonIcon20, null)
};
const popoverSizeMap = {
small: 'small',
medium: 'small',
large: 'medium'
};
/**
* Create the state required to render InfoButton.
*
* The returned state can be modified with hooks such as useInfoButtonStyles_unstable,
* before being passed to renderInfoButton_unstable.
*
* @param props - props from this instance of InfoButton
* @param ref - reference to root HTMLButtonElement of InfoButton
*/ export const useInfoButton_unstable = (props, ref)=>{
const { size = 'medium', inline = true, popover, info, ...rest } = props;
const rootRef = useMergedRefs(ref);
const state = {
inline,
size,
components: {
root: 'button',
popover: Popover,
info: PopoverSurface
},
root: slot.always(getIntrinsicElementProps('button', {
children: infoButtonIconMap[size],
type: 'button',
'aria-label': 'information',
...rest,
ref: rootRef
}), {
elementType: 'button'
}),
popover: slot.always(popover, {
defaultProps: {
inline,
positioning: 'above-start',
size: popoverSizeMap[size],
withArrow: true
},
elementType: Popover
}),
info: slot.always(info, {
defaultProps: {
role: 'note',
tabIndex: -1
},
elementType: PopoverSurface
})
};
const [popoverOpen, setPopoverOpen] = useControllableState({
state: state.popover.open,
defaultState: state.popover.defaultOpen,
initialState: false
});
state.popover.open = popoverOpen;
state.popover.onOpenChange = mergeCallbacks(state.popover.onOpenChange, (e, data)=>setPopoverOpen(data.open));
const infoRef = useMergedRefs(state.info.ref);
state.info.ref = infoRef;
// Hide the popover when focus moves out of the button and popover
const onBlurButtonOrInfo = (e)=>{
const nextFocused = e.relatedTarget;
if (nextFocused && rootRef.current !== nextFocused && !elementContains(infoRef.current, nextFocused)) {
setPopoverOpen(false);
}
};
state.root.onBlur = useEventCallback(mergeCallbacks(state.root.onBlur, onBlurButtonOrInfo));
state.info.onBlurCapture = useEventCallback(mergeCallbacks(state.info.onBlurCapture, onBlurButtonOrInfo));
return state;
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,192 @@
'use client';
import { createFocusOutlineStyle } from '@fluentui/react-tabster';
import { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';
import { __styles, mergeClasses, shorthands } from '@griffel/react';
import { tokens, typographyStyles } from '@fluentui/react-theme';
export const infoButtonClassNames = {
root: 'fui-InfoButton',
// this className won't be used, but it's needed to satisfy the type checker
popover: 'fui-InfoButton__popover',
info: 'fui-InfoButton__info'
};
/**
* Styles for the root slot
*/
const useButtonStyles = /*#__PURE__*/__styles({
base: {
Bt984gj: "f122n59",
B7ck84d: "f1ewtqcl",
mc9l5x: "ftuwxu6",
Brf1p80: "f4d9j23",
w71qe1: "f1iuv45f",
ha4doy: "fmrv4ls",
qhf8xq: "f10pi13n",
De3pzq: "f1c21dwh",
sj55zd: "fkfq4zb",
icvyot: "f1ern45e",
vrafjx: ["f1n71otn", "f1deefiw"],
oivjwe: "f1h8hb77",
wvpqe5: ["f1deefiw", "f1n71otn"],
Beyfa6y: 0,
Bbmb7ep: 0,
Btl43ni: 0,
B7oj6ja: 0,
Dimara: "ft85np5",
jrapky: 0,
Frg6f3: 0,
t21cq0: 0,
B6of3ja: 0,
B74szlk: "f1s184ao",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f16d74zd",
D0sxk3: "f16u1re",
t6yez3: "f1rw4040",
Jwef8y: "fjxutwb",
Bi91k9c: "f139oj5f",
eoavqd: "f8491dx",
Bk3fhr4: "f1jpd6y0",
Bmfj8id: "fuxngvv",
iro3zm: "fwiml72",
B2d53fq: "f1fg1p5m"
},
selected: {
De3pzq: "f1q9pm1r",
sj55zd: "f1qj7y59",
D0sxk3: "fgzdkf0",
t6yez3: "f15q0o9g",
By8wz76: "f1nz3ub2",
B7iucu3: "f1205bnn"
},
highContrast: {
B7iucu3: "fslfhp6",
Bfsdueo: "f11s1vgy",
pb71ee: "f12b7wpn",
ik86qs: "f1u668rv"
},
focusIndicator: {
Brovlpu: "ftqa4ok",
B486eqv: "f2hkw1w",
B8q5s1w: "f8hki3x",
Bci5o5g: ["f1d2448m", "ffh67wi"],
n8qw10: "f1bjia2o",
Bdrgwmp: ["ffh67wi", "f1d2448m"],
Bqhya38: "f1j6vpng",
Bwxa6fj: ["f1pniga2", "f1ffjurs"],
Bdhvstf: "f987i1v",
B7zbvrb: ["f1ffjurs", "f1pniga2"],
Bm4h7ae: "f15bsgw9",
B7ys5i9: "f14e48fq",
Busjfv9: "f18yb2kv",
Bhk32uz: "fd6o370",
f6g5ot: 0,
Boxcth7: 0,
Bhdgwq3: 0,
hgwjuy: 0,
Bshpdp8: 0,
Bsom6fd: 0,
Blkhhs4: 0,
Bonggc9: 0,
Ddfuxk: 0,
i03rao: 0,
kclons: 0,
clg4pj: 0,
Bpqj9nj: 0,
B6dhp37: 0,
Bf4ptjt: 0,
Bqtpl0w: 0,
i4rwgc: "ffwy5si",
Dah5zi: 0,
B1tsrr9: 0,
qqdqy8: 0,
Bkh64rk: 0,
e3fwne: "f3znvyf",
J0r882: "f57olzd",
Bule8hv: ["f4stah7", "fs1por5"],
Bjwuhne: "f480a47",
Ghsupd: ["fs1por5", "f4stah7"]
},
large: {
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f1kx978o"
}
}, {
d: [".f122n59{align-items:center;}", ".f1ewtqcl{box-sizing:border-box;}", ".ftuwxu6{display:inline-flex;}", ".f4d9j23{justify-content:center;}", ".f1iuv45f{text-decoration-line:none;}", ".fmrv4ls{vertical-align:middle;}", ".f10pi13n{position:relative;}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".f1ern45e{border-top-style:none;}", ".f1n71otn{border-right-style:none;}", ".f1deefiw{border-left-style:none;}", ".f1h8hb77{border-bottom-style:none;}", [".ft85np5{border-radius:var(--borderRadiusMedium);}", {
p: -1
}], [".f1s184ao{margin:0;}", {
p: -1
}], [".f16d74zd{padding:var(--spacingVerticalXS) var(--spacingHorizontalXS);}", {
p: -1
}], ".f16u1re .fui-Icon-filled{display:none;}", ".f1rw4040 .fui-Icon-regular{display:inline-flex;}", ".f1q9pm1r{background-color:var(--colorTransparentBackgroundSelected);}", ".f1qj7y59{color:var(--colorNeutralForeground2BrandSelected);}", ".fgzdkf0 .fui-Icon-filled{display:inline-flex;}", ".f15q0o9g .fui-Icon-regular{display:none;}", ".f8hki3x[data-fui-focus-visible]{border-top-color:transparent;}", ".f1d2448m[data-fui-focus-visible]{border-right-color:transparent;}", ".ffh67wi[data-fui-focus-visible]{border-left-color:transparent;}", ".f1bjia2o[data-fui-focus-visible]{border-bottom-color:transparent;}", ".f15bsgw9[data-fui-focus-visible]::after{content:\"\";}", ".f14e48fq[data-fui-focus-visible]::after{position:absolute;}", ".f18yb2kv[data-fui-focus-visible]::after{pointer-events:none;}", ".fd6o370[data-fui-focus-visible]::after{z-index:1;}", [".ffwy5si[data-fui-focus-visible]::after{border:2px solid var(--colorStrokeFocus2);}", {
p: -2
}], [".f3znvyf[data-fui-focus-visible]::after{border-radius:var(--borderRadiusMedium);}", {
p: -1
}], ".f57olzd[data-fui-focus-visible]::after{top:calc(2px * -1);}", ".f4stah7[data-fui-focus-visible]::after{right:calc(2px * -1);}", ".fs1por5[data-fui-focus-visible]::after{left:calc(2px * -1);}", ".f480a47[data-fui-focus-visible]::after{bottom:calc(2px * -1);}", [".f1kx978o{padding:var(--spacingVerticalXXS) var(--spacingVerticalXXS);}", {
p: -1
}]],
h: [".fjxutwb:hover{background-color:var(--colorTransparentBackgroundHover);}", ".f139oj5f:hover{color:var(--colorNeutralForeground2BrandHover);}", ".f8491dx:hover{cursor:pointer;}", ".f1jpd6y0:hover .fui-Icon-filled{display:inline-flex;}", ".fuxngvv:hover .fui-Icon-regular{display:none;}", ".fwiml72:hover:active{background-color:var(--colorTransparentBackgroundPressed);}", ".f1fg1p5m:hover:active{color:var(--colorNeutralForeground2BrandPressed);}"],
m: [["@media (forced-colors: active){.f1nz3ub2{background-color:Highlight;}}", {
m: "(forced-colors: active)"
}], ["@media (forced-colors: active){.f1205bnn{color:Canvas;}}", {
m: "(forced-colors: active)"
}], ["@media (forced-colors: active){.fslfhp6{color:CanvasText;}}", {
m: "(forced-colors: active)"
}], ["@media (forced-colors: active){.f11s1vgy:hover,.f11s1vgy:hover:active{forced-color-adjust:none;}}", {
m: "(forced-colors: active)"
}], ["@media (forced-colors: active){.f12b7wpn:hover,.f12b7wpn:hover:active{background-color:Highlight;}}", {
m: "(forced-colors: active)"
}], ["@media (forced-colors: active){.f1u668rv:hover,.f1u668rv:hover:active{color:Canvas;}}", {
m: "(forced-colors: active)"
}], ["@media (forced-colors: active){.f1j6vpng[data-fui-focus-visible]::after{border-top-color:Highlight;}}", {
m: "(forced-colors: active)"
}], ["@media (forced-colors: active){.f1ffjurs[data-fui-focus-visible]::after{border-left-color:Highlight;}.f1pniga2[data-fui-focus-visible]::after{border-right-color:Highlight;}}", {
m: "(forced-colors: active)"
}], ["@media (forced-colors: active){.f987i1v[data-fui-focus-visible]::after{border-bottom-color:Highlight;}}", {
m: "(forced-colors: active)"
}]],
f: [".ftqa4ok:focus{outline-style:none;}"],
i: [".f2hkw1w:focus-visible{outline-style:none;}"]
});
const usePopoverSurfaceStyles = /*#__PURE__*/__styles({
base: {
B2u0y6b: "f1qmtlvf"
},
smallMedium: {
Bahqtrf: "fk6fouc",
Be2twd7: "fy9rknc",
Bhrd7zp: "figsok6",
Bg96gwp: "fwrc4pm"
},
large: {
Bahqtrf: "fk6fouc",
Be2twd7: "fkhj508",
Bhrd7zp: "figsok6",
Bg96gwp: "f1i3iumi"
}
}, {
d: [".f1qmtlvf{max-width:264px;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}"]
});
/**
* Apply styling to the InfoButton slots based on the state
*/
export const useInfoButtonStyles_unstable = state => {
'use no memo';
const {
size
} = state;
const {
open
} = state.popover;
const buttonStyles = useButtonStyles();
const popoverSurfaceStyles = usePopoverSurfaceStyles();
state.info.className = mergeClasses(infoButtonClassNames.info, popoverSurfaceStyles.base, size === 'large' ? popoverSurfaceStyles.large : popoverSurfaceStyles.smallMedium, state.info.className);
state.root.className = mergeClasses(infoButtonClassNames.root, buttonStyles.base, buttonStyles.highContrast, buttonStyles.focusIndicator, open && buttonStyles.selected, size === 'large' && buttonStyles.large, state.root.className);
return state;
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,98 @@
'use client';
import { createFocusOutlineStyle } from '@fluentui/react-tabster';
import { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';
import { makeStyles, mergeClasses, shorthands } from '@griffel/react';
import { tokens, typographyStyles } from '@fluentui/react-theme';
export const infoButtonClassNames = {
root: 'fui-InfoButton',
// this className won't be used, but it's needed to satisfy the type checker
popover: 'fui-InfoButton__popover',
info: 'fui-InfoButton__info'
};
/**
* Styles for the root slot
*/ const useButtonStyles = makeStyles({
base: {
alignItems: 'center',
boxSizing: 'border-box',
display: 'inline-flex',
justifyContent: 'center',
textDecorationLine: 'none',
verticalAlign: 'middle',
position: 'relative',
backgroundColor: tokens.colorTransparentBackground,
color: tokens.colorNeutralForeground2,
...shorthands.borderStyle('none'),
borderRadius: tokens.borderRadiusMedium,
margin: '0',
padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalXS}`,
[`& .${iconFilledClassName}`]: {
display: 'none'
},
[`& .${iconRegularClassName}`]: {
display: 'inline-flex'
},
':hover': {
backgroundColor: tokens.colorTransparentBackgroundHover,
color: tokens.colorNeutralForeground2BrandHover,
cursor: 'pointer',
[`& .${iconFilledClassName}`]: {
display: 'inline-flex'
},
[`& .${iconRegularClassName}`]: {
display: 'none'
}
},
':hover:active': {
backgroundColor: tokens.colorTransparentBackgroundPressed,
color: tokens.colorNeutralForeground2BrandPressed
}
},
selected: {
backgroundColor: tokens.colorTransparentBackgroundSelected,
color: tokens.colorNeutralForeground2BrandSelected,
[`& .${iconFilledClassName}`]: {
display: 'inline-flex'
},
[`& .${iconRegularClassName}`]: {
display: 'none'
},
'@media (forced-colors: active)': {
backgroundColor: 'Highlight',
color: 'Canvas'
}
},
highContrast: {
'@media (forced-colors: active)': {
color: 'CanvasText',
':hover,:hover:active': {
forcedColorAdjust: 'none',
backgroundColor: 'Highlight',
color: 'Canvas'
}
}
},
focusIndicator: createFocusOutlineStyle(),
large: {
padding: `${tokens.spacingVerticalXXS} ${tokens.spacingVerticalXXS}`
}
});
const usePopoverSurfaceStyles = makeStyles({
base: {
maxWidth: '264px'
},
smallMedium: typographyStyles.caption1,
large: typographyStyles.body1
});
/**
* Apply styling to the InfoButton slots based on the state
*/ export const useInfoButtonStyles_unstable = (state)=>{
'use no memo';
const { size } = state;
const { open } = state.popover;
const buttonStyles = useButtonStyles();
const popoverSurfaceStyles = usePopoverSurfaceStyles();
state.info.className = mergeClasses(infoButtonClassNames.info, popoverSurfaceStyles.base, size === 'large' ? popoverSurfaceStyles.large : popoverSurfaceStyles.smallMedium, state.info.className);
state.root.className = mergeClasses(infoButtonClassNames.root, buttonStyles.base, buttonStyles.highContrast, buttonStyles.focusIndicator, open && buttonStyles.selected, size === 'large' && buttonStyles.large, state.root.className);
return state;
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,15 @@
'use client';
import * as React from 'react';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
import { renderInfoLabel_unstable } from './renderInfoLabel';
import { useInfoLabel_unstable } from './useInfoLabel';
import { useInfoLabelStyles_unstable } from './useInfoLabelStyles.styles';
/**
* InfoLabel component
*/ export const InfoLabel = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useInfoLabel_unstable(props, ref);
useInfoLabelStyles_unstable(state);
useCustomStyleHook_unstable('useInfoLabelStyles_unstable')(state);
return renderInfoLabel_unstable(state);
});
InfoLabel.displayName = 'InfoLabel';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoLabel/InfoLabel.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { InfoLabelProps } from './InfoLabel.types';\nimport { renderInfoLabel_unstable } from './renderInfoLabel';\nimport { useInfoLabel_unstable } from './useInfoLabel';\nimport { useInfoLabelStyles_unstable } from './useInfoLabelStyles.styles';\n\n/**\n * InfoLabel component\n */\nexport const InfoLabel: ForwardRefComponent<InfoLabelProps> = React.forwardRef((props, ref) => {\n const state = useInfoLabel_unstable(props, ref);\n\n useInfoLabelStyles_unstable(state);\n useCustomStyleHook_unstable('useInfoLabelStyles_unstable')(state);\n\n return renderInfoLabel_unstable(state);\n});\n\nInfoLabel.displayName = 'InfoLabel';\n"],"names":["React","useCustomStyleHook_unstable","renderInfoLabel_unstable","useInfoLabel_unstable","useInfoLabelStyles_unstable","InfoLabel","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,2BAA2B,QAAQ,kCAAkC;AAG9E,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,2BAA2B,QAAQ,8BAA8B;AAE1E;;CAEC,GACD,OAAO,MAAMC,0BAAiDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQN,sBAAsBI,OAAOC;IAE3CJ,4BAA4BK;IAC5BR,4BAA4B,+BAA+BQ;IAE3D,OAAOP,yBAAyBO;AAClC,GAAG;AAEHJ,UAAUK,WAAW,GAAG"}

View File

@@ -0,0 +1,3 @@
/**
* State used in rendering InfoLabel
*/ export { };

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoLabel/InfoLabel.types.ts"],"sourcesContent":["import { Label } from '@fluentui/react-label';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { InfoButton } from '../InfoButton';\nimport type { InfoButtonProps } from '../InfoButton';\n\nexport type InfoLabelSlots = {\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The Label component.\n *\n * It is not typically necessary to use this prop. The label text is the child of the `<InfoLabel>`, and other props\n * such as `size` and `required` should be set directly on the `InfoLabel`.\n *\n * This is the PRIMARY slot: all native properties specified directly on `<InfoLabel>` will be applied to this slot,\n * except `className` and `style`, which remain on the root slot.\n */\n label: NonNullable<Slot<typeof Label>>;\n\n /**\n * The InfoButton component.\n *\n * It is not typically necessary to use this prop. The content can be set using the `info` prop of the InfoLabel.\n */\n infoButton: Slot<typeof InfoButton>;\n};\n\n/**\n * InfoLabel Props\n */\nexport type InfoLabelProps = ComponentProps<Partial<InfoLabelSlots>, 'label'> & {\n /**\n * The content of the InfoButton's popover.\n */\n info?: InfoButtonProps['info'];\n};\n\n/**\n * State used in rendering InfoLabel\n */\nexport type InfoLabelState = ComponentState<InfoLabelSlots> & Pick<InfoLabelProps, 'size'>;\n"],"names":[],"mappings":"AAqCA;;CAEC,GACD,WAA2F"}

View File

@@ -0,0 +1,4 @@
export { InfoLabel } from './InfoLabel';
export { renderInfoLabel_unstable } from './renderInfoLabel';
export { useInfoLabel_unstable } from './useInfoLabel';
export { infoLabelClassNames, useInfoLabelStyles_unstable } from './useInfoLabelStyles.styles';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoLabel/index.ts"],"sourcesContent":["export { InfoLabel } from './InfoLabel';\nexport type { InfoLabelProps, InfoLabelSlots, InfoLabelState } from './InfoLabel.types';\nexport { renderInfoLabel_unstable } from './renderInfoLabel';\nexport { useInfoLabel_unstable } from './useInfoLabel';\nexport { infoLabelClassNames, useInfoLabelStyles_unstable } from './useInfoLabelStyles.styles';\n"],"names":["InfoLabel","renderInfoLabel_unstable","useInfoLabel_unstable","infoLabelClassNames","useInfoLabelStyles_unstable"],"mappings":"AAAA,SAASA,SAAS,QAAQ,cAAc;AAExC,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,mBAAmB,EAAEC,2BAA2B,QAAQ,8BAA8B"}

View File

@@ -0,0 +1,13 @@
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
import { assertSlots } from '@fluentui/react-utilities';
/**
* Render the final JSX of InfoLabel
*/ export const renderInfoLabel_unstable = (state)=>{
assertSlots(state);
return /*#__PURE__*/ _jsxs(state.root, {
children: [
/*#__PURE__*/ _jsx(state.label, {}),
state.infoButton && /*#__PURE__*/ _jsx(state.infoButton, {})
]
});
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoLabel/renderInfoLabel.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { InfoLabelSlots, InfoLabelState } from './InfoLabel.types';\n\n/**\n * Render the final JSX of InfoLabel\n */\nexport const renderInfoLabel_unstable = (state: InfoLabelState): JSXElement => {\n assertSlots<InfoLabelSlots>(state);\n\n return (\n <state.root>\n <state.label />\n {state.infoButton && <state.infoButton />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderInfoLabel_unstable","state","root","label","infoButton"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,2BAA2B,CAACC;IACvCF,YAA4BE;IAE5B,qBACE,MAACA,MAAMC,IAAI;;0BACT,KAACD,MAAME,KAAK;YACXF,MAAMG,UAAU,kBAAI,KAACH,MAAMG,UAAU;;;AAG5C,EAAE"}

View File

@@ -0,0 +1,80 @@
'use client';
import * as React from 'react';
import { Label } from '@fluentui/react-label';
import { mergeCallbacks, useId, slot, useEventCallback } from '@fluentui/react-utilities';
import { InfoButton } from '../InfoButton/InfoButton';
/**
* Create the state required to render InfoLabel.
*
* The returned state can be modified with hooks such as useInfoLabelStyles_unstable,
* before being passed to renderInfoLabel_unstable.
*
* @param props - props from this instance of InfoLabel
* @param ref - reference to label element of InfoLabel
*/ export const useInfoLabel_unstable = (props, ref)=>{
const { root: rootShorthand, label: labelShorthand, infoButton: infoButtonShorthand, info, size, className, style, ...labelProps } = props;
const baseId = useId('infolabel-');
const [open, setOpen] = React.useState(false);
const root = slot.always(rootShorthand, {
defaultProps: {
className,
style
},
elementType: 'span'
});
const label = slot.always(labelShorthand, {
defaultProps: {
id: baseId + '__label',
ref,
size,
...labelProps
},
elementType: Label
});
const infoButton = slot.optional(infoButtonShorthand, {
renderByDefault: !!info,
defaultProps: {
id: baseId + '__infoButton',
size,
info
},
elementType: InfoButton
});
const infoButtonPopover = slot.always(infoButton === null || infoButton === void 0 ? void 0 : infoButton.popover, {
elementType: 'div'
});
infoButtonPopover.onOpenChange = useEventCallback(mergeCallbacks(infoButtonPopover.onOpenChange, (_, data)=>{
setOpen(data.open);
}));
if (infoButton) {
var _infoButton, _arialabelledby;
infoButton.popover = infoButtonPopover;
const infoPopupId = baseId + '__info'; // used as a self-referencing aria-labelledby to name the popup
infoButton.info = slot.optional(infoButton === null || infoButton === void 0 ? void 0 : infoButton.info, {
defaultProps: {
id: infoPopupId,
'aria-labelledby': infoPopupId
},
elementType: 'div'
});
var _;
(_ = (_infoButton = infoButton)[_arialabelledby = 'aria-labelledby']) !== null && _ !== void 0 ? _ : _infoButton[_arialabelledby] = `${label.id} ${infoButton.id}`;
if (open) {
var _infoButton_info;
var _root, _ariaowns;
var _1;
(_1 = (_root = root)[_ariaowns = 'aria-owns']) !== null && _1 !== void 0 ? _1 : _root[_ariaowns] = (_infoButton_info = infoButton.info) === null || _infoButton_info === void 0 ? void 0 : _infoButton_info.id;
}
}
return {
size,
components: {
root: 'span',
label: Label,
infoButton: InfoButton
},
root,
label,
infoButton
};
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoLabel/useInfoLabel.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { Label } from '@fluentui/react-label';\nimport { mergeCallbacks, useId, slot, useEventCallback } from '@fluentui/react-utilities';\nimport { InfoButton } from '../InfoButton/InfoButton';\nimport type { InfoLabelProps, InfoLabelState } from './InfoLabel.types';\n\n/**\n * Create the state required to render InfoLabel.\n *\n * The returned state can be modified with hooks such as useInfoLabelStyles_unstable,\n * before being passed to renderInfoLabel_unstable.\n *\n * @param props - props from this instance of InfoLabel\n * @param ref - reference to label element of InfoLabel\n */\nexport const useInfoLabel_unstable = (props: InfoLabelProps, ref: React.Ref<HTMLLabelElement>): InfoLabelState => {\n const {\n root: rootShorthand,\n label: labelShorthand,\n infoButton: infoButtonShorthand,\n info,\n size,\n className,\n style,\n ...labelProps\n } = props;\n const baseId = useId('infolabel-');\n const [open, setOpen] = React.useState(false);\n\n const root = slot.always(rootShorthand, {\n defaultProps: {\n className,\n style,\n },\n elementType: 'span',\n });\n\n const label = slot.always(labelShorthand, {\n defaultProps: {\n id: baseId + '__label',\n ref,\n size,\n ...labelProps,\n },\n elementType: Label,\n });\n\n const infoButton = slot.optional(infoButtonShorthand, {\n renderByDefault: !!info,\n defaultProps: {\n id: baseId + '__infoButton',\n size,\n info,\n },\n elementType: InfoButton,\n });\n\n const infoButtonPopover = slot.always(infoButton?.popover, {\n elementType: 'div',\n });\n infoButtonPopover.onOpenChange = useEventCallback(\n mergeCallbacks(infoButtonPopover.onOpenChange, (_, data) => {\n setOpen(data.open);\n }),\n );\n\n if (infoButton) {\n infoButton.popover = infoButtonPopover;\n const infoPopupId = baseId + '__info'; // used as a self-referencing aria-labelledby to name the popup\n infoButton.info = slot.optional(infoButton?.info, {\n defaultProps: {\n id: infoPopupId,\n 'aria-labelledby': infoPopupId,\n },\n elementType: 'div',\n });\n\n infoButton['aria-labelledby'] ??= `${label.id} ${infoButton.id}`;\n\n if (open) {\n root['aria-owns'] ??= infoButton.info?.id;\n }\n }\n\n return {\n size,\n components: {\n root: 'span',\n label: Label,\n infoButton: InfoButton,\n },\n root,\n label,\n infoButton,\n };\n};\n"],"names":["React","Label","mergeCallbacks","useId","slot","useEventCallback","InfoButton","useInfoLabel_unstable","props","ref","root","rootShorthand","label","labelShorthand","infoButton","infoButtonShorthand","info","size","className","style","labelProps","baseId","open","setOpen","useState","always","defaultProps","elementType","id","optional","renderByDefault","infoButtonPopover","popover","onOpenChange","_","data","infoPopupId","components"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,KAAK,QAAQ,wBAAwB;AAC9C,SAASC,cAAc,EAAEC,KAAK,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,4BAA4B;AAC1F,SAASC,UAAU,QAAQ,2BAA2B;AAGtD;;;;;;;;CAQC,GACD,OAAO,MAAMC,wBAAwB,CAACC,OAAuBC;IAC3D,MAAM,EACJC,MAAMC,aAAa,EACnBC,OAAOC,cAAc,EACrBC,YAAYC,mBAAmB,EAC/BC,IAAI,EACJC,IAAI,EACJC,SAAS,EACTC,KAAK,EACL,GAAGC,YACJ,GAAGZ;IACJ,MAAMa,SAASlB,MAAM;IACrB,MAAM,CAACmB,MAAMC,QAAQ,GAAGvB,MAAMwB,QAAQ,CAAC;IAEvC,MAAMd,OAAON,KAAKqB,MAAM,CAACd,eAAe;QACtCe,cAAc;YACZR;YACAC;QACF;QACAQ,aAAa;IACf;IAEA,MAAMf,QAAQR,KAAKqB,MAAM,CAACZ,gBAAgB;QACxCa,cAAc;YACZE,IAAIP,SAAS;YACbZ;YACAQ;YACA,GAAGG,UAAU;QACf;QACAO,aAAa1B;IACf;IAEA,MAAMa,aAAaV,KAAKyB,QAAQ,CAACd,qBAAqB;QACpDe,iBAAiB,CAAC,CAACd;QACnBU,cAAc;YACZE,IAAIP,SAAS;YACbJ;YACAD;QACF;QACAW,aAAarB;IACf;IAEA,MAAMyB,oBAAoB3B,KAAKqB,MAAM,CAACX,uBAAAA,iCAAAA,WAAYkB,OAAO,EAAE;QACzDL,aAAa;IACf;IACAI,kBAAkBE,YAAY,GAAG5B,iBAC/BH,eAAe6B,kBAAkBE,YAAY,EAAE,CAACC,GAAGC;QACjDZ,QAAQY,KAAKb,IAAI;IACnB;IAGF,IAAIR,YAAY;YAWdA,aAAW;QAVXA,WAAWkB,OAAO,GAAGD;QACrB,MAAMK,cAAcf,SAAS,UAAU,+DAA+D;QACtGP,WAAWE,IAAI,GAAGZ,KAAKyB,QAAQ,CAACf,uBAAAA,iCAAAA,WAAYE,IAAI,EAAE;YAChDU,cAAc;gBACZE,IAAIQ;gBACJ,mBAAmBA;YACrB;YACAT,aAAa;QACf;;QAEAb,MAAAA,cAAAA,WAAU,CAAC,kBAAA,kBAAkB,iCAA7BA,WAAU,CAAC,gBAAkB,GAAK,GAAGF,MAAMgB,EAAE,CAAC,CAAC,EAAEd,WAAWc,EAAE,EAAE;QAEhE,IAAIN,MAAM;gBACcR;gBAAtBJ,OAAK;;YAALA,OAAAA,QAAAA,KAAI,CAAC,YAAA,YAAY,mCAAjBA,KAAI,CAAC,UAAY,IAAKI,mBAAAA,WAAWE,IAAI,cAAfF,uCAAAA,iBAAiBc,EAAE;QAC3C;IACF;IAEA,OAAO;QACLX;QACAoB,YAAY;YACV3B,MAAM;YACNE,OAAOX;YACPa,YAAYR;QACd;QACAI;QACAE;QACAE;IACF;AACF,EAAE"}

View File

@@ -0,0 +1,46 @@
'use client';
import { tokens } from '@fluentui/react-theme';
import { __styles, mergeClasses } from '@griffel/react';
export const infoLabelClassNames = {
root: 'fui-InfoLabel',
label: 'fui-InfoLabel__label',
infoButton: 'fui-InfoLabel__infoButton'
};
const useLabelStyles = /*#__PURE__*/__styles({
base: {
ha4doy: "f12kltsn",
Bceei9c: "fpo1scq",
sj55zd: "f1ym3bx4"
}
}, {
d: [".f12kltsn{vertical-align:top;}", ".fpo1scq{cursor:inherit;}", ".f1ym3bx4{color:inherit;}"]
});
const useInfoButtonStyles = /*#__PURE__*/__styles({
base: {
ha4doy: "f12kltsn",
B6of3ja: "f1bmzb36",
jrapky: "f1nyzk09"
},
large: {
B6of3ja: "fkrn0sh",
jrapky: "fmxx68s"
}
}, {
d: [".f12kltsn{vertical-align:top;}", ".f1bmzb36{margin-top:calc(0px - var(--spacingVerticalXXS));}", ".f1nyzk09{margin-bottom:calc(0px - var(--spacingVerticalXXS));}", ".fkrn0sh{margin-top:-1px;}", ".fmxx68s{margin-bottom:-1px;}"]
});
/**
* Apply styling to the InfoLabel slots based on the state
*/
export const useInfoLabelStyles_unstable = state => {
'use no memo';
state.root.className = mergeClasses(infoLabelClassNames.root, state.root.className);
const labelStyles = useLabelStyles();
state.label.className = mergeClasses(infoLabelClassNames.label, labelStyles.base, state.label.className);
const infoButtonStyles = useInfoButtonStyles();
if (state.infoButton) {
state.infoButton.className = mergeClasses(infoLabelClassNames.infoButton, infoButtonStyles.base, state.size === 'large' && infoButtonStyles.large, state.infoButton.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"names":["tokens","__styles","mergeClasses","infoLabelClassNames","root","label","infoButton","useLabelStyles","base","ha4doy","Bceei9c","sj55zd","d","useInfoButtonStyles","B6of3ja","jrapky","large","useInfoLabelStyles_unstable","state","className","labelStyles","infoButtonStyles","size"],"sources":["useInfoLabelStyles.styles.js"],"sourcesContent":["'use client';\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nexport const infoLabelClassNames = {\n root: 'fui-InfoLabel',\n label: 'fui-InfoLabel__label',\n infoButton: 'fui-InfoLabel__infoButton'\n};\nconst useLabelStyles = makeStyles({\n base: {\n verticalAlign: 'top',\n cursor: 'inherit',\n color: 'inherit'\n }\n});\nconst useInfoButtonStyles = makeStyles({\n base: {\n verticalAlign: 'top',\n // Negative margin to align with the text\n marginTop: `calc(0px - ${tokens.spacingVerticalXXS})`,\n marginBottom: `calc(0px - ${tokens.spacingVerticalXXS})`\n },\n large: {\n // Negative margin to align with the text\n marginTop: '-1px',\n marginBottom: '-1px'\n }\n});\n/**\n * Apply styling to the InfoLabel slots based on the state\n */ export const useInfoLabelStyles_unstable = (state)=>{\n 'use no memo';\n state.root.className = mergeClasses(infoLabelClassNames.root, state.root.className);\n const labelStyles = useLabelStyles();\n state.label.className = mergeClasses(infoLabelClassNames.label, labelStyles.base, state.label.className);\n const infoButtonStyles = useInfoButtonStyles();\n if (state.infoButton) {\n state.infoButton.className = mergeClasses(infoLabelClassNames.infoButton, infoButtonStyles.base, state.size === 'large' && infoButtonStyles.large, state.infoButton.className);\n }\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAAAC,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,OAAO,MAAMC,mBAAmB,GAAG;EAC/BC,IAAI,EAAE,eAAe;EACrBC,KAAK,EAAE,sBAAsB;EAC7BC,UAAU,EAAE;AAChB,CAAC;AACD,MAAMC,cAAc,gBAAGN,QAAA;EAAAO,IAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAMtB,CAAC;AACF,MAAMC,mBAAmB,gBAAGZ,QAAA;EAAAO,IAAA;IAAAC,MAAA;IAAAK,OAAA;IAAAC,MAAA;EAAA;EAAAC,KAAA;IAAAF,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAH,CAAA;AAAA,CAY3B,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMK,2BAA2B,GAAIC,KAAK,IAAG;EACpD,aAAa;;EACbA,KAAK,CAACd,IAAI,CAACe,SAAS,GAAGjB,YAAY,CAACC,mBAAmB,CAACC,IAAI,EAAEc,KAAK,CAACd,IAAI,CAACe,SAAS,CAAC;EACnF,MAAMC,WAAW,GAAGb,cAAc,CAAC,CAAC;EACpCW,KAAK,CAACb,KAAK,CAACc,SAAS,GAAGjB,YAAY,CAACC,mBAAmB,CAACE,KAAK,EAAEe,WAAW,CAACZ,IAAI,EAAEU,KAAK,CAACb,KAAK,CAACc,SAAS,CAAC;EACxG,MAAME,gBAAgB,GAAGR,mBAAmB,CAAC,CAAC;EAC9C,IAAIK,KAAK,CAACZ,UAAU,EAAE;IAClBY,KAAK,CAACZ,UAAU,CAACa,SAAS,GAAGjB,YAAY,CAACC,mBAAmB,CAACG,UAAU,EAAEe,gBAAgB,CAACb,IAAI,EAAEU,KAAK,CAACI,IAAI,KAAK,OAAO,IAAID,gBAAgB,CAACL,KAAK,EAAEE,KAAK,CAACZ,UAAU,CAACa,SAAS,CAAC;EAClL;EACA,OAAOD,KAAK;AAChB,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,41 @@
'use client';
import { tokens } from '@fluentui/react-theme';
import { makeStyles, mergeClasses } from '@griffel/react';
export const infoLabelClassNames = {
root: 'fui-InfoLabel',
label: 'fui-InfoLabel__label',
infoButton: 'fui-InfoLabel__infoButton'
};
const useLabelStyles = makeStyles({
base: {
verticalAlign: 'top',
cursor: 'inherit',
color: 'inherit'
}
});
const useInfoButtonStyles = makeStyles({
base: {
verticalAlign: 'top',
// Negative margin to align with the text
marginTop: `calc(0px - ${tokens.spacingVerticalXXS})`,
marginBottom: `calc(0px - ${tokens.spacingVerticalXXS})`
},
large: {
// Negative margin to align with the text
marginTop: '-1px',
marginBottom: '-1px'
}
});
/**
* Apply styling to the InfoLabel slots based on the state
*/ export const useInfoLabelStyles_unstable = (state)=>{
'use no memo';
state.root.className = mergeClasses(infoLabelClassNames.root, state.root.className);
const labelStyles = useLabelStyles();
state.label.className = mergeClasses(infoLabelClassNames.label, labelStyles.base, state.label.className);
const infoButtonStyles = useInfoButtonStyles();
if (state.infoButton) {
state.infoButton.className = mergeClasses(infoLabelClassNames.infoButton, infoButtonStyles.base, state.size === 'large' && infoButtonStyles.large, state.infoButton.className);
}
return state;
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/InfoLabel/useInfoLabelStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { InfoLabelSlots, InfoLabelState } from './InfoLabel.types';\n\nexport const infoLabelClassNames: SlotClassNames<InfoLabelSlots> = {\n root: 'fui-InfoLabel',\n label: 'fui-InfoLabel__label',\n infoButton: 'fui-InfoLabel__infoButton',\n};\n\nconst useLabelStyles = makeStyles({\n base: {\n verticalAlign: 'top',\n cursor: 'inherit',\n color: 'inherit',\n },\n});\n\nconst useInfoButtonStyles = makeStyles({\n base: {\n verticalAlign: 'top',\n\n // Negative margin to align with the text\n marginTop: `calc(0px - ${tokens.spacingVerticalXXS})`,\n marginBottom: `calc(0px - ${tokens.spacingVerticalXXS})`,\n },\n\n large: {\n // Negative margin to align with the text\n marginTop: '-1px',\n marginBottom: '-1px',\n },\n});\n\n/**\n * Apply styling to the InfoLabel slots based on the state\n */\nexport const useInfoLabelStyles_unstable = (state: InfoLabelState): InfoLabelState => {\n 'use no memo';\n\n state.root.className = mergeClasses(infoLabelClassNames.root, state.root.className);\n\n const labelStyles = useLabelStyles();\n state.label.className = mergeClasses(infoLabelClassNames.label, labelStyles.base, state.label.className);\n\n const infoButtonStyles = useInfoButtonStyles();\n if (state.infoButton) {\n state.infoButton.className = mergeClasses(\n infoLabelClassNames.infoButton,\n infoButtonStyles.base,\n state.size === 'large' && infoButtonStyles.large,\n state.infoButton.className,\n );\n }\n\n return state;\n};\n"],"names":["tokens","makeStyles","mergeClasses","infoLabelClassNames","root","label","infoButton","useLabelStyles","base","verticalAlign","cursor","color","useInfoButtonStyles","marginTop","spacingVerticalXXS","marginBottom","large","useInfoLabelStyles_unstable","state","className","labelStyles","infoButtonStyles","size"],"mappings":"AAAA;AAEA,SAASA,MAAM,QAAQ,wBAAwB;AAE/C,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG1D,OAAO,MAAMC,sBAAsD;IACjEC,MAAM;IACNC,OAAO;IACPC,YAAY;AACd,EAAE;AAEF,MAAMC,iBAAiBN,WAAW;IAChCO,MAAM;QACJC,eAAe;QACfC,QAAQ;QACRC,OAAO;IACT;AACF;AAEA,MAAMC,sBAAsBX,WAAW;IACrCO,MAAM;QACJC,eAAe;QAEf,yCAAyC;QACzCI,WAAW,CAAC,WAAW,EAAEb,OAAOc,kBAAkB,CAAC,CAAC,CAAC;QACrDC,cAAc,CAAC,WAAW,EAAEf,OAAOc,kBAAkB,CAAC,CAAC,CAAC;IAC1D;IAEAE,OAAO;QACL,yCAAyC;QACzCH,WAAW;QACXE,cAAc;IAChB;AACF;AAEA;;CAEC,GACD,OAAO,MAAME,8BAA8B,CAACC;IAC1C;IAEAA,MAAMd,IAAI,CAACe,SAAS,GAAGjB,aAAaC,oBAAoBC,IAAI,EAAEc,MAAMd,IAAI,CAACe,SAAS;IAElF,MAAMC,cAAcb;IACpBW,MAAMb,KAAK,CAACc,SAAS,GAAGjB,aAAaC,oBAAoBE,KAAK,EAAEe,YAAYZ,IAAI,EAAEU,MAAMb,KAAK,CAACc,SAAS;IAEvG,MAAME,mBAAmBT;IACzB,IAAIM,MAAMZ,UAAU,EAAE;QACpBY,MAAMZ,UAAU,CAACa,SAAS,GAAGjB,aAC3BC,oBAAoBG,UAAU,EAC9Be,iBAAiBb,IAAI,EACrBU,MAAMI,IAAI,KAAK,WAAWD,iBAAiBL,KAAK,EAChDE,MAAMZ,UAAU,CAACa,SAAS;IAE9B;IAEA,OAAOD;AACT,EAAE"}

2
node_modules/@fluentui/react-infolabel/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export { InfoLabel, infoLabelClassNames, renderInfoLabel_unstable, useInfoLabelStyles_unstable, useInfoLabel_unstable } from './InfoLabel';
export { InfoButton, infoButtonClassNames, renderInfoButton_unstable, useInfoButtonStyles_unstable, useInfoButton_unstable } from './InfoButton';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n InfoLabel,\n infoLabelClassNames,\n renderInfoLabel_unstable,\n useInfoLabelStyles_unstable,\n useInfoLabel_unstable,\n} from './InfoLabel';\nexport type { InfoLabelProps, InfoLabelSlots, InfoLabelState } from './InfoLabel';\n\nexport {\n InfoButton,\n infoButtonClassNames,\n renderInfoButton_unstable,\n useInfoButtonStyles_unstable,\n useInfoButton_unstable,\n} from './InfoButton';\nexport type { InfoButtonProps, InfoButtonSlots, InfoButtonState } from './InfoButton';\n"],"names":["InfoLabel","infoLabelClassNames","renderInfoLabel_unstable","useInfoLabelStyles_unstable","useInfoLabel_unstable","InfoButton","infoButtonClassNames","renderInfoButton_unstable","useInfoButtonStyles_unstable","useInfoButton_unstable"],"mappings":"AAAA,SACEA,SAAS,EACTC,mBAAmB,EACnBC,wBAAwB,EACxBC,2BAA2B,EAC3BC,qBAAqB,QAChB,cAAc;AAGrB,SACEC,UAAU,EACVC,oBAAoB,EACpBC,yBAAyB,EACzBC,4BAA4B,EAC5BC,sBAAsB,QACjB,eAAe"}

53
node_modules/@fluentui/react-infolabel/package.json generated vendored Normal file
View File

@@ -0,0 +1,53 @@
{
"name": "@fluentui/react-infolabel",
"version": "9.4.19",
"description": "InfoLabel component for Fluent UI v9",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
"typings": "./dist/index.d.ts",
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/microsoft/fluentui"
},
"license": "MIT",
"dependencies": {
"@fluentui/react-icons": "^2.0.245",
"@fluentui/react-shared-contexts": "^9.26.2",
"@fluentui/react-label": "^9.4.0",
"@fluentui/react-popover": "^9.14.1",
"@fluentui/react-tabster": "^9.26.13",
"@fluentui/react-jsx-runtime": "^9.4.1",
"@fluentui/react-theme": "^9.2.1",
"@fluentui/react-utilities": "^9.26.2",
"@griffel/react": "^1.5.32",
"@swc/helpers": "^0.5.1"
},
"peerDependencies": {
"@types/react": ">=16.8.0 <20.0.0",
"@types/react-dom": ">=16.8.0 <20.0.0",
"react": ">=16.14.0 <20.0.0",
"react-dom": ">=16.8.0 <20.0.0"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"node": "./lib-commonjs/index.js",
"import": "./lib/index.js",
"require": "./lib-commonjs/index.js"
},
"./package.json": "./package.json"
},
"beachball": {
"disallowedChangeTypes": [
"major",
"prerelease"
]
},
"files": [
"*.md",
"dist/*.d.ts",
"lib",
"lib-commonjs"
]
}