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

1294
node_modules/@fluentui/react-search/CHANGELOG.md generated vendored Normal file

File diff suppressed because it is too large Load Diff

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

@@ -0,0 +1,15 @@
@fluentui/react-search
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

35
node_modules/@fluentui/react-search/README.md generated vendored Normal file
View File

@@ -0,0 +1,35 @@
# @fluentui/react-search
**React Search components for [Fluent UI React](https://react.fluentui.dev/)**
The `SearchBox` component allows the users to access information with ease, providing flexibility and the ability to clear and filter the search.
### Usage
Import SearchBox:
```js
import { SearchBox } from '@fluentui/react-search';
```
#### Examples
```jsx
<SearchBox defaultValue="Hello, World!" />
<SearchBox value={value} onChange={onInputChange} />
```
See [Fluent UI Storybook](https://react.fluentui.dev/) for more detailed usage examples.
Alternatively, run Storybook locally with:
1. `yarn start`
2. Select `react-search` from the list.
### Specification
See [Spec.md](./docs/Spec.md)
### Upgrade Guide
If you're upgrading to Fluent UI v9 see the upgrade guide in [Storybook](https://react.fluentui.dev/) under Concepts > Upgrading.

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

@@ -0,0 +1,89 @@
import type { ComponentProps } from '@fluentui/react-utilities';
import type { ComponentState } from '@fluentui/react-utilities';
import type { ForwardRefComponent } from '@fluentui/react-utilities';
import type { InputOnChangeData } from '@fluentui/react-input';
import type { InputProps } from '@fluentui/react-input';
import type { InputSlots } from '@fluentui/react-input';
import type { InputState } from '@fluentui/react-input';
import type { JSXElement } from '@fluentui/react-utilities';
import * as React_2 from 'react';
import type { Slot } from '@fluentui/react-utilities';
import type { SlotClassNames } from '@fluentui/react-utilities';
/**
* Render the final JSX of SearchBox
*/
export declare const renderSearchBox_unstable: (state: SearchBoxBaseState) => JSXElement;
/**
* SearchBox component - TODO: add more docs
*/
export declare const SearchBox: ForwardRefComponent<SearchBoxProps>;
/**
* SearchBox base props — excludes design props (appearance, size).
*/
export declare type SearchBoxBaseProps = Omit<SearchBoxProps, 'appearance' | 'size'>;
/**
* SearchBox base state — excludes design props (appearance, size).
*/
export declare type SearchBoxBaseState = Omit<SearchBoxState, 'appearance' | 'size'>;
/** Overloaded onChange event type, used to merge functionality of regular text entry and the dismiss button */
export declare type SearchBoxChangeEvent = React_2.ChangeEvent<HTMLInputElement> | React_2.MouseEvent<HTMLSpanElement>;
export declare const searchBoxClassNames: SlotClassNames<SearchBoxSlots>;
/**
* SearchBox Props
*/
export declare type SearchBoxProps = Omit<ComponentProps<Partial<SearchBoxSlots>, 'input'>, 'children' | 'defaultValue' | 'onChange' | 'size' | 'type' | 'value'> & Omit<InputProps, 'onChange'> & {
/**
* Custom onChange callback.
* Will be traditionally supplied with a React.ChangeEvent<HTMLInputElement> for usual character entry.
* When the dismiss button is clicked, this will be called with an event of type React.MouseEvent<HTMLSpanElement>
* and an empty string as the `value` property of the data parameter
*/
onChange?: (event: SearchBoxChangeEvent, data: InputOnChangeData) => void;
};
export declare type SearchBoxSlots = InputSlots & {
/** Last element in the input, within the input border */
dismiss?: Slot<'span'>;
};
/**
* State used in rendering SearchBox
*/
export declare type SearchBoxState = ComponentState<SearchBoxSlots> & InputState & Required<Pick<InputState, 'size'>> & Required<Pick<SearchBoxProps, 'disabled'>> & {
focused: boolean;
};
/**
* Create the state required to render SearchBox.
*
* The returned state can be modified with hooks such as useSearchBoxStyles_unstable,
* before being passed to renderSearchBox_unstable.
*
* @param props - props from this instance of SearchBox
* @param ref - reference to root HTMLElement of SearchBox
*/
export declare const useSearchBox_unstable: (props: SearchBoxProps, ref: React_2.Ref<HTMLInputElement>) => SearchBoxState;
/**
* Base hook for SearchBox component. Manages state related to controlled/uncontrolled
* value, focus tracking, dismiss button click handling, search icon slot, and
* input type="search" — without design props (size, appearance).
*
* @param props - props from this instance of SearchBox (without size, appearance)
* @param ref - reference to root HTMLElement of SearchBox
*/
export declare const useSearchBoxBase_unstable: (props: SearchBoxBaseProps, ref: React_2.Ref<HTMLInputElement>) => SearchBoxBaseState;
/**
* Apply styling to the SearchBox slots based on the state
*/
export declare const useSearchBoxStyles_unstable: (state: SearchBoxState) => SearchBoxState;
export { }

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, {
SearchBox: function() {
return _index.SearchBox;
},
renderSearchBox_unstable: function() {
return _index.renderSearchBox_unstable;
},
searchBoxClassNames: function() {
return _index.searchBoxClassNames;
},
useSearchBoxBase_unstable: function() {
return _index.useSearchBoxBase_unstable;
},
useSearchBoxStyles_unstable: function() {
return _index.useSearchBoxStyles_unstable;
},
useSearchBox_unstable: function() {
return _index.useSearchBox_unstable;
}
});
const _index = require("./components/SearchBox/index");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/SearchBox.ts"],"sourcesContent":["export type {\n SearchBoxChangeEvent,\n SearchBoxProps,\n SearchBoxBaseProps,\n SearchBoxSlots,\n SearchBoxState,\n SearchBoxBaseState,\n} from './components/SearchBox/index';\nexport {\n SearchBox,\n renderSearchBox_unstable,\n searchBoxClassNames,\n useSearchBoxStyles_unstable,\n useSearchBox_unstable,\n useSearchBoxBase_unstable,\n} from './components/SearchBox/index';\n"],"names":["SearchBox","renderSearchBox_unstable","searchBoxClassNames","useSearchBoxStyles_unstable","useSearchBox_unstable","useSearchBoxBase_unstable"],"mappings":";;;;;;;;;;;;eASEA,gBAAS;;;eACTC,+BAAwB;;;eACxBC,0BAAmB;;;eAGnBG,gCAAyB;;;eAFzBF,kCAA2B;;;eAC3BC,4BAAqB;;;uBAEhB,+BAA+B"}

View File

@@ -0,0 +1,24 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "SearchBox", {
enumerable: true,
get: function() {
return SearchBox;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _useSearchBox = require("./useSearchBox");
const _renderSearchBox = require("./renderSearchBox");
const _useSearchBoxStylesstyles = require("./useSearchBoxStyles.styles");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const SearchBox = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useSearchBox.useSearchBox_unstable)(props, ref);
(0, _useSearchBoxStylesstyles.useSearchBoxStyles_unstable)(state);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useSearchBoxStyles_unstable')(state);
return (0, _renderSearchBox.renderSearchBox_unstable)(state);
});
SearchBox.displayName = 'SearchBox';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/SearchBox/SearchBox.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useSearchBox_unstable } from './useSearchBox';\nimport { renderSearchBox_unstable } from './renderSearchBox';\nimport { useSearchBoxStyles_unstable } from './useSearchBoxStyles.styles';\nimport type { SearchBoxProps } from './SearchBox.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * SearchBox component - TODO: add more docs\n */\nexport const SearchBox: ForwardRefComponent<SearchBoxProps> = React.forwardRef((props, ref) => {\n const state = useSearchBox_unstable(props, ref);\n\n useSearchBoxStyles_unstable(state);\n\n useCustomStyleHook_unstable('useSearchBoxStyles_unstable')(state);\n\n return renderSearchBox_unstable(state);\n});\n\nSearchBox.displayName = 'SearchBox';\n"],"names":["React","useSearchBox_unstable","renderSearchBox_unstable","useSearchBoxStyles_unstable","useCustomStyleHook_unstable","SearchBox","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;8BACO,iBAAiB;iCACd,oBAAoB;0CACjB,8BAA8B;qCAG9B,kCAAkC;AAKvE,MAAMK,YAAAA,WAAAA,GAAiDL,OAAMM,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,YAAQR,mCAAAA,EAAsBM,OAAOC;QAE3CL,qDAAAA,EAA4BM;QAE5BL,gDAAAA,EAA4B,+BAA+BK;IAE3D,WAAOP,yCAAAA,EAAyBO;AAClC,GAAG;AAEHJ,UAAUK,WAAW,GAAG"}

