@fluentui/react-spinbutton 9.2.15 → 9.2.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. package/CHANGELOG.json +103 -1
  2. package/CHANGELOG.md +32 -2
  3. package/lib/SpinButton.js +0 -1
  4. package/lib/SpinButton.js.map +1 -1
  5. package/lib/components/SpinButton/SpinButton.js +5 -7
  6. package/lib/components/SpinButton/SpinButton.js.map +1 -1
  7. package/lib/components/SpinButton/SpinButton.types.js +0 -1
  8. package/lib/components/SpinButton/SpinButton.types.js.map +1 -1
  9. package/lib/components/SpinButton/index.js +0 -1
  10. package/lib/components/SpinButton/index.js.map +1 -1
  11. package/lib/components/SpinButton/renderSpinButton.js +4 -9
  12. package/lib/components/SpinButton/renderSpinButton.js.map +1 -1
  13. package/lib/components/SpinButton/useSpinButton.js +239 -247
  14. package/lib/components/SpinButton/useSpinButton.js.map +1 -1
  15. package/lib/components/SpinButton/useSpinButtonStyles.styles.js.map +1 -1
  16. package/lib/index.js +0 -1
  17. package/lib/index.js.map +1 -1
  18. package/lib/utils/clamp.js +21 -17
  19. package/lib/utils/clamp.js.map +1 -1
  20. package/lib/utils/getBound.js +9 -10
  21. package/lib/utils/getBound.js.map +1 -1
  22. package/lib/utils/index.js +0 -1
  23. package/lib/utils/index.js.map +1 -1
  24. package/lib/utils/precision.js +19 -22
  25. package/lib/utils/precision.js.map +1 -1
  26. package/lib-commonjs/SpinButton.js +0 -3
  27. package/lib-commonjs/SpinButton.js.map +1 -1
  28. package/lib-commonjs/components/SpinButton/SpinButton.js +1 -3
  29. package/lib-commonjs/components/SpinButton/SpinButton.js.map +1 -1
  30. package/lib-commonjs/components/SpinButton/SpinButton.types.js +0 -3
  31. package/lib-commonjs/components/SpinButton/SpinButton.types.js.map +1 -1
  32. package/lib-commonjs/components/SpinButton/index.js +0 -3
  33. package/lib-commonjs/components/SpinButton/index.js.map +1 -1
  34. package/lib-commonjs/components/SpinButton/renderSpinButton.js +1 -3
  35. package/lib-commonjs/components/SpinButton/renderSpinButton.js.map +1 -1
  36. package/lib-commonjs/components/SpinButton/useSpinButton.js +1 -3
  37. package/lib-commonjs/components/SpinButton/useSpinButton.js.map +1 -1
  38. package/lib-commonjs/components/SpinButton/useSpinButtonStyles.styles.js +0 -2
  39. package/lib-commonjs/components/SpinButton/useSpinButtonStyles.styles.js.map +1 -1
  40. package/lib-commonjs/index.js +0 -3
  41. package/lib-commonjs/index.js.map +1 -1
  42. package/lib-commonjs/utils/clamp.js +1 -3
  43. package/lib-commonjs/utils/clamp.js.map +1 -1
  44. package/lib-commonjs/utils/getBound.js +1 -3
  45. package/lib-commonjs/utils/getBound.js.map +1 -1
  46. package/lib-commonjs/utils/index.js +0 -3
  47. package/lib-commonjs/utils/index.js.map +1 -1
  48. package/lib-commonjs/utils/precision.js +6 -8
  49. package/lib-commonjs/utils/precision.js.map +1 -1
  50. package/package.json +10 -10
package/CHANGELOG.json CHANGED
@@ -2,7 +2,109 @@
2
2
  "name": "@fluentui/react-spinbutton",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 25 May 2023 09:57:45 GMT",
