@fluentui/react-search 9.0.20 → 9.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -2
- package/lib/SearchBox.js.map +1 -1
- package/lib/components/SearchBox/SearchBox.js.map +1 -1
- package/lib/components/SearchBox/SearchBox.types.js.map +1 -1
- package/lib/components/SearchBox/index.js.map +1 -1
- package/lib/components/SearchBox/renderSearchBox.js.map +1 -1
- package/lib/components/SearchBox/useSearchBox.js.map +1 -1
- package/lib/components/SearchBox/useSearchBoxStyles.styles.js +8 -5
- package/lib/components/SearchBox/useSearchBoxStyles.styles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/SearchBox.js.map +1 -1
- package/lib-commonjs/components/SearchBox/SearchBox.js.map +1 -1
- package/lib-commonjs/components/SearchBox/SearchBox.types.js.map +1 -1
- package/lib-commonjs/components/SearchBox/index.js.map +1 -1
- package/lib-commonjs/components/SearchBox/renderSearchBox.js.map +1 -1
- package/lib-commonjs/components/SearchBox/useSearchBox.js.map +1 -1
- package/lib-commonjs/components/SearchBox/useSearchBoxStyles.styles.js +12 -5
- package/lib-commonjs/components/SearchBox/useSearchBoxStyles.styles.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +6 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-search
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 18 Nov 2024 09:42:22 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.22](https://github.com/microsoft/fluentui/tree/@fluentui/react-search_v9.0.22)
|
|
8
|
+
|
|
9
|
+
Mon, 18 Nov 2024 09:42:22 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-search_v9.0.21..@fluentui/react-search_v9.0.22)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- Bump @fluentui/react-input to v9.4.93 ([PR #33229](https://github.com/microsoft/fluentui/pull/33229) by beachball)
|
|
15
|
+
|
|
16
|
+
## [9.0.21](https://github.com/microsoft/fluentui/tree/@fluentui/react-search_v9.0.21)
|
|
17
|
+
|
|
18
|
+
Mon, 11 Nov 2024 10:00:53 GMT
|
|
19
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-search_v9.0.20..@fluentui/react-search_v9.0.21)
|
|
20
|
+
|
|
21
|
+
### Patches
|
|
22
|
+
|
|
23
|
+
- fix SearchBox contentAfter hidden clickable ([PR #33005](https://github.com/microsoft/fluentui/pull/33005) by carla.muntean@microsoft.com)
|
|
24
|
+
- chore: replace npm-scripts and just-scrtips with nx inferred tasks ([PR #33074](https://github.com/microsoft/fluentui/pull/33074) by martinhochel@microsoft.com)
|
|
25
|
+
- Bump @fluentui/react-input to v9.4.92 ([PR #33238](https://github.com/microsoft/fluentui/pull/33238) by beachball)
|
|
26
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.46 ([PR #33238](https://github.com/microsoft/fluentui/pull/33238) by beachball)
|
|
27
|
+
- Bump @fluentui/react-theme to v9.1.22 ([PR #33238](https://github.com/microsoft/fluentui/pull/33238) by beachball)
|
|
28
|
+
- Bump @fluentui/react-utilities to v9.18.17 ([PR #33238](https://github.com/microsoft/fluentui/pull/33238) by beachball)
|
|
29
|
+
|
|
7
30
|
## [9.0.20](https://github.com/microsoft/fluentui/tree/@fluentui/react-search_v9.0.20)
|
|
8
31
|
|
|
9
|
-
Tue, 15 Oct 2024 17:
|
|
32
|
+
Tue, 15 Oct 2024 17:17:53 GMT
|
|
10
33
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-search_v9.0.19..@fluentui/react-search_v9.0.20)
|
|
11
34
|
|
|
12
35
|
### Patches
|
package/lib/SearchBox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["SearchBox.ts"],"sourcesContent":["export * from './components/SearchBox/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,+BAA+B"}
|
|
1
|
+
{"version":3,"sources":["../src/SearchBox.ts"],"sourcesContent":["export * from './components/SearchBox/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,+BAA+B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["SearchBox.tsx"],"sourcesContent":["import * 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';\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 return renderSearchBox_unstable(state);\n});\n\nSearchBox.displayName = 'SearchBox';\n"],"names":["React","useSearchBox_unstable","renderSearchBox_unstable","useSearchBoxStyles_unstable","SearchBox","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,8BAA8B;AAI1E;;CAEC,GACD,OAAO,MAAMC,0BAAiDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQP,sBAAsBK,OAAOC;IAE3CJ,4BAA4BK;IAC5B,OAAON,yBAAyBM;AAClC,GAAG;AAEHJ,UAAUK,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/SearchBox/SearchBox.tsx"],"sourcesContent":["import * 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';\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 return renderSearchBox_unstable(state);\n});\n\nSearchBox.displayName = 'SearchBox';\n"],"names":["React","useSearchBox_unstable","renderSearchBox_unstable","useSearchBoxStyles_unstable","SearchBox","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,8BAA8B;AAI1E;;CAEC,GACD,OAAO,MAAMC,0BAAiDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQP,sBAAsBK,OAAOC;IAE3CJ,4BAA4BK;IAC5B,OAAON,yBAAyBM;AAClC,GAAG;AAEHJ,UAAUK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["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 * 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/** 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"],"rangeMappings":"","mappings":"AAAA,YAAYA,WAAW,QAAQ"}
|
|
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 * 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/** 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"],"rangeMappings":"","mappings":"AAAA,YAAYA,WAAW,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './SearchBox';\nexport * from './SearchBox.types';\nexport * from './renderSearchBox';\nexport * from './useSearchBox';\nexport * from './useSearchBoxStyles.styles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,oBAAoB;AAClC,cAAc,oBAAoB;AAClC,cAAc,iBAAiB;AAC/B,cAAc,8BAA8B"}
|
|
1
|
+
{"version":3,"sources":["../src/components/SearchBox/index.ts"],"sourcesContent":["export * from './SearchBox';\nexport * from './SearchBox.types';\nexport * from './renderSearchBox';\nexport * from './useSearchBox';\nexport * from './useSearchBoxStyles.styles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,oBAAoB;AAClC,cAAc,oBAAoB;AAClC,cAAc,iBAAiB;AAC/B,cAAc,8BAA8B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderSearchBox.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { SearchBoxState, SearchBoxSlots } from './SearchBox.types';\n\n/**\n * Render the final JSX of SearchBox\n */\nexport const renderSearchBox_unstable = (state: SearchBoxState) => {\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"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;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"}
|
|
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 { SearchBoxState, SearchBoxSlots } from './SearchBox.types';\n\n/**\n * Render the final JSX of SearchBox\n */\nexport const renderSearchBox_unstable = (state: SearchBoxState) => {\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"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useSearchBox.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n isResolvedShorthand,\n mergeCallbacks,\n slot,\n useControllableState,\n useEventCallback,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport { useInput_unstable } from '@fluentui/react-input';\nimport { DismissRegular, SearchRegular } from '@fluentui/react-icons';\nimport type { ExtractSlotProps } from '@fluentui/react-utilities';\nimport type { SearchBoxSlots, SearchBoxProps, SearchBoxState } from './SearchBox.types';\n\n/**\n * Create the state required to render SearchBox.\n *\n * The returned state can be modified with hooks such as useSearchBoxStyles_unstable,\n * before being passed to renderSearchBox_unstable.\n *\n * @param props - props from this instance of SearchBox\n * @param ref - reference to root HTMLElement of SearchBox\n */\nexport const useSearchBox_unstable = (props: SearchBoxProps, ref: React.Ref<HTMLInputElement>): SearchBoxState => {\n const {\n size = 'medium',\n disabled = false,\n root,\n contentBefore,\n dismiss,\n contentAfter,\n value,\n defaultValue,\n ...inputProps\n } = props;\n\n const searchBoxRootRef = React.useRef<HTMLDivElement>(null);\n const searchBoxRef = React.useRef<HTMLInputElement>(null);\n\n const [internalValue, setInternalValue] = useControllableState({\n state: value,\n defaultState: defaultValue,\n initialState: '',\n });\n\n // Tracks the focus of the component for the contentAfter and dismiss button\n const [focused, setFocused] = React.useState(false);\n\n const onFocus = React.useCallback(() => {\n setFocused(true);\n }, [setFocused]);\n\n const onBlur: React.FocusEventHandler<HTMLSpanElement> = React.useCallback(\n ev => {\n setFocused(!!searchBoxRootRef.current?.contains(ev.relatedTarget));\n },\n [setFocused],\n );\n\n const rootProps = slot.resolveShorthand(root);\n\n const handleDismissClick = useEventCallback((event: React.MouseEvent<HTMLSpanElement>) => {\n if (isResolvedShorthand(dismiss)) {\n dismiss.onClick?.(event);\n }\n const newValue = '';\n setInternalValue(newValue);\n props.onChange?.(event, { value: newValue });\n });\n\n const inputState = useInput_unstable(\n {\n type: 'search',\n disabled,\n size,\n value: internalValue,\n root: slot.always<ExtractSlotProps<SearchBoxSlots['root']>>(\n {\n ...rootProps,\n ref: useMergedRefs(rootProps?.ref, searchBoxRootRef),\n onFocus: mergeCallbacks(rootProps?.onFocus, onFocus),\n onBlur: mergeCallbacks(rootProps?.onBlur, onBlur),\n },\n {\n elementType: 'span',\n },\n ),\n contentBefore: slot.optional(contentBefore, {\n renderByDefault: true,\n defaultProps: {\n children: <SearchRegular />,\n },\n elementType: 'span',\n }),\n contentAfter: slot.optional(contentAfter, {\n renderByDefault: true,\n elementType: 'span',\n }),\n ...inputProps,\n onChange: useEventCallback(ev => {\n const newValue = ev.target.value;\n props.onChange?.(ev, { value: newValue });\n setInternalValue(newValue);\n }),\n },\n useMergedRefs(searchBoxRef, ref),\n );\n\n const state: SearchBoxState = {\n ...inputState,\n components: {\n ...inputState.components,\n dismiss: 'span',\n },\n dismiss: slot.optional(dismiss, {\n defaultProps: {\n children: <DismissRegular />,\n role: 'button',\n 'aria-label': 'clear',\n tabIndex: -1,\n },\n renderByDefault: true,\n elementType: 'span',\n }),\n disabled,\n focused,\n size,\n };\n\n if (state.dismiss) {\n state.dismiss.onClick = handleDismissClick;\n }\n\n return state;\n};\n"],"names":["React","isResolvedShorthand","mergeCallbacks","slot","useControllableState","useEventCallback","useMergedRefs","useInput_unstable","DismissRegular","SearchRegular","useSearchBox_unstable","props","ref","size","disabled","root","contentBefore","dismiss","contentAfter","value","defaultValue","inputProps","searchBoxRootRef","useRef","searchBoxRef","internalValue","setInternalValue","state","defaultState","initialState","focused","setFocused","useState","onFocus","useCallback","onBlur","ev","current","contains","relatedTarget","rootProps","resolveShorthand","handleDismissClick","event","onClick","newValue","onChange","inputState","type","always","elementType","optional","renderByDefault","defaultProps","children","target","components","role","tabIndex"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,mBAAmB,EACnBC,cAAc,EACdC,IAAI,EACJC,oBAAoB,EACpBC,gBAAgB,EAChBC,aAAa,QACR,4BAA4B;AACnC,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,cAAc,EAAEC,aAAa,QAAQ,wBAAwB;AAItE;;;;;;;;CAQC,GACD,OAAO,MAAMC,wBAAwB,CAACC,OAAuBC;IAC3D,MAAM,EACJC,OAAO,QAAQ,EACfC,WAAW,KAAK,EAChBC,IAAI,EACJC,aAAa,EACbC,OAAO,EACPC,YAAY,EACZC,KAAK,EACLC,YAAY,EACZ,GAAGC,YACJ,GAAGV;IAEJ,MAAMW,mBAAmBtB,MAAMuB,MAAM,CAAiB;IACtD,MAAMC,eAAexB,MAAMuB,MAAM,CAAmB;IAEpD,MAAM,CAACE,eAAeC,iBAAiB,GAAGtB,qBAAqB;QAC7DuB,OAAOR;QACPS,cAAcR;QACdS,cAAc;IAChB;IAEA,4EAA4E;IAC5E,MAAM,CAACC,SAASC,WAAW,GAAG/B,MAAMgC,QAAQ,CAAC;IAE7C,MAAMC,UAAUjC,MAAMkC,WAAW,CAAC;QAChCH,WAAW;IACb,GAAG;QAACA;KAAW;IAEf,MAAMI,SAAmDnC,MAAMkC,WAAW,CACxEE,CAAAA;YACed;QAAbS,WAAW,CAAC,GAACT,4BAAAA,iBAAiBe,OAAO,cAAxBf,gDAAAA,0BAA0BgB,QAAQ,CAACF,GAAGG,aAAa;IAClE,GACA;QAACR;KAAW;IAGd,MAA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,SAASd,KAAKgD,QAAQ,CAAClC,SAAS;YAC9BoC,cAAc;gBACZC,wBAAU,oBAAC9C;gBACXiD,MAAM;gBACN,cAAc;gBACdC,UAAU,CAAC;YACb;YACAN,iBAAiB;YACjBF,aAAa;QACf;QACApC;QACAgB;QACAjB;IACF;IAEA,IAAIc,MAAMV,OAAO,EAAE;QACjBU,MAAMV,OAAO,CAAC2B,OAAO,GAAGF;IAC1B;IAEA,OAAOf;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../src/components/SearchBox/useSearchBox.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n isResolvedShorthand,\n mergeCallbacks,\n slot,\n useControllableState,\n useEventCallback,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport { useInput_unstable } from '@fluentui/react-input';\nimport { DismissRegular, SearchRegular } from '@fluentui/react-icons';\nimport type { ExtractSlotProps } from '@fluentui/react-utilities';\nimport type { SearchBoxSlots, SearchBoxProps, SearchBoxState } from './SearchBox.types';\n\n/**\n * Create the state required to render SearchBox.\n *\n * The returned state can be modified with hooks such as useSearchBoxStyles_unstable,\n * before being passed to renderSearchBox_unstable.\n *\n * @param props - props from this instance of SearchBox\n * @param ref - reference to root HTMLElement of SearchBox\n */\nexport const useSearchBox_unstable = (props: SearchBoxProps, ref: React.Ref<HTMLInputElement>): SearchBoxState => {\n const {\n size = 'medium',\n disabled = false,\n root,\n contentBefore,\n dismiss,\n contentAfter,\n value,\n defaultValue,\n ...inputProps\n } = props;\n\n const searchBoxRootRef = React.useRef<HTMLDivElement>(null);\n const searchBoxRef = React.useRef<HTMLInputElement>(null);\n\n const [internalValue, setInternalValue] = useControllableState({\n state: value,\n defaultState: defaultValue,\n initialState: '',\n });\n\n // Tracks the focus of the component for the contentAfter and dismiss button\n const [focused, setFocused] = React.useState(false);\n\n const onFocus = React.useCallback(() => {\n setFocused(true);\n }, [setFocused]);\n\n const onBlur: React.FocusEventHandler<HTMLSpanElement> = React.useCallback(\n ev => {\n setFocused(!!searchBoxRootRef.current?.contains(ev.relatedTarget));\n },\n [setFocused],\n );\n\n const rootProps = slot.resolveShorthand(root);\n\n const handleDismissClick = useEventCallback((event: React.MouseEvent<HTMLSpanElement>) => {\n if (isResolvedShorthand(dismiss)) {\n dismiss.onClick?.(event);\n }\n const newValue = '';\n setInternalValue(newValue);\n props.onChange?.(event, { value: newValue });\n });\n\n const inputState = useInput_unstable(\n {\n type: 'search',\n disabled,\n size,\n value: internalValue,\n root: slot.always<ExtractSlotProps<SearchBoxSlots['root']>>(\n {\n ...rootProps,\n ref: useMergedRefs(rootProps?.ref, searchBoxRootRef),\n onFocus: mergeCallbacks(rootProps?.onFocus, onFocus),\n onBlur: mergeCallbacks(rootProps?.onBlur, onBlur),\n },\n {\n elementType: 'span',\n },\n ),\n contentBefore: slot.optional(contentBefore, {\n renderByDefault: true,\n defaultProps: {\n children: <SearchRegular />,\n },\n elementType: 'span',\n }),\n contentAfter: slot.optional(contentAfter, {\n renderByDefault: true,\n elementType: 'span',\n }),\n ...inputProps,\n onChange: useEventCallback(ev => {\n const newValue = ev.target.value;\n props.onChange?.(ev, { value: newValue });\n setInternalValue(newValue);\n }),\n },\n useMergedRefs(searchBoxRef, ref),\n );\n\n const state: SearchBoxState = {\n ...inputState,\n components: {\n ...inputState.components,\n dismiss: 'span',\n },\n dismiss: slot.optional(dismiss, {\n defaultProps: {\n children: <DismissRegular />,\n role: 'button',\n 'aria-label': 'clear',\n tabIndex: -1,\n },\n renderByDefault: true,\n elementType: 'span',\n }),\n disabled,\n focused,\n size,\n };\n\n if (state.dismiss) {\n state.dismiss.onClick = handleDismissClick;\n }\n\n return state;\n};\n"],"names":["React","isResolvedShorthand","mergeCallbacks","slot","useControllableState","useEventCallback","useMergedRefs","useInput_unstable","DismissRegular","SearchRegular","useSearchBox_unstable","props","ref","size","disabled","root","contentBefore","dismiss","contentAfter","value","defaultValue","inputProps","searchBoxRootRef","useRef","searchBoxRef","internalValue","setInternalValue","state","defaultState","initialState","focused","setFocused","useState","onFocus","useCallback","onBlur","ev","current","contains","relatedTarget","rootProps","resolveShorthand","handleDismissClick","event","onClick","newValue","onChange","inputState","type","always","elementType","optional","renderByDefault","defaultProps","children","target","components","role","tabIndex"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,mBAAmB,EACnBC,cAAc,EACdC,IAAI,EACJC,oBAAoB,EACpBC,gBAAgB,EAChBC,aAAa,QACR,4BAA4B;AACnC,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,cAAc,EAAEC,aAAa,QAAQ,wBAAwB;AAItE;;;;;;;;CAQC,GACD,OAAO,MAAMC,wBAAwB,CAACC,OAAuBC;IAC3D,MAAM,EACJC,OAAO,QAAQ,EACfC,WAAW,KAAK,EAChBC,IAAI,EACJC,aAAa,EACbC,OAAO,EACPC,YAAY,EACZC,KAAK,EACLC,YAAY,EACZ,GAAGC,YACJ,GAAGV;IAEJ,MAAMW,mBAAmBtB,MAAMuB,MAAM,CAAiB;IACtD,MAAMC,eAAexB,MAAMuB,MAAM,CAAmB;IAEpD,MAAM,CAACE,eAAeC,iBAAiB,GAAGtB,qBAAqB;QAC7DuB,OAAOR;QACPS,cAAcR;QACdS,cAAc;IAChB;IAEA,4EAA4E;IAC5E,MAAM,CAACC,SAASC,WAAW,GAAG/B,MAAMgC,QAAQ,CAAC;IAE7C,MAAMC,UAAUjC,MAAMkC,WAAW,CAAC;QAChCH,WAAW;IACb,GAAG;QAACA;KAAW;IAEf,MAAMI,SAAmDnC,MAAMkC,WAAW,CACxEE,CAAAA;YACed;QAAbS,WAAW,CAAC,GAACT,4BAAAA,iBAAiBe,OAAO,cAAxBf,gDAAAA,0BAA0BgB,QAAQ,CAACF,GAAGG,aAAa;IAClE,GACA;QAACR;KAA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S;QACX;QACAA,SAASd,KAAKgD,QAAQ,CAAClC,SAAS;YAC9BoC,cAAc;gBACZC,wBAAU,oBAAC9C;gBACXiD,MAAM;gBACN,cAAc;gBACdC,UAAU,CAAC;YACb;YACAN,iBAAiB;YACjBF,aAAa;QACf;QACApC;QACAgB;QACAjB;IACF;IAEA,IAAIc,MAAMV,OAAO,EAAE;QACjBU,MAAMV,OAAO,CAAC2B,OAAO,GAAGF;IAC1B;IAEA,OAAOf;AACT,EAAE"}
|
|
@@ -61,13 +61,17 @@ const useContentAfterStyles = /*#__PURE__*/__styles({
|
|
|
61
61
|
i8kkvl: "f1ufnopg"
|
|
62
62
|
},
|
|
63
63
|
rest: {
|
|
64
|
-
abs64n: "fk73vx1",
|
|
65
64
|
Bqenvij: "fniina8",
|
|
66
65
|
a9b677: "f3tsq5r",
|
|
67
|
-
uwmqm3: ["f1cnd47f", "fhxju0i"]
|
|
66
|
+
uwmqm3: ["f1cnd47f", "fhxju0i"],
|
|
67
|
+
B68tc82: 0,
|
|
68
|
+
Bmxbyg5: 0,
|
|
69
|
+
Bpg54ce: "f1a3p1vp"
|
|
68
70
|
}
|
|
69
71
|
}, {
|
|
70
|
-
d: [".f1uw59to{padding-left:var(--spacingHorizontalM);}", ".fw5db7e{padding-right:var(--spacingHorizontalM);}", ".f1ufnopg{column-gap:var(--spacingHorizontalXS);}", ".
|
|
72
|
+
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;}", {
|
|
73
|
+
p: -1
|
|
74
|
+
}]]
|
|
71
75
|
});
|
|
72
76
|
const useDismissClassName = /*#__PURE__*/__resetStyles("r1pvzcuu", null, [".r1pvzcuu{box-sizing:border-box;color:var(--colorNeutralForeground3);display:flex;cursor:pointer;}", ".r1pvzcuu>svg{font-size:20px;}"]);
|
|
73
77
|
const useDismissStyles = /*#__PURE__*/__styles({
|
|
@@ -115,5 +119,4 @@ export const useSearchBoxStyles_unstable = state => {
|
|
|
115
119
|
}
|
|
116
120
|
useInputStyles_unstable(state);
|
|
117
121
|
return state;
|
|
118
|
-
};
|
|
119
|
-
//# sourceMappingURL=useSearchBoxStyles.styles.js.map
|
|
122
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","useInputStyles_unstable","searchBoxClassNames","root","dismiss","contentAfter","contentBefore","input","useRootStyles","small","i8kkvl","B2u0y6b","uwmqm3","z189sj","medium","large","Boqhc8c","B8uat0v","unfocusedNoContentAfter","d","useInputStyles","useContentAfterStyles","rest","
|
|
1
|
+
{"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","useInputStyles_unstable","searchBoxClassNames","root","dismiss","contentAfter","contentBefore","input","useRootStyles","small","i8kkvl","B2u0y6b","uwmqm3","z189sj","medium","large","Boqhc8c","B8uat0v","unfocusedNoContentAfter","d","useInputStyles","useContentAfterStyles","rest","Bqenvij","a9b677","B68tc82","Bmxbyg5","Bpg54ce","p","useDismissClassName","useDismissStyles","disabled","sj55zd","Duoase","useSearchBoxStyles_unstable","state","focused","size","rootStyles","inputStyles","contentAfterStyles","dismissClassName","dismissStyles","className"],"sources":["useSearchBoxStyles.styles.js"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { useInputStyles_unstable } from '@fluentui/react-input';\nexport const searchBoxClassNames = {\n root: 'fui-SearchBox',\n dismiss: 'fui-SearchBox__dismiss',\n contentAfter: 'fui-SearchBox__contentAfter',\n contentBefore: 'fui-SearchBox__contentBefore',\n input: 'fui-SearchBox__input'\n};\n/**\n * Styles for the root slot\n */ const useRootStyles = makeStyles({\n small: {\n columnGap: 0,\n maxWidth: '468px',\n paddingLeft: tokens.spacingHorizontalSNudge,\n paddingRight: tokens.spacingHorizontalSNudge\n },\n medium: {\n columnGap: 0,\n maxWidth: '468px',\n paddingLeft: tokens.spacingHorizontalS,\n paddingRight: tokens.spacingHorizontalS\n },\n large: {\n columnGap: 0,\n maxWidth: '468px',\n paddingLeft: tokens.spacingHorizontalMNudge,\n paddingRight: tokens.spacingHorizontalMNudge\n },\n input: {\n paddingLeft: tokens.spacingHorizontalSNudge,\n paddingRight: 0,\n // removes the WebKit pseudoelement styling\n '::-webkit-search-decoration': {\n display: 'none'\n },\n '::-webkit-search-cancel-button': {\n display: 'none'\n }\n },\n unfocusedNoContentAfter: {\n paddingRight: 0\n }\n});\nconst useInputStyles = makeStyles({\n small: {\n paddingRight: tokens.spacingHorizontalSNudge\n },\n medium: {\n paddingRight: tokens.spacingHorizontalS\n },\n large: {\n paddingRight: tokens.spacingHorizontalMNudge\n }\n});\nconst useContentAfterStyles = makeStyles({\n contentAfter: {\n paddingLeft: tokens.spacingHorizontalM,\n columnGap: tokens.spacingHorizontalXS\n },\n rest: {\n height: 0,\n width: 0,\n paddingLeft: 0,\n overflow: 'hidden'\n }\n});\nconst useDismissClassName = makeResetStyles({\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground3,\n display: 'flex',\n // special case styling for icons (most common case) to ensure they're centered vertically\n // size: medium (default)\n '> svg': {\n fontSize: '20px'\n },\n cursor: 'pointer'\n});\nconst useDismissStyles = makeStyles({\n disabled: {\n color: tokens.colorNeutralForegroundDisabled\n },\n // Ensure resizable icons show up with the proper font size\n small: {\n '> svg': {\n fontSize: '16px'\n }\n },\n medium: {\n },\n large: {\n '> svg': {\n fontSize: '24px'\n }\n }\n});\n/**\n * Apply styling to the SearchBox slots based on the state\n */ export const useSearchBoxStyles_unstable = (state)=>{\n 'use no memo';\n const { disabled, focused, size } = state;\n const rootStyles = useRootStyles();\n const inputStyles = useInputStyles();\n const contentAfterStyles = useContentAfterStyles();\n const dismissClassName = useDismissClassName();\n const dismissStyles = useDismissStyles();\n state.root.className = mergeClasses(searchBoxClassNames.root, rootStyles[size], !focused && rootStyles.unfocusedNoContentAfter, state.root.className);\n state.input.className = mergeClasses(searchBoxClassNames.input, rootStyles.input, !focused && inputStyles[size], state.input.className);\n if (state.dismiss) {\n state.dismiss.className = mergeClasses(searchBoxClassNames.dismiss, dismissClassName, disabled && dismissStyles.disabled, dismissStyles[size], state.dismiss.className);\n }\n if (state.contentBefore) {\n state.contentBefore.className = mergeClasses(searchBoxClassNames.contentBefore, state.contentBefore.className);\n }\n if (state.contentAfter) {\n state.contentAfter.className = mergeClasses(searchBoxClassNames.contentAfter, contentAfterStyles.contentAfter, !focused && contentAfterStyles.rest, state.contentAfter.className);\n } else if (state.dismiss) {\n state.dismiss.className = mergeClasses(state.dismiss.className, contentAfterStyles.contentAfter);\n }\n useInputStyles_unstable(state);\n return state;\n};\n"],"mappings":"AAAA,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,uBAAuB,QAAQ,uBAAuB;AAC/D,OAAO,MAAMC,mBAAmB,GAAG;EAC/BC,IAAI,EAAE,eAAe;EACrBC,OAAO,EAAE,wBAAwB;EACjCC,YAAY,EAAE,6BAA6B;EAC3CC,aAAa,EAAE,8BAA8B;EAC7CC,KAAK,EAAE;AACX,CAAC;AACD;AACA;AACA;AAAI,MAAMC,aAAa,gBAAGV,QAAA;EAAAW,KAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,MAAA;IAAAJ,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAE,KAAA;IAAAL,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAN,KAAA;IAAAK,MAAA;IAAAC,MAAA;IAAAG,OAAA;IAAAC,OAAA;EAAA;EAAAC,uBAAA;IAAAL,MAAA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|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export {\n SearchBox,\n renderSearchBox_unstable,\n searchBoxClassNames,\n useSearchBoxStyles_unstable,\n useSearchBox_unstable,\n} from './SearchBox';\nexport type { SearchBoxChangeEvent, SearchBoxProps, SearchBoxSlots, SearchBoxState } from './SearchBox';\n"],"names":["SearchBox","renderSearchBox_unstable","searchBoxClassNames","useSearchBoxStyles_unstable","useSearchBox_unstable"],"rangeMappings":"","mappings":"AAAA,SACEA,SAAS,EACTC,wBAAwB,EACxBC,mBAAmB,EACnBC,2BAA2B,EAC3BC,qBAAqB,QAChB,cAAc"}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n SearchBox,\n renderSearchBox_unstable,\n searchBoxClassNames,\n useSearchBoxStyles_unstable,\n useSearchBox_unstable,\n} from './SearchBox';\nexport type { SearchBoxChangeEvent, SearchBoxProps, SearchBoxSlots, SearchBoxState } from './SearchBox';\n"],"names":["SearchBox","renderSearchBox_unstable","searchBoxClassNames","useSearchBoxStyles_unstable","useSearchBox_unstable"],"rangeMappings":"","mappings":"AAAA,SACEA,SAAS,EACTC,wBAAwB,EACxBC,mBAAmB,EACnBC,2BAA2B,EAC3BC,qBAAqB,QAChB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["SearchBox.ts"],"sourcesContent":["export * from './components/SearchBox/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
|
1
|
+
{"version":3,"sources":["../src/SearchBox.ts"],"sourcesContent":["export * from './components/SearchBox/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["SearchBox.tsx"],"sourcesContent":["import * 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';\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 return renderSearchBox_unstable(state);\n});\n\nSearchBox.displayName = 'SearchBox';\n"],"names":["SearchBox","React","forwardRef","props","ref","state","useSearchBox_unstable","useSearchBoxStyles_unstable","renderSearchBox_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;;iEAVU;8BACe;iCACG;0CACG;AAOrC,MAAMA,YAAAA,WAAAA,GAAiDC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQC,IAAAA,mCAAAA,EAAsBH,OAAOC;IAE3CG,IAAAA,qDAAAA,EAA4BF;IAC5B,OAAOG,IAAAA,yCAAAA,EAAyBH;AAClC;AAEAL,UAAUS,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/SearchBox/SearchBox.tsx"],"sourcesContent":["import * 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';\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 return renderSearchBox_unstable(state);\n});\n\nSearchBox.displayName = 'SearchBox';\n"],"names":["SearchBox","React","forwardRef","props","ref","state","useSearchBox_unstable","useSearchBoxStyles_unstable","renderSearchBox_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;;iEAVU;8BACe;iCACG;0CACG;AAOrC,MAAMA,YAAAA,WAAAA,GAAiDC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQC,IAAAA,mCAAAA,EAAsBH,OAAOC;IAE3CG,IAAAA,qDAAAA,EAA4BF;IAC5B,OAAOG,IAAAA,yCAAAA,EAAyBH;AAClC;AAEAL,UAAUS,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["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 * 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/** 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":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
|
|
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 * 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/** 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":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './SearchBox';\nexport * from './SearchBox.types';\nexport * from './renderSearchBox';\nexport * from './useSearchBox';\nexport * from './useSearchBoxStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
|
|
1
|
+
{"version":3,"sources":["../src/components/SearchBox/index.ts"],"sourcesContent":["export * from './SearchBox';\nexport * from './SearchBox.types';\nexport * from './renderSearchBox';\nexport * from './useSearchBox';\nexport * from './useSearchBoxStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderSearchBox.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { SearchBoxState, SearchBoxSlots } from './SearchBox.types';\n\n/**\n * Render the final JSX of SearchBox\n */\nexport const renderSearchBox_unstable = (state: SearchBoxState) => {\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":["renderSearchBox_unstable","state","assertSlots","_jsxs","root","contentBefore","_jsx","input","contentAfter","children","dismiss"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAE4B;AAMrB,MAAMA,2BAA2B,CAACC;IACvCC,IAAAA,2BAAAA,EAA4BD;IAE5B,OAAA,WAAA,GACEE,IAAAA,gBAAA,EAACF,MAAMG,IAAI,EAAA;;YACRH,MAAMI,aAAa,IAAA,WAAA,GAAIC,IAAAA,eAAA,EAACL,MAAMI,aAAa,EAAA,CAAA;0BAC5CC,IAAAA,eAAA,EAACL,MAAMM,KAAK,EAAA,CAAA;YACXN,MAAMO,YAAY,IAAA,WAAA,GACjBL,IAAAA,gBAAA,EAACF,MAAMO,YAAY,EAAA;;oBAChBP,MAAMO,YAAY,CAACC,QAAQ;oBAC3BR,MAAMS,OAAO,IAAA,WAAA,GAAIJ,IAAAA,eAAA,EAACL,MAAMS,OAAO,EAAA,CAAA;;;;;AAK1C"}
|
|
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 { SearchBoxState, SearchBoxSlots } from './SearchBox.types';\n\n/**\n * Render the final JSX of SearchBox\n */\nexport const renderSearchBox_unstable = (state: SearchBoxState) => {\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":["renderSearchBox_unstable","state","assertSlots","_jsxs","root","contentBefore","_jsx","input","contentAfter","children","dismiss"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAE4B;AAMrB,MAAMA,2BAA2B,CAACC;IACvCC,IAAAA,2BAAAA,EAA4BD;IAE5B,OAAA,WAAA,GACEE,IAAAA,gBAAA,EAACF,MAAMG,IAAI,EAAA;;YACRH,MAAMI,aAAa,IAAA,WAAA,GAAIC,IAAAA,eAAA,EAACL,MAAMI,aAAa,EAAA,CAAA;0BAC5CC,IAAAA,eAAA,EAACL,MAAMM,KAAK,EAAA,CAAA;YACXN,MAAMO,YAAY,IAAA,WAAA,GACjBL,IAAAA,gBAAA,EAACF,MAAMO,YAAY,EAAA;;oBAChBP,MAAMO,YAAY,CAACC,QAAQ;oBAC3BR,MAAMS,OAAO,IAAA,WAAA,GAAIJ,IAAAA,eAAA,EAACL,MAAMS,OAAO,EAAA,CAAA;;;;;AAK1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useSearchBox.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n isResolvedShorthand,\n mergeCallbacks,\n slot,\n useControllableState,\n useEventCallback,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport { useInput_unstable } from '@fluentui/react-input';\nimport { DismissRegular, SearchRegular } from '@fluentui/react-icons';\nimport type { ExtractSlotProps } from '@fluentui/react-utilities';\nimport type { SearchBoxSlots, SearchBoxProps, SearchBoxState } from './SearchBox.types';\n\n/**\n * Create the state required to render SearchBox.\n *\n * The returned state can be modified with hooks such as useSearchBoxStyles_unstable,\n * before being passed to renderSearchBox_unstable.\n *\n * @param props - props from this instance of SearchBox\n * @param ref - reference to root HTMLElement of SearchBox\n */\nexport const useSearchBox_unstable = (props: SearchBoxProps, ref: React.Ref<HTMLInputElement>): SearchBoxState => {\n const {\n size = 'medium',\n disabled = false,\n root,\n contentBefore,\n dismiss,\n contentAfter,\n value,\n defaultValue,\n ...inputProps\n } = props;\n\n const searchBoxRootRef = React.useRef<HTMLDivElement>(null);\n const searchBoxRef = React.useRef<HTMLInputElement>(null);\n\n const [internalValue, setInternalValue] = useControllableState({\n state: value,\n defaultState: defaultValue,\n initialState: '',\n });\n\n // Tracks the focus of the component for the contentAfter and dismiss button\n const [focused, setFocused] = React.useState(false);\n\n const onFocus = React.useCallback(() => {\n setFocused(true);\n }, [setFocused]);\n\n const onBlur: React.FocusEventHandler<HTMLSpanElement> = React.useCallback(\n ev => {\n setFocused(!!searchBoxRootRef.current?.contains(ev.relatedTarget));\n },\n [setFocused],\n );\n\n const rootProps = slot.resolveShorthand(root);\n\n const handleDismissClick = useEventCallback((event: React.MouseEvent<HTMLSpanElement>) => {\n if (isResolvedShorthand(dismiss)) {\n dismiss.onClick?.(event);\n }\n const newValue = '';\n setInternalValue(newValue);\n props.onChange?.(event, { value: newValue });\n });\n\n const inputState = useInput_unstable(\n {\n type: 'search',\n disabled,\n size,\n value: internalValue,\n root: slot.always<ExtractSlotProps<SearchBoxSlots['root']>>(\n {\n ...rootProps,\n ref: useMergedRefs(rootProps?.ref, searchBoxRootRef),\n onFocus: mergeCallbacks(rootProps?.onFocus, onFocus),\n onBlur: mergeCallbacks(rootProps?.onBlur, onBlur),\n },\n {\n elementType: 'span',\n },\n ),\n contentBefore: slot.optional(contentBefore, {\n renderByDefault: true,\n defaultProps: {\n children: <SearchRegular />,\n },\n elementType: 'span',\n }),\n contentAfter: slot.optional(contentAfter, {\n renderByDefault: true,\n elementType: 'span',\n }),\n ...inputProps,\n onChange: useEventCallback(ev => {\n const newValue = ev.target.value;\n props.onChange?.(ev, { value: newValue });\n setInternalValue(newValue);\n }),\n },\n useMergedRefs(searchBoxRef, ref),\n );\n\n const state: SearchBoxState = {\n ...inputState,\n components: {\n ...inputState.components,\n dismiss: 'span',\n },\n dismiss: slot.optional(dismiss, {\n defaultProps: {\n children: <DismissRegular />,\n role: 'button',\n 'aria-label': 'clear',\n tabIndex: -1,\n },\n renderByDefault: true,\n elementType: 'span',\n }),\n disabled,\n focused,\n size,\n };\n\n if (state.dismiss) {\n state.dismiss.onClick = handleDismissClick;\n }\n\n return state;\n};\n"],"names":["useSearchBox_unstable","props","ref","size","disabled","root","contentBefore","dismiss","contentAfter","value","defaultValue","inputProps","searchBoxRootRef","React","useRef","searchBoxRef","internalValue","setInternalValue","useControllableState","state","defaultState","initialState","focused","setFocused","useState","onFocus","useCallback","onBlur","ev","current","contains","relatedTarget","rootProps","slot","resolveShorthand","handleDismissClick","useEventCallback","event","isResolvedShorthand","onClick","newValue","onChange","inputState","useInput_unstable","type","always","useMergedRefs","mergeCallbacks","elementType","optional","renderByDefault","defaultProps","children","createElement","SearchRegular","target","components","DismissRegular","role","tabIndex"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAuBaA;;;eAAAA;;;;iEAvBU;gCAQhB;4BAC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bc,YAAY;YACV,GAAGd,WAAWc,UAAU;YACxBjD,SAAS;QACX;QACAA,SAAS0B,oBAAAA,CAAKgB,QAAQ,CAAC1C,SAAS;YAC9B4C,cAAc;gBACZC,UAAAA,WAAAA,GAAUvC,OAAAwC,aAAA,CAACI,0BAAAA,EAAAA;gBACXC,MAAM;gBACN,cAAc;gBACdC,UAAU,CAAC;YACb;YACAT,iBAAiB;YACjBF,aAAa;QACf;QACA5C;QACAkB;QACAnB;IACF;IAEA,IAAIgB,MAAMZ,OAAO,EAAE;QACjBY,MAAMZ,OAAO,CAACgC,OAAO,GAAGJ;IAC1B;IAEA,OAAOhB;AACT"}
|
|
1
|
+
{"version":3,"sources":["../src/components/SearchBox/useSearchBox.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n isResolvedShorthand,\n mergeCallbacks,\n slot,\n useControllableState,\n useEventCallback,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport { useInput_unstable } from '@fluentui/react-input';\nimport { DismissRegular, SearchRegular } from '@fluentui/react-icons';\nimport type { ExtractSlotProps } from '@fluentui/react-utilities';\nimport type { SearchBoxSlots, SearchBoxProps, SearchBoxState } from './SearchBox.types';\n\n/**\n * Create the state required to render SearchBox.\n *\n * The returned state can be modified with hooks such as useSearchBoxStyles_unstable,\n * before being passed to renderSearchBox_unstable.\n *\n * @param props - props from this instance of SearchBox\n * @param ref - reference to root HTMLElement of SearchBox\n */\nexport const useSearchBox_unstable = (props: SearchBoxProps, ref: React.Ref<HTMLInputElement>): SearchBoxState => {\n const {\n size = 'medium',\n disabled = false,\n root,\n contentBefore,\n dismiss,\n contentAfter,\n value,\n defaultValue,\n ...inputProps\n } = props;\n\n const searchBoxRootRef = React.useRef<HTMLDivElement>(null);\n const searchBoxRef = React.useRef<HTMLInputElement>(null);\n\n const [internalValue, setInternalValue] = useControllableState({\n state: value,\n defaultState: defaultValue,\n initialState: '',\n });\n\n // Tracks the focus of the component for the contentAfter and dismiss button\n const [focused, setFocused] = React.useState(false);\n\n const onFocus = React.useCallback(() => {\n setFocused(true);\n }, [setFocused]);\n\n const onBlur: React.FocusEventHandler<HTMLSpanElement> = React.useCallback(\n ev => {\n setFocused(!!searchBoxRootRef.current?.contains(ev.relatedTarget));\n },\n [setFocused],\n );\n\n const rootProps = slot.resolveShorthand(root);\n\n const handleDismissClick = useEventCallback((event: React.MouseEvent<HTMLSpanElement>) => {\n if (isResolvedShorthand(dismiss)) {\n dismiss.onClick?.(event);\n }\n const newValue = '';\n setInternalValue(newValue);\n props.onChange?.(event, { value: newValue });\n });\n\n const inputState = useInput_unstable(\n {\n type: 'search',\n disabled,\n size,\n value: internalValue,\n root: slot.always<ExtractSlotProps<SearchBoxSlots['root']>>(\n {\n ...rootProps,\n ref: useMergedRefs(rootProps?.ref, searchBoxRootRef),\n onFocus: mergeCallbacks(rootProps?.onFocus, onFocus),\n onBlur: mergeCallbacks(rootProps?.onBlur, onBlur),\n },\n {\n elementType: 'span',\n },\n ),\n contentBefore: slot.optional(contentBefore, {\n renderByDefault: true,\n defaultProps: {\n children: <SearchRegular />,\n },\n elementType: 'span',\n }),\n contentAfter: slot.optional(contentAfter, {\n renderByDefault: true,\n elementType: 'span',\n }),\n ...inputProps,\n onChange: useEventCallback(ev => {\n const newValue = ev.target.value;\n props.onChange?.(ev, { value: newValue });\n setInternalValue(newValue);\n }),\n },\n useMergedRefs(searchBoxRef, ref),\n );\n\n const state: SearchBoxState = {\n ...inputState,\n components: {\n ...inputState.components,\n dismiss: 'span',\n },\n dismiss: slot.optional(dismiss, {\n defaultProps: {\n children: <DismissRegular />,\n role: 'button',\n 'aria-label': 'clear',\n tabIndex: -1,\n },\n renderByDefault: true,\n elementType: 'span',\n }),\n disabled,\n focused,\n size,\n };\n\n if (state.dismiss) {\n state.dismiss.onClick = handleDismissClick;\n }\n\n return state;\n};\n"],"names":["useSearchBox_unstable","props","ref","size","disabled","root","contentBefore","dismiss","contentAfter","value","defaultValue","inputProps","searchBoxRootRef","React","useRef","searchBoxRef","internalValue","setInternalValue","useControllableState","state","defaultState","initialState","focused","setFocused","useState","onFocus","useCallback","onBlur","ev","current","contains","relatedTarget","rootProps","slot","resolveShorthand","handleDismissClick","useEventCallback","event","isResolvedShorthand","onClick","newValue","onChange","inputState","useInput_unstable","type","always","useMergedRefs","mergeCallbacks","elementType","optional","renderByDefault","defaultProps","children","createElement","SearchRegular","target","components","DismissRegular","role","tabIndex"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAuBaA;;;eAAAA;;;;iEAvBU;gCAQhB;4BAC2B;4BACY;AAavC,MAAMA,wBAAwB,CAACC,OAAuBC;IAC3D,MAAM,EACJC,OAAO,QAAQ,EACfC,WAAW,KAAK,EAChBC,IAAI,EACJC,aAAa,EACbC,OAAO,EACPC,YAAY,EACZC,KAAK,EACLC,YAAY,EACZ,GAAGC,YACJ,GAAGV;IAEJ,MAAMW,mBAAmBC,OAAMC,MAAM,CAAiB;IACtD,MAAMC,eAAeF,OAAMC,MAAM,CAAmB;IAEpD,MAAM,CAACE,eAAeC,iBAAiB,GAAGC,IAAAA,oCAAAA,EAAqB;QAC7DC,OAAOV;QACPW,cAAcV;QACdW,cAAc;IAChB;IAEA,4EAA4E;IAC5E,MAAM,CAACC,SAASC,WAAW,GAAGV,OAAMW,QAAQ,CAAC;IAE7C,MAAMC,UAAUZ,OAAMa,WAAW,CAAC;QAChCH,WAAW;IACb,GAAG;QAACA;KAAW;IAEf,MAAMI,SAAmDd,OAAMa,WAAW,CACxEE,CAAAA;YACehB;QAAbW,WAAW,CAAC,CAAA,CAAA,AAACX,CAAAA,4BAAAA,iBAAiBiB,OAAO,AAAPA,MAAO,QAAxBjB,8BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,0BAA0BkB,QAAQ,CAACF,GAAGG,aAAa,CAAA;IAClE,GAC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,CAACzC,cAAc;YACxC0C,iBAAiB;YACjBF,aAAa;QACf;QACA,GAAGrC,UAAU;QACb8B,UAAUL,IAAAA,gCAAAA,EAAiBR,CAAAA;gBAEzB3B;YADA,MAAMuC,WAAWZ,GAAG2B,MAAM,CAAC9C,KAAK;YAChCR,CAAAA,kBAAAA,MAAMwC,QAAQ,AAARA,MAAQ,QAAdxC,oBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,gBAAAA,IAAAA,CAAAA,OAAiB2B,IAAI;gBAAEnB,OAAO+B;YAAS;YACvCvB,iBAAiBuB;QACnB;IACF,GACAM,IAAAA,6BAAAA,EAAc/B,cAAcb;IAG9B,MAAMiB,QAAwB;QAC5B,GAAGuB,UAAU;QACbc,YAAY;YACV,GAAGd,WAAWc,UAAU;YACxBjD,SAAS;QACX;QACAA,SAAS0B,oBAAAA,CAAKgB,QAAQ,CAAC1C,SAAS;YAC9B4C,cAAc;gBACZC,UAAAA,WAAAA,GAAUvC,OAAAwC,aAAA,CAACI,0BAAAA,EAAAA;gBACXC,MAAM;gBACN,cAAc;gBACdC,UAAU,CAAC;YACb;YACAT,iBAAiB;YACjBF,aAAa;QACf;QACA5C;QACAkB;QACAnB;IACF;IAEA,IAAIgB,MAAMZ,OAAO,EAAE;QACjBY,MAAMZ,OAAO,CAACgC,OAAO,GAAGJ;IAC1B;IAEA,OAAOhB;AACT"}
|
|
@@ -136,24 +136,31 @@ const useContentAfterStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
136
136
|
i8kkvl: "f1ufnopg"
|
|
137
137
|
},
|
|
138
138
|
rest: {
|
|
139
|
-
abs64n: "fk73vx1",
|
|
140
139
|
Bqenvij: "fniina8",
|
|
141
140
|
a9b677: "f3tsq5r",
|
|
142
141
|
uwmqm3: [
|
|
143
142
|
"f1cnd47f",
|
|
144
143
|
"fhxju0i"
|
|
145
|
-
]
|
|
144
|
+
],
|
|
145
|
+
B68tc82: 0,
|
|
146
|
+
Bmxbyg5: 0,
|
|
147
|
+
Bpg54ce: "f1a3p1vp"
|
|
146
148
|
}
|
|
147
149
|
}, {
|
|
148
150
|
d: [
|
|
149
151
|
".f1uw59to{padding-left:var(--spacingHorizontalM);}",
|
|
150
152
|
".fw5db7e{padding-right:var(--spacingHorizontalM);}",
|
|
151
153
|
".f1ufnopg{column-gap:var(--spacingHorizontalXS);}",
|
|
152
|
-
".fk73vx1{opacity:0;}",
|
|
153
154
|
".fniina8{height:0;}",
|
|
154
155
|
".f3tsq5r{width:0;}",
|
|
155
156
|
".f1cnd47f{padding-left:0;}",
|
|
156
|
-
".fhxju0i{padding-right:0;}"
|
|
157
|
+
".fhxju0i{padding-right:0;}",
|
|
158
|
+
[
|
|
159
|
+
".f1a3p1vp{overflow:hidden;}",
|
|
160
|
+
{
|
|
161
|
+
p: -1
|
|
162
|
+
}
|
|
163
|
+
]
|
|
157
164
|
]
|
|
158
165
|
});
|
|
159
166
|
const useDismissClassName = /*#__PURE__*/ (0, _react.__resetStyles)("r1pvzcuu", null, [
|
|
@@ -201,4 +208,4 @@ const useSearchBoxStyles_unstable = (state)=>{
|
|
|
201
208
|
}
|
|
202
209
|
(0, _reactinput.useInputStyles_unstable)(state);
|
|
203
210
|
return state;
|
|
204
|
-
};
|
|
211
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useSearchBoxStyles.styles.js"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { useInputStyles_unstable } from '@fluentui/react-input';\nexport const searchBoxClassNames = {\n root: 'fui-SearchBox',\n dismiss: 'fui-SearchBox__dismiss',\n contentAfter: 'fui-SearchBox__contentAfter',\n contentBefore: 'fui-SearchBox__contentBefore',\n input: 'fui-SearchBox__input'\n};\n/**\n * Styles for the root slot\n */ const useRootStyles = makeStyles({\n small: {\n columnGap: 0,\n maxWidth: '468px',\n paddingLeft: tokens.spacingHorizontalSNudge,\n paddingRight: tokens.spacingHorizontalSNudge\n },\n medium: {\n columnGap: 0,\n maxWidth: '468px',\n paddingLeft: tokens.spacingHorizontalS,\n paddingRight: tokens.spacingHorizontalS\n },\n large: {\n columnGap: 0,\n maxWidth: '468px',\n paddingLeft: tokens.spacingHorizontalMNudge,\n paddingRight: tokens.spacingHorizontalMNudge\n },\n input: {\n paddingLeft: tokens.spacingHorizontalSNudge,\n paddingRight: 0,\n // removes the WebKit pseudoelement styling\n '::-webkit-search-decoration': {\n display: 'none'\n },\n '::-webkit-search-cancel-button': {\n display: 'none'\n }\n },\n unfocusedNoContentAfter: {\n paddingRight: 0\n }\n});\nconst useInputStyles = makeStyles({\n small: {\n paddingRight: tokens.spacingHorizontalSNudge\n },\n medium: {\n paddingRight: tokens.spacingHorizontalS\n },\n large: {\n paddingRight: tokens.spacingHorizontalMNudge\n }\n});\nconst useContentAfterStyles = makeStyles({\n contentAfter: {\n paddingLeft: tokens.spacingHorizontalM,\n columnGap: tokens.spacingHorizontalXS\n },\n rest: {\n
|
|
1
|
+
{"version":3,"sources":["useSearchBoxStyles.styles.js"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { useInputStyles_unstable } from '@fluentui/react-input';\nexport const searchBoxClassNames = {\n root: 'fui-SearchBox',\n dismiss: 'fui-SearchBox__dismiss',\n contentAfter: 'fui-SearchBox__contentAfter',\n contentBefore: 'fui-SearchBox__contentBefore',\n input: 'fui-SearchBox__input'\n};\n/**\n * Styles for the root slot\n */ const useRootStyles = makeStyles({\n small: {\n columnGap: 0,\n maxWidth: '468px',\n paddingLeft: tokens.spacingHorizontalSNudge,\n paddingRight: tokens.spacingHorizontalSNudge\n },\n medium: {\n columnGap: 0,\n maxWidth: '468px',\n paddingLeft: tokens.spacingHorizontalS,\n paddingRight: tokens.spacingHorizontalS\n },\n large: {\n columnGap: 0,\n maxWidth: '468px',\n paddingLeft: tokens.spacingHorizontalMNudge,\n paddingRight: tokens.spacingHorizontalMNudge\n },\n input: {\n paddingLeft: tokens.spacingHorizontalSNudge,\n paddingRight: 0,\n // removes the WebKit pseudoelement styling\n '::-webkit-search-decoration': {\n display: 'none'\n },\n '::-webkit-search-cancel-button': {\n display: 'none'\n }\n },\n unfocusedNoContentAfter: {\n paddingRight: 0\n }\n});\nconst useInputStyles = makeStyles({\n small: {\n paddingRight: tokens.spacingHorizontalSNudge\n },\n medium: {\n paddingRight: tokens.spacingHorizontalS\n },\n large: {\n paddingRight: tokens.spacingHorizontalMNudge\n }\n});\nconst useContentAfterStyles = makeStyles({\n contentAfter: {\n paddingLeft: tokens.spacingHorizontalM,\n columnGap: tokens.spacingHorizontalXS\n },\n rest: {\n height: 0,\n width: 0,\n paddingLeft: 0,\n overflow: 'hidden'\n }\n});\nconst useDismissClassName = makeResetStyles({\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground3,\n display: 'flex',\n // special case styling for icons (most common case) to ensure they're centered vertically\n // size: medium (default)\n '> svg': {\n fontSize: '20px'\n },\n cursor: 'pointer'\n});\nconst useDismissStyles = makeStyles({\n disabled: {\n color: tokens.colorNeutralForegroundDisabled\n },\n // Ensure resizable icons show up with the proper font size\n small: {\n '> svg': {\n fontSize: '16px'\n }\n },\n medium: {\n },\n large: {\n '> svg': {\n fontSize: '24px'\n }\n }\n});\n/**\n * Apply styling to the SearchBox slots based on the state\n */ export const useSearchBoxStyles_unstable = (state)=>{\n 'use no memo';\n const { disabled, focused, size } = state;\n const rootStyles = useRootStyles();\n const inputStyles = useInputStyles();\n const contentAfterStyles = useContentAfterStyles();\n const dismissClassName = useDismissClassName();\n const dismissStyles = useDismissStyles();\n state.root.className = mergeClasses(searchBoxClassNames.root, rootStyles[size], !focused && rootStyles.unfocusedNoContentAfter, state.root.className);\n state.input.className = mergeClasses(searchBoxClassNames.input, rootStyles.input, !focused && inputStyles[size], state.input.className);\n if (state.dismiss) {\n state.dismiss.className = mergeClasses(searchBoxClassNames.dismiss, dismissClassName, disabled && dismissStyles.disabled, dismissStyles[size], state.dismiss.className);\n }\n if (state.contentBefore) {\n state.contentBefore.className = mergeClasses(searchBoxClassNames.contentBefore, state.contentBefore.className);\n }\n if (state.contentAfter) {\n state.contentAfter.className = mergeClasses(searchBoxClassNames.contentAfter, contentAfterStyles.contentAfter, !focused && contentAfterStyles.rest, state.contentAfter.className);\n } else if (state.dismiss) {\n state.dismiss.className = mergeClasses(state.dismiss.className, contentAfterStyles.contentAfter);\n }\n useInputStyles_unstable(state);\n return state;\n};\n"],"names":["searchBoxClassNames","useSearchBoxStyles_unstable","root","dismiss","contentAfter","contentBefore","input","useRootStyles","__styles","small","i8kkvl","B2u0y6b","uwmqm3","z189sj","medium","large","Boqhc8c","B8uat0v","unfocusedNoContentAfter","d","useInputStyles","useContentAfterStyles","rest","Bqenvij","a9b677","B68tc82","Bmxbyg5","Bpg54ce","p","useDismissClassName","__resetStyles","useDismissStyles","disabled","sj55zd","Duoase","state","focused","size","rootStyles","inputStyles","contentAfterStyles","dismissClassName","dismissStyles","className","mergeClasses","useInputStyles_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAGaA,mBAAmB;eAAnBA;;IAiGIC,2BAA2B;eAA3BA;;;uBApGyC;4BAElB;AACjC,MAAMD,sBAAsB;IAC/BE,MAAM;IACNC,SAAS;IACTC,cAAc;IACdC,eAAe;IACfC,OAAO;AACX;AACA;;CAEA,GAAI,MAAMC,gBAAa,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAC,OAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,QAAA;YAAA;YAAA;SAAA;QA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MAAM/B,YAAY,EAAE;QACpB+B,MAAM/B,YAAY,CAACuC,SAAS,GAAGC,IAAAA,mBAAY,EAAC5C,oBAAoBI,YAAY,EAAEoC,mBAAmBpC,YAAY,EAAE,CAACgC,WAAWI,mBAAmBlB,IAAI,EAAEa,MAAM/B,YAAY,CAACuC,SAAS;IACpL,OAAO,IAAIR,MAAMhC,OAAO,EAAE;QACtBgC,MAAMhC,OAAO,CAACwC,SAAS,GAAGC,IAAAA,mBAAY,EAACT,MAAMhC,OAAO,CAACwC,SAAS,EAAEH,mBAAmBpC,YAAY;IACnG;IACAyC,IAAAA,mCAAuB,EAACV;IACxB,OAAOA;AACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export {\n SearchBox,\n renderSearchBox_unstable,\n searchBoxClassNames,\n useSearchBoxStyles_unstable,\n useSearchBox_unstable,\n} from './SearchBox';\nexport type { SearchBoxChangeEvent, SearchBoxProps, SearchBoxSlots, SearchBoxState } from './SearchBox';\n"],"names":["SearchBox","renderSearchBox_unstable","searchBoxClassNames","useSearchBoxStyles_unstable","useSearchBox_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,SAAS;eAATA,oBAAS;;IACTC,wBAAwB;eAAxBA,mCAAwB;;IACxBC,mBAAmB;eAAnBA,8BAAmB;;IACnBC,2BAA2B;eAA3BA,sCAA2B;;IAC3BC,qBAAqB;eAArBA,gCAAqB;;;2BAChB"}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n SearchBox,\n renderSearchBox_unstable,\n searchBoxClassNames,\n useSearchBoxStyles_unstable,\n useSearchBox_unstable,\n} from './SearchBox';\nexport type { SearchBoxChangeEvent, SearchBoxProps, SearchBoxSlots, SearchBoxState } from './SearchBox';\n"],"names":["SearchBox","renderSearchBox_unstable","searchBoxClassNames","useSearchBoxStyles_unstable","useSearchBox_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,SAAS;eAATA,oBAAS;;IACTC,wBAAwB;eAAxBA,mCAAwB;;IACxBC,mBAAmB;eAAnBA,8BAAmB;;IACnBC,2BAA2B;eAA3BA,sCAA2B;;IAC3BC,qBAAqB;eAArBA,gCAAqB;;;2BAChB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-search",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.22",
|
|
4
4
|
"description": "Search input for Fluent UI v9",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -11,31 +11,18 @@
|
|
|
11
11
|
"url": "https://github.com/microsoft/fluentui"
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "just-scripts build",
|
|
16
|
-
"clean": "just-scripts clean",
|
|
17
|
-
"code-style": "just-scripts code-style",
|
|
18
|
-
"just": "just-scripts",
|
|
19
|
-
"lint": "just-scripts lint",
|
|
20
|
-
"test": "jest --passWithNoTests",
|
|
21
|
-
"type-check": "just-scripts type-check",
|
|
22
|
-
"generate-api": "just-scripts generate-api",
|
|
23
|
-
"storybook": "yarn --cwd ../stories storybook",
|
|
24
|
-
"start": "yarn storybook"
|
|
25
|
-
},
|
|
26
14
|
"devDependencies": {
|
|
27
15
|
"@fluentui/eslint-plugin": "*",
|
|
28
16
|
"@fluentui/react-conformance": "*",
|
|
29
17
|
"@fluentui/react-conformance-griffel": "*",
|
|
30
|
-
"@fluentui/scripts-api-extractor": "*"
|
|
31
|
-
"@fluentui/scripts-tasks": "*"
|
|
18
|
+
"@fluentui/scripts-api-extractor": "*"
|
|
32
19
|
},
|
|
33
20
|
"dependencies": {
|
|
34
21
|
"@fluentui/react-icons": "^2.0.245",
|
|
35
|
-
"@fluentui/react-input": "^9.4.
|
|
36
|
-
"@fluentui/react-jsx-runtime": "^9.0.
|
|
37
|
-
"@fluentui/react-theme": "^9.1.
|
|
38
|
-
"@fluentui/react-utilities": "^9.18.
|
|
22
|
+
"@fluentui/react-input": "^9.4.93",
|
|
23
|
+
"@fluentui/react-jsx-runtime": "^9.0.46",
|
|
24
|
+
"@fluentui/react-theme": "^9.1.22",
|
|
25
|
+
"@fluentui/react-utilities": "^9.18.17",
|
|
39
26
|
"@griffel/react": "^1.5.22",
|
|
40
27
|
"@swc/helpers": "^0.5.1"
|
|
41
28
|
},
|