@ceed/ads 1.25.1-next.3 → 1.27.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 (62) hide show
  1. package/dist/chunks/rehype-accent-FZRUD7VI.js +39 -0
  2. package/dist/components/CurrencyInput/CurrencyInput.d.ts +1 -1
  3. package/dist/components/CurrencyInput/hooks/use-currency-setting.d.ts +2 -2
  4. package/dist/components/DataTable/components.d.ts +2 -1
  5. package/dist/components/DataTable/hooks.d.ts +1 -1
  6. package/dist/components/DataTable/styled.d.ts +3 -1
  7. package/dist/components/DataTable/types.d.ts +11 -0
  8. package/dist/components/DataTable/utils.d.ts +2 -2
  9. package/dist/components/ProfileMenu/ProfileMenu.d.ts +1 -1
  10. package/dist/components/data-display/Badge.md +71 -39
  11. package/dist/components/data-display/DataTable.md +177 -1
  12. package/dist/components/data-display/InfoSign.md +74 -98
  13. package/dist/components/data-display/Typography.md +363 -97
  14. package/dist/components/feedback/CircularProgress.md +257 -0
  15. package/dist/components/feedback/Dialog.md +76 -62
  16. package/dist/components/feedback/Modal.md +259 -44
  17. package/dist/components/feedback/Skeleton.md +280 -0
  18. package/dist/components/feedback/llms.txt +2 -0
  19. package/dist/components/inputs/Autocomplete.md +356 -107
  20. package/dist/components/inputs/ButtonGroup.md +115 -106
  21. package/dist/components/inputs/Calendar.md +98 -459
  22. package/dist/components/inputs/CurrencyInput.md +183 -5
  23. package/dist/components/inputs/DatePicker.md +108 -431
  24. package/dist/components/inputs/DateRangePicker.md +131 -492
  25. package/dist/components/inputs/FilterMenu.md +169 -19
  26. package/dist/components/inputs/FilterableCheckboxGroup.md +123 -23
  27. package/dist/components/inputs/FormControl.md +361 -0
  28. package/dist/components/inputs/IconButton.md +137 -88
  29. package/dist/components/inputs/Input.md +5 -0
  30. package/dist/components/inputs/MonthPicker.md +95 -422
  31. package/dist/components/inputs/MonthRangePicker.md +89 -466
  32. package/dist/components/inputs/PercentageInput.md +185 -16
  33. package/dist/components/inputs/RadioButton.md +163 -35
  34. package/dist/components/inputs/RadioList.md +241 -0
  35. package/dist/components/inputs/RadioTileGroup.md +150 -61
  36. package/dist/components/inputs/Select.md +222 -326
  37. package/dist/components/inputs/Slider.md +334 -0
  38. package/dist/components/inputs/Switch.md +136 -376
  39. package/dist/components/inputs/Textarea.md +213 -10
  40. package/dist/components/inputs/Uploader/Uploader.md +145 -66
  41. package/dist/components/inputs/llms.txt +3 -0
  42. package/dist/components/navigation/Breadcrumbs.md +80 -322
  43. package/dist/components/navigation/Dropdown.md +92 -221
  44. package/dist/components/navigation/IconMenuButton.md +40 -502
  45. package/dist/components/navigation/InsetDrawer.md +68 -738
  46. package/dist/components/navigation/Link.md +39 -298
  47. package/dist/components/navigation/Menu.md +92 -285
  48. package/dist/components/navigation/MenuButton.md +55 -448
  49. package/dist/components/navigation/Pagination.md +47 -338
  50. package/dist/components/navigation/ProfileMenu.md +45 -268
  51. package/dist/components/navigation/Stepper.md +160 -28
  52. package/dist/components/navigation/Tabs.md +57 -316
  53. package/dist/components/surfaces/Sheet.md +151 -334
  54. package/dist/guides/ThemeProvider.md +116 -0
  55. package/dist/guides/llms.txt +9 -0
  56. package/dist/index.browser.js +16 -18
  57. package/dist/index.browser.js.map +4 -4
  58. package/dist/index.cjs +381 -244
  59. package/dist/index.js +459 -378
  60. package/dist/llms.txt +8 -0
  61. package/framer/index.js +1 -166
  62. package/package.json +15 -16
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Introduction
4
4
 
