@ceed/ads 1.35.1 → 1.36.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.
- package/README.md +85 -95
- package/dist/components/Accordions/Accordions.d.ts +1 -0
- package/dist/components/Alert/Alert.d.ts +5 -5
- package/dist/components/Autocomplete/Autocomplete.d.ts +2 -2
- package/dist/components/Avatar/Avatar.d.ts +7 -17
- package/dist/components/Box/Box.d.ts +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +6 -5
- package/dist/components/Button/Button.d.ts +3 -2
- package/dist/components/Calendar/Calendar.d.ts +1 -0
- package/dist/components/Card/Card.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/Chip/Chip.d.ts +1 -0
- package/dist/components/Container/Container.d.ts +6 -1
- package/dist/components/DialogActions/DialogActions.d.ts +1 -0
- package/dist/components/DialogContent/DialogContent.d.ts +1 -0
- package/dist/components/DialogFrame/DialogFrame.d.ts +1 -1
- package/dist/components/DialogTitle/DialogTitle.d.ts +1 -0
- package/dist/components/Divider/Divider.d.ts +1 -0
- package/dist/components/Dropdown/Dropdown.d.ts +28 -1
- package/dist/components/FilterMenu/components/MonthRange.d.ts +11 -0
- package/dist/components/FilterMenu/types.d.ts +5 -1
- package/dist/components/FormControl/FormControl.d.ts +1 -0
- package/dist/components/FormHelperText/FormHelperText.d.ts +1 -0
- package/dist/components/FormLabel/FormLabel.d.ts +1 -0
- package/dist/components/Grid/Grid.d.ts +1 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -2
- package/dist/components/IconMenuButton/IconMenuButton.d.ts +7 -6
- package/dist/components/InfoSign/InfoSign.d.ts +3 -2
- package/dist/components/Input/Input.d.ts +8 -22
- package/dist/components/InsetDrawer/InsetDrawer.d.ts +1 -0
- package/dist/components/Markdown/Markdown.d.ts +9 -24
- package/dist/components/Menu/Menu.d.ts +2 -1
- package/dist/components/MenuButton/MenuButton.d.ts +10 -8
- package/dist/components/Modal/Modal.d.ts +4 -2
- package/dist/components/NavigationGroup/NavigationGroup.d.ts +3 -2
- package/dist/components/NavigationItem/NavigationItem.d.ts +3 -2
- package/dist/components/Navigator/Navigator.d.ts +5 -4
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/ProfileMenu/ProfileMenu.d.ts +2 -2
- package/dist/components/Radio/Radio.d.ts +1 -0
- package/dist/components/RadioList/RadioList.d.ts +3 -2
- package/dist/components/Select/Select.d.ts +12 -10
- package/dist/components/Sheet/Sheet.d.ts +1 -0
- package/dist/components/Stack/Stack.d.ts +1 -0
- package/dist/components/Stepper/Stepper.d.ts +2 -1
- package/dist/components/Switch/Switch.d.ts +1 -0
- package/dist/components/Table/Table.d.ts +7 -5
- package/dist/components/Tabs/Tabs.d.ts +1 -0
- package/dist/components/Textarea/Textarea.d.ts +8 -20
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +4 -2
- package/dist/components/Tooltip/Tooltip.d.ts +1 -0
- package/dist/components/Typography/Typography.d.ts +1 -0
- package/dist/components/Uploader/Uploader.d.ts +18 -17
- package/dist/components/data-display/Avatar.md +60 -72
- package/dist/components/data-display/Badge.md +197 -181
- package/dist/components/data-display/Chip.md +164 -142
- package/dist/components/data-display/DataTable.md +843 -338
- package/dist/components/data-display/InfoSign.md +1 -3
- package/dist/components/data-display/Markdown.md +93 -125
- package/dist/components/data-display/Table.md +1453 -1007
- package/dist/components/data-display/Typography.md +101 -104
- package/dist/components/feedback/Alert.md +80 -86
- package/dist/components/feedback/CircularProgress.md +32 -36
- package/dist/components/feedback/Dialog.md +25 -17
- package/dist/components/feedback/Modal.md +296 -265
- package/dist/components/feedback/Skeleton.md +125 -89
- package/dist/components/index.d.ts +60 -1
- package/dist/components/inputs/Autocomplete.md +191 -95
- package/dist/components/inputs/Button.md +83 -83
- package/dist/components/inputs/ButtonGroup.md +195 -185
- package/dist/components/inputs/Calendar.md +25 -28
- package/dist/components/inputs/Checkbox.md +11 -29
- package/dist/components/inputs/CurrencyInput.md +4 -4
- package/dist/components/inputs/DatePicker.md +229 -110
- package/dist/components/inputs/DateRangePicker.md +248 -137
- package/dist/components/inputs/FilterMenu.md +138 -8
- package/dist/components/inputs/FilterableCheckboxGroup.md +115 -55
- package/dist/components/inputs/FormControl.md +75 -69
- package/dist/components/inputs/IconButton.md +229 -205
- package/dist/components/inputs/Input.md +131 -98
- package/dist/components/inputs/MonthPicker.md +186 -84
- package/dist/components/inputs/MonthRangePicker.md +73 -49
- package/dist/components/inputs/PercentageInput.md +15 -31
- package/dist/components/inputs/RadioButton.md +320 -256
- package/dist/components/inputs/RadioList.md +66 -50
- package/dist/components/inputs/RadioTileGroup.md +287 -170
- package/dist/components/inputs/SearchBar.md +82 -60
- package/dist/components/inputs/Select.md +106 -95
- package/dist/components/inputs/Slider.md +153 -102
- package/dist/components/inputs/Switch.md +193 -138
- package/dist/components/inputs/Textarea.md +15 -20
- package/dist/components/inputs/Uploader/Uploader.md +68 -39
- package/dist/components/layout/Box.md +841 -662
- package/dist/components/layout/Container.md +3 -11
- package/dist/components/layout/Grid.md +480 -394
- package/dist/components/layout/Stack.md +739 -566
- package/dist/components/navigation/Breadcrumbs.md +182 -116
- package/dist/components/navigation/Dropdown.md +732 -391
- package/dist/components/navigation/IconMenuButton.md +14 -6
- package/dist/components/navigation/InsetDrawer.md +550 -378
- package/dist/components/navigation/Link.md +104 -94
- package/dist/components/navigation/Menu.md +623 -502
- package/dist/components/navigation/MenuButton.md +18 -10
- package/dist/components/navigation/NavigationGroup.md +19 -50
- package/dist/components/navigation/NavigationItem.md +6 -6
- package/dist/components/navigation/Navigator.md +26 -28
- package/dist/components/navigation/Pagination.md +86 -75
- package/dist/components/navigation/ProfileMenu.md +65 -43
- package/dist/components/navigation/Stepper.md +2 -12
- package/dist/components/navigation/Tabs.md +209 -183
- package/dist/components/surfaces/Accordions.md +89 -172
- package/dist/components/surfaces/Card.md +1094 -709
- package/dist/components/surfaces/Divider.md +562 -412
- package/dist/components/surfaces/Sheet.md +700 -518
- package/dist/guides/ThemeProvider.md +65 -40
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +4 -4
- package/dist/index.cjs +1643 -1550
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1303 -1202
- package/framer/index.js +1 -1
- package/package.json +32 -35
|
@@ -36,11 +36,7 @@ function MonthRangeForm() {
|
|
|
36
36
|
const [monthRange, setMonthRange] = useState('');
|
|
37
37
|
|
|
38
38
|
return (
|
|
39
|
-
<MonthRangePicker
|
|
40
|
-
label="Select Month Range"
|
|
41
|
-
value={monthRange}
|
|
42
|
-
onChange={(e) => setMonthRange(e.target.value)}
|
|
43
|
-
/>
|
|
39
|
+
<MonthRangePicker label="Select Month Range" value={monthRange} onChange={(e) => setMonthRange(e.target.value)} />
|
|
44
40
|
);
|
|
45
41
|
}
|
|
46
42
|
```
|
|
@@ -56,10 +52,10 @@ MonthRangePicker supports three sizes (`sm`, `md`, `lg`) for different layouts a
|
|
|
56
52
|
|
|
57
53
|
```tsx
|
|
58
54
|
<Stack gap={2}>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
</Stack>
|
|
55
|
+
<MonthRangePicker size="sm" />
|
|
56
|
+
<MonthRangePicker size="md" />
|
|
57
|
+
<MonthRangePicker size="lg" />
|
|
58
|
+
</Stack>
|
|
63
59
|
```
|
|
64
60
|
|
|
65
61
|
## Form Field Features
|
|
@@ -157,21 +153,23 @@ The parent component manages the month range state via the `value` and `onChange
|
|
|
157
153
|
|
|
158
154
|
```tsx
|
|
159
155
|
<Stack gap={2}>
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
156
|
+
<MonthRangePicker {...args} value={value} onChange={(e) => setValue(e.target.value)} />
|
|
157
|
+
<Button
|
|
158
|
+
onClick={() => {
|
|
159
|
+
const [start, end] = value.split(" - ");
|
|
160
|
+
function shiftMonth(dateString: string) {
|
|
161
|
+
const currentValue = new Date(dateString);
|
|
162
|
+
currentValue.setFullYear(currentValue.getFullYear() + 1);
|
|
163
|
+
const year = currentValue.getFullYear();
|
|
164
|
+
const month = String(currentValue.getMonth() + 1).padStart(2, "0");
|
|
165
|
+
return `${year}/${month}`;
|
|
166
|
+
}
|
|
167
|
+
setValue(`${shiftMonth(start)} - ${shiftMonth(end)}`);
|
|
168
|
+
}}
|
|
169
|
+
>
|
|
170
|
+
Shift Year
|
|
171
|
+
</Button>
|
|
172
|
+
</Stack>
|
|
175
173
|
```
|
|
176
174
|
|
|
177
175
|
### Uncontrolled
|
|
@@ -194,11 +192,39 @@ The value is a string with start and end months separated by `-` (e.g., `"2024/0
|
|
|
194
192
|
|
|
195
193
|
```tsx
|
|
196
194
|
<Stack gap={2}>
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
195
|
+
<MonthRangePicker
|
|
196
|
+
{...args}
|
|
197
|
+
value={value["YYYY.MM"]}
|
|
198
|
+
label="YYYY.MM"
|
|
199
|
+
name="YYYY.MM"
|
|
200
|
+
format="YYYY.MM"
|
|
201
|
+
onChange={handleChange}
|
|
202
|
+
/>
|
|
203
|
+
<MonthRangePicker
|
|
204
|
+
{...args}
|
|
205
|
+
value={value["YYYY/MM"]}
|
|
206
|
+
label="YYYY/MM"
|
|
207
|
+
name="YYYY/MM"
|
|
208
|
+
format="YYYY/MM"
|
|
209
|
+
onChange={handleChange}
|
|
210
|
+
/>
|
|
211
|
+
<MonthRangePicker
|
|
212
|
+
{...args}
|
|
213
|
+
value={value["MM/YYYY"]}
|
|
214
|
+
label="MM/YYYY"
|
|
215
|
+
name="MM/YYYY"
|
|
216
|
+
format="MM/YYYY"
|
|
217
|
+
onChange={handleChange}
|
|
218
|
+
/>
|
|
219
|
+
<MonthRangePicker
|
|
220
|
+
{...args}
|
|
221
|
+
value={value["YYYY-MM"]}
|
|
222
|
+
label="YYYY-MM"
|
|
223
|
+
name="YYYY-MM"
|
|
224
|
+
format="YYYY-MM"
|
|
225
|
+
onChange={handleChange}
|
|
226
|
+
/>
|
|
227
|
+
</Stack>
|
|
202
228
|
```
|
|
203
229
|
|
|
204
230
|
### With Reset Button
|
|
@@ -206,15 +232,21 @@ The value is a string with start and end months separated by `-` (e.g., `"2024/0
|
|
|
206
232
|
A controlled example with an external reset button to clear the selected range.
|
|
207
233
|
|
|
208
234
|
```tsx
|
|
209
|
-
<div
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
235
|
+
<div
|
|
236
|
+
style={{
|
|
237
|
+
display: "flex",
|
|
238
|
+
gap: "10px"
|
|
239
|
+
}}
|
|
240
|
+
>
|
|
241
|
+
<MonthRangePicker
|
|
242
|
+
{...props}
|
|
243
|
+
value={value}
|
|
244
|
+
onChange={(event) => {
|
|
245
|
+
setValue(event.target.value);
|
|
246
|
+
}}
|
|
247
|
+
/>
|
|
248
|
+
<Button onClick={() => setValue("")}>Reset</Button>
|
|
249
|
+
</div>
|
|
218
250
|
```
|
|
219
251
|
|
|
220
252
|
## Fiscal Period Report
|
|
@@ -267,9 +299,7 @@ function SubscriptionForm() {
|
|
|
267
299
|
onChange={(e) => setDuration(e.target.value)}
|
|
268
300
|
disablePast
|
|
269
301
|
helperText={
|
|
270
|
-
getMonthsCount(duration) > 0
|
|
271
|
-
? `${getMonthsCount(duration)} month subscription`
|
|
272
|
-
: 'Select start and end months'
|
|
302
|
+
getMonthsCount(duration) > 0 ? `${getMonthsCount(duration)} month subscription` : 'Select start and end months'
|
|
273
303
|
}
|
|
274
304
|
required
|
|
275
305
|
/>
|
|
@@ -299,11 +329,7 @@ function YearOverYearComparison() {
|
|
|
299
329
|
onChange={(e) => setCurrentPeriod(e.target.value)}
|
|
300
330
|
disableFuture
|
|
301
331
|
/>
|
|
302
|
-
<MonthRangePicker
|
|
303
|
-
label="Previous Period (Auto-calculated)"
|
|
304
|
-
value={getPreviousPeriod(currentPeriod)}
|
|
305
|
-
disabled
|
|
306
|
-
/>
|
|
332
|
+
<MonthRangePicker label="Previous Period (Auto-calculated)" value={getPreviousPeriod(currentPeriod)} disabled />
|
|
307
333
|
</Stack>
|
|
308
334
|
);
|
|
309
335
|
}
|
|
@@ -331,9 +357,7 @@ function YearOverYearComparison() {
|
|
|
331
357
|
|
|
332
358
|
```tsx
|
|
333
359
|
// ✅ Good: Dynamic helper text
|
|
334
|
-
<MonthRangePicker
|
|
335
|
-
helperText={`${getMonthsCount(range)} months selected`}
|
|
336
|
-
/>
|
|
360
|
+
<MonthRangePicker helperText={`${getMonthsCount(range)} months selected`} />
|
|
337
361
|
```
|
|
338
362
|
|
|
339
363
|
3. **Set reasonable date constraints**: Use `minDate`, `maxDate`, `disableFuture`, or `disablePast` to prevent invalid selections at the UI level.
|
|
@@ -36,15 +36,7 @@ import { PercentageInput } from '@ceed/ads';
|
|
|
36
36
|
function MyComponent() {
|
|
37
37
|
const [rate, setRate] = React.useState(0);
|
|
38
38
|
|
|
39
|
-
return (
|
|
40
|
-
<PercentageInput
|
|
41
|
-
label="Tax Rate"
|
|
42
|
-
value={rate}
|
|
43
|
-
onChange={(e) => setRate(e.target.value)}
|
|
44
|
-
min={0}
|
|
45
|
-
max={100}
|
|
46
|
-
/>
|
|
47
|
-
);
|
|
39
|
+
return <PercentageInput label="Tax Rate" value={rate} onChange={(e) => setRate(e.target.value)} min={0} max={100} />;
|
|
48
40
|
}
|
|
49
41
|
```
|
|
50
42
|
|
|
@@ -54,10 +46,10 @@ PercentageInput supports three sizes: `sm`, `md` (default), and `lg`.
|
|
|
54
46
|
|
|
55
47
|
```tsx
|
|
56
48
|
<Stack gap={2}>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
</Stack>
|
|
49
|
+
<PercentageInput size="sm" label="Small" />
|
|
50
|
+
<PercentageInput size="md" label="Medium" />
|
|
51
|
+
<PercentageInput size="lg" label="Large" />
|
|
52
|
+
</Stack>
|
|
61
53
|
```
|
|
62
54
|
|
|
63
55
|
## Form Features
|
|
@@ -146,8 +138,10 @@ Set `min` and `max` to enforce value boundaries. When the entered value is outsi
|
|
|
146
138
|
```
|
|
147
139
|
|
|
148
140
|
```tsx
|
|
149
|
-
<PercentageInput min={10} defaultValue={5}
|
|
150
|
-
{
|
|
141
|
+
<PercentageInput min={10} defaultValue={5} />;
|
|
142
|
+
{
|
|
143
|
+
/* Shows error because 5 < 10 */
|
|
144
|
+
}
|
|
151
145
|
```
|
|
152
146
|
|
|
153
147
|
### Maximum Value
|
|
@@ -163,8 +157,10 @@ Set `min` and `max` to enforce value boundaries. When the entered value is outsi
|
|
|
163
157
|
```
|
|
164
158
|
|
|
165
159
|
```tsx
|
|
166
|
-
<PercentageInput max={500} defaultValue={5000}
|
|
167
|
-
{
|
|
160
|
+
<PercentageInput max={500} defaultValue={5000} />;
|
|
161
|
+
{
|
|
162
|
+
/* Shows error because 5000 > 500 */
|
|
163
|
+
}
|
|
168
164
|
```
|
|
169
165
|
|
|
170
166
|
## Decimal Scale
|
|
@@ -219,20 +215,8 @@ function DiscountSetting() {
|
|
|
219
215
|
function TaxRateForm() {
|
|
220
216
|
return (
|
|
221
217
|
<Stack gap={2}>
|
|
222
|
-
<PercentageInput
|
|
223
|
-
|
|
224
|
-
defaultValue={10}
|
|
225
|
-
maxDecimalScale={2}
|
|
226
|
-
min={0}
|
|
227
|
-
max={100}
|
|
228
|
-
/>
|
|
229
|
-
<PercentageInput
|
|
230
|
-
label="Local Tax Rate"
|
|
231
|
-
defaultValue={2.5}
|
|
232
|
-
maxDecimalScale={2}
|
|
233
|
-
min={0}
|
|
234
|
-
max={50}
|
|
235
|
-
/>
|
|
218
|
+
<PercentageInput label="VAT Rate" defaultValue={10} maxDecimalScale={2} min={0} max={100} />
|
|
219
|
+
<PercentageInput label="Local Tax Rate" defaultValue={2.5} maxDecimalScale={2} min={0} max={50} />
|
|
236
220
|
</Stack>
|
|
237
221
|
);
|
|
238
222
|
}
|