5
+ "date": "Tue, 20 Jun 2023 12:34:47 GMT",
6
+ "tag": "@fluentui/react-spinbutton_v9.2.17",
7
+ "version": "9.2.17",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "ololubek@microsoft.com",
12
+ "package": "@fluentui/react-spinbutton",
13
+ "commit": "8a5ae3aa00faa327c58887a99a5698b18f2930ee",
14
+ "comment": "chore: update @fluentui/react-icons to 2.0.203"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-spinbutton",
19
+ "comment": "Bump @fluentui/react-field to v9.1.7",
20
+ "commit": "81c9b35e0830297b2aca2cece2ae67b3899c4647"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-spinbutton",
25
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.7",
26
+ "commit": "81c9b35e0830297b2aca2cece2ae67b3899c4647"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-spinbutton",
31
+ "comment": "Bump @fluentui/react-shared-contexts to v9.5.1",
32
+ "commit": "81c9b35e0830297b2aca2cece2ae67b3899c4647"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-spinbutton",
37
+ "comment": "Bump @fluentui/react-theme to v9.1.9",
38
+ "commit": "81c9b35e0830297b2aca2cece2ae67b3899c4647"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui/react-spinbutton",
43
+ "comment": "Bump @fluentui/react-utilities to v9.9.3",
44
+ "commit": "81c9b35e0830297b2aca2cece2ae67b3899c4647"
45
+ },
46
+ {
47
+ "author": "beachball",
48
+ "package": "@fluentui/react-spinbutton",
49
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.23",
50
+ "commit": "81c9b35e0830297b2aca2cece2ae67b3899c4647"
51
+ },
52
+ {
53
+ "author": "beachball",
54
+ "package": "@fluentui/react-spinbutton",
55
+ "comment": "Bump @fluentui/react-label to v9.1.16",
56
+ "commit": "81c9b35e0830297b2aca2cece2ae67b3899c4647"
57
+ }
58
+ ]
59
+ }
60
+ },
61
+ {
62
+ "date": "Wed, 31 May 2023 06:46:19 GMT",
63
+ "tag": "@fluentui/react-spinbutton_v9.2.16",
64
+ "version": "9.2.16",
65
+ "comments": {
66
+ "patch": [
67
+ {
68
+ "author": "seanmonahan@microsoft.com",
69
+ "package": "@fluentui/react-spinbutton",
70
+ "commit": "d640b972d7ac86bfb76ae6c6329f12cdd33b3b7c",
71
+ "comment": "chore: Update Griffel to v1.5.7."
72
+ },
73
+ {
74
+ "author": "beachball",
75
+ "package": "@fluentui/react-spinbutton",
76
+ "comment": "Bump @fluentui/react-field to v9.1.6",
77
+ "commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
78
+ },
79
+ {
80
+ "author": "beachball",
81
+ "package": "@fluentui/react-spinbutton",
82
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.6",
83
+ "commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
84
+ },
85
+ {
86
+ "author": "beachball",
87
+ "package": "@fluentui/react-spinbutton",
88
+ "comment": "Bump @fluentui/react-utilities to v9.9.2",
89
+ "commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
90
+ },
91
+ {
92
+ "author": "beachball",
93
+ "package": "@fluentui/react-spinbutton",
94
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.22",
95
+ "commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
96
+ },
97
+ {
98
+ "author": "beachball",
99
+ "package": "@fluentui/react-spinbutton",
100
+ "comment": "Bump @fluentui/react-label to v9.1.15",
101
+ "commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
102
+ }
103
+ ]
104
+ }
105
+ },
106
+ {
107
+ "date": "Thu, 25 May 2023 10:00:48 GMT",
6
108
  "tag": "@fluentui/react-spinbutton_v9.2.15",
7
109
  "version": "9.2.15",
8
110
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,42 @@
1
1
  # Change Log - @fluentui/react-spinbutton
2
2
 
3
- This log was last generated on Thu, 25 May 2023 09:57:45 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 20 Jun 2023 12:34:47 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.2.17](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinbutton_v9.2.17)
8
+
9
+ Tue, 20 Jun 2023 12:34:47 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinbutton_v9.2.16..@fluentui/react-spinbutton_v9.2.17)
11
+
12
+ ### Patches
13
+
14
+ - chore: update @fluentui/react-icons to 2.0.203 ([PR #28203](https://github.com/microsoft/fluentui/pull/28203) by ololubek@microsoft.com)
15
+ - Bump @fluentui/react-field to v9.1.7 ([PR #28229](https://github.com/microsoft/fluentui/pull/28229) by beachball)
16
+ - Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.7 ([PR #28229](https://github.com/microsoft/fluentui/pull/28229) by beachball)
17
+ - Bump @fluentui/react-shared-contexts to v9.5.1 ([PR #28229](https://github.com/microsoft/fluentui/pull/28229) by beachball)
18
+ - Bump @fluentui/react-theme to v9.1.9 ([PR #28229](https://github.com/microsoft/fluentui/pull/28229) by beachball)
19
+ - Bump @fluentui/react-utilities to v9.9.3 ([PR #28229](https://github.com/microsoft/fluentui/pull/28229) by beachball)
20
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.23 ([PR #28229](https://github.com/microsoft/fluentui/pull/28229) by beachball)
21
+ - Bump @fluentui/react-label to v9.1.16 ([PR #28229](https://github.com/microsoft/fluentui/pull/28229) by beachball)
22
+
23
+ ## [9.2.16](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinbutton_v9.2.16)
24
+
25
+ Wed, 31 May 2023 06:46:19 GMT
26
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinbutton_v9.2.15..@fluentui/react-spinbutton_v9.2.16)
27
+
28
+ ### Patches
29
+
30
+ - chore: Update Griffel to v1.5.7. ([PR #27925](https://github.com/microsoft/fluentui/pull/27925) by seanmonahan@microsoft.com)
31
+ - Bump @fluentui/react-field to v9.1.6 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
32
+ - Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.6 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
33
+ - Bump @fluentui/react-utilities to v9.9.2 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
34
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.22 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
35
+ - Bump @fluentui/react-label to v9.1.15 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
36
+
7
37
  ## [9.2.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-spinbutton_v9.2.15)
8
38
 
9
- Thu, 25 May 2023 09:57:45 GMT
39
+ Thu, 25 May 2023 10:00:48 GMT
10
40
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-spinbutton_v9.2.14..@fluentui/react-spinbutton_v9.2.15)
11
41
 
12
42
  ### Patches
package/lib/SpinButton.js CHANGED
@@ -1,2 +1 @@
1
1
  export * from './components/SpinButton/index';
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,"sources":["SpinButton.ts"],"sourcesContent":["export * from './components/SpinButton/index';\n"],"names":[],"mappings":"AAAA,cAAc,gCAAgC"}
@@ -5,12 +5,10 @@ import { useSpinButtonStyles_unstable } from './useSpinButtonStyles.styles';
5
5
  import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
6
6
  /**
7
7
  * A SpinButton allows someone to incrementally adjust a value in small steps.
8
- */
9
- export const SpinButton = /*#__PURE__*/React.forwardRef((props, ref) => {
10
- const state = useSpinButton_unstable(props, ref);
11
- useSpinButtonStyles_unstable(state);
12
- useCustomStyleHook_unstable('useSpinButtonStyles_unstable')(state);
13
- return renderSpinButton_unstable(state);
8
+ */ export const SpinButton = /*#__PURE__*/ React.forwardRef((props, ref)=>{
9
+ const state = useSpinButton_unstable(props, ref);
10
+ useSpinButtonStyles_unstable(state);
11
+ useCustomStyleHook_unstable('useSpinButtonStyles_unstable')(state);
12
+ return renderSpinButton_unstable(state);
14
13
  });
15
14
  SpinButton.displayName = 'SpinButton';
16
- //# sourceMappingURL=SpinButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useSpinButton_unstable","renderSpinButton_unstable","useSpinButtonStyles_unstable","useCustomStyleHook_unstable","SpinButton","forwardRef","props","ref","state","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.styles';\nimport type { SpinButtonProps } from './SpinButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_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 useCustomStyleHook_unstable('useSpinButtonStyles_unstable')(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,2BAA2B,QAAQ;AAE5C;;;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;EAE7BL,2BAAA,CAA4B,gCAAgCK,KAAA;EAE5D,OAAOP,yBAAA,CAA0BO,KAAA;AACnC;AAEAJ,UAAA,CAAWK,WAAW,GAAG"}
1
+ {"version":3,"sources":["SpinButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useSpinButton_unstable } from './useSpinButton';\nimport { renderSpinButton_unstable } from './renderSpinButton';\nimport { useSpinButtonStyles_unstable } from './useSpinButtonStyles.styles';\nimport type { SpinButtonProps } from './SpinButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_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 useCustomStyleHook_unstable('useSpinButtonStyles_unstable')(state);\n\n return renderSpinButton_unstable(state);\n});\n\nSpinButton.displayName = 'SpinButton';\n"],"names":["React","useSpinButton_unstable","renderSpinButton_unstable","useSpinButtonStyles_unstable","useCustomStyleHook_unstable","SpinButton","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,4BAA4B,QAAQ,+BAA+B;AAG5E,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,2BAAmDL,MAAMM,UAAU,CAAC,CAACC,OAAOC,MAAQ;IAC/F,MAAMC,QAAQR,uBAAuBM,OAAOC;IAE5CL,6BAA6BM;IAE7BL,4BAA4B,gCAAgCK;IAE5D,OAAOP,0BAA0BO;AACnC,GAAG;AAEHJ,WAAWK,WAAW,GAAG"}
@@ -1,2 +1 @@
1
1
  import * as React from 'react';
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,"sources":["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"],"names":["React"],"mappings":"AACA,YAAYA,WAAW,QAAQ"}
@@ -3,4 +3,3 @@ export * from './SpinButton.types';
3
3
  export * from './renderSpinButton';
4
4
  export * from './useSpinButton';
5
5
  export * from './useSpinButtonStyles.styles';
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.styles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './SpinButton';\nexport * from './SpinButton.types';\nexport * from './renderSpinButton';\nexport * from './useSpinButton';\nexport * from './useSpinButtonStyles.styles';\n"],"names":[],"mappings":"AAAA,cAAc,eAAe;AAC7B,cAAc,qBAAqB;AACnC,cAAc,qBAAqB;AACnC,cAAc,kBAAkB;AAChC,cAAc,+BAA+B"}
@@ -1,13 +1,8 @@
1
- /** @jsxRuntime classic */ /** @jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';
1
+ /** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';
2
2
  import { getSlotsNext } from '@fluentui/react-utilities';
3
3
  /**
4
4
  * Render the final JSX of SpinButton
5
- */
6
- export const renderSpinButton_unstable = state => {
7
- const {
8
- slots,
9
- slotProps
10
- } = getSlotsNext(state);
11
- return /*#__PURE__*/createElement(slots.root, slotProps.root, /*#__PURE__*/createElement(slots.input, slotProps.input), /*#__PURE__*/createElement(slots.incrementButton, slotProps.incrementButton), /*#__PURE__*/createElement(slots.decrementButton, slotProps.decrementButton));
5
+ */ export const renderSpinButton_unstable = (state)=>{
6
+ const { slots , slotProps } = getSlotsNext(state);
7
+ return /*#__PURE__*/ createElement(slots.root, slotProps.root, /*#__PURE__*/ createElement(slots.input, slotProps.input), /*#__PURE__*/ createElement(slots.incrementButton, slotProps.incrementButton), /*#__PURE__*/ createElement(slots.decrementButton, slotProps.decrementButton));
12
8
  };
13
- //# sourceMappingURL=renderSpinButton.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createElement","getSlotsNext","renderSpinButton_unstable","state","slots","slotProps","root","input","incrementButton","decrementButton"],"sources":["../../../src/components/SpinButton/renderSpinButton.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\n\nimport { getSlotsNext } 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 } = getSlotsNext<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,2BACA,yBAEA,SAASA,aAAa,QAAQ;AAE9B,SAASC,YAAY,QAAQ;AAG7B;;;AAGA,OAAO,MAAMC,yBAAA,GAA6BC,KAAA,IAA2B;EACnE,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGJ,YAAA,CAA8BE,KAAA;EAE3D,oBACEH,aAdJ,CAcKI,KAAA,CAAME,IAAI,EAAKD,SAAA,CAAUC,IAAI,eAC5BN,aAfN,CAeOI,KAAA,CAAMG,KAAK,EAAKF,SAAA,CAAUE,KAAK,gBAChCP,aAhBN,CAgBOI,KAAA,CAAMI,eAAe,EAAKH,SAAA,CAAUG,eAAe,gBACpDR,aAjBN,CAiBOI,KAAA,CAAMK,eAAe,EAAKJ,SAAA,CAAUI,eAAe;AAG1D"}
1
+ {"version":3,"sources":["renderSpinButton.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\n\nimport { getSlotsNext } 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 } = getSlotsNext<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"],"names":["createElement","getSlotsNext","renderSpinButton_unstable","state","slots","slotProps","root","input","incrementButton","decrementButton"],"mappings":"AAAA,wBAAwB,GACxB,uBAAuB,GAEvB,SAASA,aAAa,QAAQ,8BAA8B;AAE5D,SAASC,YAAY,QAAQ,4BAA4B;AAGzD;;CAEC,GACD,OAAO,MAAMC,4BAA4B,CAACC,QAA2B;IACnE,MAAM,EAAEC,MAAK,EAAEC,UAAS,EAAE,GAAGJ,aAA8BE;IAE3D,qBACE,AAdJ,cAcKC,MAAME,IAAI,EAAKD,UAAUC,IAAI,gBAC5B,AAfN,cAeOF,MAAMG,KAAK,EAAKF,UAAUE,KAAK,iBAChC,AAhBN,cAgBOH,MAAMI,eAAe,EAAKH,UAAUG,eAAe,iBACpD,AAjBN,cAiBOJ,MAAMK,eAAe,EAAKJ,UAAUI,eAAe;AAG1D,EAAE"}