5
+ CurrencyInput is a specialized numeric input for entering monetary values. It automatically formats numbers with the appropriate currency symbol, thousand separators, and decimal places based on the selected currency (USD or KRW). It supports features like maximum value validation, minor unit conversion, and controlled/uncontrolled modes.
6
+
7
+ > **Tip: Use built-in form props**
8
+ >
9
+ > This component supports `label` and `helperText` props directly. Use these instead of wrapping with FormControl + FormLabel + FormHelperText for simpler forms.
10
+
5
11
  ```tsx
6
12
  <CurrencyInput
7
13
  name="currency-input"
@@ -25,8 +31,42 @@
25
31
  | useMinorUnit | — | — |
26
32
  | onChange | — | — |
27
33
 
34
+ ## Usage
35
+
36
+ ```tsx
37
+ import { CurrencyInput } from '@ceed/ads';
38
+
39
+ function MyComponent() {
40
+ const [amount, setAmount] = React.useState(0);
41
+
42
+ return (
43
+ <CurrencyInput
44
+ label="Price"
45
+ currency="USD"
46
+ value={amount}
47
+ onChange={(e) => setAmount(e.target.value)}
48
+ />
49
+ );
50
+ }
51
+ ```
52
+
53
+ ## Currency Formats
54
+
55
+ ### USD (Default)
56
+
57
+ US Dollar format with `$` symbol, comma thousand separators, and 2 decimal places.
58
+
59
+ ```tsx
60
+ <CurrencyInput
61
+ name="currency-input"
62
+ defaultValue={1000}
63
+ />
64
+ ```
65
+
28
66
  ### KRW
29
67
 
68
+ Korean Won format with `₩` symbol, comma thousand separators, and no decimal places.
69
+
30
70
  ```tsx
31
71
  <CurrencyInput
32
72
  name="currency-input"
@@ -35,7 +75,13 @@
35
75
  />
36
76
  ```
37
77
 
38
- ### Sizes
78
+ ```tsx
79
+ <CurrencyInput currency="KRW" value={50000} />
80
+ ```
81
+
82
+ ## Sizes
83
+
84
+ CurrencyInput supports three sizes: `sm`, `md` (default), and `lg`.
39
85
 
40
86
  ```tsx
41
87
  <Stack gap={2}>
@@ -45,7 +91,9 @@
45
91
  </Stack>
46
92
  ```
47
93
 
48
- ### WithLabel
94
+ ## Form Features
95
+
96
+ ### With Label
49
97
 
50
98
  ```tsx
51
99
  <CurrencyInput
@@ -55,7 +103,11 @@
55
103
  />
56
104
  ```
57
105
 
58
- ### WithHelperText
106
+ ```tsx
107
+ <CurrencyInput label="Total Amount" />
108
+ ```
109
+
110
+ ### With Helper Text
59
111
 
60
112
  ```tsx
61
113
  <CurrencyInput
@@ -66,7 +118,11 @@
66
118
  />
67
119
  ```
68
120
 
69
- ### Error
121
+ ```tsx
122
+ <CurrencyInput label="Price" helperText="Enter the item price in USD." />
123
+ ```
124
+
125
+ ### Error State
70
126
 
71
127
  ```tsx
72
128
  <CurrencyInput
@@ -78,7 +134,13 @@
78
134
  />
79
135
  ```
80
136
 
81
- ### PriceLimitError
137
+ ```tsx
138
+ <CurrencyInput label="Amount" error helperText="Amount is required." />
139
+ ```
140
+
141
+ ## Price Limit
142
+
143
+ Set the `max` prop to enforce a maximum value. When the entered value exceeds the limit, the input automatically displays an error state with a formatted limit message.
82
144
 
83
145
  ```tsx
84
146
  <CurrencyInput
@@ -89,3 +151,119 @@
89
151
  max={1000000}
90
152
  />