View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/SearchBox/SearchBox.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { InputOnChangeData, InputProps, InputSlots, InputState } from '@fluentui/react-input';\n\nexport type SearchBoxSlots = InputSlots & {\n /** Last element in the input, within the input border */\n dismiss?: Slot<'span'>;\n};\n\n/**\n * SearchBox Props\n */\nexport type SearchBoxProps = Omit<\n ComponentProps<Partial<SearchBoxSlots>, 'input'>,\n // `children` is unsupported. The rest of these native props have customized definitions.\n 'children' | 'defaultValue' | 'onChange' | 'size' | 'type' | 'value'\n> &\n Omit<InputProps, 'onChange'> & {\n /**\n * Custom onChange callback.\n * Will be traditionally supplied with a React.ChangeEvent<HTMLInputElement> for usual character entry.\n * When the dismiss button is clicked, this will be called with an event of type React.MouseEvent<HTMLSpanElement>\n * and an empty string as the `value` property of the data parameter\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onChange?: (event: SearchBoxChangeEvent, data: InputOnChangeData) => void;\n };\n\n/**\n * SearchBox base props — excludes design props (appearance, size).\n */\nexport type SearchBoxBaseProps = Omit<SearchBoxProps, 'appearance' | 'size'>;\n\n/**\n * State used in rendering SearchBox\n */\nexport type SearchBoxState = ComponentState<SearchBoxSlots> &\n InputState &\n Required<Pick<InputState, 'size'>> &\n Required<Pick<SearchBoxProps, 'disabled'>> & {\n focused: boolean;\n };\n\n/**\n * SearchBox base state — excludes design props (appearance, size).\n */\nexport type SearchBoxBaseState = Omit<SearchBoxState, 'appearance' | 'size'>;\n\n/** Overloaded onChange event type, used to merge functionality of regular text entry and the dismiss button */\nexport type SearchBoxChangeEvent = React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLSpanElement>;\n"],"names":["React"],"mappings":";;;;;iEAAuB,QAAQ"}

View File

@@ -0,0 +1,34 @@
"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, {
SearchBox: function() {
return _SearchBox.SearchBox;
},
renderSearchBox_unstable: function() {
return _renderSearchBox.renderSearchBox_unstable;
},
searchBoxClassNames: function() {
return _useSearchBoxStylesstyles.searchBoxClassNames;
},
useSearchBoxBase_unstable: function() {
return _useSearchBox.useSearchBoxBase_unstable;
},
useSearchBoxStyles_unstable: function() {
return _useSearchBoxStylesstyles.useSearchBoxStyles_unstable;
},
useSearchBox_unstable: function() {
return _useSearchBox.useSearchBox_unstable;
}
});
const _SearchBox = require("./SearchBox");
const _renderSearchBox = require("./renderSearchBox");
const _useSearchBox = require("./useSearchBox");
const _useSearchBoxStylesstyles = require("./useSearchBoxStyles.styles");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/SearchBox/index.ts"],"sourcesContent":["export { SearchBox } from './SearchBox';\nexport type {\n SearchBoxChangeEvent,\n SearchBoxProps,\n SearchBoxBaseProps,\n SearchBoxSlots,\n SearchBoxState,\n SearchBoxBaseState,\n} from './SearchBox.types';\nexport { renderSearchBox_unstable } from './renderSearchBox';\nexport { useSearchBox_unstable, useSearchBoxBase_unstable } from './useSearchBox';\nexport { searchBoxClassNames, useSearchBoxStyles_unstable } from './useSearchBoxStyles.styles';\n"],"names":["SearchBox","renderSearchBox_unstable","useSearchBox_unstable","useSearchBoxBase_unstable","searchBoxClassNames","useSearchBoxStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,oBAAS;;;eASTC,yCAAwB;;;eAExBG,6CAAmB;;;eADID,uCAAyB;;;eAC3BE,qDAA2B;;;eADhDH,mCAAqB;;;2BAVJ,cAAc;iCASC,oBAAoB;8BACI,iBAAiB;0CACjB,8BAA8B"}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/SearchBox/renderSearchBox.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 { SearchBoxBaseState, SearchBoxSlots } from './SearchBox.types';\n\n/**\n * Render the final JSX of SearchBox\n */\nexport const renderSearchBox_unstable = (state: SearchBoxBaseState): JSXElement => {\n assertSlots<SearchBoxSlots>(state);\n\n return (\n <state.root>\n {state.contentBefore && <state.contentBefore />}\n <state.input />\n {state.contentAfter && (\n <state.contentAfter>\n {state.contentAfter.children}\n {state.dismiss && <state.dismiss />}\n </state.contentAfter>\n )}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderSearchBox_unstable","state","root","contentBefore","input","contentAfter","children","dismiss"],"mappings":";;;;+BAUaC;;;;;;4BATb,iCAAiD;gCAErB,4BAA4B;AAOjD,iCAAiC,CAACC;QACvCF,2BAAAA,EAA4BE;IAE5B,OAAA,WAAA,OACE,gBAAA,EAACA,MAAMC,IAAI,EAAA;;YACRD,MAAME,aAAa,IAAA,WAAA,OAAI,eAAA,EAACF,MAAME,aAAa,EAAA,CAAA;8BAC5C,eAAA,EAACF,MAAMG,KAAK,EAAA,CAAA;YACXH,MAAMI,YAAY,IAAA,WAAA,OACjB,gBAAA,EAACJ,MAAMI,YAAY,EAAA;;oBAChBJ,MAAMI,YAAY,CAACC,QAAQ;oBAC3BL,MAAMM,OAAO,IAAA,WAAA,OAAI,eAAA,EAACN,MAAMM,OAAO,EAAA,CAAA;;;;;AAK1C,EAAE"}

