remix 3.0.0-rc.4 → 3.0.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 (191) hide show
  1. package/INDEX.md +6 -21
  2. package/README.md +1 -1
  3. package/dist/component/dev/refresh.d.ts +2 -0
  4. package/dist/component/dev/refresh.d.ts.map +1 -0
  5. package/dist/{ui → component}/dev/refresh.js +1 -1
  6. package/dist/component/jsx-dev-runtime.d.ts +2 -0
  7. package/dist/component/jsx-dev-runtime.d.ts.map +1 -0
  8. package/dist/{ui → component}/jsx-dev-runtime.js +1 -1
  9. package/dist/component/jsx-runtime.d.ts +2 -0
  10. package/dist/component/jsx-runtime.d.ts.map +1 -0
  11. package/dist/{ui → component}/jsx-runtime.js +1 -1
  12. package/dist/component/server.d.ts +2 -0
  13. package/dist/component/server.d.ts.map +1 -0
  14. package/dist/{ui → component}/server.js +1 -1
  15. package/dist/component/test.d.ts +2 -0
  16. package/dist/component/test.d.ts.map +1 -0
  17. package/dist/{ui → component}/test.js +1 -1
  18. package/dist/component-hmr/assets.d.ts +2 -0
  19. package/dist/component-hmr/assets.d.ts.map +1 -0
  20. package/dist/{ui-hmr.js → component-hmr/assets.js} +1 -1
  21. package/dist/component-hmr/node.d.ts +3 -0
  22. package/dist/component-hmr/node.d.ts.map +1 -0
  23. package/dist/{ui-hmr → component-hmr}/node.js +1 -1
  24. package/dist/component-hmr/runtime/browser.d.ts +2 -0
  25. package/dist/component-hmr/runtime/browser.d.ts.map +1 -0
  26. package/dist/{ui-hmr → component-hmr}/runtime/browser.js +1 -1
  27. package/dist/component-hmr/runtime/server.d.ts +2 -0
  28. package/dist/component-hmr/runtime/server.d.ts.map +1 -0
  29. package/dist/{ui-hmr → component-hmr}/runtime/server.js +1 -1
  30. package/dist/component-hmr.d.ts +2 -0
  31. package/dist/component-hmr.d.ts.map +1 -0
  32. package/dist/{ui-hmr/assets.js → component-hmr.js} +1 -1
  33. package/dist/component.d.ts +2 -0
  34. package/dist/component.d.ts.map +1 -0
  35. package/dist/{ui/anchor.js → component.js} +1 -1
  36. package/guides/01-start-here.md +20 -20
  37. package/guides/02-routing-and-controllers.md +1 -1
  38. package/guides/03-request-handling.md +1 -1
  39. package/guides/04-rendering-ui.md +41 -307
  40. package/guides/05-interactivity.md +42 -37
  41. package/guides/06-streaming-ui-with-frames.md +28 -70
  42. package/guides/07-animation.md +41 -35
  43. package/guides/08-data-and-validation.md +423 -27
  44. package/guides/09-forms-and-mutations.md +250 -25
  45. package/guides/13-testing.md +10 -10
  46. package/guides/14-cli-and-tooling.md +2 -2
  47. package/package.json +96 -180
  48. package/src/assets/README.md +12 -12
  49. package/src/cli/README.md +3 -3
  50. package/src/{ui → component}/README.md +31 -75
  51. package/src/{ui → component}/dev/refresh.ts +1 -1
  52. package/src/{ui → component}/jsx-dev-runtime.ts +1 -1
  53. package/src/{ui → component}/jsx-runtime.ts +1 -1
  54. package/src/{ui → component}/server/README.md +8 -8
  55. package/src/{ui → component}/server.ts +1 -1
  56. package/src/{ui → component}/test/README.md +6 -6
  57. package/src/{ui → component}/test.ts +1 -1
  58. package/src/{ui-hmr → component-hmr}/README.md +13 -13
  59. package/src/{ui-hmr → component-hmr}/assets.ts +1 -1
  60. package/src/{ui-hmr → component-hmr}/node.ts +1 -1
  61. package/src/{ui-hmr → component-hmr}/runtime/browser.ts +1 -1
  62. package/src/{ui-hmr → component-hmr}/runtime/server.ts +1 -1
  63. package/{dist/ui/accordion.js → src/component-hmr.ts} +1 -1
  64. package/{dist/ui/tabs.js → src/component.ts} +1 -1
  65. package/src/data-table/README.md +2 -1
  66. package/src/multiple-import-maps-polyfill/README.md +3 -3
  67. package/src/node-hmr/README.md +6 -6
  68. package/src/render-middleware/README.md +5 -5
  69. package/src/spa/README.md +4 -4
  70. package/src/test/README.md +4 -4
  71. package/dist/ui/accordion/primitives.d.ts +0 -2
  72. package/dist/ui/accordion/primitives.d.ts.map +0 -1
  73. package/dist/ui/accordion/primitives.js +0 -2
  74. package/dist/ui/accordion.d.ts +0 -2
  75. package/dist/ui/accordion.d.ts.map +0 -1
  76. package/dist/ui/anchor.d.ts +0 -2
  77. package/dist/ui/anchor.d.ts.map +0 -1
  78. package/dist/ui/animation.d.ts +0 -2
  79. package/dist/ui/animation.d.ts.map +0 -1
  80. package/dist/ui/animation.js +0 -2
  81. package/dist/ui/breadcrumbs.d.ts +0 -2
  82. package/dist/ui/breadcrumbs.d.ts.map +0 -1
  83. package/dist/ui/breadcrumbs.js +0 -2
  84. package/dist/ui/button.d.ts +0 -3
  85. package/dist/ui/button.d.ts.map +0 -1
  86. package/dist/ui/button.js +0 -3
  87. package/dist/ui/checkbox.d.ts +0 -3
  88. package/dist/ui/checkbox.d.ts.map +0 -1
  89. package/dist/ui/checkbox.js +0 -3
  90. package/dist/ui/combobox/primitives.d.ts +0 -2
  91. package/dist/ui/combobox/primitives.d.ts.map +0 -1
  92. package/dist/ui/combobox/primitives.js +0 -2
  93. package/dist/ui/combobox.d.ts +0 -2
  94. package/dist/ui/combobox.d.ts.map +0 -1
  95. package/dist/ui/combobox.js +0 -2
  96. package/dist/ui/dev/refresh.d.ts +0 -2
  97. package/dist/ui/dev/refresh.d.ts.map +0 -1
  98. package/dist/ui/input.d.ts +0 -3
  99. package/dist/ui/input.d.ts.map +0 -1
  100. package/dist/ui/input.js +0 -3
  101. package/dist/ui/jsx-dev-runtime.d.ts +0 -2
  102. package/dist/ui/jsx-dev-runtime.d.ts.map +0 -1
  103. package/dist/ui/jsx-runtime.d.ts +0 -2
  104. package/dist/ui/jsx-runtime.d.ts.map +0 -1
  105. package/dist/ui/listbox.d.ts +0 -2
  106. package/dist/ui/listbox.d.ts.map +0 -1
  107. package/dist/ui/listbox.js +0 -2
  108. package/dist/ui/menu/primitives.d.ts +0 -2
  109. package/dist/ui/menu/primitives.d.ts.map +0 -1
  110. package/dist/ui/menu/primitives.js +0 -2
  111. package/dist/ui/menu.d.ts +0 -2
  112. package/dist/ui/menu.d.ts.map +0 -1
  113. package/dist/ui/menu.js +0 -2
  114. package/dist/ui/popover.d.ts +0 -2
  115. package/dist/ui/popover.d.ts.map +0 -1
  116. package/dist/ui/popover.js +0 -2
  117. package/dist/ui/radio.d.ts +0 -3
  118. package/dist/ui/radio.d.ts.map +0 -1
  119. package/dist/ui/radio.js +0 -3
  120. package/dist/ui/select/primitives.d.ts +0 -2
  121. package/dist/ui/select/primitives.d.ts.map +0 -1
  122. package/dist/ui/select/primitives.js +0 -2
  123. package/dist/ui/select.d.ts +0 -2
  124. package/dist/ui/select.d.ts.map +0 -1
  125. package/dist/ui/select.js +0 -2
  126. package/dist/ui/server.d.ts +0 -2
  127. package/dist/ui/server.d.ts.map +0 -1
  128. package/dist/ui/tabs/primitives.d.ts +0 -2
  129. package/dist/ui/tabs/primitives.d.ts.map +0 -1
  130. package/dist/ui/tabs/primitives.js +0 -2
  131. package/dist/ui/tabs.d.ts +0 -2
  132. package/dist/ui/tabs.d.ts.map +0 -1
  133. package/dist/ui/test.d.ts +0 -2
  134. package/dist/ui/test.d.ts.map +0 -1
  135. package/dist/ui/toggle/primitives.d.ts +0 -2
  136. package/dist/ui/toggle/primitives.d.ts.map +0 -1
  137. package/dist/ui/toggle/primitives.js +0 -2
  138. package/dist/ui/toggle.d.ts +0 -3
  139. package/dist/ui/toggle.d.ts.map +0 -1
  140. package/dist/ui/toggle.js +0 -3
  141. package/dist/ui-hmr/assets.d.ts +0 -2
  142. package/dist/ui-hmr/assets.d.ts.map +0 -1
  143. package/dist/ui-hmr/node.d.ts +0 -3
  144. package/dist/ui-hmr/node.d.ts.map +0 -1
  145. package/dist/ui-hmr/runtime/browser.d.ts +0 -2
  146. package/dist/ui-hmr/runtime/browser.d.ts.map +0 -1
  147. package/dist/ui-hmr/runtime/server.d.ts +0 -2
  148. package/dist/ui-hmr/runtime/server.d.ts.map +0 -1
  149. package/dist/ui-hmr.d.ts +0 -2
  150. package/dist/ui-hmr.d.ts.map +0 -1
  151. package/dist/ui.d.ts +0 -2
  152. package/dist/ui.d.ts.map +0 -1
  153. package/dist/ui.js +0 -2
  154. package/src/ui/accordion/README.md +0 -202
  155. package/src/ui/accordion/primitives.ts +0 -2
  156. package/src/ui/accordion.ts +0 -2
  157. package/src/ui/anchor/README.md +0 -196
  158. package/src/ui/anchor.ts +0 -2
  159. package/src/ui/animation/README.md +0 -318
  160. package/src/ui/animation.ts +0 -2
  161. package/src/ui/breadcrumbs/README.md +0 -55
  162. package/src/ui/breadcrumbs.ts +0 -2
  163. package/src/ui/button/README.md +0 -44
  164. package/src/ui/button.ts +0 -3
  165. package/src/ui/checkbox/README.md +0 -59
  166. package/src/ui/checkbox.ts +0 -3
  167. package/src/ui/combobox/README.md +0 -194
  168. package/src/ui/combobox/primitives.ts +0 -2
  169. package/src/ui/combobox.ts +0 -2
  170. package/src/ui/input/README.md +0 -52
  171. package/src/ui/input.ts +0 -3
  172. package/src/ui/listbox/README.md +0 -83
  173. package/src/ui/listbox.ts +0 -2
  174. package/src/ui/menu/README.md +0 -161
  175. package/src/ui/menu/primitives.ts +0 -2
  176. package/src/ui/menu.ts +0 -2
  177. package/src/ui/popover/README.md +0 -103
  178. package/src/ui/popover.ts +0 -2
  179. package/src/ui/radio/README.md +0 -53
  180. package/src/ui/radio.ts +0 -3
  181. package/src/ui/select/README.md +0 -117
  182. package/src/ui/select/primitives.ts +0 -2
  183. package/src/ui/select.ts +0 -2
  184. package/src/ui/tabs/README.md +0 -141
  185. package/src/ui/tabs/primitives.ts +0 -2
  186. package/src/ui/tabs.ts +0 -2
  187. package/src/ui/toggle/README.md +0 -56
  188. package/src/ui/toggle/primitives.ts +0 -2
  189. package/src/ui/toggle.ts +0 -3
  190. package/src/ui-hmr.ts +0 -2
  191. package/src/ui.ts +0 -2
