Commit bea3fa2
NextJS 13 App router / RSC support (themesberg#994)
* feat: nextJS 13 RSC support; initial approach - ditch `useTheme` react context, use polymorphic singleton (cross env: client/server)
BETA IDEA
* add missing `'use client';`
* add more missing `'use client';`
* refactor: remove `ThemeContext`; create `useThemeMode` hook and persist in LS; polymorphic custom theme init (server/client)
* refactor: `useThemeMode` - cleanup; change LS key name to be specific
* simplify theme init
* fix: `Flowbite` test
* remove redundant TS HTMLDivElement types to `Flowbite` component
* fix: build failure due to variable not being used
* update: RSC demo page
* fix: import types
* fix: SSR error
* feat: sync all tabs with the latest theme mode value
* abstract away hook
* refactor: import/export hierarchy; simplify package dependency graph, avoid circular imports errors
* keep `useThemeMode` state in sync inbetween instances
* update demo RSC page
* fix: conflicts after merge with main
* refactor: `Flowbite` exports
* fix: `FloatingLabel` export
* fix: `FloatingLabel` imports + use new `getTheme` function
* refactor: allow mutation of `getTheme` return object; abstract `cloneDeep` and `isObject`
* refactor: theme init; theme mode hook: add `auto` mode as well + extend API
* fix: performance improvements: improve for loops, lower garbage collector size; add some tests
* fix: `use-client` spacing
* refactor: inline fallback return
* fix: strict type imports
* fix: build - add `ts-expect-error` description
* refactor: embed `mode` into theme init flow
* remove demo page
* fix `FloatingLabel` imports/exports
* fix: flowbite test
* fix: `blockquote` imports
* fix: export `Blockquote`
* fix: import type
* refactor: rename `useWatchLSValue` to be more explicit: `useWatchLocalStorageValue`
---------
Co-authored-by: Sebastian Sutu <sebastian.sutu@sensidev.com>1 parent 232de5a commit bea3fa2
File tree
158 files changed
+1036
-712
lines changed- app/docs/forms/floating-label
- src
- components
- Accordion
- Alert
- Avatar
- Badge
- Blockquote
- Breadcrumb
- Button
- Card
- Carousel
- Checkbox
- DarkThemeToggle
- Datepicker
- Views
- Dropdown
- FileInput
- FloatingLabel
- Floating
- Flowbite
- HelperText
- Kbd
- Label
- ListGroup
- Modal
- Pagination
- Progress
- Radio
- RangeSlider
- Rating
- Select
- Sidebar
- Spinner
- Table
- Tab
- TextInput
- Textarea
- Timeline
- Toast
- ToggleSwitch
- Tooltip
- helpers
- theme-store
- init
- types
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
158 files changed
+1036
-712
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
| 2 | + | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
5 | | - | |
6 | | - | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
61 | | - | |
| 64 | + | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | | - | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| |||
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | | - | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | | - | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
0 commit comments