@fluentui/react-spinbutton 0.0.0-nightly-20230317-1454.1 → 0.0.0-nightly-20230321-0440.1

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 (64) hide show
  1. package/CHANGELOG.json +17 -17
  2. package/CHANGELOG.md +11 -11
  3. package/lib/SpinButton.js +1 -1
  4. package/lib/SpinButton.js.map +1 -1
  5. package/lib/SpinButtonField.js +1 -1
  6. package/lib/SpinButtonField.js.map +1 -1
  7. package/lib/components/SpinButton/SpinButton.js +6 -6
  8. package/lib/components/SpinButton/SpinButton.js.map +1 -1
  9. package/lib/components/SpinButton/SpinButton.types.js +1 -1
  10. package/lib/components/SpinButton/SpinButton.types.js.map +1 -1
  11. package/lib/components/SpinButton/index.js +5 -5
  12. package/lib/components/SpinButton/index.js.map +1 -1
  13. package/lib/components/SpinButton/renderSpinButton.js +11 -3
  14. package/lib/components/SpinButton/renderSpinButton.js.map +1 -1
  15. package/lib/components/SpinButton/useSpinButton.js +57 -56
  16. package/lib/components/SpinButton/useSpinButton.js.map +1 -1
  17. package/lib/components/SpinButton/useSpinButtonStyles.js +14 -14
  18. package/lib/components/SpinButton/useSpinButtonStyles.js.map +1 -1
  19. package/lib/components/SpinButtonField/SpinButtonField.js +3 -2
  20. package/lib/components/SpinButtonField/SpinButtonField.js.map +1 -1
  21. package/lib/components/SpinButtonField/index.js +1 -1
  22. package/lib/components/SpinButtonField/index.js.map +1 -1
  23. package/lib/index.js +2 -2
  24. package/lib/index.js.map +1 -1
  25. package/lib/utils/clamp.js +1 -1
  26. package/lib/utils/clamp.js.map +1 -1
  27. package/lib/utils/getBound.js +4 -4
  28. package/lib/utils/getBound.js.map +1 -1
  29. package/lib/utils/index.js +3 -3
  30. package/lib/utils/index.js.map +1 -1
  31. package/lib/utils/precision.js +7 -6
  32. package/lib/utils/precision.js.map +1 -1
  33. package/lib-commonjs/SpinButton.js +4 -5
  34. package/lib-commonjs/SpinButton.js.map +1 -1
  35. package/lib-commonjs/SpinButtonField.js +4 -5
  36. package/lib-commonjs/SpinButtonField.js.map +1 -1
  37. package/lib-commonjs/components/SpinButton/SpinButton.js +20 -19
  38. package/lib-commonjs/components/SpinButton/SpinButton.js.map +1 -1
  39. package/lib-commonjs/components/SpinButton/SpinButton.types.js +2 -5
  40. package/lib-commonjs/components/SpinButton/SpinButton.types.js.map +1 -1
  41. package/lib-commonjs/components/SpinButton/index.js +8 -9
  42. package/lib-commonjs/components/SpinButton/index.js.map +1 -1
  43. package/lib-commonjs/components/SpinButton/renderSpinButton.js +24 -13
  44. package/lib-commonjs/components/SpinButton/renderSpinButton.js.map +1 -1
  45. package/lib-commonjs/components/SpinButton/useSpinButton.js +259 -246
  46. package/lib-commonjs/components/SpinButton/useSpinButton.js.map +1 -1
  47. package/lib-commonjs/components/SpinButton/useSpinButtonStyles.js +246 -506
  48. package/lib-commonjs/components/SpinButton/useSpinButtonStyles.js.map +1 -1
  49. package/lib-commonjs/components/SpinButtonField/SpinButtonField.js +11 -17
  50. package/lib-commonjs/components/SpinButtonField/SpinButtonField.js.map +1 -1
  51. package/lib-commonjs/components/SpinButtonField/index.js +4 -5
  52. package/lib-commonjs/components/SpinButtonField/index.js.map +1 -1
  53. package/lib-commonjs/index.js +49 -21
  54. package/lib-commonjs/index.js.map +1 -1
  55. package/lib-commonjs/utils/clamp.js +21 -28
  56. package/lib-commonjs/utils/clamp.js.map +1 -1
  57. package/lib-commonjs/utils/getBound.js +14 -16
  58. package/lib-commonjs/utils/getBound.js.map +1 -1
  59. package/lib-commonjs/utils/index.js +6 -7
  60. package/lib-commonjs/utils/index.js.map +1 -1
  61. package/lib-commonjs/utils/precision.js +33 -33
  62. package/lib-commonjs/utils/precision.js.map +1 -1
  63. package/package.json +12 -11
  64. package/.swcrc +0 -39
package/CHANGELOG.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@fluentui/react-spinbutton",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 17 Mar 2023 15:00:04 GMT",
6
- "tag": "@fluentui/react-spinbutton_v0.0.0-nightly-20230317-1454.1",
7
- "version": "0.0.0-nightly-20230317-1454.1",
5
+ "date": "Tue, 21 Mar 2023 04:49:43 GMT",
6
+ "tag": "@fluentui/react-spinbutton_v0.0.0-nightly-20230321-0440.1",
7
+ "version": "0.0.0-nightly-20230321-0440.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
@@ -16,44 +16,44 @@
16
16
  {
17
17
  "author": "beachball",
18
18
  "package": "@fluentui/react-spinbutton",
19
- "comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230317-1454.1",
20
- "commit": "636275472966fa37b1efc14ac2e70ad32bd39b86"
19
+ "comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230321-0440.1",
20
+ "commit": "e913db5700c77cb74564f4422c775d52ef302e91"
21
21
  },
