@fluentui/react-search 9.74.7-experimental.cli-api.20261006-ccaa611d58.0 → 9.75.0-experimental.css-modules.20261031-810ab07afb.0

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +32 -10
  2. package/README.md +4 -0
  3. package/lib/components/SearchBox/SearchBox.js.map +1 -1
  4. package/lib/components/SearchBox/SearchBox.module.css +79 -0
  5. package/lib/components/SearchBox/SearchBox.types.js.map +1 -1
  6. package/lib/components/SearchBox/index.js.map +1 -1
  7. package/lib/components/SearchBox/renderSearchBox.js +2 -2
  8. package/lib/components/SearchBox/renderSearchBox.js.map +1 -1
  9. package/lib/components/SearchBox/useSearchBox.js +2 -4
  10. package/lib/components/SearchBox/useSearchBox.js.map +1 -1
  11. package/lib/components/SearchBox/useSearchBoxStyles.styles.css.js +32 -0
  12. package/lib/components/SearchBox/useSearchBoxStyles.styles.css.js.map +1 -0
  13. package/lib/components/SearchBox/useSearchBoxStyles.styles.raw.css.js +32 -0
  14. package/lib/components/SearchBox/useSearchBoxStyles.styles.raw.css.js.map +1 -0
  15. package/lib/components/SearchBox/useSearchBoxStyles.styles.raw.js.map +1 -1
  16. package/lib-commonjs/SearchBox.cjs +7 -7
  17. package/lib-commonjs/components/SearchBox/SearchBox.cjs.map +1 -1
  18. package/lib-commonjs/components/SearchBox/SearchBox.module.css +79 -0
  19. package/lib-commonjs/components/SearchBox/SearchBox.types.cjs.map +1 -1
  20. package/lib-commonjs/components/SearchBox/index.cjs +7 -7
  21. package/lib-commonjs/components/SearchBox/index.cjs.map +1 -1
  22. package/lib-commonjs/components/SearchBox/renderSearchBox.cjs.map +1 -1
  23. package/lib-commonjs/components/SearchBox/useSearchBox.cjs +5 -7
  24. package/lib-commonjs/components/SearchBox/useSearchBox.cjs.map +1 -1
  25. package/lib-commonjs/components/SearchBox/useSearchBoxStyles.styles.cjs +3 -3
  26. package/lib-commonjs/components/SearchBox/useSearchBoxStyles.styles.cjs.map +1 -1
  27. package/lib-commonjs/components/SearchBox/useSearchBoxStyles.styles.css.cjs +51 -0
  28. package/lib-commonjs/components/SearchBox/useSearchBoxStyles.styles.css.cjs.map +1 -0
  29. package/lib-commonjs/components/SearchBox/useSearchBoxStyles.styles.raw.cjs +3 -3
  30. package/lib-commonjs/components/SearchBox/useSearchBoxStyles.styles.raw.cjs.map +1 -1
  31. package/lib-commonjs/components/SearchBox/useSearchBoxStyles.styles.raw.css.cjs +51 -0
  32. package/lib-commonjs/components/SearchBox/useSearchBoxStyles.styles.raw.css.cjs.map +1 -0
  33. package/lib-commonjs/index.cjs +7 -7
  34. package/package.json +13 -13
  35. package/dist/metadata/api/api-root.json +0 -1
  36. package/dist/metadata/index.json +0 -1
package/CHANGELOG.md CHANGED
@@ -1,22 +1,44 @@
1
1
  # Change Log - @fluentui/react-search
2
2
 
3
- <!-- This log was last generated on Tue, 06 Oct 2026 11:40:31 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Sat, 31 Oct 2026 11:08:54 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [9.74.7-experimental.cli-api.20261006-ccaa611d58.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-search_v9.74.7-experimental.cli-api.20261006-ccaa611d58.0)
7
+ ## [9.75.0-experimental.css-modules.20261031-810ab07afb.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-search_v9.75.0-experimental.css-modules.20261031-810ab07afb.0)
8
8
 
9
- Tue, 06 Oct 2026 11:40:31 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-search_v9.4.6..@fluentui/react-search_v9.74.7-experimental.cli-api.20261006-ccaa611d58.0)
9
+ Sat, 31 Oct 2026 11:08:54 GMT
11
10
 
12
11
  ### Changes
13
12
 