91
153
  ```
154
+
155
+ ```tsx
156
+ <CurrencyInput
157
+ currency="USD"
158
+ max={1000000}
159
+ value={10000000}
160
+ />
161
+ ```
162
+
163
+ ## Minor Unit Mode
164
+
165
+ When `useMinorUnit` is true, the component converts between display values and minor units (e.g., cents for USD). This is useful when your API stores amounts in the smallest currency unit.
166
+
167
+ ```tsx
168
+ // Display shows "$10.00", but onChange returns 1000 (cents)
169
+ <CurrencyInput currency="USD" useMinorUnit value={1000} />
170
+
171
+ // Display shows "₩10,000", onChange returns 10000 (no conversion for KRW)
172
+ <CurrencyInput currency="KRW" useMinorUnit value={10000} />
173
+ ```
174
+
175
+ ## Common Use Cases
176
+
177
+ ### Product Price Editor
178
+
179
+ ```tsx
180
+ function ProductPriceEditor() {
181
+ const [priceUSD, setPriceUSD] = React.useState(0);
182
+ const [priceKRW, setPriceKRW] = React.useState(0);
183
+
184
+ return (
185
+ <Stack gap={2}>
186
+ <CurrencyInput
187
+ label="USD Price"
188
+ currency="USD"
189
+ value={priceUSD}
190
+ onChange={(e) => setPriceUSD(e.target.value)}
191
+ max={99999.99}
192
+ />
193
+ <CurrencyInput
194
+ label="KRW Price"
195
+ currency="KRW"
196
+ value={priceKRW}
197
+ onChange={(e) => setPriceKRW(e.target.value)}
198
+ max={99999999}
199
+ />
200
+ </Stack>
201
+ );
202
+ }
203
+ ```
204
+
205
+ ### Invoice Line Item
206
+
207
+ ```tsx
208
+ function InvoiceLineItem({ item, onChange }) {
209
+ return (
210
+ <Stack direction="row" gap={2} alignItems="flex-end">
211
+ <Input label="Description" value={item.description} />
212
+ <CurrencyInput
213
+ label="Unit Price"
214
+ currency="USD"
215
+ value={item.unitPrice}
216
+ onChange={(e) => onChange({ ...item, unitPrice: e.target.value })}
217
+ />
218
+ <Input label="Qty" type="number" value={item.quantity} sx={{ width: 80 }} />
219
+ </Stack>
220
+ );
221
+ }
222
+ ```
223
+
224
+ ### Budget Limit Input
225
+
226
+ ```tsx
227
+ function BudgetSetting() {
228
+ const [budget, setBudget] = React.useState(50000);
229
+
230
+ return (
231
+ <CurrencyInput
232
+ label="Monthly Budget"
233
+ helperText="Set the maximum monthly spending limit."
234
+ currency="USD"
235
+ value={budget}
236
+ onChange={(e) => setBudget(e.target.value)}
237
+ max={1000000}
238
+ />
239
+ );
240
+ }
241
+ ```
242
+
243
+ ## Best Practices
244
+
245
+ 1. **Choose the right currency**: Always set the `currency` prop explicitly. USD uses 2 decimal places while KRW uses none.
246
+
247
+ ```tsx
248
+ // ✅ Explicit currency
249
+ <CurrencyInput currency="USD" />
250
+ <CurrencyInput currency="KRW" />
251
+
252
+ // ❌ Relying on default — may confuse users expecting KRW
253
+ <CurrencyInput />
254
+ ```
255
+
256
+ 2. **Set max limits**: Use `max` to prevent unreasonable values. The component displays a helpful error message when the limit is exceeded.
257
+
258
+ 3. **Use `useMinorUnit` for API integration**: When your backend stores amounts in minor units (cents, etc.), enable `useMinorUnit` to avoid manual conversion.
259
+
260
+ 4. **Use built-in label and helperText**: Prefer the component's own `label` and `helperText` props over wrapping with FormControl.
261
+
262
+ 5. **Handle negative values carefully**: CurrencyInput supports negative values. If negatives are not valid for your use case, validate in `onChange`.
263
+
264
+ ## Accessibility
265
+
266
+ - The input has `role="textbox"` with proper labeling via the `label` prop.
267
+ - Error states are communicated via `aria-invalid` and associated error messages.
268
+ - The currency symbol serves as a visual indicator; ensure labels also mention the currency for screen readers.
269
+ - Keyboard input is fully supported — users can type numbers, and formatting is applied automatically.