22
22
  {
23
23
  "author": "beachball",
24
24
  "package": "@fluentui/react-spinbutton",
25
- "comment": "Bump @fluentui/react-field to v0.0.0-nightly-20230317-1454.1",
26
- "commit": "636275472966fa37b1efc14ac2e70ad32bd39b86"
25
+ "comment": "Bump @fluentui/react-field to v0.0.0-nightly-20230321-0440.1",
26
+ "commit": "e913db5700c77cb74564f4422c775d52ef302e91"
27
27
  },
28
28
  {
29
29
  "author": "beachball",
30
30
  "package": "@fluentui/react-spinbutton",
31
- "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230317-1454.1",
32
- "commit": "636275472966fa37b1efc14ac2e70ad32bd39b86"
31
+ "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230321-0440.1",
32
+ "commit": "e913db5700c77cb74564f4422c775d52ef302e91"
33
33
  },
34
34
  {
35
35
  "author": "beachball",
36
36
  "package": "@fluentui/react-spinbutton",
37
- "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230317-1454.1",
38
- "commit": "636275472966fa37b1efc14ac2e70ad32bd39b86"
37
+ "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230321-0440.1",
38
+ "commit": "e913db5700c77cb74564f4422c775d52ef302e91"
39
39
  },
40
40
  {
41
41
  "author": "beachball",
42
42
  "package": "@fluentui/react-spinbutton",
43
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230317-1454.1",
44
- "commit": "636275472966fa37b1efc14ac2e70ad32bd39b86"
43
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230321-0440.1",
44
+ "commit": "e913db5700c77cb74564f4422c775d52ef302e91"
45
45
  },
46
46
  {
47
47
  "author": "beachball",
48
48
  "package": "@fluentui/react-spinbutton",
49
- "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230317-1454.1",
50
- "commit": "636275472966fa37b1efc14ac2e70ad32bd39b86"
49
+ "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230321-0440.1",
50
+ "commit": "e913db5700c77cb74564f4422c775d52ef302e91"
51
51
  },
52
52
  {
53
53
  "author": "beachball",
54
54
  "package": "@fluentui/react-spinbutton",
55
- "comment": "Bump @fluentui/react-label to v0.0.0-nightly-20230317-1454.1",
56
- "commit": "636275472966fa37b1efc14ac2e70ad32bd39b86"
55
+ "comment": "Bump @fluentui/react-label to v0.0.0-nightly-20230321-0440.1",
56
+ "commit": "e913db5700c77cb74564f4422c775d52ef302e91"
57
57
  }
58
58
  ]
59
59
  }
package/CHANGELOG.md CHANGED
@@ -1,24 +1,24 @@
1
1
  # Change Log - @fluentui/react-spinbutton
2
2
 
3
- This log was last generated on Fri, 17 Mar 2023 15:00:04 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 21 Mar 2023 04:49:43 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20230317-1454.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinbutton_v0.0.0-nightly-20230317-1454.1)
7
+ ## [0.0.0-nightly-20230321-0440.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinbutton_v0.0.0-nightly-20230321-0440.1)
8
8
 
9
- Fri, 17 Mar 2023 15:00:04 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinbutton_v9.2.4..@fluentui/react-spinbutton_v0.0.0-nightly-20230317-1454.1)
9
+ Tue, 21 Mar 2023 04:49:43 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinbutton_v9.2.4..@fluentui/react-spinbutton_v0.0.0-nightly-20230321-0440.1)
11
11
 
12
12
  ### Changes
13
13
 
14
14
  - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
- - Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230317-1454.1 ([commit](https://github.com/microsoft/fluentui/commit/636275472966fa37b1efc14ac2e70ad32bd39b86) by beachball)
16
- - Bump @fluentui/react-field to v0.0.0-nightly-20230317-1454.1 ([commit](https://github.com/microsoft/fluentui/commit/636275472966fa37b1efc14ac2e70ad32bd39b86) by beachball)
17
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230317-1454.1 ([commit](https://github.com/microsoft/fluentui/commit/636275472966fa37b1efc14ac2e70ad32bd39b86) by beachball)
18
- - Bump @fluentui/react-theme to v0.0.0-nightly-20230317-1454.1 ([commit](https://github.com/microsoft/fluentui/commit/636275472966fa37b1efc14ac2e70ad32bd39b86) by beachball)
19
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20230317-1454.1 ([commit](https://github.com/microsoft/fluentui/commit/636275472966fa37b1efc14ac2e70ad32bd39b86) by beachball)
20
- - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230317-1454.1 ([commit](https://github.com/microsoft/fluentui/commit/636275472966fa37b1efc14ac2e70ad32bd39b86) by beachball)
21
- - Bump @fluentui/react-label to v0.0.0-nightly-20230317-1454.1 ([commit](https://github.com/microsoft/fluentui/commit/636275472966fa37b1efc14ac2e70ad32bd39b86) by beachball)
15
+ - Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230321-0440.1 ([commit](https://github.com/microsoft/fluentui/commit/e913db5700c77cb74564f4422c775d52ef302e91) by beachball)
16
+ - Bump @fluentui/react-field to v0.0.0-nightly-20230321-0440.1 ([commit](https://github.com/microsoft/fluentui/commit/e913db5700c77cb74564f4422c775d52ef302e91) by beachball)
17
+ - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230321-0440.1 ([commit](https://github.com/microsoft/fluentui/commit/e913db5700c77cb74564f4422c775d52ef302e91) by beachball)
18
+ - Bump @fluentui/react-theme to v0.0.0-nightly-20230321-0440.1 ([commit](https://github.com/microsoft/fluentui/commit/e913db5700c77cb74564f4422c775d52ef302e91) by beachball)
19
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20230321-0440.1 ([commit](https://github.com/microsoft/fluentui/commit/e913db5700c77cb74564f4422c775d52ef302e91) by beachball)
20
+ - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230321-0440.1 ([commit](https://github.com/microsoft/fluentui/commit/e913db5700c77cb74564f4422c775d52ef302e91) by beachball)
21
+ - Bump @fluentui/react-label to v0.0.0-nightly-20230321-0440.1 ([commit](https://github.com/microsoft/fluentui/commit/e913db5700c77cb74564f4422c775d52ef302e91) by beachball)
22
22
 
23
23
  ## [9.2.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinbutton_v9.2.4)
24
24
 
package/lib/SpinButton.js CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./components/SpinButton/index";
1
+ export * from './components/SpinButton/index';
2
2
  //# sourceMappingURL=SpinButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../src/SpinButton.ts"],"sourcesContent":["export * from './components/SpinButton/index';\n"],"mappings":"AAAA,cAAc"}
1
+ {"version":3,"file":"SpinButton.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-spinbutton/src/SpinButton.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC","sourcesContent":["export * from './components/SpinButton/index';\n"]}
@@ -1,2 +1,2 @@
1
- export * from "./components/SpinButtonField/index";
1
+ export * from './components/SpinButtonField/index';
2
2
  //# sourceMappingURL=SpinButtonField.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../src/SpinButtonField.ts"],"sourcesContent":["export * from './components/SpinButtonField/index';\n"],"mappings":"AAAA,cAAc"}
1
+ {"version":3,"file":"SpinButtonField.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-spinbutton/src/SpinButtonField.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC","sourcesContent":["export * from './components/SpinButtonField/index';\n"]}
@@ -1,8 +1,8 @@
1
- import * as React from "react";
2
- import { useSpinButton_unstable } from "./useSpinButton";
3
- import { renderSpinButton_unstable } from "./renderSpinButton";
4
- import { useSpinButtonStyles_unstable } from "./useSpinButtonStyles";
5
- import { useCustomStyleHooks_unstable } from "@fluentui/react-shared-contexts";
1
+ import * as React from 'react';
2
+ import { useSpinButton_unstable } from './useSpinButton';
3
+ import { renderSpinButton_unstable } from './renderSpinButton';
4
+ import { useSpinButtonStyles_unstable } from './useSpinButtonStyles';
5
+ import { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';
6
6
  /**
7
7
  * A SpinButton allows someone to incrementally adjust a value in small steps.
8
8
  */
@@ -15,5 +15,5 @@ export const SpinButton = /*#__PURE__*/React.forwardRef((props, ref) => {
15
15
  useCustomStyles(state);
16
16
  return renderSpinButton_unstable(state);
17
17
  });
18
- SpinButton.displayName = "SpinButton";
18
+ SpinButton.displayName = 'SpinButton';
19
19
  //# sourceMappingURL=SpinButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useSpinButton_unstable","renderSpinButton_unstable","useSpinButtonStyles_unstable","useCustomStyleHooks_unstable","SpinButton","forwardRef","props","ref","state","useCustomStyles","displayName"],"sources":["../../../src/components/SpinButton/SpinButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useSpinButton_unstable } from './useSpinButton';\nimport { renderSpinButton_unstable } from './renderSpinButton';\nimport { useSpinButtonStyles_unstable } from './useSpinButtonStyles';\nimport type { SpinButtonProps } from './SpinButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A SpinButton allows someone to incrementally adjust a value in small steps.\n */\nexport const SpinButton: ForwardRefComponent<SpinButtonProps> = React.forwardRef((props, ref) => {\n const state = useSpinButton_unstable(props, ref);\n\n useSpinButtonStyles_unstable(state);\n\n const { useSpinButtonStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderSpinButton_unstable(state);\n});\n\nSpinButton.displayName = 'SpinButton';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,sBAAsB,QAAQ;AACvC,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,4BAA4B,QAAQ;AAG7C,SAASC,4BAA4B,QAAQ;AAE7C;;;AAGA,OAAO,MAAMC,UAAA,gBAAmDL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EAC/F,MAAMC,KAAA,GAAQR,sBAAA,CAAuBM,KAAA,EAAOC,GAAA;EAE5CL,4BAAA,CAA6BM,KAAA;EAE7B,MAAM;IAAEN,4BAAA,EAA8BO;EAAe,CAAE,GAAGN,4BAAA;EAC1DM,eAAA,CAAgBD,KAAA;EAEhB,OAAOP,yBAAA,CAA0BO,KAAA;AACnC;AAEAJ,UAAA,CAAWM,WAAW,GAAG"}
1
+ {"version":3,"names":["React","useSpinButton_unstable","renderSpinButton_unstable","useSpinButtonStyles_unstable","useCustomStyleHooks_unstable","SpinButton","forwardRef","props","ref","state","useCustomStyles","displayName"],"sources":["../../../../../../../../../packages/react-components/react-spinbutton/src/components/SpinButton/SpinButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useSpinButton_unstable } from './useSpinButton';\nimport { renderSpinButton_unstable } from './renderSpinButton';\nimport { useSpinButtonStyles_unstable } from './useSpinButtonStyles';\nimport type { SpinButtonProps } from './SpinButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A SpinButton allows someone to incrementally adjust a value in small steps.\n */\nexport const SpinButton: ForwardRefComponent<SpinButtonProps> = React.forwardRef((props, ref) => {\n const state = useSpinButton_unstable(props, ref);\n\n useSpinButtonStyles_unstable(state);\n\n const { useSpinButtonStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderSpinButton_unstable(state);\n});\n\nSpinButton.displayName = 'SpinButton';\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,sBAAsB,QAAQ,iBAAiB;AACxD,SAASC,yBAAyB,QAAQ,oBAAoB;AAC9D,SAASC,4BAA4B,QAAQ,uBAAuB;AAGpE,SAASC,4BAA4B,QAAQ,iCAAiC;AAE9E;;;AAGA,OAAO,MAAMC,UAAU,gBAAyCL,KAAK,CAACM,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC9F,MAAMC,KAAK,GAAGR,sBAAsB,CAACM,KAAK,EAAEC,GAAG,CAAC;EAEhDL,4BAA4B,CAACM,KAAK,CAAC;EAEnC,MAAM;IAAEN,4BAA4B,EAAEO;EAAe,CAAE,GAAGN,4BAA4B,EAAE;EACxFM,eAAe,CAACD,KAAK,CAAC;EAEtB,OAAOP,yBAAyB,CAACO,KAAK,CAAC;AACzC,CAAC,CAAC;AAEFJ,UAAU,CAACM,WAAW,GAAG,YAAY"}
@@ -1,2 +1,2 @@
1
- import * as React from "react";
1
+ export {};
2
2
  //# sourceMappingURL=SpinButton.types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React"],"sources":["../../../src/components/SpinButton/SpinButton.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nexport type SpinButtonSlots = {\n /**\n * The root element of SpinButton is a container `<div>`.\n * The root slot receives the `className` and `style` specified on the `<SpinButton>`.\n * All other native props are applied to the primary slot: `input`.\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * Input that displays the current value and accepts direct input from the user.\n * Displayed value is formatted.\n *\n * This is the primary slot.\n */\n input: NonNullable<Slot<'input'>>;\n\n /**\n * Renders the increment control.\n */\n incrementButton: NonNullable<Slot<'button'>>;\n\n /**\n * Renders the decrement control.\n */\n decrementButton: NonNullable<Slot<'button'>>;\n};\n\n/**\n * SpinButton Props\n */\nexport type SpinButtonProps = Omit<\n ComponentProps<Partial<SpinButtonSlots>, 'input'>,\n 'defaultValue' | 'onChange' | 'size' | 'value'\n> & {\n /**\n * Controls the colors and borders of the input.\n * @default 'outline'\n */\n appearance?: 'outline' | 'underline' | 'filled-darker' | 'filled-lighter';\n\n /**\n * Initial value of the control (assumed to be valid). Updates to this prop will not be respected.\n *\n * Use this if you intend for the SpinButton to be an uncontrolled component which maintains its\n * own value. For a controlled component, use `value` instead. (Mutually exclusive with `value`.)\n *\n * Use `null` to indicate the control has no value.\n */\n defaultValue?: number | null;\n\n /**\n * String representation of `value`.\n *\n * Use this when displaying the value to users as something other than a plain number.\n * For example, when displaying currency values this might be \"$1.00\" when value is `1`.\n *\n * Only provide this if the SpinButton is a controlled component where you are maintaining its\n * current state and passing updates based on change events. When SpinButton is used as an\n * uncontrolled component this prop is ignored.\n */\n displayValue?: string;\n\n /**\n * Max value of the control. If not provided, the control has no maximum value.\n */\n max?: number;\n\n /**\n * Min value of the control. If not provided, the control has no minimum value.\n */\n min?: number;\n\n /**\n * Callback for when the committed value changes.\n * - User presses the up/down buttons (on single press or every spin)\n * - User presses the up/down arrow keys (on single press or every spin)\n * - User *commits* edits to the input text by focusing away (blurring) or pressing enter.\n * Note that this is NOT called for every key press while the user is editing.\n */\n onChange?: (event: SpinButtonChangeEvent, data: SpinButtonOnChangeData) => void;\n\n /**\n * How many decimal places the value should be rounded to.\n *\n * The default is calculated based on the precision of `step`: i.e. if step = 1, precision = 0.\n * step = 0.0089, precision = 4. step = 300, precision = 2. step = 23.00, precision = 2.\n */\n precision?: number;\n\n /**\n * Size of the input.\n * @default 'medium'\n */\n size?: 'small' | 'medium';\n\n /**\n * Difference between two adjacent values of the control.\n * This value is used to calculate the precision of the input if no `precision` is given.\n * The precision calculated this way will always be greater than or equal 0.\n * @default 1\n */\n step?: number;\n\n /**\n * Large difference between two values. This should be greater than `step` and is used\n * when users hit the Page Up or Page Down keys.\n * @default 1\n */\n stepPage?: number;\n\n /**\n * Current value of the control (assumed to be valid).\n *\n * Only provide this if the SpinButton is a controlled component where you are maintaining its\n * current state and passing updates based on change events; otherwise, use the `defaultValue`\n * property.\n *\n * Use `null` to indicate the control has no value.\n *\n * Mutually exclusive with `defaultValue`.\n */\n value?: number | null;\n};\n\n/**\n * State used in rendering SpinButton\n */\nexport type SpinButtonState = ComponentState<SpinButtonSlots> &\n Required<Pick<SpinButtonProps, 'appearance' | 'size'>> & {\n /**\n * State used to track which direction, if any, SpinButton is currently spinning.\n * @default 'rest'\n */\n spinState: SpinButtonSpinState;\n\n /**\n * State used to track if the value is at the range bounds of [min-max].\n * @default 'none'\n */\n atBound: SpinButtonBounds;\n };\n\nexport type SpinButtonChangeEvent =\n | React.MouseEvent<HTMLButtonElement>\n | React.ChangeEvent<HTMLElement>\n | React.FocusEvent<HTMLInputElement>\n | React.KeyboardEvent<HTMLInputElement>;\n\nexport type SpinButtonOnChangeData = {\n value?: number | null;\n displayValue?: string;\n};\n\nexport type SpinButtonSpinState = 'rest' | 'up' | 'down';\nexport type SpinButtonBounds = 'none' | 'min' | 'max' | 'both';\n"],"mappings":"AACA,YAAYA,KAAA,MAAW"}
1
+ {"version":3,"file":"SpinButton.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-spinbutton/src/components/SpinButton/SpinButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nexport type SpinButtonSlots = {\n /**\n * The root element of SpinButton is a container `<div>`.\n * The root slot receives the `className` and `style` specified on the `<SpinButton>`.\n * All other native props are applied to the primary slot: `input`.\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * Input that displays the current value and accepts direct input from the user.\n * Displayed value is formatted.\n *\n * This is the primary slot.\n */\n input: NonNullable<Slot<'input'>>;\n\n /**\n * Renders the increment control.\n */\n incrementButton: NonNullable<Slot<'button'>>;\n\n /**\n * Renders the decrement control.\n */\n decrementButton: NonNullable<Slot<'button'>>;\n};\n\n/**\n * SpinButton Props\n */\nexport type SpinButtonProps = Omit<\n ComponentProps<Partial<SpinButtonSlots>, 'input'>,\n 'defaultValue' | 'onChange' | 'size' | 'value'\n> & {\n /**\n * Controls the colors and borders of the input.\n * @default 'outline'\n */\n appearance?: 'outline' | 'underline' | 'filled-darker' | 'filled-lighter';\n\n /**\n * Initial value of the control (assumed to be valid). Updates to this prop will not be respected.\n *\n * Use this if you intend for the SpinButton to be an uncontrolled component which maintains its\n * own value. For a controlled component, use `value` instead. (Mutually exclusive with `value`.)\n *\n * Use `null` to indicate the control has no value.\n */\n defaultValue?: number | null;\n\n /**\n * String representation of `value`.\n *\n * Use this when displaying the value to users as something other than a plain number.\n * For example, when displaying currency values this might be \"$1.00\" when value is `1`.\n *\n * Only provide this if the SpinButton is a controlled component where you are maintaining its\n * current state and passing updates based on change events. When SpinButton is used as an\n * uncontrolled component this prop is ignored.\n */\n displayValue?: string;\n\n /**\n * Max value of the control. If not provided, the control has no maximum value.\n */\n max?: number;\n\n /**\n * Min value of the control. If not provided, the control has no minimum value.\n */\n min?: number;\n\n /**\n * Callback for when the committed value changes.\n * - User presses the up/down buttons (on single press or every spin)\n * - User presses the up/down arrow keys (on single press or every spin)\n * - User *commits* edits to the input text by focusing away (blurring) or pressing enter.\n * Note that this is NOT called for every key press while the user is editing.\n */\n onChange?: (event: SpinButtonChangeEvent, data: SpinButtonOnChangeData) => void;\n\n /**\n * How many decimal places the value should be rounded to.\n *\n * The default is calculated based on the precision of `step`: i.e. if step = 1, precision = 0.\n * step = 0.0089, precision = 4. step = 300, precision = 2. step = 23.00, precision = 2.\n */\n precision?: number;\n\n /**\n * Size of the input.\n * @default 'medium'\n */\n size?: 'small' | 'medium';\n\n /**\n * Difference between two adjacent values of the control.\n * This value is used to calculate the precision of the input if no `precision` is given.\n * The precision calculated this way will always be greater than or equal 0.\n * @default 1\n */\n step?: number;\n\n /**\n * Large difference between two values. This should be greater than `step` and is used\n * when users hit the Page Up or Page Down keys.\n * @default 1\n */\n stepPage?: number;\n\n /**\n * Current value of the control (assumed to be valid).\n *\n * Only provide this if the SpinButton is a controlled component where you are maintaining its\n * current state and passing updates based on change events; otherwise, use the `defaultValue`\n * property.\n *\n * Use `null` to indicate the control has no value.\n *\n * Mutually exclusive with `defaultValue`.\n */\n value?: number | null;\n};\n\n/**\n * State used in rendering SpinButton\n */\nexport type SpinButtonState = ComponentState<SpinButtonSlots> &\n Required<Pick<SpinButtonProps, 'appearance' | 'size'>> & {\n /**\n * State used to track which direction, if any, SpinButton is currently spinning.\n * @default 'rest'\n */\n spinState: SpinButtonSpinState;\n\n /**\n * State used to track if the value is at the range bounds of [min-max].\n * @default 'none'\n */\n atBound: SpinButtonBounds;\n };\n\nexport type SpinButtonChangeEvent =\n | React.MouseEvent<HTMLButtonElement>\n | React.ChangeEvent<HTMLElement>\n | React.FocusEvent<HTMLInputElement>\n | React.KeyboardEvent<HTMLInputElement>;\n\nexport type SpinButtonOnChangeData = {\n value?: number | null;\n displayValue?: string;\n};\n\nexport type SpinButtonSpinState = 'rest' | 'up' | 'down';\nexport type SpinButtonBounds = 'none' | 'min' | 'max' | 'both';\n"]}
@@ -1,6 +1,6 @@
1
- export * from "./SpinButton";
2
- export * from "./SpinButton.types";
3
- export * from "./renderSpinButton";
4
- export * from "./useSpinButton";
5
- export * from "./useSpinButtonStyles";
1
+ export * from './SpinButton';
2
+ export * from './SpinButton.types';
3
+ export * from './renderSpinButton';
4
+ export * from './useSpinButton';
5
+ export * from './useSpinButtonStyles';
6
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/components/SpinButton/index.ts"],"sourcesContent":["export * from './SpinButton';\nexport * from './SpinButton.types';\nexport * from './renderSpinButton';\nexport * from './useSpinButton';\nexport * from './useSpinButtonStyles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-spinbutton/src/components/SpinButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './SpinButton';\nexport * from './SpinButton.types';\nexport * from './renderSpinButton';\nexport * from './useSpinButton';\nexport * from './useSpinButtonStyles';\n"]}
@@ -1,5 +1,5 @@
1
- import * as React from "react";
2
- import { getSlots } from "@fluentui/react-utilities";
1
+ import * as React from 'react';
2
+ import { getSlots } from '@fluentui/react-utilities';
3
3
  /**
4
4
  * Render the final JSX of SpinButton
5
5
  */
@@ -8,6 +8,14 @@ export const renderSpinButton_unstable = state => {
8
8
  slots,
9
9
  slotProps
10
10
  } = getSlots(state);
11
- return /*#__PURE__*/React.createElement(slots.root, slotProps.root, /*#__PURE__*/React.createElement(slots.input, slotProps.input), /*#__PURE__*/React.createElement(slots.incrementButton, slotProps.incrementButton), /*#__PURE__*/React.createElement(slots.decrementButton, slotProps.decrementButton));
11
+ return /*#__PURE__*/React.createElement(slots.root, {
12
+ ...slotProps.root
13
+ }, /*#__PURE__*/React.createElement(slots.input, {
14
+ ...slotProps.input
15
+ }), /*#__PURE__*/React.createElement(slots.incrementButton, {
16
+ ...slotProps.incrementButton
17
+ }), /*#__PURE__*/React.createElement(slots.decrementButton, {
18
+ ...slotProps.decrementButton
19
+ }));
12
20
  };
13
21
  //# sourceMappingURL=renderSpinButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","getSlots","renderSpinButton_unstable","state","slots","slotProps","createElement","root","input","incrementButton","decrementButton"],"sources":["../../../src/components/SpinButton/renderSpinButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { SpinButtonState, SpinButtonSlots } from './SpinButton.types';\n\n/**\n * Render the final JSX of SpinButton\n */\nexport const renderSpinButton_unstable = (state: SpinButtonState) => {\n const { slots, slotProps } = getSlots<SpinButtonSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.input {...slotProps.input} />\n <slots.incrementButton {...slotProps.incrementButton} />\n <slots.decrementButton {...slotProps.decrementButton} />\n </slots.root>\n );\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,QAAQ,QAAQ;AAGzB;;;AAGA,OAAO,MAAMC,yBAAA,GAA6BC,KAAA,IAA2B;EACnE,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGJ,QAAA,CAA0BE,KAAA;EAEvD,oBACEH,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMG,IAAI,EAAKF,SAAA,CAAUE,IAAI,eAC5BP,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMI,KAAK,EAAKH,SAAA,CAAUG,KAAK,gBAChCR,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMK,eAAe,EAAKJ,SAAA,CAAUI,eAAe,gBACpDT,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMM,eAAe,EAAKL,SAAA,CAAUK,eAAe;AAG1D"}
1
+ {"version":3,"names":["React","getSlots","renderSpinButton_unstable","state","slots","slotProps","createElement","root","input","incrementButton","decrementButton"],"sources":["../../../../../../../../../packages/react-components/react-spinbutton/src/components/SpinButton/renderSpinButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { SpinButtonState, SpinButtonSlots } from './SpinButton.types';\n\n/**\n * Render the final JSX of SpinButton\n */\nexport const renderSpinButton_unstable = (state: SpinButtonState) => {\n const { slots, slotProps } = getSlots<SpinButtonSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.input {...slotProps.input} />\n <slots.incrementButton {...slotProps.incrementButton} />\n <slots.decrementButton {...slotProps.decrementButton} />\n </slots.root>\n );\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,yBAAyB,GAAIC,KAAsB,IAAI;EAClE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAkBE,KAAK,CAAC;EAE7D,oBACEH,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACG,IAAI;IAAA,GAAKF,SAAS,CAACE;EAAI,gBAC5BP,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACI,KAAK;IAAA,GAAKH,SAAS,CAACG;EAAK,EAAI,eACpCR,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACK,eAAe;IAAA,GAAKJ,SAAS,CAACI;EAAe,EAAI,eACxDT,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACM,eAAe;IAAA,GAAKL,SAAS,CAACK;EAAe,EAAI,CAC7C;AAEjB,CAAC"}
@@ -1,9 +1,9 @@
1
- import * as React from "react";
2
- import { getPartitionedNativeProps, mergeCallbacks, resolveShorthand, useControllableState, useTimeout } from "@fluentui/react-utilities";
3
- import { ArrowUp, ArrowDown, End, Enter, Escape, Home, PageDown, PageUp } from "@fluentui/keyboard-keys";
4
- import { calculatePrecision, precisionRound, getBound, clamp } from "../../utils/index";
5
- import { ChevronUp16Regular, ChevronDown16Regular } from "@fluentui/react-icons";
6
- import { useOverrides_unstable as useOverrides } from "@fluentui/react-shared-contexts";
1
+ import * as React from 'react';
2
+ import { getPartitionedNativeProps, mergeCallbacks, resolveShorthand, useControllableState, useTimeout } from '@fluentui/react-utilities';
3
+ import { ArrowUp, ArrowDown, End, Enter, Escape, Home, PageDown, PageUp } from '@fluentui/keyboard-keys';
4
+ import { calculatePrecision, precisionRound, getBound, clamp } from '../../utils/index';
5
+ import { ChevronUp16Regular, ChevronDown16Regular } from '@fluentui/react-icons';
6
+ import { useOverrides_unstable as useOverrides } from '@fluentui/react-shared-contexts';
7
7
  const DEFAULT_SPIN_DELAY_MS = 150;
8
8
  const MIN_SPIN_DELAY_MS = 80;
9
9
  const MAX_SPIN_TIME_MS = 1000;
@@ -21,10 +21,11 @@ const lerp = (start, end, percent) => start + (end - start) * percent;
21
21
  * @param ref - reference to root HTMLElement of SpinButton
22
22
  */
23
23
  export const useSpinButton_unstable = (props, ref) => {
24
+ var _a, _b;
24
25
  const nativeProps = getPartitionedNativeProps({
25
26
  props,
26
- primarySlotTagName: "input",
27
- excludedPropNames: ["defaultValue", "max", "min", "onChange", "size", "value"]
27
+ primarySlotTagName: 'input',
28
+ excludedPropNames: ['defaultValue', 'max', 'min', 'onChange', 'size', 'value']
28
29
  });
29
30
  const overrides = useOverrides();
30
31
  const {
@@ -37,15 +38,15 @@ export const useSpinButton_unstable = (props, ref) => {
37
38
  stepPage = 1,
38
39
  precision: precisionFromProps,
39
40
  onChange,
40
- size = "medium",
41
- appearance = overrides.inputDefaultAppearance ?? "outline",
41
+ size = 'medium',
42
+ appearance = (_a = overrides.inputDefaultAppearance) !== null && _a !== void 0 ? _a : 'outline',
42
43
  root,
43
44
  input,
44
45
  incrementButton,
45
46
  decrementButton
46
47
  } = props;
47
48
  const precision = React.useMemo(() => {
48
- return precisionFromProps ?? Math.max(calculatePrecision(step), 0);
49
+ return precisionFromProps !== null && precisionFromProps !== void 0 ? precisionFromProps : Math.max(calculatePrecision(step), 0);
49
50
  }, [precisionFromProps, step]);
50
51
  const [currentValue, setCurrentValue] = useControllableState({
51
52
  state: value,
@@ -54,13 +55,13 @@ export const useSpinButton_unstable = (props, ref) => {
54
55
  });
55
56
  const isControlled = value !== undefined;
56
57
  const [textValue, setTextValue] = React.useState(undefined);
57
- const [keyboardSpinState, setKeyboardSpinState] = React.useState("rest");
58
+ const [keyboardSpinState, setKeyboardSpinState] = React.useState('rest');
58
59
  const internalState = React.useRef({
59
60
  value: currentValue,
60
- spinState: "rest",
61
+ spinState: 'rest',
61
62
  spinTime: 0,
62
63
  spinDelay: DEFAULT_SPIN_DELAY_MS,
63
- atBound: currentValue !== null ? getBound(precisionRound(currentValue, precision), min, max) : "none"
64
+ atBound: currentValue !== null ? getBound(precisionRound(currentValue, precision), min, max) : 'none'
64
65
  });
65
66
  const [setStepTimeout, clearStepTimeout] = useTimeout();
66
67
  const stepValue = (e, direction, startFrom) => {
@@ -72,8 +73,8 @@ export const useSpinButton_unstable = (props, ref) => {
72
73
  }
73
74
  }
74
75
  const val = startValue;
75
- const dir = direction === "up" || direction === "upPage" ? 1 : -1;
76
- const stepSize = direction === "upPage" || direction === "downPage" ? stepPage : step;
76
+ const dir = direction === 'up' || direction === 'upPage' ? 1 : -1;
77
+ const stepSize = direction === 'upPage' || direction === 'downPage' ? stepPage : step;
77
78
  if (val === null) {
78
79
  const stepStart = min === undefined ? 0 : min;
79
80
  const nullStep = clamp(stepStart + stepSize * dir, min, max);
@@ -85,7 +86,7 @@ export const useSpinButton_unstable = (props, ref) => {
85
86
  newValue = clamp(newValue, min, max);
86
87
  }
87
88
  commit(e, newValue);
88
- if (internalState.current.spinState !== "rest") {
89
+ if (internalState.current.spinState !== 'rest') {
89
90
  setStepTimeout(() => {
90
91
  // Ease the step speed a bit
91
92
  internalState.current.spinTime += internalState.current.spinDelay;
@@ -96,22 +97,22 @@ export const useSpinButton_unstable = (props, ref) => {
96
97
  };
97
98
  const handleInputChange = e => {
98
99
  if (!internalState.current.previousTextValue) {
99
- internalState.current.previousTextValue = textValue ?? String(currentValue);
100
+ internalState.current.previousTextValue = textValue !== null && textValue !== void 0 ? textValue : String(currentValue);
100
101
  }
101
102
  const newValue = e.target.value;
102
103
  setTextValue(newValue);
103
104
  };
104
105
  const handleIncrementMouseDown = e => {
105
- internalState.current.spinState = "up";
106
- stepValue(e, "up");
106
+ internalState.current.spinState = 'up';
107
+ stepValue(e, 'up');
107
108
  };
108
109
  const handleDecrementMouseDown = e => {
109
- internalState.current.spinState = "down";
110
- stepValue(e, "down");
110
+ internalState.current.spinState = 'down';
111
+ stepValue(e, 'down');
111
112
  };
112
113
  const handleStepMouseUpOrLeave = e => {
113
114
  clearStepTimeout();
114
- internalState.current.spinState = "rest";
115
+ internalState.current.spinState = 'rest';
115
116
  internalState.current.spinDelay = DEFAULT_SPIN_DELAY_MS;
116
117
  internalState.current.spinTime = 0;
117
118
  };
@@ -120,27 +121,27 @@ export const useSpinButton_unstable = (props, ref) => {
120
121
  internalState.current.previousTextValue = undefined;
121
122
  };
122
123
  const handleKeyDown = e => {
123
- let nextKeyboardSpinState = "rest";
124
+ let nextKeyboardSpinState = 'rest';
124
125
  if (e.key === ArrowUp) {
125
- stepValue(e, "up", textValue);
126
- nextKeyboardSpinState = "up";
126
+ stepValue(e, 'up', textValue);
127
+ nextKeyboardSpinState = 'up';
127
128
  } else if (e.key === ArrowDown) {
128
- stepValue(e, "down", textValue);
129
- nextKeyboardSpinState = "down";
129
+ stepValue(e, 'down', textValue);
130
+ nextKeyboardSpinState = 'down';
130
131
  } else if (e.key === PageUp) {
131
132
  e.preventDefault();
132
- stepValue(e, "upPage", textValue);
133
- nextKeyboardSpinState = "up";
133
+ stepValue(e, 'upPage', textValue);
134
+ nextKeyboardSpinState = 'up';
134
135
  } else if (e.key === PageDown) {
135
136
  e.preventDefault();
136
- stepValue(e, "downPage", textValue);
137
- nextKeyboardSpinState = "down";
137
+ stepValue(e, 'downPage', textValue);
138
+ nextKeyboardSpinState = 'down';
138
139
  } else if (!e.shiftKey && e.key === Home && min !== undefined) {
139
140
  commit(e, min);
140
- nextKeyboardSpinState = "down";
141
+ nextKeyboardSpinState = 'down';
141
142
  } else if (!e.shiftKey && e.key === End && max !== undefined) {
142
143
  commit(e, max);
143
- nextKeyboardSpinState = "up";
144
+ nextKeyboardSpinState = 'up';
144
145
  } else if (e.key === Enter) {
145
146
  commit(e, currentValue, textValue);
146
147
  internalState.current.previousTextValue = undefined;
@@ -155,9 +156,9 @@ export const useSpinButton_unstable = (props, ref) => {
155
156
  }
156
157
  };
157
158
  const handleKeyUp = e => {
158
- if (keyboardSpinState !== "rest") {
159
- setKeyboardSpinState("rest");
160
- internalState.current.spinState = "rest";
159
+ if (keyboardSpinState !== 'rest') {
160
+ setKeyboardSpinState('rest');
161
+ internalState.current.spinState = 'rest';
161
162
  }
162
163
  };
163
164
  const commit = (e, newValue, newDisplayValue) => {
@@ -174,7 +175,7 @@ export const useSpinButton_unstable = (props, ref) => {
174
175
  }
175
176
  }
176
177
  if (valueChanged || displayValueChanged) {
177
- onChange?.(e, {
178
+ onChange === null || onChange === void 0 ? void 0 : onChange(e, {
178
179
  value: roundedValue,
179
180
  displayValue: newDisplayValue
180
181
  });
@@ -187,10 +188,10 @@ export const useSpinButton_unstable = (props, ref) => {
187
188
  spinState: keyboardSpinState,
188
189
  atBound: internalState.current.atBound,
189
190
  components: {
190
- root: "span",
191
- input: "input",
192
- incrementButton: "button",
193
- decrementButton: "button"
191
+ root: 'span',
192
+ input: 'input',
193
+ incrementButton: 'button',
194
+ decrementButton: 'button'
194
195
  },
195
196
  root: resolveShorthand(root, {
196
197
  required: true,
@@ -200,10 +201,10 @@ export const useSpinButton_unstable = (props, ref) => {
200
201
  required: true,
201
202
  defaultProps: {
202
203
  ref,
203
- autoComplete: "off",
204
- role: "spinbutton",
204
+ autoComplete: 'off',
205
+ role: 'spinbutton',
205
206
  appearance,
206
- type: "text",
207
+ type: 'text',
207
208
  ...nativeProps.primary
208
209
  }
209
210
  }),
@@ -213,8 +214,8 @@ export const useSpinButton_unstable = (props, ref) => {
213
214
  tabIndex: -1,
214
215
  children: /*#__PURE__*/React.createElement(ChevronUp16Regular, null),
215
216
  disabled: nativeProps.primary.disabled,
216
- "aria-label": "Increment value",
217
- type: "button"
217
+ 'aria-label': 'Increment value',
218
+ type: 'button'
218
219
  }
219
220
  }),
220
221
  decrementButton: resolveShorthand(decrementButton, {
@@ -223,8 +224,8 @@ export const useSpinButton_unstable = (props, ref) => {
223
224
  tabIndex: -1,
224
225
  children: /*#__PURE__*/React.createElement(ChevronDown16Regular, null),
225
226
  disabled: nativeProps.primary.disabled,
226
- "aria-label": "Decrement value",
227
- type: "button"
227
+ 'aria-label': 'Decrement value',
228
+ type: 'button'
228
229
  }
229
230
  })
230
231
  };
@@ -232,24 +233,24 @@ export const useSpinButton_unstable = (props, ref) => {
232
233
  if (textValue !== undefined) {
233
234
  valueToDisplay = textValue;
234
235
  } else if (value === null || currentValue === null) {
235
- valueToDisplay = displayValue ?? "";
236
+ valueToDisplay = displayValue !== null && displayValue !== void 0 ? displayValue : '';
236
237
  internalState.current.value = null;
237
- internalState.current.atBound = "none";
238
+ internalState.current.atBound = 'none';
238
239
  } else {
239
240
  const roundedValue = precisionRound(currentValue, precision);
240
241
  internalState.current.value = roundedValue;
241
242
  internalState.current.atBound = getBound(roundedValue, min, max);
242
243
  if (isControlled) {
243
- valueToDisplay = displayValue ?? String(roundedValue);
244
+ valueToDisplay = displayValue !== null && displayValue !== void 0 ? displayValue : String(roundedValue);
244
245
  } else {
245
246
  valueToDisplay = String(roundedValue);
246
247
  }
247
248
  }
248
249
  state.input.value = valueToDisplay;
249
- state.input["aria-valuemin"] = min;
250
- state.input["aria-valuemax"] = max;
251
- state.input["aria-valuenow"] = currentValue ?? undefined;
252
- state.input["aria-valuetext"] = state.input["aria-valuetext"] ?? (value !== undefined && displayValue || undefined);
250
+ state.input['aria-valuemin'] = min;
251
+ state.input['aria-valuemax'] = max;
252
+ state.input['aria-valuenow'] = currentValue !== null && currentValue !== void 0 ? currentValue : undefined;
253
+ state.input['aria-valuetext'] = (_b = state.input['aria-valuetext']) !== null && _b !== void 0 ? _b : value !== undefined && displayValue || undefined;
253
254
  state.input.onChange = mergeCallbacks(state.input.onChange, handleInputChange);
254
255
  state.input.onBlur = mergeCallbacks(state.input.onBlur, handleBlur);
255
256
  state.input.onKeyDown = mergeCallbacks(state.input.onKeyDown, handleKeyDown);