View File

@@ -0,0 +1,133 @@
'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, {
useSearchBoxBase_unstable: function() {
return useSearchBoxBase_unstable;
},
useSearchBox_unstable: function() {
return useSearchBox_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactutilities = require("@fluentui/react-utilities");
const _reactinput = require("@fluentui/react-input");
const _reacticons = require("@fluentui/react-icons");
const useSearchBox_unstable = (props, ref)=>{
const { size = 'medium', appearance = 'outline', ...baseProps } = props;
const state = useSearchBoxBase_unstable(baseProps, ref);
if (state.contentBefore) {
var _state_contentBefore;
var _children;
(_children = (_state_contentBefore = state.contentBefore).children) !== null && _children !== void 0 ? _children : _state_contentBefore.children = /*#__PURE__*/ _react.createElement(_reacticons.SearchRegular, null);
}
if (state.dismiss) {
var _state_dismiss;
var _children1;
(_children1 = (_state_dismiss = state.dismiss).children) !== null && _children1 !== void 0 ? _children1 : _state_dismiss.children = /*#__PURE__*/ _react.createElement(_reacticons.DismissRegular, null);
}
return {
...state,
size,
appearance
};
};
const useSearchBoxBase_unstable = (props, ref)=>{
const { disabled = false, root, contentBefore, dismiss, contentAfter, value, defaultValue, ...inputProps } = props;
const searchBoxRootRef = _react.useRef(null);
const searchBoxRef = _react.useRef(null);
const [internalValue, setInternalValue] = (0, _reactutilities.useControllableState)({
state: value,
defaultState: defaultValue,
initialState: ''
});
// Tracks the focus of the component for the contentAfter and dismiss button
const [focused, setFocused] = _react.useState(false);
const onFocus = _react.useCallback(()=>{
setFocused(true);
}, [
setFocused
]);
const onBlur = _react.useCallback((ev)=>{
var _searchBoxRootRef_current;
setFocused(!!((_searchBoxRootRef_current = searchBoxRootRef.current) === null || _searchBoxRootRef_current === void 0 ? void 0 : _searchBoxRootRef_current.contains(ev.relatedTarget)));
}, [
setFocused
]);
const rootProps = _reactutilities.slot.resolveShorthand(root);
const handleDismissClick = (0, _reactutilities.useEventCallback)((event)=>{
var _props_onChange, _searchBoxRef_current;
if ((0, _reactutilities.isResolvedShorthand)(dismiss)) {
var _dismiss_onClick;
(_dismiss_onClick = dismiss.onClick) === null || _dismiss_onClick === void 0 ? void 0 : _dismiss_onClick.call(dismiss, event);
}
const newValue = '';
setInternalValue(newValue);
(_props_onChange = props.onChange) === null || _props_onChange === void 0 ? void 0 : _props_onChange.call(props, event, {
value: newValue
});
(_searchBoxRef_current = searchBoxRef.current) === null || _searchBoxRef_current === void 0 ? void 0 : _searchBoxRef_current.focus();
});
const inputState = (0, _reactinput.useInput_unstable)({
type: 'search',
disabled,
value: internalValue,
root: _reactutilities.slot.always({
...rootProps,
ref: (0, _reactutilities.useMergedRefs)(rootProps === null || rootProps === void 0 ? void 0 : rootProps.ref, searchBoxRootRef),
onFocus: (0, _reactutilities.mergeCallbacks)(rootProps === null || rootProps === void 0 ? void 0 : rootProps.onFocus, onFocus),
onBlur: (0, _reactutilities.mergeCallbacks)(rootProps === null || rootProps === void 0 ? void 0 : rootProps.onBlur, onBlur)
}, {
elementType: 'span'
}),
contentBefore: _reactutilities.slot.optional(contentBefore, {
renderByDefault: true,
elementType: 'span'
}),
contentAfter: _reactutilities.slot.optional(contentAfter, {
renderByDefault: true,
elementType: 'span'
}),
...inputProps,
onChange: (0, _reactutilities.useEventCallback)((ev)=>{
var _props_onChange;
const newValue = ev.target.value;
(_props_onChange = props.onChange) === null || _props_onChange === void 0 ? void 0 : _props_onChange.call(props, ev, {
value: newValue
});
setInternalValue(newValue);
})
}, (0, _reactutilities.useMergedRefs)(searchBoxRef, ref));
const state = {
...inputState,
components: {
// eslint-disable-next-line @typescript-eslint/no-deprecated
...inputState.components,
dismiss: 'span'
},
dismiss: _reactutilities.slot.optional(dismiss, {
defaultProps: {
role: 'button',
'aria-label': 'clear',
tabIndex: -1
},
renderByDefault: true,
elementType: 'span'
}),
disabled,
focused
};
if (state.dismiss) {
state.dismiss.onClick = handleDismissClick;
}
return state;
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,212 @@
'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, {
searchBoxClassNames: function() {
return searchBoxClassNames;
},
useSearchBoxStyles_unstable: function() {
return useSearchBoxStyles_unstable;
}
});
const _react = require("@griffel/react");
const _reactinput = require("@fluentui/react-input");
const searchBoxClassNames = {
root: 'fui-SearchBox',
dismiss: 'fui-SearchBox__dismiss',
contentAfter: 'fui-SearchBox__contentAfter',
contentBefore: 'fui-SearchBox__contentBefore',
input: 'fui-SearchBox__input'
};
/**
* Styles for the root slot
*/ const useRootStyles = /*#__PURE__*/ (0, _react.__styles)({
small: {
i8kkvl: "fjuset5",
B2u0y6b: "f1xzfw5u",
uwmqm3: [
"fk8j09s",
"fdw0yi8"
],
z189sj: [
"fdw0yi8",
"fk8j09s"
]
},
medium: {
i8kkvl: "fjuset5",
B2u0y6b: "f1xzfw5u",
uwmqm3: [
"f1f5gg8d",
"f1vdfbxk"
],
z189sj: [
"f1vdfbxk",
"f1f5gg8d"
]
},
large: {
i8kkvl: "fjuset5",
B2u0y6b: "f1xzfw5u",
uwmqm3: [
"f1ng84yb",
"f11gcy0p"
],
z189sj: [
"f11gcy0p",
"f1ng84yb"
]
},
input: {
uwmqm3: [
"fk8j09s",
"fdw0yi8"
],
z189sj: [
"fhxju0i",
"f1cnd47f"
],
Boqhc8c: "f18izjht",
B8uat0v: "fcoa6sg"
},
unfocusedNoContentAfter: {
z189sj: [
"fhxju0i",
"f1cnd47f"
]
}
}, {
d: [
".fjuset5{column-gap:0;}",
".f1xzfw5u{max-width:468px;}",
".fk8j09s{padding-left:var(--spacingHorizontalSNudge);}",
".fdw0yi8{padding-right:var(--spacingHorizontalSNudge);}",
".f1f5gg8d{padding-left:var(--spacingHorizontalS);}",
".f1vdfbxk{padding-right:var(--spacingHorizontalS);}",
".f1ng84yb{padding-left:var(--spacingHorizontalMNudge);}",
".f11gcy0p{padding-right:var(--spacingHorizontalMNudge);}",
".fhxju0i{padding-right:0;}",
".f1cnd47f{padding-left:0;}",
".f18izjht::-webkit-search-decoration{display:none;}",
".fcoa6sg::-webkit-search-cancel-button{display:none;}"
]
});
const useInputStyles = /*#__PURE__*/ (0, _react.__styles)({
small: {
z189sj: [
"fdw0yi8",
"fk8j09s"
]
},
medium: {
z189sj: [
"f1vdfbxk",
"f1f5gg8d"
]
},
large: {
z189sj: [
"f11gcy0p",
"f1ng84yb"
]
}
}, {
d: [
".fdw0yi8{padding-right:var(--spacingHorizontalSNudge);}",
".fk8j09s{padding-left:var(--spacingHorizontalSNudge);}",
".f1vdfbxk{padding-right:var(--spacingHorizontalS);}",
".f1f5gg8d{padding-left:var(--spacingHorizontalS);}",
".f11gcy0p{padding-right:var(--spacingHorizontalMNudge);}",
".f1ng84yb{padding-left:var(--spacingHorizontalMNudge);}"
]
});
const useContentAfterStyles = /*#__PURE__*/ (0, _react.__styles)({
contentAfter: {
uwmqm3: [
"f1uw59to",
"fw5db7e"
],
i8kkvl: "f1ufnopg"
},
rest: {
Bqenvij: "fniina8",
a9b677: "f3tsq5r",
uwmqm3: [
"f1cnd47f",
"fhxju0i"
],
B68tc82: 0,
Bmxbyg5: 0,
Bpg54ce: "f1a3p1vp"
}
}, {
d: [
".f1uw59to{padding-left:var(--spacingHorizontalM);}",
".fw5db7e{padding-right:var(--spacingHorizontalM);}",
".f1ufnopg{column-gap:var(--spacingHorizontalXS);}",
".fniina8{height:0;}",
".f3tsq5r{width:0;}",
".f1cnd47f{padding-left:0;}",
".fhxju0i{padding-right:0;}",
[
".f1a3p1vp{overflow:hidden;}",
{
p: -1
}
]
]
});
const useDismissClassName = /*#__PURE__*/ (0, _react.__resetStyles)("r1pvzcuu", null, [
".r1pvzcuu{box-sizing:border-box;color:var(--colorNeutralForeground3);display:flex;cursor:pointer;}",
".r1pvzcuu>svg{font-size:20px;}"
]);
const useDismissStyles = /*#__PURE__*/ (0, _react.__styles)({
disabled: {
sj55zd: "f1s2aq7o"
},
small: {
Duoase: "f3qv9w"
},
medium: {},
large: {
Duoase: "f16u2scb"
}
}, {
d: [
".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}",
".f3qv9w>svg{font-size:16px;}",
".f16u2scb>svg{font-size:24px;}"
]
});
const useSearchBoxStyles_unstable = (state)=>{
'use no memo';
const { disabled, focused, size } = state;
const rootStyles = useRootStyles();
const inputStyles = useInputStyles();
const contentAfterStyles = useContentAfterStyles();
const dismissClassName = useDismissClassName();
const dismissStyles = useDismissStyles();
state.root.className = (0, _react.mergeClasses)(searchBoxClassNames.root, rootStyles[size], !focused && rootStyles.unfocusedNoContentAfter, state.root.className);
state.input.className = (0, _react.mergeClasses)(searchBoxClassNames.input, rootStyles.input, !focused && inputStyles[size], state.input.className);
if (state.dismiss) {
state.dismiss.className = (0, _react.mergeClasses)(searchBoxClassNames.dismiss, dismissClassName, disabled && dismissStyles.disabled, dismissStyles[size], state.dismiss.className);
}
if (state.contentBefore) {
state.contentBefore.className = (0, _react.mergeClasses)(searchBoxClassNames.contentBefore, state.contentBefore.className);
}
if (state.contentAfter) {
state.contentAfter.className = (0, _react.mergeClasses)(searchBoxClassNames.contentAfter, contentAfterStyles.contentAfter, !focused && contentAfterStyles.rest, state.contentAfter.className);
} else if (state.dismiss) {
state.dismiss.className = (0, _react.mergeClasses)(state.dismiss.className, contentAfterStyles.contentAfter);
}
(0, _reactinput.useInputStyles_unstable)(state);
return state;
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,140 @@
'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, {
searchBoxClassNames: function() {
return searchBoxClassNames;
},
useSearchBoxStyles_unstable: function() {
return useSearchBoxStyles_unstable;
}
});
const _react = require("@griffel/react");
const _reacttheme = require("@fluentui/react-theme");
const _reactinput = require("@fluentui/react-input");
const searchBoxClassNames = {
root: 'fui-SearchBox',
dismiss: 'fui-SearchBox__dismiss',
contentAfter: 'fui-SearchBox__contentAfter',
contentBefore: 'fui-SearchBox__contentBefore',
input: 'fui-SearchBox__input'
};
/**
* Styles for the root slot
*/ const useRootStyles = (0, _react.makeStyles)({
small: {
columnGap: 0,
maxWidth: '468px',
paddingLeft: _reacttheme.tokens.spacingHorizontalSNudge,
paddingRight: _reacttheme.tokens.spacingHorizontalSNudge
},
medium: {
columnGap: 0,
maxWidth: '468px',
paddingLeft: _reacttheme.tokens.spacingHorizontalS,
paddingRight: _reacttheme.tokens.spacingHorizontalS
},
large: {
columnGap: 0,
maxWidth: '468px',
paddingLeft: _reacttheme.tokens.spacingHorizontalMNudge,
paddingRight: _reacttheme.tokens.spacingHorizontalMNudge
},
input: {
paddingLeft: _reacttheme.tokens.spacingHorizontalSNudge,
paddingRight: 0,
// removes the WebKit pseudoelement styling
'::-webkit-search-decoration': {
display: 'none'
},
'::-webkit-search-cancel-button': {
display: 'none'
}
},
unfocusedNoContentAfter: {
paddingRight: 0
}
});
const useInputStyles = (0, _react.makeStyles)({
small: {
paddingRight: _reacttheme.tokens.spacingHorizontalSNudge
},
medium: {
paddingRight: _reacttheme.tokens.spacingHorizontalS
},
large: {
paddingRight: _reacttheme.tokens.spacingHorizontalMNudge
}
});
const useContentAfterStyles = (0, _react.makeStyles)({
contentAfter: {
paddingLeft: _reacttheme.tokens.spacingHorizontalM,
columnGap: _reacttheme.tokens.spacingHorizontalXS
},
rest: {
height: 0,
width: 0,
paddingLeft: 0,
overflow: 'hidden'
}
});
const useDismissClassName = (0, _react.makeResetStyles)({
boxSizing: 'border-box',
color: _reacttheme.tokens.colorNeutralForeground3,
display: 'flex',
// special case styling for icons (most common case) to ensure they're centered vertically
// size: medium (default)
'> svg': {
fontSize: '20px'
},
cursor: 'pointer'
});
const useDismissStyles = (0, _react.makeStyles)({
disabled: {
color: _reacttheme.tokens.colorNeutralForegroundDisabled
},
// Ensure resizable icons show up with the proper font size
small: {
'> svg': {
fontSize: '16px'
}
},
medium: {},
large: {
'> svg': {
fontSize: '24px'
}
}
});
const useSearchBoxStyles_unstable = (state)=>{
'use no memo';
const { disabled, focused, size } = state;
const rootStyles = useRootStyles();
const inputStyles = useInputStyles();
const contentAfterStyles = useContentAfterStyles();
const dismissClassName = useDismissClassName();
const dismissStyles = useDismissStyles();
state.root.className = (0, _react.mergeClasses)(searchBoxClassNames.root, rootStyles[size], !focused && rootStyles.unfocusedNoContentAfter, state.root.className);
state.input.className = (0, _react.mergeClasses)(searchBoxClassNames.input, rootStyles.input, !focused && inputStyles[size], state.input.className);
if (state.dismiss) {
state.dismiss.className = (0, _react.mergeClasses)(searchBoxClassNames.dismiss, dismissClassName, disabled && dismissStyles.disabled, dismissStyles[size], state.dismiss.className);
}
if (state.contentBefore) {
state.contentBefore.className = (0, _react.mergeClasses)(searchBoxClassNames.contentBefore, state.contentBefore.className);
}
if (state.contentAfter) {
state.contentAfter.className = (0, _react.mergeClasses)(searchBoxClassNames.contentAfter, contentAfterStyles.contentAfter, !focused && contentAfterStyles.rest, state.contentAfter.className);
} else if (state.dismiss) {
state.dismiss.className = (0, _react.mergeClasses)(state.dismiss.className, contentAfterStyles.contentAfter);
}
(0, _reactinput.useInputStyles_unstable)(state);
return state;
};