@@ -1,141 +0,0 @@
1
- # tabs
2
-
3
- `Tabs` renders a tab control with one active tab and matching panels. Use it when related views share the same page space and the owning component may either control the active tab or let the tabs context manage it.
4
-
5
- ## Component Usage
6
-
7
- ```tsx
8
- import { Tabs, TabList, Tab, TabPanel } from 'remix/ui/tabs'
9
-
10
- export function ProjectTabs() {
11
- return (
12
- <Tabs defaultActiveTab="overview">
13
- <TabList aria-label="Project sections">
14
- <Tab name="overview">Overview</Tab>
15
- <Tab name="activity">Activity</Tab>
16
- <Tab name="settings">Settings</Tab>
17
- </TabList>
18
-
19
- <TabPanel name="overview">Project summary.</TabPanel>
20
- <TabPanel name="activity">Recent changes.</TabPanel>
21
- <TabPanel name="settings">Project settings.</TabPanel>
22
- </Tabs>
23
- )
24
- }
25
- ```
26
-
27
- Control the active tab when state should live in the owning component:
28
-
29
- ```tsx
30
- import type { Handle } from 'remix/ui'
31
- import { Tabs, TabList, Tab, TabPanel } from 'remix/ui/tabs'
32
-
33
- export function ControlledTabs(handle: Handle) {
34
- let activeTab = 'overview'
35
-
36
- return () => (
37
- <Tabs
38
- activeTab={activeTab}
39
- onActiveTabChange={(nextActiveTab) => {
40
- activeTab = nextActiveTab
41
- void handle.update()
42
- }}
43
- >
44
- <TabList aria-label="Project sections">
45
- <Tab name="overview">Overview</Tab>
46
- <Tab name="activity">Activity</Tab>
47
- </TabList>
48
-
49
- <TabPanel name="overview">Project summary.</TabPanel>
50
- <TabPanel name="activity">Recent changes.</TabPanel>
51
- </Tabs>
52
- )
53
- }
54
- ```
55
-
56
- Listen for bubbling `TabsChangeEvent` events with `onTabsChange` from `remix/ui/tabs/primitives`.
57
-
58
- ```tsx
59
- import { onTabsChange } from 'remix/ui/tabs/primitives'
60
- import { Tabs, TabList, Tab, TabPanel } from 'remix/ui/tabs'
61
-
62
- export function TrackedTabs() {
63
- return (
64
- <div
65
- mix={[
66
- onTabsChange((event) => {
67
- console.log(event.previousActiveTab, event.activeTab)
68
- }),
69
- ]}
70
- >
71
- <Tabs defaultActiveTab="overview">
72
- <TabList aria-label="Project sections">
73
- <Tab name="overview">Overview</Tab>
74
- <Tab name="activity">Activity</Tab>
75
- </TabList>
76
- <TabPanel name="overview">Project summary.</TabPanel>
77
- <TabPanel name="activity">Recent changes.</TabPanel>
78
- </Tabs>
79
- </div>
80
- )
81
- }
82
- ```
83
-
84
- ## Primitive Usage
85
-
86
- Use the lower-level primitives when app code owns the markup and styles:
87
-
88
- ```tsx
89
- import * as tabs from 'remix/ui/tabs/primitives'
90
- import { listStyle, panelStyle, rootStyle, tabStyle } from './tabs.styles'
91
-
92
- export function PrimitiveTabs() {
93
- return (
94
- <tabs.Context defaultActiveTab="overview">
95
- <div mix={[rootStyle, tabs.root()]}>
96
- <div mix={[listStyle, tabs.list()]} aria-label="Project sections">
97
- <button mix={[tabStyle, tabs.tab({ name: 'overview' })]} type="button">
98
- Overview
99
- </button>
100
- <button mix={[tabStyle, tabs.tab({ name: 'activity' })]} type="button">
101
- Activity
102
- </button>
103
- </div>
104
-
105
- <div mix={[panelStyle, tabs.panel({ name: 'overview' })]}>Project summary.</div>
106
- <div mix={[panelStyle, tabs.panel({ name: 'activity' })]}>Recent changes.</div>
107
- </div>
108
- </tabs.Context>
109
- )
110
- }
111
- ```
112
-
113
- ## `remix/ui/tabs`
114
-
115
- - `Tabs`: root component. Supports controlled `activeTab`, uncontrolled `defaultActiveTab`, `onActiveTabChange`, `disabled`, and `size: 'md' | 'lg'`.
116
- - `TabList`: tablist wrapper that lays out the tabs in a track and applies the tablist primitive.
117
- - `Tab`: button for one tab `name`. The active tab uses the toggle slider treatment and button-sized text. Pass `disabled` to prevent activation.
118
- - `TabPanel`: panel for one tab `name`.
119
- - `rootStyle`, `listStyle`, `tabStyle`, and `panelStyle`: flat style mixins used by the component markup.
120
- - `onTabsChange` and `TabsChangeEvent`: re-exported primitive event helpers.
121
- - `TabsProps`, `TabListProps`, `TabProps`, `TabPanelProps`, and `TabsSize`: public TypeScript types for the composed APIs.
122
-
123
- ## `remix/ui/tabs/primitives`
124
-
125
- - `Context`: lower-level provider for custom tabs composition.
126
- - `root()`: wires the root element and bubbling change events.
127
- - `list()`: wires the tablist role and disabled state.
128
- - `tab({ name, disabled })`: wires a tab button with selected state, ids, keyboard activation, and pointer activation.
129
- - `panel({ name })`: wires the matching tab panel id, hidden state, inert state, and label relationship.
130
- - `onTabsChange(...)`: event mixin for the bubbling `TabsChangeEvent`.
131
- - `TabsChangeEvent`: bubbling event with `activeTab` and `previousActiveTab`.
132
- - `TabsContextProps`, `TabsContextValue`, `TabsRegisteredTab`, `TabsActivationDirection`, `TabsRootOptions`, `TabListOptions`, `TabOptions`, and `TabPanelOptions`: primitive prop and option types for custom composition.
133
-
134
- ## Behavior Notes
135
-
136
- - If neither `activeTab` nor `defaultActiveTab` is provided, the first enabled tab becomes active.
137
- - Arrow keys activate the next or previous enabled tab. `Home` and `End` activate the first and last enabled tabs.
138
- - `Enter`, `Space`, and pointer clicks activate the focused tab.
139
- - Root `disabled` disables every tab. Tab `disabled` only disables that tab.
140
- - Tabs and panels are linked with generated ids through `aria-controls`, `aria-labelledby`, and `aria-selected`.
141
- - Inactive panels receive `hidden`, `inert`, and `data-state="inactive"`.
@@ -1,2 +0,0 @@
1
- // IMPORTANT: This file is auto-generated, please do not edit manually.
2
- export * from '@remix-run/ui/tabs/primitives'
package/src/ui/tabs.ts DELETED
@@ -1,2 +0,0 @@
1
- // IMPORTANT: This file is auto-generated, please do not edit manually.
2
- export * from '@remix-run/ui/tabs'
@@ -1,56 +0,0 @@
1
- # toggle
2
-
3
- `toggle` is a style mixin for checkbox inputs rendered as switches. Use native input props for normal form behavior, and compose it with `remix/ui/toggle/primitives` when you need the headless toggle state helpers or custom hosts.
4
-
5
- ## Usage
6
-
7
- ```tsx
8
- import toggle from 'remix/ui/toggle'
9
-
10
- function NotificationSetting() {
11
- return () => (
12
- <label>
13
- <input mix={toggle({ size: 'lg' })} defaultChecked />
14
- Email notifications
15
- </label>
16
- )
17
- }
18
- ```
19
-
20
- ## Primitive Usage
21
-
22
- Use the lower-level primitive when app code needs normalized checked state, toggle change events, or a non-input host:
23
-
24
- ```tsx
25
- import toggle from 'remix/ui/toggle'
26
- import * as togglePrimitive from 'remix/ui/toggle/primitives'
27
-
28
- function CustomToggle() {
29
- return () => (
30
- <button
31
- aria-label="Notifications"
32
- mix={[...toggle(), togglePrimitive.control({ defaultChecked: true })]}
33
- />
34
- )
35
- }
36
- ```
37
-
38
- ## `remix/ui/toggle`
39
-
40
- - `toggle(options)`: styles a native checkbox input as a switch and supplies `type="checkbox"` plus `role="switch"` when the host is an `<input>` without an explicit non-checkbox `type`. Supports `size: 'md' | 'lg'` and defaults to `'md'`.
41
- - `onToggleChange(handler)`: re-exported primitive event mixin.
42
- - `ToggleChangeEvent`: re-exported primitive event class.
43
- - `ToggleSize` and `ToggleOptions`: public TypeScript types for the style mixin.
44
-
45
- ## `remix/ui/toggle/primitives`
46
-
47
- - `control(options)`: wires a boolean switch control with checked state, ARIA, keyboard, and native input behavior.
48
- - `onToggleChange(handler)`: event mixin for bubbling toggle changes.
49
- - `ToggleChangeEvent`: event class dispatched when a toggle changes.
50
- - `ToggleControlOptions`: primitive options for controlled and uncontrolled state.
51
-
52
- ## Behavior Notes
53
-
54
- - Checked styles apply through `:checked`, `[aria-checked="true"]`, or `[data-state="checked"]`.
55
- - Native checkbox switches use the native `checked` attribute for state. Custom hosts use `role="switch"` and `aria-checked="true"` or `aria-checked="false"`.
56
- - Every switch needs an accessible name, usually from visible label text, `aria-label`, or `aria-labelledby`.
@@ -1,2 +0,0 @@
1
- // IMPORTANT: This file is auto-generated, please do not edit manually.
2
- export * from '@remix-run/ui/toggle/primitives'
package/src/ui/toggle.ts DELETED
@@ -1,3 +0,0 @@
1
- // IMPORTANT: This file is auto-generated, please do not edit manually.
2
- export * from '@remix-run/ui/toggle'
3
- export { default } from '@remix-run/ui/toggle'
package/src/ui-hmr.ts DELETED
@@ -1,2 +0,0 @@
1
- // IMPORTANT: This file is auto-generated, please do not edit manually.
2
- export * from '@remix-run/ui-hmr'
package/src/ui.ts DELETED
@@ -1,2 +0,0 @@
1
- // IMPORTANT: This file is auto-generated, please do not edit manually.
2
- export * from '@remix-run/ui'