@ceed/cds 1.32.0-next.1 → 1.33.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.
|
@@ -39,14 +39,7 @@ import { CurrencyInput } from '@ceed/cds';
|
|
|
39
39
|
function MyComponent() {
|
|
40
40
|
const [amount, setAmount] = React.useState(0);
|
|
41
41
|
|
|
42
|
-
return (
|
|
43
|
-
<CurrencyInput
|
|
44
|
-
label="Price"
|
|
45
|
-
currency="USD"
|
|
46
|
-
value={amount}
|
|
47
|
-
onChange={(e) => setAmount(e.target.value)}
|
|
48
|
-
/>
|
|
49
|
-
);
|
|
42
|
+
return <CurrencyInput label="Price" currency="USD" value={amount} onChange={(e) => setAmount(e.target.value)} />;
|
|
50
43
|
}
|
|
51
44
|
```
|
|
52
45
|
|
|
@@ -153,11 +146,7 @@ Set the `max` prop to enforce a maximum value. When the entered value exceeds th
|
|
|
153
146
|
```
|
|
154
147
|
|
|
155
148
|
```tsx
|
|
156
|
-
<CurrencyInput
|
|
157
|
-
currency="USD"
|
|
158
|
-
max={1000000}
|
|
159
|
-
value={10000000}
|
|
160
|
-
/>
|
|
149
|
+
<CurrencyInput currency="USD" max={1000000} value={10000000} />
|
|
161
150
|
```
|
|
162
151
|
|
|
163
152
|
## Minor Unit Mode
|
|
@@ -265,23 +254,23 @@ function BudgetSetting() {
|
|
|
265
254
|
|
|
266
255
|
### Key Props
|
|
267
256
|
|
|
268
|
-
| Prop | Type | Default | Description
|
|
269
|
-
| -------------- | -------------------------------------------------------- | ------- |
|
|
270
|
-
| `value` | `number` | - | Currency value (controlled mode)
|
|
271
|
-
| `defaultValue` | `number` | - | Initial currency value (uncontrolled mode)
|
|
272
|
-
| `onChange` | `(event: { target: { name?, value?: number } }) => void` | - | Callback when the value changes
|
|
273
|
-
| `currency` | `'USD' \| 'KRW' \| 'CAD'`
|
|
274
|
-
| `useMinorUnit` | `boolean` | `false` | When true, value is in minor units (e.g., cents for USD)
|
|
275
|
-
| `max` | `number` | - | Maximum allowed value
|
|
276
|
-
| `label` | `ReactNode` | - | Form label displayed above the input
|
|
277
|
-
| `helperText` | `ReactNode` | - | Helper text displayed below the input
|
|
278
|
-
| `error` | `boolean` | `false` | Applies danger color to indicate validation error
|
|
279
|
-
| `required` | `boolean` | `false` | Marks the field as required
|
|
280
|
-
| `disabled` | `boolean` | `false` | Disables the input
|
|
281
|
-
| `name` | `string` | - | HTML name attribute for form submission
|
|
282
|
-
| `placeholder` | `string` | - | Placeholder text when the input is empty
|
|
283
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Input size
|
|
284
|
-
| `sx` | `SxProps` | - | Custom styles using the MUI system
|
|
257
|
+
| Prop | Type | Default | Description |
|
|
258
|
+
| -------------- | -------------------------------------------------------- | ------- | ------------------------------------------------------------------------ |
|
|
259
|
+
| `value` | `number` | - | Currency value (controlled mode) |
|
|
260
|
+
| `defaultValue` | `number` | - | Initial currency value (uncontrolled mode) |
|
|
261
|
+
| `onChange` | `(event: { target: { name?, value?: number } }) => void` | - | Callback when the value changes |
|
|
262
|
+
| `currency` | `'USD' \| 'KRW' \| 'CAD' \| 'usd' \| 'krw' \| 'cad'` | `'USD'` | Currency code (uppercase or lowercase; determines symbol and formatting) |
|
|
263
|
+
| `useMinorUnit` | `boolean` | `false` | When true, value is in minor units (e.g., cents for USD) |
|
|
264
|
+
| `max` | `number` | - | Maximum allowed value |
|
|
265
|
+
| `label` | `ReactNode` | - | Form label displayed above the input |
|
|
266
|
+
| `helperText` | `ReactNode` | - | Helper text displayed below the input |
|
|
267
|
+
| `error` | `boolean` | `false` | Applies danger color to indicate validation error |
|
|
268
|
+
| `required` | `boolean` | `false` | Marks the field as required |
|
|
269
|
+
| `disabled` | `boolean` | `false` | Disables the input |
|
|
270
|
+
| `name` | `string` | - | HTML name attribute for form submission |
|
|
271
|
+
| `placeholder` | `string` | - | Placeholder text when the input is empty |
|
|
272
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Input size |
|
|
273
|
+
| `sx` | `SxProps` | - | Custom styles using the MUI system |
|
|
285
274
|
|
|
286
275
|
## Accessibility
|
|
287
276
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ceed/cds",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.33.0",
|
|
4
4
|
"main": "dist/index.cjs",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -100,6 +100,5 @@
|
|
|
100
100
|
"type": "git",
|
|
101
101
|
"url": "git+ssh://git@github.com/Ecube-Labs/hds.git"
|
|
102
102
|
},
|
|
103
|
-
"packageManager": "yarn@4.1.0"
|
|
104
|
-
"stableVersion": "1.0.0"
|
|
103
|
+
"packageManager": "yarn@4.1.0"
|
|
105
104
|
}
|