File diff suppressed because one or more lines are too long

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, {
SearchBox: function() {
return _SearchBox.SearchBox;
},
renderSearchBox_unstable: function() {
return _SearchBox.renderSearchBox_unstable;
},
searchBoxClassNames: function() {
return _SearchBox.searchBoxClassNames;
},
useSearchBoxBase_unstable: function() {
return _SearchBox.useSearchBoxBase_unstable;
},
useSearchBoxStyles_unstable: function() {
return _SearchBox.useSearchBoxStyles_unstable;
},
useSearchBox_unstable: function() {
return _SearchBox.useSearchBox_unstable;
}
});
const _SearchBox = require("./SearchBox");

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n SearchBox,\n renderSearchBox_unstable,\n searchBoxClassNames,\n useSearchBoxStyles_unstable,\n useSearchBox_unstable,\n useSearchBoxBase_unstable,\n} from './SearchBox';\nexport type {\n SearchBoxChangeEvent,\n SearchBoxProps,\n SearchBoxSlots,\n SearchBoxState,\n SearchBoxBaseProps,\n SearchBoxBaseState,\n} from './SearchBox';\n"],"names":["SearchBox","renderSearchBox_unstable","searchBoxClassNames","useSearchBoxStyles_unstable","useSearchBox_unstable","useSearchBoxBase_unstable"],"mappings":";;;;;;;;;;;;eACEA,oBAAS;;;eACTC,mCAAwB;;;eACxBC,8BAAmB;;;eAGnBG,oCAAyB;;;eAFzBF,sCAA2B;;;eAC3BC,gCAAqB;;;2BAEhB,cAAc"}

