Skip to content

Commit d0ab341

Browse files
authored
Deprecate min and max props in NumberField component (#3019)
### Background Resolves part of [issue #1999](shop/issues-retail#1999) Deprecating `min` and `max` props in the NumberField component because they are (and have been) non-functional. ### Solution - Adds deprecation notice for `min` and `max` props <img src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/aQSCLikeEHKP71ewIlF3/da6bcd76-508f-4d74-9afa-2fda85247842.png" width=400> ### 🎩 - See [pos-next-react-native #62931](https://app.graphite.dev/github/pr/Shopify/pos-next-react-native/62931) for tophat instructions ### Checklist - [ ] I have 🎩'd these changes - [ ] I have updated relevant documentation
2 parents 0928780 + 2576793 commit d0ab341

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

.changeset/silent-yaks-beam.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@shopify/ui-extensions': minor
3+
'@shopify/ui-extensions-react': minor
4+
---
5+
6+
NumberField - deprecate min and max props

packages/ui-extensions/docs/surfaces/point-of-sale/staticPages/pages/versions.doc.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Refer to the [migration guide](/docs/api/pos-ui-extensions/migrating) for more i
7474
- Added optional \`tone\` property to \`Icon\` component and expanded \`name\` and \`size\` options.
7575
- Deprecated \`'minor'\`, \`'major'\`, \`'spot'\`, \`'caption'\`, \`'badge'\` as values for the \`size\` prop in the [Icon](/docs/api/pos-ui-extensions/components/icon) component. Use \`'s'\`, \`'m'\`, \`'l'\`, \`'xl'\` instead.
7676
- Deprecated \`'arrow'\`, \`'available-at-other-locations'\`, \`'collections'\`, \`'connectivity-warning'\`, \`'delivery'\`, \`'home'\`, \`'image-placeholder'\`, \`'internet'\`, \`'menu'\`, \`'orders'\`, \`'products'\`, \`'shipment'\` as values for the \`name\` prop in the [Icon](/docs/api/pos-ui-extensions/components/icon) component. See the available icon list names in the \`name\` prop documentation.
77+
- Deprecated \`max\` and \`min\` props in the [NumberField](/docs/api/pos-ui-extensions/components/numberfield) component. Implement validation logic instead.
7778
7879
**Developer Preview**:
7980
- Introduced a [Storage API](/docs/api/pos-ui-extensions/apis/storage-api). The Storage API gives the UI Extension access to store data on the POS device that the extension is running on.

packages/ui-extensions/src/surfaces/point-of-sale/render/components/NumberField/NumberField.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ import type {InputProps} from '../shared/InputField';
88
*/
99
export interface NumberFieldProps extends InputProps {
1010
inputMode?: 'decimal' | 'numeric';
11+
/**
12+
* @deprecated Implement validation logic instead. This prop will be removed in 2025-10.
13+
*/
1114
max?: number;
15+
/**
16+
* @deprecated Implement validation logic instead. This prop will be removed in 2025-10.
17+
*/
1218
min?: number;
1319
}
1420

0 commit comments

Comments
 (0)