@jirawatpyk/aura-react 4.11.0 → 4.13.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 +17 -3
- package/dist/aura.bundle.js +955 -433
- package/dist/cjs/index.cjs +954 -432
- package/dist/esm/Command.js +213 -0
- package/dist/esm/DatePicker.js +18 -1
- package/dist/esm/FilterBar.js +112 -0
- package/dist/esm/FormErrorSummary.js +76 -0
- package/dist/esm/PasswordField.js +38 -0
- package/dist/esm/Toaster.js +60 -14
- package/dist/esm/index.js +10 -1
- package/dist/esm/locale.js +39 -0
- package/dist/index.d.ts +114 -1
- package/dist/styles.css +100 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ export default function Root() {
|
|
|
65
65
|
|
|
66
66
|
## Components (49)
|
|
67
67
|
|
|
68
|
-
Actions: Button, IconButton, Menu, DropdownMenu, Tag · Forms: TextField, Textarea, NumberField, Select, RadioGroup, Checkbox, Switch, SegmentedControl, Combobox (one value, or `multiple`), FileUpload (+ `formatBytes`) · Dates & times: DatePicker, DateRangePicker, Calendar, TimePicker (+ `formatDate`, `parseDate`, `parseTime`) · Feedback: Alert, Toaster/`toast()
|
|
68
|
+
Actions: Button, IconButton, Menu, DropdownMenu, Tag · Forms: TextField, PasswordField, Textarea, NumberField, Select, RadioGroup, Checkbox, Switch, SegmentedControl, Combobox (one value, or `multiple`), FileUpload (+ `formatBytes`) · Dates & times: DatePicker, DateRangePicker, Calendar, TimePicker (+ `useFormatDate`, `formatDate`, `parseDate`, `parseTime`) · Feedback: Alert, FormErrorSummary, Toaster/`toast()` (+ `.success/.error/.warning/.info/.loading`), Tooltip, StatusPill, Badge, Progress, Skeleton, EmptyState · Overlays: Dialog, Drawer, Popover · Data: DataTable, FilterBar, Stat · Navigation: Command (⌘K palette) · Layout: AppShell, Container, Stack, Grid, Accordion, Pagination, Card, Tabs, Stepper, SideNav, Breadcrumb, Avatar, Surface, Icon · Theme: ColorSchemeToggle, ColorSchemeScript, `useColorScheme`, ThemeStyle/`createTheme` · Hooks: `useBreakpoint`, `useResponsive`, `breakpoints`, `useAuraLocale`.
|
|
69
69
|
|
|
70
70
|
## Router links, Swedish, motion
|
|
71
71
|
|
|
@@ -74,10 +74,24 @@ import Link from 'next/link';
|
|
|
74
74
|
<AuraProvider locale="sv" linkComponent={Link}> {/* th | en | sv */}
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
`linkComponent` is used by Button `href`, Breadcrumb, Pagination `getHref`, Stat `href`, SideNav and DataTable row/pager links. Only `th` shows Buddhist-era years; `en` and `sv` are Gregorian (`sv` weeks start Monday). **Without a provider, components are English with Gregorian dates** — wrap Thai apps in `<AuraProvider locale="th">`. `formatDate()` has no provider to read
|
|
77
|
+
`linkComponent` is used by Button `href`, Breadcrumb, Pagination `getHref`, Stat `href`, SideNav and DataTable row/pager links. Only `th` shows Buddhist-era years; `en` and `sv` are Gregorian (`sv` weeks start Monday). **Without a provider, components are English with Gregorian dates** — wrap Thai apps in `<AuraProvider locale="th">`. For dates in your own components use `useFormatDate()` — it follows the provider (`const fmt = useFormatDate(); fmt(iso, { format: 'long' })`). Plain `formatDate()` has no provider to read and stays Thai unless you pass `locale`. Values are always Gregorian ISO dates.
|
|
78
78
|
|
|
79
79
|
Motion: skeleton pulses and indeterminate bars honour `prefers-reduced-motion: reduce` — skeletons stop (a static bar), spinners and progress bars slow to a third.
|
|
80
80
|
|
|
81
|
+
## Toasts, forms, filters, rich text, ⌘K
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
const id = toast.loading('Saving'); // spinner, stays
|
|
85
|
+
toast.success('Saved', { id }); // same id: replaced in place, never stacked
|
|
86
|
+
toast.error('Could not save'); // danger = role="alert"; the rest role="status"
|
|
87
|
+
|
|
88
|
+
<FormErrorSummary errors={formState.errors} focusKey={formState.submitCount} onSelect={setFocus} />
|
|
89
|
+
<PasswordField label="Password" {...register('password')} />
|
|
90
|
+
<FilterBar search={q} onSearchChange={setQ} filters={chips} onClearAll={clear} resultCount={total}>…</FilterBar>
|
|
91
|
+
<div className="aura-prose" dangerouslySetInnerHTML={{ __html: sanitised }} /> {/* p, h1–h4, lists, blockquote, hr, a, strong, em, u */}
|
|
92
|
+
<Command open={open} onOpenChange={setOpen} items={commands} /> {/* ⌘K / Ctrl+K toggles it */}
|
|
93
|
+
```
|
|
94
|
+
|
|
81
95
|
## Phones and touch
|
|
82
96
|
|
|
83
97
|
Under 640px every text control uses 16px text (iOS Safari doesn't zoom). On touch screens (`pointer: coarse`) IconButton keeps its 32px look with a 44px hit area, and Radio, Checkbox and Switch rows are at least 44px with the whole row as the target. `<Button fullWidth>` fills its row and wraps long Thai or Swedish labels.
|
|
@@ -110,7 +124,7 @@ Every component forwards `ref` to its real element — fields to the `<input>`/`
|
|
|
110
124
|
|
|
111
125
|
## Thai dates
|
|
112
126
|
|
|
113
|
-
Values are ISO strings (`2026-09-18`); with `locale="th"` display is Thai with Buddhist-era years (`18 ก.ย. 2569`). People can type `18/09/2569`, `18/09/2026`, `2026-09-18` or `18 ก.ย. 2569`. Store ISO, never พ.ศ. `
|
|
127
|
+
Values are ISO strings (`2026-09-18`); with `locale="th"` display is Thai with Buddhist-era years (`18 ก.ย. 2569`). People can type `18/09/2569`, `18/09/2026`, `2026-09-18` or `18 ก.ย. 2569`. Store ISO, never พ.ศ. In components, `useFormatDate()(iso, { format: 'long' })` → `18 กันยายน 2569` under `locale="th"`, `18 September 2026` under `en`. `parseDate(text)` reads any of these forms in every locale.
|
|
114
128
|
|
|
115
129
|
## Server rendering
|
|
116
130
|
|