1
node_modules/@fluentui/react-search/lib/SearchBox.js generated vendored Normal file
View File

@@ -0,0 +1 @@
export { SearchBox, renderSearchBox_unstable, searchBoxClassNames, useSearchBoxStyles_unstable, useSearchBox_unstable, useSearchBoxBase_unstable } from './components/SearchBox/index';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/SearchBox.ts"],"sourcesContent":["export type {\n SearchBoxChangeEvent,\n SearchBoxProps,\n SearchBoxBaseProps,\n SearchBoxSlots,\n SearchBoxState,\n SearchBoxBaseState,\n} from './components/SearchBox/index';\nexport {\n SearchBox,\n renderSearchBox_unstable,\n searchBoxClassNames,\n useSearchBoxStyles_unstable,\n useSearchBox_unstable,\n useSearchBoxBase_unstable,\n} from './components/SearchBox/index';\n"],"names":["SearchBox","renderSearchBox_unstable","searchBoxClassNames","useSearchBoxStyles_unstable","useSearchBox_unstable","useSearchBoxBase_unstable"],"mappings":"AAQA,SACEA,SAAS,EACTC,wBAAwB,EACxBC,mBAAmB,EACnBC,2BAA2B,EAC3BC,qBAAqB,EACrBC,yBAAyB,QACpB,+BAA+B"}

View File

@@ -0,0 +1,15 @@
'use client';
import * as React from 'react';
import { useSearchBox_unstable } from './useSearchBox';
import { renderSearchBox_unstable } from './renderSearchBox';
import { useSearchBoxStyles_unstable } from './useSearchBoxStyles.styles';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
/**
* SearchBox component - TODO: add more docs
*/ export const SearchBox = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useSearchBox_unstable(props, ref);
useSearchBoxStyles_unstable(state);
useCustomStyleHook_unstable('useSearchBoxStyles_unstable')(state);
return renderSearchBox_unstable(state);
});
SearchBox.displayName = 'SearchBox';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/SearchBox/SearchBox.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useSearchBox_unstable } from './useSearchBox';\nimport { renderSearchBox_unstable } from './renderSearchBox';\nimport { useSearchBoxStyles_unstable } from './useSearchBoxStyles.styles';\nimport type { SearchBoxProps } from './SearchBox.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * SearchBox component - TODO: add more docs\n */\nexport const SearchBox: ForwardRefComponent<SearchBoxProps> = React.forwardRef((props, ref) => {\n const state = useSearchBox_unstable(props, ref);\n\n useSearchBoxStyles_unstable(state);\n\n useCustomStyleHook_unstable('useSearchBoxStyles_unstable')(state);\n\n return renderSearchBox_unstable(state);\n});\n\nSearchBox.displayName = 'SearchBox';\n"],"names":["React","useSearchBox_unstable","renderSearchBox_unstable","useSearchBoxStyles_unstable","useCustomStyleHook_unstable","SearchBox","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,8BAA8B;AAG1E,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,0BAAiDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQR,sBAAsBM,OAAOC;IAE3CL,4BAA4BM;IAE5BL,4BAA4B,+BAA+BK;IAE3D,OAAOP,yBAAyBO;AAClC,GAAG;AAEHJ,UAAUK,WAAW,GAAG"}

View File

