@jirawatpyk/aura-react 4.5.0 → 4.6.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 CHANGED
@@ -29,7 +29,7 @@ One HTML file, no install — the packages are on npmjs, so jsDelivr serves them
29
29
  ## Install
30
30
 
31
31
  ```bash
32
- npm i @jirawatpyk/aura-react @jirawatpyk/aura-tokens # react >= 18 is a peer; import from "@jirawatpyk/aura-react"
32
+ npm i @jirawatpyk/aura-react @jirawatpyk/aura-tokens # React 18 or 19; import from "@jirawatpyk/aura-react"
33
33
  # or under the short names the docs use (imports stay `@aura/...`):
34
34
  npm i @aura/react@npm:@jirawatpyk/aura-react @aura/tokens@npm:@jirawatpyk/aura-tokens
35
35
  ```
@@ -65,7 +65,21 @@ export default function Root() {
65
65
 
66
66
  ## Components (43)
67
67
 
68
- Actions: Button, IconButton, Menu, DropdownMenu, Tag · Forms: TextField, Textarea, Select, RadioGroup, Checkbox, Switch, Combobox, FileUpload (+ `formatBytes`) · Dates & times: DatePicker, DateRangePicker, Calendar, TimePicker (+ `formatDate`, `parseDate`, `parseTime`) · Feedback: Alert, Toaster/`toast()`, Tooltip, StatusPill, Badge, Progress, Skeleton, EmptyState · Overlays: Dialog, Drawer, Popover · Data: DataTable, Stat · Layout: AppShell, Container, Stack, Grid, Accordion, Pagination, Card, Tabs, SideNav, Breadcrumb, Avatar, Surface, Icon · Hooks: `useBreakpoint`, `useResponsive`, `breakpoints`, `useAuraLocale`.
68
+ Actions: Button, IconButton, Menu, DropdownMenu, Tag · Forms: TextField, Textarea, Select, RadioGroup, Checkbox, Switch, Combobox, FileUpload (+ `formatBytes`) · Dates & times: DatePicker, DateRangePicker, Calendar, TimePicker (+ `formatDate`, `parseDate`, `parseTime`) · Feedback: Alert, Toaster/`toast()`, Tooltip, StatusPill, Badge, Progress, Skeleton, EmptyState · Overlays: Dialog, Drawer, Popover · Data: DataTable, Stat · Layout: AppShell, Container, Stack, Grid, Accordion, Pagination, Card, Tabs, SideNav, Breadcrumb, Avatar, Surface, Icon · Theme: ColorSchemeToggle, ColorSchemeScript, `useColorScheme`, ThemeStyle/`createTheme` · Hooks: `useBreakpoint`, `useResponsive`, `breakpoints`, `useAuraLocale`.
69
+
70
+ ## Light and dark
71
+
72
+ The tokens carry both schemes; `<html data-theme="light|dark|system">` picks one (`system` follows the OS in pure CSS).
73
+
74
+ ```tsx
75
+ <html lang="th" data-theme="system" suppressHydrationWarning>
76
+ <head><ColorSchemeScript /></head> {/* applies the saved choice before first paint — no flash */}
77
+ ...
78
+ <ColorSchemeToggle /> {/* Light / Dark / System menu; saved in localStorage */}
79
+ const { scheme, resolved, setScheme } = useColorScheme();
80
+ ```
81
+
82
+ Tailwind's `dark:` variant keeps working: the `.dark` class on `<html>` is kept in step.
69
83
 
70
84
  ## Refs and forms
71
85
 
@@ -89,12 +103,13 @@ Portals (Dialog, Drawer, menus, pickers, toasts) wait until after hydration; `us
89
103
  npm run build # dist/ (ESM, CJS, IIFE, CSS, types)
90
104
  npm run test:ssr # server-render every component
91
105
  npm run typecheck # tsc --strict over src/, then types-test/usage.tsx against the public API
92
- npm run test:pilots # builds the pilots + 4 brand themes, then 37 behaviour/axe checks at 1440/820/390px (Playwright for Python, axe-core)
106
+ npm run size # gzip size of what projects import, against size-budgets.json
107
+ npm run test:pilots # builds the pilots + 4 brand themes, then 37 behaviour/axe checks at 1440/820/390px (Playwright for Python, axe-core)
93
108
  ```
94
109
 
95
110
  ## Source
96
111
 
97
- `src/` is TypeScript (strict). Public prop types live in `src/types.ts` with their docs; each component imports its props from there and `forwardRef`s with them, so the published `dist/index.d.ts` is generated from the code and can't drift from it. Components still use `React.createElement` (`h`) — moving them to JSX is the next step.
112
+ `src/` is TypeScript (strict) and JSX, formatted with Prettier (`npm run format`). Public prop types live in `src/types.ts` with their docs; each component imports its props from there and `forwardRef`s with them, so the published `dist/index.d.ts` is generated from the code and can't drift from it. The build compiles JSX to `React.createElement` (classic runtime), so the `window.Aura` script needs only `window.React`.
98
113
 
99
114
  ## Pilots
100
115