14
- - Release 9.74.7-experimental.cli-api.20261006-ccaa611d58 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
15
- - Bump @fluentui/react-input to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
16
- - Bump @fluentui/react-jsx-runtime to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
17
- - Bump @fluentui/react-shared-contexts to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
18
- - Bump @fluentui/react-theme to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
19
- - Bump @fluentui/react-utilities to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
13
+ - Release 9.75.0-experimental.css-modules.20261031-810ab07afb ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
14
+ - Bump @fluentui/react-input to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
15
+ - Bump @fluentui/react-jsx-runtime to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
16
+ - Bump @fluentui/react-shared-contexts to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
17
+ - Bump @fluentui/react-theme to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
18
+ - Bump @fluentui/react-utilities to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
19
+
20
+ ## [9.4.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-search_v9.4.8)
21
+
22
+ Mon, 19 Oct 2026 16:49:01 GMT
23
+
24
+ ### Patches
25
+
26
+ - Bump @fluentui/react-input to v9.8.8 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
27
+ - Bump @fluentui/react-jsx-runtime to v9.4.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
28
+ - Bump @fluentui/react-utilities to v9.27.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
29
+
30
+ ## [9.4.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-search_v9.4.7)
31
+
32
+ Tue, 22 Sep 2026 11:25:39 GMT
33
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-search_v9.4.6..@fluentui/react-search_v9.4.7)
34
+
35
+ ### Patches
36
+
37
+ - fix: remove unused react-dom and @types/react-dom peer dependencies, mark @types/react as optional ([PR #36559](https://github.com/microsoft/fluentui/pull/36559) by martinhochel@microsoft.com)
38
+ - Bump @fluentui/react-input to v9.8.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
39
+ - Bump @fluentui/react-jsx-runtime to v9.4.6 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
40
+ - Bump @fluentui/react-shared-contexts to v9.26.4 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
41
+ - Bump @fluentui/react-utilities to v9.26.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
20
42
 
21
43
  ## [9.4.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-search_v9.4.6)
22
44
 
package/README.md CHANGED
@@ -33,3 +33,7 @@ See [Spec.md](./docs/Spec.md)
33
33
  ### Upgrade Guide
34
34
 
35
35
  If you're upgrading to Fluent UI v9 see the upgrade guide in [Storybook](https://react.fluentui.dev/) under Concepts > Upgrading.
36
+
37
+ ## Opt-in CSS Modules styles
38
+
39
+ SearchBox has a layered CSS Modules alternative beside its Griffel style hook. It continues to call the public Input style hook; use the same bundler resolver for `@fluentui/react-input` so that hook is replaced wholesale.
@@ -1 +1 @@
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,oBAAiB;AACvD,SAASC,wBAAwB,QAAQ,uBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,iCAA8B;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"}
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,oBAAiB;AACvD,SAASC,wBAAwB,QAAQ,uBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,iCAA8B;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"}
@@ -0,0 +1,79 @@
1
+ @layer fluentui {
2
+ .root {
3
+ column-gap: 0;
4
+ max-width: 468px;
5
+ }
6
+
7
+ .root.small {
8
+ padding-inline: var(--spacingHorizontalSNudge);
9
+ }
10
+
11
+ .root.medium {
12
+ padding-inline: var(--spacingHorizontalS);
13
+ }
14
+
15
+ .root.large {
16
+ padding-inline: var(--spacingHorizontalMNudge);
17
+ }
18
+
19
+ .root.unfocusedNoContentAfter {
20
+ padding-inline-end: 0;
21
+ }
22
+
23
+ .input {
24
+ padding-inline-start: var(--spacingHorizontalSNudge);
25
+ padding-inline-end: 0;
26
+
27
+ &::-webkit-search-decoration,
28
+ &::-webkit-search-cancel-button {
29
+ display: none;
30
+ }
31
+ }
32
+
33
+ .input.small {
34
+ padding-inline-end: var(--spacingHorizontalSNudge);
35
+ }
36
+
37
+ .input.medium {
38
+ padding-inline-end: var(--spacingHorizontalS);
39
+ }
40
+
41
+ .input.large {
42
+ padding-inline-end: var(--spacingHorizontalMNudge);
43
+ }
44
+
45
+ .dismiss {
46
+ box-sizing: border-box;
47
+ color: var(--colorNeutralForeground3);
48
+ display: flex;
49
+ cursor: pointer;
50
+
51
+ > svg {
52
+ font-size: var(--fontSizeBase500);
53
+ }
54
+ }
55
+
56
+ .dismiss.disabled {
57
+ color: var(--colorNeutralForegroundDisabled);
58
+ }
59
+
60
+ .dismiss.small > svg {
61
+ font-size: var(--fontSizeBase400);
62
+ }
63
+
64
+ .dismiss.large > svg {
65
+ font-size: var(--fontSizeBase600);
66
+ }
67
+
68
+ .contentAfter {
69
+ padding-inline-start: var(--spacingHorizontalM);
70
+ column-gap: var(--spacingHorizontalXS);
71
+ }
72
+
73
+ .rest {
74
+ height: 0;
75
+ width: 0;
76
+ padding-inline-start: 0;
77
+ overflow: hidden;
78
+ }
79
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/SearchBox/SearchBox.types.ts"],"sourcesContent":["import type * 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":[],"mappings":"AAgDA,6GAA6G,GAC7G,WAA2G"}
1
+ {"version":3,"sources":["../../../src/components/SearchBox/SearchBox.types.ts"],"sourcesContent":["import type * 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":[],"mappings":"AAgDA,6GAA6G,GAC7G,WAA2G"}
@@ -1 +1 @@
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,iBAAc;AASxC,SAASC,wBAAwB,QAAQ,uBAAoB;AAC7D,SAASC,qBAAqB,EAAEC,yBAAyB,QAAQ,oBAAiB;AAClF,SAASC,mBAAmB,EAAEC,2BAA2B,QAAQ,iCAA8B"}
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,iBAAc;AASxC,SAASC,wBAAwB,QAAQ,uBAAoB;AAC7D,SAASC,qBAAqB,EAAEC,yBAAyB,QAAQ,oBAAiB;AAClF,SAASC,mBAAmB,EAAEC,2BAA2B,QAAQ,iCAA8B"}
@@ -1,5 +1,5 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
- import { assertSlots } from "@fluentui/react-utilities";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
+ import { assertSlots } from "@fluentui/react-utilities";
3
3
  /**
4
4
  * Render the final JSX of SearchBox
5
5
  */ export const renderSearchBox_unstable = (state)=>{
@@ -1 +1 @@
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"}
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,GAEjD,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"}
@@ -15,13 +15,11 @@ import { DismissRegular, SearchRegular } from "@fluentui/react-icons";
15
15
  const { size = 'medium', appearance = 'outline', ...baseProps } = props;
16
16
  const state = useSearchBoxBase_unstable(baseProps, ref);
17
17
  if (state.contentBefore) {
18
- var _state_contentBefore;
19
- var _children;
18
+ var _state_contentBefore, _children;
20
19
  (_children = (_state_contentBefore = state.contentBefore).children) !== null && _children !== void 0 ? _children : _state_contentBefore.children = /*#__PURE__*/ React.createElement(SearchRegular, null);
21
20
  }
22
21
  if (state.dismiss) {
23
- var _state_dismiss;
24
- var _children1;
22
+ var _state_dismiss, _children1;
25
23
  (_children1 = (_state_dismiss = state.dismiss).children) !== null && _children1 !== void 0 ? _children1 : _state_dismiss.children = /*#__PURE__*/ React.createElement(DismissRegular, null);
26
24
  }
27
25
  return {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/SearchBox/useSearchBox.tsx"],"sourcesContent":["'use client';\n\nimport * 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 {\n SearchBoxBaseProps,\n SearchBoxBaseState,\n SearchBoxSlots,\n SearchBoxProps,\n SearchBoxState,\n} 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 { size = 'medium', appearance = 'outline', ...baseProps } = props;\n const state = useSearchBoxBase_unstable(baseProps, ref);\n\n if (state.contentBefore) {\n state.contentBefore.children ??= <SearchRegular />;\n }\n\n if (state.dismiss) {\n state.dismiss.children ??= <DismissRegular />;\n }\n\n return {\n ...state,\n size,\n appearance,\n };\n};\n\n/**\n * Base hook for SearchBox component. Manages state related to controlled/uncontrolled\n * value, focus tracking, dismiss button click handling, search icon slot, and\n * input type=\"search\" — without design props (size, appearance).\n *\n * @param props - props from this instance of SearchBox (without size, appearance)\n * @param ref - reference to root HTMLElement of SearchBox\n */\nexport const useSearchBoxBase_unstable = (\n props: SearchBoxBaseProps,\n ref: React.Ref<HTMLInputElement>,\n): SearchBoxBaseState => {\n const { disabled = false, root, contentBefore, dismiss, contentAfter, value, defaultValue, ...inputProps } = 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 searchBoxRef.current?.focus();\n });\n\n const inputState = useInput_unstable(\n {\n type: 'search',\n disabled,\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 // eslint-disable-next-line react-hooks/refs\n onBlur: mergeCallbacks(rootProps?.onBlur, onBlur),\n },\n {\n elementType: 'span',\n },\n ),\n contentBefore: slot.optional(contentBefore, {\n renderByDefault: true,\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: SearchBoxBaseState = {\n ...inputState,\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...inputState.components,\n dismiss: 'span',\n },\n dismiss: slot.optional(dismiss, {\n defaultProps: {\n role: 'button',\n 'aria-label': 'clear',\n tabIndex: -1,\n },\n renderByDefault: true,\n elementType: 'span',\n }),\n disabled,\n focused,\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","appearance","baseProps","state","useSearchBoxBase_unstable","contentBefore","children","dismiss","disabled","root","contentAfter","value","defaultValue","inputProps","searchBoxRootRef","useRef","searchBoxRef","internalValue","setInternalValue","defaultState","initialState","focused","setFocused","useState","onFocus","useCallback","onBlur","ev","current","contains","relatedTarget","rootProps","resolveShorthand","handleDismissClick","event","onClick","newValue","onChange","focus","inputState","type","always","elementType","optional","renderByDefault","target","components","defaultProps","role","tabIndex"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,mBAAmB,EACnBC,cAAc,EACdC,IAAI,EACJC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,OAAOyB;YAAS;YACvClB,iBAAiBkB;QACnB;IACF,GACA3C,cAAcuB,cAAcjB;IAG9B,MAAMI,QAA4B;QAChC,GAAGoC,UAAU;QACbO,YAAY;YACV,4DAA4D;YAC5D,GAAGP,WAAWO,UAAU;YACxBvC,SAAS;QACX;QACAA,SAASjB,KAAKqD,QAAQ,CAACpC,SAAS;YAC9BwC,cAAc;gBACZC,MAAM;gBACN,cAAc;gBACdC,UAAU,CAAC;YACb;YACAL,iBAAiB;YACjBF,aAAa;QACf;QACAlC;QACAa;IACF;IAEA,IAAIlB,MAAMI,OAAO,EAAE;QACjBJ,MAAMI,OAAO,CAAC4B,OAAO,GAAGF;IAC1B;IAEA,OAAO9B;AACT,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/SearchBox/useSearchBox.tsx"],"sourcesContent":["'use client';\n\nimport * 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 {\n SearchBoxBaseProps,\n SearchBoxBaseState,\n SearchBoxSlots,\n SearchBoxProps,\n SearchBoxState,\n} 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 { size = 'medium', appearance = 'outline', ...baseProps } = props;\n const state = useSearchBoxBase_unstable(baseProps, ref);\n\n if (state.contentBefore) {\n state.contentBefore.children ??= <SearchRegular />;\n }\n\n if (state.dismiss) {\n state.dismiss.children ??= <DismissRegular />;\n }\n\n return {\n ...state,\n size,\n appearance,\n };\n};\n\n/**\n * Base hook for SearchBox component. Manages state related to controlled/uncontrolled\n * value, focus tracking, dismiss button click handling, search icon slot, and\n * input type=\"search\" — without design props (size, appearance).\n *\n * @param props - props from this instance of SearchBox (without size, appearance)\n * @param ref - reference to root HTMLElement of SearchBox\n */\nexport const useSearchBoxBase_unstable = (\n props: SearchBoxBaseProps,\n ref: React.Ref<HTMLInputElement>,\n): SearchBoxBaseState => {\n const { disabled = false, root, contentBefore, dismiss, contentAfter, value, defaultValue, ...inputProps } = 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 searchBoxRef.current?.focus();\n });\n\n const inputState = useInput_unstable(\n {\n type: 'search',\n disabled,\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 // eslint-disable-next-line react-hooks/refs\n onBlur: mergeCallbacks(rootProps?.onBlur, onBlur),\n },\n {\n elementType: 'span',\n },\n ),\n contentBefore: slot.optional(contentBefore, {\n renderByDefault: true,\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: SearchBoxBaseState = {\n ...inputState,\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...inputState.components,\n dismiss: 'span',\n },\n dismiss: slot.optional(dismiss, {\n defaultProps: {\n role: 'button',\n 'aria-label': 'clear',\n tabIndex: -1,\n },\n renderByDefault: true,\n elementType: 'span',\n }),\n disabled,\n focused,\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","appearance","baseProps","state","useSearchBoxBase_unstable","contentBefore","children","dismiss","disabled","root","contentAfter","value","defaultValue","inputProps","searchBoxRootRef","useRef","searchBoxRef","internalValue","setInternalValue","defaultState","initialState","focused","setFocused","useState","onFocus","useCallback","onBlur","ev","current","contains","relatedTarget","rootProps","resolveShorthand","handleDismissClick","event","onClick","newValue","onChange","focus","inputState","type","always","elementType","optional","renderByDefault","target","components","defaultProps","role","tabIndex"],"mappings":"AAAA;AAEA,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;AAUtE;;;;;;;;CAQC,GACD,OAAO,MAAMC,wBAAwB,CAACC,OAAuBC;IAC3D,MAAM,EAAEC,OAAO,QAAQ,EAAEC,aAAa,SAAS,EAAE,GAAGC,WAAW,GAAGJ;IAClE,MAAMK,QAAQC,0BAA0BF,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AAS;YAC9BwC,cAAc;gBACZC,MAAM;gBACN,cAAc;gBACdC,UAAU,CAAC;YACb;YACAL,iBAAiB;YACjBF,aAAa;QACf;QACAlC;QACAa;IACF;IAEA,IAAIlB,MAAMI,OAAO,EAAE;QACjBJ,MAAMI,OAAO,CAAC4B,OAAO,GAAGF;IAC1B;IAEA,OAAO9B;AACT,EAAE"}
@@ -0,0 +1,32 @@
1
+ 'use client';
2
+ import { clsx } from "clsx";
3
+ import { useInputStyles_unstable } from "@fluentui/react-input";
4
+ import styles from "./SearchBox.module.css";
5
+ export const searchBoxClassNames = {
6
+ root: 'fui-SearchBox',
7
+ dismiss: 'fui-SearchBox__dismiss',
8
+ contentAfter: 'fui-SearchBox__contentAfter',
9
+ contentBefore: 'fui-SearchBox__contentBefore',
10
+ input: 'fui-SearchBox__input'
11
+ };
12
+ export const useSearchBoxStyles_unstable = (state)=>{
13
+ const { disabled, focused, size } = state;
14
+ useInputStyles_unstable(state);
15
+ // eslint-disable-next-line react-hooks/immutability
16
+ state.root.className = clsx(searchBoxClassNames.root, styles.root, styles[size], !focused && styles.unfocusedNoContentAfter, state.root.className);
17
+ // eslint-disable-next-line react-hooks/immutability
18
+ state.input.className = clsx(searchBoxClassNames.input, styles.input, !focused && styles[size], state.input.className);
19
+ if (state.dismiss) {
20
+ // eslint-disable-next-line react-hooks/immutability
21
+ state.dismiss.className = clsx(searchBoxClassNames.dismiss, styles.dismiss, styles[size], disabled && styles.disabled, !state.contentAfter && styles.contentAfter, state.dismiss.className);
22
+ }
23
+ if (state.contentBefore) {
24
+ // eslint-disable-next-line react-hooks/immutability
25
+ state.contentBefore.className = clsx(searchBoxClassNames.contentBefore, state.contentBefore.className);
26
+ }
27
+ if (state.contentAfter) {
28
+ // eslint-disable-next-line react-hooks/immutability
29
+ state.contentAfter.className = clsx(searchBoxClassNames.contentAfter, styles.contentAfter, !focused && styles.rest, state.contentAfter.className);
30
+ }
31
+ return state;
32
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/SearchBox/useSearchBoxStyles.styles.css.ts"],"sourcesContent":["'use client';\n\nimport { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useInputStyles_unstable } from '@fluentui/react-input';\nimport type { SearchBoxSlots, SearchBoxState } from './SearchBox.types';\nimport styles from './SearchBox.module.css';\n\nexport const searchBoxClassNames: SlotClassNames<SearchBoxSlots> = {\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\nexport const useSearchBoxStyles_unstable = (state: SearchBoxState): SearchBoxState => {\n const { disabled, focused, size } = state;\n useInputStyles_unstable(state);\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = clsx(\n searchBoxClassNames.root,\n styles.root,\n styles[size],\n !focused && styles.unfocusedNoContentAfter,\n state.root.className,\n );\n\n // eslint-disable-next-line react-hooks/immutability\n state.input.className = clsx(\n searchBoxClassNames.input,\n styles.input,\n !focused && styles[size],\n state.input.className,\n );\n\n if (state.dismiss) {\n // eslint-disable-next-line react-hooks/immutability\n state.dismiss.className = clsx(\n searchBoxClassNames.dismiss,\n styles.dismiss,\n styles[size],\n disabled && styles.disabled,\n !state.contentAfter && styles.contentAfter,\n state.dismiss.className,\n );\n }\n\n if (state.contentBefore) {\n // eslint-disable-next-line react-hooks/immutability\n state.contentBefore.className = clsx(searchBoxClassNames.contentBefore, state.contentBefore.className);\n }\n\n if (state.contentAfter) {\n // eslint-disable-next-line react-hooks/immutability\n state.contentAfter.className = clsx(\n searchBoxClassNames.contentAfter,\n styles.contentAfter,\n !focused && styles.rest,\n state.contentAfter.className,\n );\n }\n\n return state;\n};\n"],"names":["clsx","useInputStyles_unstable","styles","searchBoxClassNames","root","dismiss","contentAfter","contentBefore","input","useSearchBoxStyles_unstable","state","disabled","focused","size","className","unfocusedNoContentAfter","rest"],"mappings":"AAA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AAY,EACnB,CAACM,WAAWV,OAAOc,IAAI,EACvBN,MAAMJ,YAAY,CAACQ,SAAS;IAEhC;IAEA,OAAOJ;AACT,EAAE"}
@@ -0,0 +1,32 @@
1
+ 'use client';
2
+ import { clsx } from "clsx";
3
+ import { useInputStyles_unstable } from "@fluentui/react-input";
4
+ import styles from "./SearchBox.module.css";
5
+ export const searchBoxClassNames = {
6
+ root: 'fui-SearchBox',
7
+ dismiss: 'fui-SearchBox__dismiss',
8
+ contentAfter: 'fui-SearchBox__contentAfter',
9
+ contentBefore: 'fui-SearchBox__contentBefore',
10
+ input: 'fui-SearchBox__input'
11
+ };
12
+ export const useSearchBoxStyles_unstable = (state)=>{
13
+ const { disabled, focused, size } = state;
14
+ useInputStyles_unstable(state);
15
+ // eslint-disable-next-line react-hooks/immutability
16
+ state.root.className = clsx(searchBoxClassNames.root, styles.root, styles[size], !focused && styles.unfocusedNoContentAfter, state.root.className);
17
+ // eslint-disable-next-line react-hooks/immutability
18
+ state.input.className = clsx(searchBoxClassNames.input, styles.input, !focused && styles[size], state.input.className);
19
+ if (state.dismiss) {
20
+ // eslint-disable-next-line react-hooks/immutability
21
+ state.dismiss.className = clsx(searchBoxClassNames.dismiss, styles.dismiss, styles[size], disabled && styles.disabled, !state.contentAfter && styles.contentAfter, state.dismiss.className);
22
+ }
23
+ if (state.contentBefore) {
24
+ // eslint-disable-next-line react-hooks/immutability
25
+ state.contentBefore.className = clsx(searchBoxClassNames.contentBefore, state.contentBefore.className);
26
+ }
27
+ if (state.contentAfter) {
28
+ // eslint-disable-next-line react-hooks/immutability
29
+ state.contentAfter.className = clsx(searchBoxClassNames.contentAfter, styles.contentAfter, !focused && styles.rest, state.contentAfter.className);
30
+ }
31
+ return state;
32
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/SearchBox/useSearchBoxStyles.styles.css.ts"],"sourcesContent":["'use client';\n\nimport { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useInputStyles_unstable } from '@fluentui/react-input';\nimport type { SearchBoxSlots, SearchBoxState } from './SearchBox.types';\nimport styles from './SearchBox.module.css';\n\nexport const searchBoxClassNames: SlotClassNames<SearchBoxSlots> = {\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\nexport const useSearchBoxStyles_unstable = (state: SearchBoxState): SearchBoxState => {\n const { disabled, focused, size } = state;\n useInputStyles_unstable(state);\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = clsx(\n searchBoxClassNames.root,\n styles.root,\n styles[size],\n !focused && styles.unfocusedNoContentAfter,\n state.root.className,\n );\n\n // eslint-disable-next-line react-hooks/immutability\n state.input.className = clsx(\n searchBoxClassNames.input,\n styles.input,\n !focused && styles[size],\n state.input.className,\n );\n\n if (state.dismiss) {\n // eslint-disable-next-line react-hooks/immutability\n state.dismiss.className = clsx(\n searchBoxClassNames.dismiss,\n styles.dismiss,\n styles[size],\n disabled && styles.disabled,\n !state.contentAfter && styles.contentAfter,\n state.dismiss.className,\n );\n }\n\n if (state.contentBefore) {\n // eslint-disable-next-line react-hooks/immutability\n state.contentBefore.className = clsx(searchBoxClassNames.contentBefore, state.contentBefore.className);\n }\n\n if (state.contentAfter) {\n // eslint-disable-next-line react-hooks/immutability\n state.contentAfter.className = clsx(\n searchBoxClassNames.contentAfter,\n styles.contentAfter,\n !focused && styles.rest,\n state.contentAfter.className,\n );\n }\n\n return state;\n};\n"],"names":["clsx","useInputStyles_unstable","styles","searchBoxClassNames","root","dismiss","contentAfter","contentBefore","input","useSearchBoxStyles_unstable","state","disabled","focused","size","className","unfocusedNoContentAfter","rest"],"mappings":"AAAA;AAEA,SAASA,IAAI,QAAQ,OAAO;AAE5B,SAASC,uBAAuB,QAAQ,wBAAwB;AAEhE,OAAOC,YAAY,yBAAyB;AAE5C,OAAO,MAAMC,sBAA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{"version":3,"sources":["../src/components/SearchBox/useSearchBoxStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SearchBoxSlots, SearchBoxState } from './SearchBox.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { useInputStyles_unstable } from '@fluentui/react-input';\n\nexport const searchBoxClassNames: SlotClassNames<SearchBoxSlots> = {\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/**\n * Styles for the root slot\n */\nconst useRootStyles = makeStyles({\n small: {\n columnGap: 0,\n maxWidth: '468px',\n\n paddingLeft: tokens.spacingHorizontalSNudge,\n paddingRight: tokens.spacingHorizontalSNudge,\n },\n medium: {\n columnGap: 0,\n maxWidth: '468px',\n\n paddingLeft: tokens.spacingHorizontalS,\n paddingRight: tokens.spacingHorizontalS,\n },\n large: {\n columnGap: 0,\n maxWidth: '468px',\n\n paddingLeft: tokens.spacingHorizontalMNudge,\n paddingRight: tokens.spacingHorizontalMNudge,\n },\n\n input: {\n paddingLeft: tokens.spacingHorizontalSNudge,\n paddingRight: 0,\n\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\n unfocusedNoContentAfter: {\n paddingRight: 0,\n },\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});\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});\n\nconst useDismissClassName = makeResetStyles({\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground3, // \"icon color\" in design spec\n display: 'flex',\n // special case styling for icons (most common case) to ensure they're centered vertically\n // size: medium (default)\n '> svg': { fontSize: '20px' },\n cursor: 'pointer',\n});\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': { fontSize: '16px' },\n },\n medium: {\n // included in useDismissClassName\n },\n large: {\n '> svg': { fontSize: '24px' },\n },\n});\n\n/**\n * Apply styling to the SearchBox slots based on the state\n */\nexport const useSearchBoxStyles_unstable = (state: SearchBoxState): SearchBoxState => {\n const { disabled, focused, size } = state;\n\n const rootStyles = useRootStyles();\n const inputStyles = useInputStyles();\n const contentAfterStyles = useContentAfterStyles();\n const dismissClassName = useDismissClassName();\n const dismissStyles = useDismissStyles();\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(\n searchBoxClassNames.root,\n rootStyles[size],\n !focused && rootStyles.unfocusedNoContentAfter,\n state.root.className,\n );\n // eslint-disable-next-line react-hooks/immutability\n state.input.className = mergeClasses(\n searchBoxClassNames.input,\n rootStyles.input,\n !focused && inputStyles[size],\n state.input.className,\n );\n\n if (state.dismiss) {\n // eslint-disable-next-line react-hooks/immutability\n state.dismiss.className = mergeClasses(\n searchBoxClassNames.dismiss,\n dismissClassName,\n disabled && dismissStyles.disabled,\n dismissStyles[size],\n\n state.dismiss.className,\n );\n }\n\n if (state.contentBefore) {\n // eslint-disable-next-line react-hooks/immutability\n state.contentBefore.className = mergeClasses(searchBoxClassNames.contentBefore, state.contentBefore.className);\n }\n\n if (state.contentAfter) {\n // eslint-disable-next-line react-hooks/immutability\n state.contentAfter.className = mergeClasses(\n searchBoxClassNames.contentAfter,\n contentAfterStyles.contentAfter,\n\n !focused && contentAfterStyles.rest,\n\n state.contentAfter.className,\n );\n } else if (state.dismiss) {\n // eslint-disable-next-line react-hooks/immutability\n state.dismiss.className = mergeClasses(state.dismiss.className, contentAfterStyles.contentAfter);\n }\n\n useInputStyles_unstable(state);\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","useInputStyles_unstable","searchBoxClassNames","root","dismiss","contentAfter","contentBefore","input","useRootStyles","small","columnGap","maxWidth","paddingLeft","spacingHorizontalSNudge","paddingRight","medium","spacingHorizontalS","large","spacingHorizontalMNudge","display","unfocusedNoContentAfter","useInputStyles","useContentAfterStyles","spacingHorizontalM","spacingHorizontalXS","rest","height","width","overflow","useDismissClassName","boxSizing","color","colorNeutralForeground3","fontSize","cursor","useDismissStyles","disabled","colorNeutralForegroundDisabled","useSearchBoxStyles_unstable","state","focused","size","rootStyles","inputStyles","contentAfterStyles","dismissClassName","dismissStyles","className"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG3E,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,uBAAuB,QAAQ,wBAAwB;AAEhE,OAAO,MAAMC,sBAAsD;IACjEC,MAAM;IACNC,SAAS;IACTC,cAAc;IACdC,eAAe;IACfC,OAAO;AACT,EAAE;AAEF;;CAEC,GACD,MAAMC,gBAAgBV,WAAW;IAC/BW,OAAO;QACLC,WAAW;QACXC,UAAU;QAEVC,aAAaZ,OAAOa,uBAAuB;QAC3CC,cAAcd,OAAOa,uBAAuB;IAC9C;IACAE,QAAQ;QACNL,WAAW;QACXC,UAAU;QAEVC,aAAaZ,OAAOgB,kBAAkB;QACtCF,cAAcd,OAAOgB,kBAAkB;IACzC;IACAC,OAAO;QACLP,WAAW;QACXC,UAAU;QAEVC,aAAaZ,OAAOkB,uBAAuB;QAC3CJ,cAAcd,OAAOkB,uBAAuB;IAC9C;IAEAX,OAAO;QACLK,aAAaZ,OAAOa,uBAAuB;QAC3CC,cAAc;QAEd,2CAA2C;QAC3C,+BAA+B;YAC7BK,SAAS;QACX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MpC,IAAI,CAAC4C,SAAS;IAEtB,oDAAoD;IACpDR,MAAMhC,KAAK,CAACwC,SAAS,GAAGhD,aACtBG,oBAAoBK,KAAK,EACzBmC,WAAWnC,KAAK,EAChB,CAACiC,WAAWG,WAAW,CAACF,KAAK,EAC7BF,MAAMhC,KAAK,CAACwC,SAAS;IAGvB,IAAIR,MAAMnC,OAAO,EAAE;QACjB,oDAAoD;QACpDmC,MAAMnC,OAAO,CAAC2C,SAAS,GAAGhD,aACxBG,oBAAoBE,OAAO,EAC3ByC,kBACAT,YAAYU,cAAcV,QAAQ,EAClCU,aAAa,CAACL,KAAK,EAEnBF,MAAMnC,OAAO,CAAC2C,SAAS;IAE3B;IAEA,IAAIR,MAAMjC,aAAa,EAAE;QACvB,oDAAoD;QACpDiC,MAAMjC,aAAa,CAACyC,SAAS,GAAGhD,aAAaG,oBAAoBI,aAAa,EAAEiC,MAAMjC,aAAa,CAACyC,SAAS;IAC/G;IAEA,IAAIR,MAAMlC,YAAY,EAAE;QACtB,oDAAoD;QACpDkC,MAAMlC,YAAY,CAAC0C,SAAS,GAAGhD,aAC7BG,oBAAoBG,YAAY,EAChCuC,mBAAmBvC,YAAY,EAE/B,CAACmC,WAAWI,mBAAmBnB,IAAI,EAEnCc,MAAMlC,YAAY,CAAC0C,SAAS;IAEhC,OAAO,IAAIR,MAAMnC,OAAO,EAAE;QACxB,oDAAoD;QACpDmC,MAAMnC,OAAO,CAAC2C,SAAS,GAAGhD,aAAawC,MAAMnC,OAAO,CAAC2C,SAAS,EAAEH,mBAAmBvC,YAAY;IACjG;IAEAJ,wBAAwBsC;IAExB,OAAOA;AACT,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/SearchBox/useSearchBoxStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SearchBoxSlots, SearchBoxState } from './SearchBox.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { useInputStyles_unstable } from '@fluentui/react-input';\n\nexport const searchBoxClassNames: SlotClassNames<SearchBoxSlots> = {\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/**\n * Styles for the root slot\n */\nconst useRootStyles = makeStyles({\n small: {\n columnGap: 0,\n maxWidth: '468px',\n\n paddingLeft: tokens.spacingHorizontalSNudge,\n paddingRight: tokens.spacingHorizontalSNudge,\n },\n medium: {\n columnGap: 0,\n maxWidth: '468px',\n\n paddingLeft: tokens.spacingHorizontalS,\n paddingRight: tokens.spacingHorizontalS,\n },\n large: {\n columnGap: 0,\n maxWidth: '468px',\n\n paddingLeft: tokens.spacingHorizontalMNudge,\n paddingRight: tokens.spacingHorizontalMNudge,\n },\n\n input: {\n paddingLeft: tokens.spacingHorizontalSNudge,\n paddingRight: 0,\n\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\n unfocusedNoContentAfter: {\n paddingRight: 0,\n },\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});\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});\n\nconst useDismissClassName = makeResetStyles({\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground3, // \"icon color\" in design spec\n display: 'flex',\n // special case styling for icons (most common case) to ensure they're centered vertically\n // size: medium (default)\n '> svg': { fontSize: '20px' },\n cursor: 'pointer',\n});\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': { fontSize: '16px' },\n },\n medium: {\n // included in useDismissClassName\n },\n large: {\n '> svg': { fontSize: '24px' },\n },\n});\n\n/**\n * Apply styling to the SearchBox slots based on the state\n */\nexport const useSearchBoxStyles_unstable = (state: SearchBoxState): SearchBoxState => {\n const { disabled, focused, size } = state;\n\n const rootStyles = useRootStyles();\n const inputStyles = useInputStyles();\n const contentAfterStyles = useContentAfterStyles();\n const dismissClassName = useDismissClassName();\n const dismissStyles = useDismissStyles();\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(\n searchBoxClassNames.root,\n rootStyles[size],\n !focused && rootStyles.unfocusedNoContentAfter,\n state.root.className,\n );\n // eslint-disable-next-line react-hooks/immutability\n state.input.className = mergeClasses(\n searchBoxClassNames.input,\n rootStyles.input,\n !focused && inputStyles[size],\n state.input.className,\n );\n\n if (state.dismiss) {\n // eslint-disable-next-line react-hooks/immutability\n state.dismiss.className = mergeClasses(\n searchBoxClassNames.dismiss,\n dismissClassName,\n disabled && dismissStyles.disabled,\n dismissStyles[size],\n\n state.dismiss.className,\n );\n }\n\n if (state.contentBefore) {\n // eslint-disable-next-line react-hooks/immutability\n state.contentBefore.className = mergeClasses(searchBoxClassNames.contentBefore, state.contentBefore.className);\n }\n\n if (state.contentAfter) {\n // eslint-disable-next-line react-hooks/immutability\n state.contentAfter.className = mergeClasses(\n searchBoxClassNames.contentAfter,\n contentAfterStyles.contentAfter,\n\n !focused && contentAfterStyles.rest,\n\n state.contentAfter.className,\n );\n } else if (state.dismiss) {\n // eslint-disable-next-line react-hooks/immutability\n state.dismiss.className = mergeClasses(state.dismiss.className, contentAfterStyles.contentAfter);\n }\n\n useInputStyles_unstable(state);\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","useInputStyles_unstable","searchBoxClassNames","root","dismiss","contentAfter","contentBefore","input","useRootStyles","small","columnGap","maxWidth","paddingLeft","spacingHorizontalSNudge","paddingRight","medium","spacingHorizontalS","large","spacingHorizontalMNudge","display","unfocusedNoContentAfter","useInputStyles","useContentAfterStyles","spacingHorizontalM","spacingHorizontalXS","rest","height","width","overflow","useDismissClassName","boxSizing","color","colorNeutralForeground3","fontSize","cursor","useDismissStyles","disabled","colorNeutralForegroundDisabled","useSearchBoxStyles_unstable","state","focused","size","rootStyles","inputStyles","contentAfterStyles","dismissClassName","dismissStyles","className"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG3E,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,uBAAuB,QAAQ,wBAAwB;AAEhE,OAAO,MAAMC,sBAAsD;IACjEC,MAAM;IACNC,SAAS;IACTC,cAAc;IACdC,eAAe;IACfC,OAAO;AACT,EAAE;AAEF;;CAEC,GACD,MAAMC,gBAAgBV,WAAW;IAC/BW,OAAO;QACLC,WAAW;QACXC,UAAU;QAEVC,aAAaZ,OAAOa,uBAAuB;QAC3CC,cAAcd,OAAOa,uBAAuB;IAC9C;IACAE,QAAQ;QACNL,WAAW;QACXC,UAAU;QAEVC,aAAaZ,OAAOgB,kBAAkB;QACtCF,cAAcd,OAAOgB,kBAAkB;IACzC;IACAC,OAAO;QACLP,WAAW;QACXC,UAAU;QAEVC,aAAaZ,OAAOkB,uBAAuB;QAC3CJ,cAAcd,OAAOkB,uBAAuB;IAC9C;IAEAX,OAAO;QACLK,aAAaZ,OAAOa,uBAAuB;QAC3CC,cAAc;QAEd,2CAA2C;QAC3C,+BAA+B;YAC7BK,SAAS;QACX;QACA,kCAAkC;YAChCA,SAAS;QACX;IACF;IAEAC,yBAAyB;QACvBN,cAAc;IAChB;AACF;AAEA,MAAMO,iBAAiBvB,WAAW;IAChCW,OAAO;QACLK,cAAcd,OAAOa,uBAAuB;IAC9C;IACAE,QAAQ;QACND,cAAcd,OAAOgB,kBAAkB;IACzC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;IAGvB,IAAIR,MAAMnC,OAAO,EAAE;QACjB,oDAAoD;QACpDmC,MAAMnC,OAAO,CAAC2C,SAAS,GAAGhD,aACxBG,oBAAoBE,OAAO,EAC3ByC,kBACAT,YAAYU,cAAcV,QAAQ,EAClCU,aAAa,CAACL,KAAK,EAEnBF,MAAMnC,OAAO,CAAC2C,SAAS;IAE3B;IAEA,IAAIR,MAAMjC,aAAa,EAAE;QACvB,oDAAoD;QACpDiC,MAAMjC,aAAa,CAACyC,SAAS,GAAGhD,aAAaG,oBAAoBI,aAAa,EAAEiC,MAAMjC,aAAa,CAACyC,SAAS;IAC/G;IAEA,IAAIR,MAAMlC,YAAY,EAAE;QACtB,oDAAoD;QACpDkC,MAAMlC,YAAY,CAAC0C,SAAS,GAAGhD,aAC7BG,oBAAoBG,YAAY,EAChCuC,mBAAmBvC,YAAY,EAE/B,CAACmC,WAAWI,mBAAmBnB,IAAI,EAEnCc,MAAMlC,YAAY,CAAC0C,SAAS;IAEhC,OAAO,IAAIR,MAAMnC,OAAO,EAAE;QACxB,oDAAoD;QACpDmC,MAAMnC,OAAO,CAAC2C,SAAS,GAAGhD,aAAawC,MAAMnC,OAAO,CAAC2C,SAAS,EAAEH,mBAAmBvC,YAAY;IACjG;IAEAJ,wBAAwBsC;IAExB,OAAOA;AACT,EAAE"}
@@ -5,26 +5,26 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- SearchBox: function() {
12
+ get SearchBox () {
13
13
  return _index.SearchBox;
14
14
  },
15
- renderSearchBox_unstable: function() {
15
+ get renderSearchBox_unstable () {
16
16
  return _index.renderSearchBox_unstable;
17
17
  },
18
- searchBoxClassNames: function() {
18
+ get searchBoxClassNames () {
19
19
  return _index.searchBoxClassNames;
20
20
  },
21
- useSearchBoxBase_unstable: function() {
21
+ get useSearchBoxBase_unstable () {
22
22
  return _index.useSearchBoxBase_unstable;
23
23
  },
24
- useSearchBoxStyles_unstable: function() {
24
+ get useSearchBoxStyles_unstable () {
25
25
  return _index.useSearchBoxStyles_unstable;
26
26
  },
27
- useSearchBox_unstable: function() {
27
+ get useSearchBox_unstable () {
28
28
  return _index.useSearchBox_unstable;
29
29
  }
30
30
  });
@@ -1 +1 @@
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,oBAAiB;iCACd,uBAAoB;0CACjB,iCAA8B;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"}
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,oBAAiB;iCACd,uBAAoB;0CACjB,iCAA8B;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"}
@@ -0,0 +1,79 @@
1
+ @layer fluentui {
2
+ .root {
3
+ column-gap: 0;
4
+ max-width: 468px;
5
+ }
6
+
7
+ .root.small {
8
+ padding-inline: var(--spacingHorizontalSNudge);
9
+ }
10
+
11
+ .root.medium {
12
+ padding-inline: var(--spacingHorizontalS);
13
+ }
14
+
15
+ .root.large {
16
+ padding-inline: var(--spacingHorizontalMNudge);
17
+ }
18
+
19
+ .root.unfocusedNoContentAfter {
20
+ padding-inline-end: 0;
21
+ }
22
+
23
+ .input {
24
+ padding-inline-start: var(--spacingHorizontalSNudge);
25
+ padding-inline-end: 0;
26
+
27
+ &::-webkit-search-decoration,
28
+ &::-webkit-search-cancel-button {
29
+ display: none;
30
+ }
31
+ }
32
+
33
+ .input.small {
34
+ padding-inline-end: var(--spacingHorizontalSNudge);
35
+ }
36
+
37
+ .input.medium {
38
+ padding-inline-end: var(--spacingHorizontalS);
39
+ }
40
+
41
+ .input.large {
42
+ padding-inline-end: var(--spacingHorizontalMNudge);
43
+ }
44
+
45
+ .dismiss {
46
+ box-sizing: border-box;
47
+ color: var(--colorNeutralForeground3);
48
+ display: flex;
49
+ cursor: pointer;
50
+
51
+ > svg {
52
+ font-size: var(--fontSizeBase500);
53
+ }
54
+ }
55
+
56
+ .dismiss.disabled {
57
+ color: var(--colorNeutralForegroundDisabled);
58
+ }
59
+
60
+ .dismiss.small > svg {
61
+ font-size: var(--fontSizeBase400);
62
+ }
63
+
64
+ .dismiss.large > svg {
65
+ font-size: var(--fontSizeBase600);
66
+ }
67
+
68
+ .contentAfter {
69
+ padding-inline-start: var(--spacingHorizontalM);
70
+ column-gap: var(--spacingHorizontalXS);
71
+ }
72
+
73
+ .rest {
74
+ height: 0;
75
+ width: 0;
76
+ padding-inline-start: 0;
77
+ overflow: hidden;
78
+ }
79
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/SearchBox/SearchBox.types.ts"],"sourcesContent":["import type * 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":[],"mappings":"AAgDA,6GAA6G,GAC7G,WAA2G"}
1
+ {"version":3,"sources":["../../../src/components/SearchBox/SearchBox.types.ts"],"sourcesContent":["import type * 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":[],"mappings":"AAgDA,6GAA6G,GAC7G,WAA2G"}
@@ -5,26 +5,26 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- SearchBox: function() {
12
+ get SearchBox () {
13
13
  return _SearchBox.SearchBox;
14
14
  },
15
- renderSearchBox_unstable: function() {
15
+ get renderSearchBox_unstable () {
16
16
  return _renderSearchBox.renderSearchBox_unstable;
17
17
  },
18
- searchBoxClassNames: function() {
18
+ get searchBoxClassNames () {
19
19
  return _useSearchBoxStylesstyles.searchBoxClassNames;
20
20
  },
21
- useSearchBoxBase_unstable: function() {
21
+ get useSearchBoxBase_unstable () {
22
22
  return _useSearchBox.useSearchBoxBase_unstable;
23
23
  },
24
- useSearchBoxStyles_unstable: function() {
24
+ get useSearchBoxStyles_unstable () {
25
25
  return _useSearchBoxStylesstyles.useSearchBoxStyles_unstable;
26
26
  },
27
- useSearchBox_unstable: function() {
27
+ get useSearchBox_unstable () {
28
28
  return _useSearchBox.useSearchBox_unstable;
29
29
  }
30
30
  });
@@ -1 +1 @@
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,iBAAc;iCASC,uBAAoB;8BACI,oBAAiB;0CACjB,iCAA8B"}
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,iBAAc;iCASC,uBAAoB;8BACI,oBAAiB;0CACjB,iCAA8B"}
@@ -1 +1 @@
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"}
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;;;;;;;gCATb,gDAAiD,GAEjD,SAASD,WAAW,QAAQ,4BAA4B;AAOjD,iCAAiC,CAACE;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"}