@@ -0,0 +1 @@
import * as React from 'react';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/SearchBox/SearchBox.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { InputOnChangeData, InputProps, InputSlots, InputState } from '@fluentui/react-input';\n\nexport type SearchBoxSlots = InputSlots & {\n /** Last element in the input, within the input border */\n dismiss?: Slot<'span'>;\n};\n\n/**\n * SearchBox Props\n */\nexport type SearchBoxProps = Omit<\n ComponentProps<Partial<SearchBoxSlots>, 'input'>,\n // `children` is unsupported. The rest of these native props have customized definitions.\n 'children' | 'defaultValue' | 'onChange' | 'size' | 'type' | 'value'\n> &\n Omit<InputProps, 'onChange'> & {\n /**\n * Custom onChange callback.\n * Will be traditionally supplied with a React.ChangeEvent<HTMLInputElement> for usual character entry.\n * When the dismiss button is clicked, this will be called with an event of type React.MouseEvent<HTMLSpanElement>\n * and an empty string as the `value` property of the data parameter\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onChange?: (event: SearchBoxChangeEvent, data: InputOnChangeData) => void;\n };\n\n/**\n * SearchBox base props — excludes design props (appearance, size).\n */\nexport type SearchBoxBaseProps = Omit<SearchBoxProps, 'appearance' | 'size'>;\n\n/**\n * State used in rendering SearchBox\n */\nexport type SearchBoxState = ComponentState<SearchBoxSlots> &\n InputState &\n Required<Pick<InputState, 'size'>> &\n Required<Pick<SearchBoxProps, 'disabled'>> & {\n focused: boolean;\n };\n\n/**\n * SearchBox base state — excludes design props (appearance, size).\n */\nexport type SearchBoxBaseState = Omit<SearchBoxState, 'appearance' | 'size'>;\n\n/** Overloaded onChange event type, used to merge functionality of regular text entry and the dismiss button */\nexport type SearchBoxChangeEvent = React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLSpanElement>;\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}

View File

@@ -0,0 +1,4 @@
export { SearchBox } from './SearchBox';
export { renderSearchBox_unstable } from './renderSearchBox';
export { useSearchBox_unstable, useSearchBoxBase_unstable } from './useSearchBox';
export { searchBoxClassNames, useSearchBoxStyles_unstable } from './useSearchBoxStyles.styles';

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/SearchBox/index.ts"],"sourcesContent":["export { SearchBox } from './SearchBox';\nexport type {\n SearchBoxChangeEvent,\n SearchBoxProps,\n SearchBoxBaseProps,\n SearchBoxSlots,\n SearchBoxState,\n SearchBoxBaseState,\n} from './SearchBox.types';\nexport { renderSearchBox_unstable } from './renderSearchBox';\nexport { useSearchBox_unstable, useSearchBoxBase_unstable } from './useSearchBox';\nexport { searchBoxClassNames, useSearchBoxStyles_unstable } from './useSearchBoxStyles.styles';\n"],"names":["SearchBox","renderSearchBox_unstable","useSearchBox_unstable","useSearchBoxBase_unstable","searchBoxClassNames","useSearchBoxStyles_unstable"],"mappings":"AAAA,SAASA,SAAS,QAAQ,cAAc;AASxC,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,qBAAqB,EAAEC,yBAAyB,QAAQ,iBAAiB;AAClF,SAASC,mBAAmB,EAAEC,2BAA2B,QAAQ,8BAA8B"}

View File

@@ -0,0 +1,19 @@
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 SearchBox
*/ export const renderSearchBox_unstable = (state)=>{
assertSlots(state);
return /*#__PURE__*/ _jsxs(state.root, {
children: [
state.contentBefore && /*#__PURE__*/ _jsx(state.contentBefore, {}),
/*#__PURE__*/ _jsx(state.input, {}),
state.contentAfter && /*#__PURE__*/ _jsxs(state.contentAfter, {
children: [
state.contentAfter.children,
state.dismiss && /*#__PURE__*/ _jsx(state.dismiss, {})
]
})
]
});
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/SearchBox/renderSearchBox.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 { SearchBoxBaseState, SearchBoxSlots } from './SearchBox.types';\n\n/**\n * Render the final JSX of SearchBox\n */\nexport const renderSearchBox_unstable = (state: SearchBoxBaseState): JSXElement => {\n assertSlots<SearchBoxSlots>(state);\n\n return (\n <state.root>\n {state.contentBefore && <state.contentBefore />}\n <state.input />\n {state.contentAfter && (\n <state.contentAfter>\n {state.contentAfter.children}\n {state.dismiss && <state.dismiss />}\n </state.contentAfter>\n )}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderSearchBox_unstable","state","root","contentBefore","input","contentAfter","children","dismiss"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,2BAA2B,CAACC;IACvCF,YAA4BE;IAE5B,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,aAAa,kBAAI,KAACF,MAAME,aAAa;0BAC5C,KAACF,MAAMG,KAAK;YACXH,MAAMI,YAAY,kBACjB,MAACJ,MAAMI,YAAY;;oBAChBJ,MAAMI,YAAY,CAACC,QAAQ;oBAC3BL,MAAMM,OAAO,kBAAI,KAACN,MAAMM,OAAO;;;;;AAK1C,EAAE"}

View File

@@ -0,0 +1,129 @@
'use client';
import * as React from 'react';
import { isResolvedShorthand, mergeCallbacks, slot, useControllableState, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';
import { useInput_unstable } from '@fluentui/react-input';
import { DismissRegular, SearchRegular } from '@fluentui/react-icons';
/**
* Create the state required to render SearchBox.
*
* The returned state can be modified with hooks such as useSearchBoxStyles_unstable,
* before being passed to renderSearchBox_unstable.
*
* @param props - props from this instance of SearchBox
* @param ref - reference to root HTMLElement of SearchBox
*/ export const useSearchBox_unstable = (props, ref)=>{
const { size = 'medium', appearance = 'outline', ...baseProps } = props;
const state = useSearchBoxBase_unstable(baseProps, ref);
if (state.contentBefore) {
var _state_contentBefore;
var _children;
(_children = (_state_contentBefore = state.contentBefore).children) !== null && _children !== void 0 ? _children : _state_contentBefore.children = /*#__PURE__*/ React.createElement(SearchRegular, null);
}
if (state.dismiss) {
var _state_dismiss;
var _children1;
(_children1 = (_state_dismiss = state.dismiss).children) !== null && _children1 !== void 0 ? _children1 : _state_dismiss.children = /*#__PURE__*/ React.createElement(DismissRegular, null);
}
return {
...state,
size,
appearance
};
};
/**
* Base hook for SearchBox component. Manages state related to controlled/uncontrolled
* value, focus tracking, dismiss button click handling, search icon slot, and
* input type="search" — without design props (size, appearance).
*
* @param props - props from this instance of SearchBox (without size, appearance)
* @param ref - reference to root HTMLElement of SearchBox
*/ export const useSearchBoxBase_unstable = (props, ref)=>{
const { disabled = false, root, contentBefore, dismiss, contentAfter, value, defaultValue, ...inputProps } = props;
const searchBoxRootRef = React.useRef(null);
const searchBoxRef = React.useRef(null);
const [internalValue, setInternalValue] = useControllableState({
state: value,
defaultState: defaultValue,
initialState: ''
});
// Tracks the focus of the component for the contentAfter and dismiss button
const [focused, setFocused] = React.useState(false);
const onFocus = React.useCallback(()=>{
setFocused(true);
}, [
setFocused
]);
const onBlur = React.useCallback((ev)=>{
var _searchBoxRootRef_current;
setFocused(!!((_searchBoxRootRef_current = searchBoxRootRef.current) === null || _searchBoxRootRef_current === void 0 ? void 0 : _searchBoxRootRef_current.contains(ev.relatedTarget)));
}, [
setFocused
]);
const rootProps = slot.resolveShorthand(root);
const handleDismissClick = useEventCallback((event)=>{
var _props_onChange, _searchBoxRef_current;
if (isResolvedShorthand(dismiss)) {
var _dismiss_onClick;
(_dismiss_onClick = dismiss.onClick) === null || _dismiss_onClick === void 0 ? void 0 : _dismiss_onClick.call(dismiss, event);
}
const newValue = '';
setInternalValue(newValue);
(_props_onChange = props.onChange) === null || _props_onChange === void 0 ? void 0 : _props_onChange.call(props, event, {
value: newValue
});
(_searchBoxRef_current = searchBoxRef.current) === null || _searchBoxRef_current === void 0 ? void 0 : _searchBoxRef_current.focus();
});
const inputState = useInput_unstable({
type: 'search',
disabled,
value: internalValue,
root: slot.always({
...rootProps,
ref: useMergedRefs(rootProps === null || rootProps === void 0 ? void 0 : rootProps.ref, searchBoxRootRef),
onFocus: mergeCallbacks(rootProps === null || rootProps === void 0 ? void 0 : rootProps.onFocus, onFocus),
onBlur: mergeCallbacks(rootProps === null || rootProps === void 0 ? void 0 : rootProps.onBlur, onBlur)
}, {
elementType: 'span'
}),
contentBefore: slot.optional(contentBefore, {
renderByDefault: true,
elementType: 'span'
}),
contentAfter: slot.optional(contentAfter, {
renderByDefault: true,
elementType: 'span'
}),
...inputProps,
onChange: useEventCallback((ev)=>{
var _props_onChange;
const newValue = ev.target.value;
(_props_onChange = props.onChange) === null || _props_onChange === void 0 ? void 0 : _props_onChange.call(props, ev, {
value: newValue
});
setInternalValue(newValue);
})
}, useMergedRefs(searchBoxRef, ref));
const state = {
...inputState,
components: {
// eslint-disable-next-line @typescript-eslint/no-deprecated
...inputState.components,
dismiss: 'span'
},
dismiss: slot.optional(dismiss, {
defaultProps: {
role: 'button',
'aria-label': 'clear',
tabIndex: -1
},
renderByDefault: true,
elementType: 'span'
}),
disabled,
focused
};
if (state.dismiss) {
state.dismiss.onClick = handleDismissClick;
}
return state;
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,124 @@
'use client';
import { __resetStyles, __styles, mergeClasses } from '@griffel/react';
import { tokens } from '@fluentui/react-theme';
import { useInputStyles_unstable } from '@fluentui/react-input';
export const searchBoxClassNames = {
root: 'fui-SearchBox',
dismiss: 'fui-SearchBox__dismiss',
contentAfter: 'fui-SearchBox__contentAfter',
contentBefore: 'fui-SearchBox__contentBefore',
input: 'fui-SearchBox__input'
};
/**
* Styles for the root slot
*/
const useRootStyles = /*#__PURE__*/__styles({
small: {
i8kkvl: "fjuset5",
B2u0y6b: "f1xzfw5u",
uwmqm3: ["fk8j09s", "fdw0yi8"],
z189sj: ["fdw0yi8", "fk8j09s"]
},
medium: {
i8kkvl: "fjuset5",
B2u0y6b: "f1xzfw5u",
uwmqm3: ["f1f5gg8d", "f1vdfbxk"],
z189sj: ["f1vdfbxk", "f1f5gg8d"]
},
large: {
i8kkvl: "fjuset5",
B2u0y6b: "f1xzfw5u",
uwmqm3: ["f1ng84yb", "f11gcy0p"],
z189sj: ["f11gcy0p", "f1ng84yb"]
},
input: {
uwmqm3: ["fk8j09s", "fdw0yi8"],
z189sj: ["fhxju0i", "f1cnd47f"],
Boqhc8c: "f18izjht",
B8uat0v: "fcoa6sg"
},
unfocusedNoContentAfter: {
z189sj: ["fhxju0i", "f1cnd47f"]
}
}, {
d: [".fjuset5{column-gap:0;}", ".f1xzfw5u{max-width:468px;}", ".fk8j09s{padding-left:var(--spacingHorizontalSNudge);}", ".fdw0yi8{padding-right:var(--spacingHorizontalSNudge);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1ng84yb{padding-left:var(--spacingHorizontalMNudge);}", ".f11gcy0p{padding-right:var(--spacingHorizontalMNudge);}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f18izjht::-webkit-search-decoration{display:none;}", ".fcoa6sg::-webkit-search-cancel-button{display:none;}"]
});
const useInputStyles = /*#__PURE__*/__styles({
small: {
z189sj: ["fdw0yi8", "fk8j09s"]
},
medium: {
z189sj: ["f1vdfbxk", "f1f5gg8d"]
},
large: {
z189sj: ["f11gcy0p", "f1ng84yb"]
}
}, {
d: [".fdw0yi8{padding-right:var(--spacingHorizontalSNudge);}", ".fk8j09s{padding-left:var(--spacingHorizontalSNudge);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f11gcy0p{padding-right:var(--spacingHorizontalMNudge);}", ".f1ng84yb{padding-left:var(--spacingHorizontalMNudge);}"]
});
const useContentAfterStyles = /*#__PURE__*/__styles({
contentAfter: {
uwmqm3: ["f1uw59to", "fw5db7e"],
i8kkvl: "f1ufnopg"
},
rest: {
Bqenvij: "fniina8",
a9b677: "f3tsq5r",
uwmqm3: ["f1cnd47f", "fhxju0i"],
B68tc82: 0,
Bmxbyg5: 0,
Bpg54ce: "f1a3p1vp"
}
}, {
d: [".f1uw59to{padding-left:var(--spacingHorizontalM);}", ".fw5db7e{padding-right:var(--spacingHorizontalM);}", ".f1ufnopg{column-gap:var(--spacingHorizontalXS);}", ".fniina8{height:0;}", ".f3tsq5r{width:0;}", ".f1cnd47f{padding-left:0;}", ".fhxju0i{padding-right:0;}", [".f1a3p1vp{overflow:hidden;}", {
p: -1
}]]
});
const useDismissClassName = /*#__PURE__*/__resetStyles("r1pvzcuu", null, [".r1pvzcuu{box-sizing:border-box;color:var(--colorNeutralForeground3);display:flex;cursor:pointer;}", ".r1pvzcuu>svg{font-size:20px;}"]);
const useDismissStyles = /*#__PURE__*/__styles({
disabled: {
sj55zd: "f1s2aq7o"
},
small: {
Duoase: "f3qv9w"
},
medium: {},
large: {
Duoase: "f16u2scb"
}
}, {
d: [".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".f3qv9w>svg{font-size:16px;}", ".f16u2scb>svg{font-size:24px;}"]
});
/**
* Apply styling to the SearchBox slots based on the state
*/
export const useSearchBoxStyles_unstable = state => {
'use no memo';
const {
disabled,
focused,
size
} = state;
const rootStyles = useRootStyles();
const inputStyles = useInputStyles();
const contentAfterStyles = useContentAfterStyles();
const dismissClassName = useDismissClassName();
const dismissStyles = useDismissStyles();
state.root.className = mergeClasses(searchBoxClassNames.root, rootStyles[size], !focused && rootStyles.unfocusedNoContentAfter, state.root.className);
state.input.className = mergeClasses(searchBoxClassNames.input, rootStyles.input, !focused && inputStyles[size], state.input.className);
if (state.dismiss) {
state.dismiss.className = mergeClasses(searchBoxClassNames.dismiss, dismissClassName, disabled && dismissStyles.disabled, dismissStyles[size], state.dismiss.className);
}
if (state.contentBefore) {
state.contentBefore.className = mergeClasses(searchBoxClassNames.contentBefore, state.contentBefore.className);
}
if (state.contentAfter) {
state.contentAfter.className = mergeClasses(searchBoxClassNames.contentAfter, contentAfterStyles.contentAfter, !focused && contentAfterStyles.rest, state.contentAfter.className);
} else if (state.dismiss) {
state.dismiss.className = mergeClasses(state.dismiss.className, contentAfterStyles.contentAfter);
}
useInputStyles_unstable(state);
return state;
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,125 @@
'use client';
import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';
import { tokens } from '@fluentui/react-theme';
import { useInputStyles_unstable } from '@fluentui/react-input';
export const searchBoxClassNames = {
root: 'fui-SearchBox',
dismiss: 'fui-SearchBox__dismiss',
contentAfter: 'fui-SearchBox__contentAfter',
contentBefore: 'fui-SearchBox__contentBefore',
input: 'fui-SearchBox__input'
};
/**
* Styles for the root slot
*/ const useRootStyles = makeStyles({
small: {
columnGap: 0,
maxWidth: '468px',
paddingLeft: tokens.spacingHorizontalSNudge,
paddingRight: tokens.spacingHorizontalSNudge
},
medium: {
columnGap: 0,
maxWidth: '468px',
paddingLeft: tokens.spacingHorizontalS,
paddingRight: tokens.spacingHorizontalS
},
large: {
columnGap: 0,
maxWidth: '468px',
paddingLeft: tokens.spacingHorizontalMNudge,
paddingRight: tokens.spacingHorizontalMNudge
},
input: {
paddingLeft: tokens.spacingHorizontalSNudge,
paddingRight: 0,
// removes the WebKit pseudoelement styling
'::-webkit-search-decoration': {
display: 'none'
},
'::-webkit-search-cancel-button': {
display: 'none'
}
},
unfocusedNoContentAfter: {
paddingRight: 0
}
});
const useInputStyles = makeStyles({
small: {
paddingRight: tokens.spacingHorizontalSNudge
},
medium: {
paddingRight: tokens.spacingHorizontalS
},
large: {
paddingRight: tokens.spacingHorizontalMNudge
}
});
const useContentAfterStyles = makeStyles({
contentAfter: {
paddingLeft: tokens.spacingHorizontalM,
columnGap: tokens.spacingHorizontalXS
},
rest: {
height: 0,
width: 0,
paddingLeft: 0,
overflow: 'hidden'
}
});
const useDismissClassName = makeResetStyles({
boxSizing: 'border-box',
color: tokens.colorNeutralForeground3,
display: 'flex',
// special case styling for icons (most common case) to ensure they're centered vertically
// size: medium (default)
'> svg': {
fontSize: '20px'
},
cursor: 'pointer'
});
const useDismissStyles = makeStyles({
disabled: {
color: tokens.colorNeutralForegroundDisabled
},
// Ensure resizable icons show up with the proper font size
small: {
'> svg': {
fontSize: '16px'
}
},
medium: {
},
large: {
'> svg': {
fontSize: '24px'
}
}
});
/**
* Apply styling to the SearchBox slots based on the state
*/ export const useSearchBoxStyles_unstable = (state)=>{
'use no memo';
const { disabled, focused, size } = state;
const rootStyles = useRootStyles();
const inputStyles = useInputStyles();
const contentAfterStyles = useContentAfterStyles();
const dismissClassName = useDismissClassName();
const dismissStyles = useDismissStyles();
state.root.className = mergeClasses(searchBoxClassNames.root, rootStyles[size], !focused && rootStyles.unfocusedNoContentAfter, state.root.className);
state.input.className = mergeClasses(searchBoxClassNames.input, rootStyles.input, !focused && inputStyles[size], state.input.className);
if (state.dismiss) {
state.dismiss.className = mergeClasses(searchBoxClassNames.dismiss, dismissClassName, disabled && dismissStyles.disabled, dismissStyles[size], state.dismiss.className);
}
if (state.contentBefore) {
state.contentBefore.className = mergeClasses(searchBoxClassNames.contentBefore, state.contentBefore.className);
}
if (state.contentAfter) {
state.contentAfter.className = mergeClasses(searchBoxClassNames.contentAfter, contentAfterStyles.contentAfter, !focused && contentAfterStyles.rest, state.contentAfter.className);
} else if (state.dismiss) {
state.dismiss.className = mergeClasses(state.dismiss.className, contentAfterStyles.contentAfter);
}
useInputStyles_unstable(state);
return state;
};

File diff suppressed because one or more lines are too long

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

@@ -0,0 +1 @@
export { SearchBox, renderSearchBox_unstable, searchBoxClassNames, useSearchBoxStyles_unstable, useSearchBox_unstable, useSearchBoxBase_unstable } from './SearchBox';

1
node_modules/@fluentui/react-search/lib/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n SearchBox,\n renderSearchBox_unstable,\n searchBoxClassNames,\n useSearchBoxStyles_unstable,\n useSearchBox_unstable,\n useSearchBoxBase_unstable,\n} from './SearchBox';\nexport type {\n SearchBoxChangeEvent,\n SearchBoxProps,\n SearchBoxSlots,\n SearchBoxState,\n SearchBoxBaseProps,\n SearchBoxBaseState,\n} from './SearchBox';\n"],"names":["SearchBox","renderSearchBox_unstable","searchBoxClassNames","useSearchBoxStyles_unstable","useSearchBox_unstable","useSearchBoxBase_unstable"],"mappings":"AAAA,SACEA,SAAS,EACTC,wBAAwB,EACxBC,mBAAmB,EACnBC,2BAA2B,EAC3BC,qBAAqB,EACrBC,yBAAyB,QACpB,cAAc"}

51
node_modules/@fluentui/react-search/package.json generated vendored Normal file
View File

@@ -0,0 +1,51 @@
{
"name": "@fluentui/react-search",
"version": "9.4.1",
"description": "Search input 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-input": "^9.8.1",
"@fluentui/react-jsx-runtime": "^9.4.1",
"@fluentui/react-shared-contexts": "^9.26.2",
"@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.14.0 <20.0.0",
"@types/react-dom": ">=16.9.0 <20.0.0",
"react": ">=16.14.0 <20.0.0",
"react-dom": ">=16.14.0 <20.0.0"
},
"beachball": {
"disallowedChangeTypes": [
"major",
"prerelease"
]
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"node": "./lib-commonjs/index.js",
"import": "./lib/index.js",
"require": "./lib-commonjs/index.js"
},
"./package.json": "./package.json"
},
"files": [
"*.md",
"dist/*.d.ts",
"lib",
"lib-commonjs"
]
}