@proyecto-viviana/solidaria-components 0.2.5 → 0.3.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/LICENSE +21 -0
- package/README.md +39 -272
- package/dist/ActionBar.d.ts +79 -0
- package/dist/ActionBar.d.ts.map +1 -0
- package/dist/ActionGroup.d.ts +74 -0
- package/dist/ActionGroup.d.ts.map +1 -0
- package/dist/Alert.d.ts +70 -0
- package/dist/Alert.d.ts.map +1 -0
- package/dist/Autocomplete.d.ts +5 -5
- package/dist/Autocomplete.d.ts.map +1 -1
- package/dist/Breadcrumbs.d.ts +27 -8
- package/dist/Breadcrumbs.d.ts.map +1 -1
- package/dist/Button.d.ts +28 -5
- package/dist/Button.d.ts.map +1 -1
- package/dist/Calendar.d.ts +51 -7
- package/dist/Calendar.d.ts.map +1 -1
- package/dist/Checkbox.d.ts +33 -8
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/Collection.d.ts +130 -0
- package/dist/Collection.d.ts.map +1 -0
- package/dist/Color.d.ts +210 -9
- package/dist/Color.d.ts.map +1 -1
- package/dist/ColorEditor.d.ts +42 -0
- package/dist/ColorEditor.d.ts.map +1 -0
- package/dist/ComboBox.d.ts +146 -16
- package/dist/ComboBox.d.ts.map +1 -1
- package/dist/ContextualHelpTrigger.d.ts +40 -0
- package/dist/ContextualHelpTrigger.d.ts.map +1 -0
- package/dist/DateField.d.ts +35 -8
- package/dist/DateField.d.ts.map +1 -1
- package/dist/DatePicker.d.ts +101 -5
- package/dist/DatePicker.d.ts.map +1 -1
- package/dist/DateRangePickerContext.d.ts +30 -0
- package/dist/DateRangePickerContext.d.ts.map +1 -0
- package/dist/Dialog.d.ts +5 -5
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Disclosure.d.ts +25 -5
- package/dist/Disclosure.d.ts.map +1 -1
- package/dist/DragAndDrop.d.ts +80 -0
- package/dist/DragAndDrop.d.ts.map +1 -0
- package/dist/DragPreview.d.ts +14 -0
- package/dist/DragPreview.d.ts.map +1 -0
- package/dist/DropZone.d.ts +27 -0
- package/dist/DropZone.d.ts.map +1 -0
- package/dist/FieldError.d.ts +27 -0
- package/dist/FieldError.d.ts.map +1 -0
- package/dist/FileTrigger.d.ts +26 -0
- package/dist/FileTrigger.d.ts.map +1 -0
- package/dist/Focusable.d.ts +27 -0
- package/dist/Focusable.d.ts.map +1 -0
- package/dist/Form.d.ts +41 -0
- package/dist/Form.d.ts.map +1 -0
- package/dist/GridList.d.ts +69 -10
- package/dist/GridList.d.ts.map +1 -1
- package/dist/HiddenDateInput.d.ts +26 -0
- package/dist/HiddenDateInput.d.ts.map +1 -0
- package/dist/HiddenTimeInput.d.ts +25 -0
- package/dist/HiddenTimeInput.d.ts.map +1 -0
- package/dist/Icon.d.ts +57 -0
- package/dist/Icon.d.ts.map +1 -0
- package/dist/Keyboard.d.ts +13 -0
- package/dist/Keyboard.d.ts.map +1 -0
- package/dist/Landmark.d.ts +3 -3
- package/dist/Landmark.d.ts.map +1 -1
- package/dist/Link.d.ts +10 -4
- package/dist/Link.d.ts.map +1 -1
- package/dist/ListBox.d.ts +73 -11
- package/dist/ListBox.d.ts.map +1 -1
- package/dist/ListDropTargetDelegate.d.ts +38 -0
- package/dist/ListDropTargetDelegate.d.ts.map +1 -0
- package/dist/Menu.d.ts +79 -10
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Meter.d.ts +4 -4
- package/dist/Meter.d.ts.map +1 -1
- package/dist/Modal.d.ts +6 -4
- package/dist/Modal.d.ts.map +1 -1
- package/dist/NumberField.d.ts +10 -12
- package/dist/NumberField.d.ts.map +1 -1
- package/dist/Popover.d.ts +32 -7
- package/dist/Popover.d.ts.map +1 -1
- package/dist/Pressable.d.ts +27 -0
- package/dist/Pressable.d.ts.map +1 -0
- package/dist/ProgressBar.d.ts +6 -4
- package/dist/ProgressBar.d.ts.map +1 -1
- package/dist/RadioGroup.d.ts +43 -9
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RangeCalendar.d.ts +39 -7
- package/dist/RangeCalendar.d.ts.map +1 -1
- package/dist/RouterProvider.d.ts +75 -0
- package/dist/RouterProvider.d.ts.map +1 -0
- package/dist/SearchField.d.ts +23 -21
- package/dist/SearchField.d.ts.map +1 -1
- package/dist/Select.d.ts +48 -7
- package/dist/Select.d.ts.map +1 -1
- package/dist/SelectionIndicator.d.ts +30 -0
- package/dist/SelectionIndicator.d.ts.map +1 -0
- package/dist/Separator.d.ts +9 -3
- package/dist/Separator.d.ts.map +1 -1
- package/dist/SharedElementTransition.d.ts +41 -0
- package/dist/SharedElementTransition.d.ts.map +1 -0
- package/dist/Slider.d.ts +15 -8
- package/dist/Slider.d.ts.map +1 -1
- package/dist/StepList.d.ts +90 -0
- package/dist/StepList.d.ts.map +1 -0
- package/dist/Switch.d.ts +11 -5
- package/dist/Switch.d.ts.map +1 -1
- package/dist/Table.d.ts +222 -19
- package/dist/Table.d.ts.map +1 -1
- package/dist/Tabs.d.ts +47 -10
- package/dist/Tabs.d.ts.map +1 -1
- package/dist/TagGroup.d.ts +22 -10
- package/dist/TagGroup.d.ts.map +1 -1
- package/dist/Text.d.ts +10 -0
- package/dist/Text.d.ts.map +1 -0
- package/dist/TextField.d.ts +19 -11
- package/dist/TextField.d.ts.map +1 -1
- package/dist/TimeField.d.ts +32 -7
- package/dist/TimeField.d.ts.map +1 -1
- package/dist/Toast.d.ts +29 -14
- package/dist/Toast.d.ts.map +1 -1
- package/dist/ToggleButton.d.ts +36 -0
- package/dist/ToggleButton.d.ts.map +1 -0
- package/dist/ToggleButtonGroup.d.ts +33 -0
- package/dist/ToggleButtonGroup.d.ts.map +1 -0
- package/dist/Toolbar.d.ts +7 -3
- package/dist/Toolbar.d.ts.map +1 -1
- package/dist/Tooltip.d.ts +58 -7
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/Tree.d.ts +102 -11
- package/dist/Tree.d.ts.map +1 -1
- package/dist/Virtualizer.d.ts +61 -0
- package/dist/Virtualizer.d.ts.map +1 -0
- package/dist/VirtualizerLayouts.d.ts +82 -0
- package/dist/VirtualizerLayouts.d.ts.map +1 -0
- package/dist/VisuallyHidden.d.ts +4 -2
- package/dist/VisuallyHidden.d.ts.map +1 -1
- package/dist/contexts.d.ts +6 -1
- package/dist/contexts.d.ts.map +1 -1
- package/dist/index.d.ts +73 -39
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23342 -10644
- package/dist/index.js.map +1 -7
- package/dist/index.jsx +18110 -0
- package/dist/index.jsx.map +1 -0
- package/dist/useDragAndDrop.d.ts +93 -0
- package/dist/useDragAndDrop.d.ts.map +1 -0
- package/dist/utils.d.ts +8 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/virtualizer/Layout.d.ts +79 -0
- package/dist/virtualizer/Layout.d.ts.map +1 -0
- package/package.json +33 -32
- package/src/ActionBar.tsx +251 -0
- package/src/ActionGroup.tsx +277 -0
- package/src/Alert.tsx +152 -0
- package/src/Autocomplete.tsx +39 -44
- package/src/Breadcrumbs.tsx +227 -72
- package/src/Button.tsx +315 -74
- package/src/Calendar.tsx +347 -141
- package/src/Checkbox.tsx +414 -123
- package/src/Collection.tsx +350 -0
- package/src/Color.tsx +1325 -284
- package/src/ColorEditor.tsx +213 -0
- package/src/ComboBox.tsx +644 -245
- package/src/ContextualHelpTrigger.tsx +195 -0
- package/src/DateField.tsx +274 -106
- package/src/DatePicker.tsx +892 -111
- package/src/DateRangePickerContext.tsx +44 -0
- package/src/Dialog.tsx +173 -104
- package/src/Disclosure.tsx +158 -105
- package/src/DragAndDrop.tsx +340 -0
- package/src/DragPreview.tsx +47 -0
- package/src/DropZone.tsx +233 -0
- package/src/FieldError.tsx +89 -0
- package/src/FileTrigger.tsx +83 -0
- package/src/Focusable.tsx +103 -0
- package/src/Form.tsx +140 -0
- package/src/GridList.tsx +542 -128
- package/src/HiddenDateInput.tsx +153 -0
- package/src/HiddenTimeInput.tsx +133 -0
- package/src/Icon.tsx +133 -0
- package/src/Keyboard.tsx +26 -0
- package/src/Landmark.tsx +37 -63
- package/src/Link.tsx +132 -69
- package/src/ListBox.tsx +656 -106
- package/src/ListDropTargetDelegate.ts +283 -0
- package/src/Menu.tsx +1234 -132
- package/src/Meter.tsx +44 -58
- package/src/Modal.tsx +262 -166
- package/src/NumberField.tsx +267 -151
- package/src/Popover.tsx +452 -343
- package/src/Pressable.tsx +108 -0
- package/src/ProgressBar.tsx +54 -59
- package/src/RadioGroup.tsx +533 -121
- package/src/RangeCalendar.tsx +249 -150
- package/src/RouterProvider.tsx +223 -0
- package/src/SearchField.tsx +460 -133
- package/src/Select.tsx +804 -233
- package/src/SelectionIndicator.tsx +108 -0
- package/src/Separator.tsx +47 -49
- package/src/SharedElementTransition.tsx +264 -0
- package/src/Slider.tsx +148 -98
- package/src/StepList.tsx +272 -0
- package/src/Switch.tsx +93 -46
- package/src/Table.tsx +1551 -225
- package/src/Tabs.tsx +377 -123
- package/src/TagGroup.tsx +233 -135
- package/src/Text.tsx +18 -0
- package/src/TextField.tsx +413 -86
- package/src/TimeField.tsx +232 -222
- package/src/Toast.tsx +306 -160
- package/src/ToggleButton.tsx +169 -0
- package/src/ToggleButtonGroup.tsx +141 -0
- package/src/Toolbar.tsx +61 -70
- package/src/Tooltip.tsx +473 -116
- package/src/Tree.tsx +1514 -175
- package/src/Virtualizer.tsx +730 -0
- package/src/VirtualizerLayouts.ts +280 -0
- package/src/VisuallyHidden.tsx +32 -38
- package/src/contexts.ts +29 -36
- package/src/index.ts +972 -620
- package/src/useDragAndDrop.ts +367 -0
- package/src/utils.tsx +69 -50
- package/src/virtualizer/Layout.ts +192 -0
- package/dist/index.ssr.js +0 -9785
- package/dist/index.ssr.js.map +0 -7
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Proyecto Viviana contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,304 +1,71 @@
|
|
|
1
1
|
# @proyecto-viviana/solidaria-components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
SolidJS port of React Aria Components: unstyled, accessible components built on
|
|
4
|
+
`@proyecto-viviana/solidaria` and `@proyecto-viviana/solid-stately`.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
This package is still part of a parity port. Do not treat export coverage as a
|
|
7
|
+
production readiness guarantee.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
6
10
|
|
|
7
11
|
```bash
|
|
8
|
-
|
|
12
|
+
npm install @proyecto-viviana/solidaria-components solid-js
|
|
9
13
|
```
|
|
10
14
|
|
|
11
|
-
## Overview
|
|
12
|
-
|
|
13
|
-
solidaria-components provides ready-to-use headless components that combine state management and accessibility in one package. Unlike the lower-level hooks in solidaria, these components handle all the wiring for you while giving you full control over styling through render props and data attributes.
|
|
14
|
-
|
|
15
|
-
## Available Components
|
|
16
|
-
|
|
17
|
-
### Form Controls
|
|
18
|
-
|
|
19
|
-
| Component | Description |
|
|
20
|
-
|-----------|-------------|
|
|
21
|
-
| Button | Accessible button with press states |
|
|
22
|
-
| Checkbox, CheckboxGroup | Checkboxes with group support |
|
|
23
|
-
| Radio, RadioGroup | Radio buttons |
|
|
24
|
-
| ToggleSwitch | Toggle switch control |
|
|
25
|
-
| TextField, Input, TextArea, Label | Text inputs with labels |
|
|
26
|
-
| NumberField | Numeric input with inc/dec buttons |
|
|
27
|
-
| SearchField | Search input with clear button |
|
|
28
|
-
| Slider, SliderTrack, SliderThumb | Range slider |
|
|
29
|
-
|
|
30
|
-
### Navigation
|
|
31
|
-
|
|
32
|
-
| Component | Description |
|
|
33
|
-
|-----------|-------------|
|
|
34
|
-
| Tabs, TabList, Tab, TabPanel | Tabbed navigation |
|
|
35
|
-
| Breadcrumbs, BreadcrumbItem | Breadcrumb navigation |
|
|
36
|
-
| Link | Accessible link |
|
|
37
|
-
| Landmark | ARIA landmark regions with F6 navigation |
|
|
38
|
-
|
|
39
|
-
### Selection
|
|
40
|
-
|
|
41
|
-
| Component | Description |
|
|
42
|
-
|-----------|-------------|
|
|
43
|
-
| Select, SelectTrigger, SelectValue, SelectListBox, SelectOption | Dropdown select |
|
|
44
|
-
| Menu, MenuItem, MenuTrigger, MenuButton | Action menus |
|
|
45
|
-
| ListBox, ListBoxOption | Selectable lists |
|
|
46
|
-
|
|
47
|
-
### Feedback & Layout
|
|
48
|
-
|
|
49
|
-
| Component | Description |
|
|
50
|
-
|-----------|-------------|
|
|
51
|
-
| ProgressBar | Progress indicator |
|
|
52
|
-
| Separator | Visual divider |
|
|
53
|
-
| VisuallyHidden | Screen reader only content |
|
|
54
|
-
|
|
55
15
|
## Usage
|
|
56
16
|
|
|
57
|
-
### Render Props Pattern
|
|
58
|
-
|
|
59
|
-
Components expose state through render props for full styling control:
|
|
60
|
-
|
|
61
17
|
```tsx
|
|
62
18
|
import { Button } from "@proyecto-viviana/solidaria-components";
|
|
63
19
|
|
|
64
|
-
function
|
|
65
|
-
return (
|
|
66
|
-
<Button onPress={() => console.log("pressed")}>
|
|
67
|
-
{({ isPressed, isHovered, isFocusVisible }) => (
|
|
68
|
-
<span
|
|
69
|
-
class={`btn ${isPressed() ? "pressed" : ""} ${isHovered() ? "hovered" : ""}`}
|
|
70
|
-
>
|
|
71
|
-
Click me
|
|
72
|
-
</span>
|
|
73
|
-
)}
|
|
74
|
-
</Button>
|
|
75
|
-
);
|
|
20
|
+
export function SaveButton() {
|
|
21
|
+
return <Button onPress={() => save()}>Save</Button>;
|
|
76
22
|
}
|
|
77
23
|
```
|
|
78
24
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
Components also expose state via data attributes for CSS styling:
|
|
25
|
+
Components are headless. Style them with classes, data attributes, and render
|
|
26
|
+
props.
|
|
82
27
|
|
|
83
28
|
```tsx
|
|
84
29
|
import { Button } from "@proyecto-viviana/solidaria-components";
|
|
85
30
|
|
|
86
|
-
function
|
|
87
|
-
return (
|
|
88
|
-
<Button class="my-button" onPress={() => {}}>
|
|
89
|
-
Click me
|
|
90
|
-
</Button>
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
```css
|
|
96
|
-
.my-button {
|
|
97
|
-
background: blue;
|
|
98
|
-
}
|
|
99
|
-
.my-button[data-pressed] {
|
|
100
|
-
background: darkblue;
|
|
101
|
-
}
|
|
102
|
-
.my-button[data-hovered] {
|
|
103
|
-
background: lightblue;
|
|
104
|
-
}
|
|
105
|
-
.my-button[data-focus-visible] {
|
|
106
|
-
outline: 2px solid white;
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Checkbox Example
|
|
111
|
-
|
|
112
|
-
```tsx
|
|
113
|
-
import { Checkbox, CheckboxGroup } from "@proyecto-viviana/solidaria-components";
|
|
114
|
-
|
|
115
|
-
function Preferences() {
|
|
116
|
-
return (
|
|
117
|
-
<CheckboxGroup>
|
|
118
|
-
{({ groupProps }) => (
|
|
119
|
-
<div {...groupProps}>
|
|
120
|
-
<Checkbox value="newsletter">
|
|
121
|
-
{({ inputProps, isSelected }) => (
|
|
122
|
-
<label>
|
|
123
|
-
<input {...inputProps} />
|
|
124
|
-
<span class={isSelected() ? "checked" : ""}>
|
|
125
|
-
Subscribe to newsletter
|
|
126
|
-
</span>
|
|
127
|
-
</label>
|
|
128
|
-
)}
|
|
129
|
-
</Checkbox>
|
|
130
|
-
<Checkbox value="updates">
|
|
131
|
-
{({ inputProps, isSelected }) => (
|
|
132
|
-
<label>
|
|
133
|
-
<input {...inputProps} />
|
|
134
|
-
<span class={isSelected() ? "checked" : ""}>
|
|
135
|
-
Receive updates
|
|
136
|
-
</span>
|
|
137
|
-
</label>
|
|
138
|
-
)}
|
|
139
|
-
</Checkbox>
|
|
140
|
-
</div>
|
|
141
|
-
)}
|
|
142
|
-
</CheckboxGroup>
|
|
143
|
-
);
|
|
144
|
-
}
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
### Select Example
|
|
148
|
-
|
|
149
|
-
```tsx
|
|
150
|
-
import { Select, SelectTrigger, SelectValue, SelectListBox, SelectOption } from "@proyecto-viviana/solidaria-components";
|
|
151
|
-
|
|
152
|
-
const countries = [
|
|
153
|
-
{ key: "us", label: "United States" },
|
|
154
|
-
{ key: "uk", label: "United Kingdom" },
|
|
155
|
-
{ key: "ca", label: "Canada" },
|
|
156
|
-
];
|
|
157
|
-
|
|
158
|
-
function CountrySelect() {
|
|
159
|
-
return (
|
|
160
|
-
<Select items={countries} onSelectionChange={(key) => console.log(key)}>
|
|
161
|
-
<SelectTrigger>
|
|
162
|
-
<SelectValue placeholder="Select a country" />
|
|
163
|
-
</SelectTrigger>
|
|
164
|
-
<SelectListBox>
|
|
165
|
-
{(item) => (
|
|
166
|
-
<SelectOption key={item.key}>
|
|
167
|
-
{({ isSelected, isFocused }) => (
|
|
168
|
-
<span class={`option ${isSelected() ? "selected" : ""}`}>
|
|
169
|
-
{item.label}
|
|
170
|
-
</span>
|
|
171
|
-
)}
|
|
172
|
-
</SelectOption>
|
|
173
|
-
)}
|
|
174
|
-
</SelectListBox>
|
|
175
|
-
</Select>
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### Tabs Example
|
|
181
|
-
|
|
182
|
-
```tsx
|
|
183
|
-
import { Tabs, TabList, Tab, TabPanel } from "@proyecto-viviana/solidaria-components";
|
|
184
|
-
|
|
185
|
-
const tabs = [
|
|
186
|
-
{ id: "overview", label: "Overview", content: "Overview content here" },
|
|
187
|
-
{ id: "features", label: "Features", content: "Features content here" },
|
|
188
|
-
{ id: "pricing", label: "Pricing", content: "Pricing content here" },
|
|
189
|
-
];
|
|
190
|
-
|
|
191
|
-
function Navigation() {
|
|
31
|
+
export function ToolbarButton() {
|
|
192
32
|
return (
|
|
193
|
-
<
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
)}
|
|
202
|
-
</TabList>
|
|
203
|
-
{tabs.map((tab) => (
|
|
204
|
-
<TabPanel key={tab.id}>{tab.content}</TabPanel>
|
|
205
|
-
))}
|
|
206
|
-
</Tabs>
|
|
207
|
-
);
|
|
208
|
-
}
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
### Slider Example
|
|
212
|
-
|
|
213
|
-
```tsx
|
|
214
|
-
import { Slider, SliderTrack, SliderThumb, SliderOutput } from "@proyecto-viviana/solidaria-components";
|
|
215
|
-
|
|
216
|
-
function VolumeSlider() {
|
|
217
|
-
return (
|
|
218
|
-
<Slider defaultValue={50} minValue={0} maxValue={100}>
|
|
219
|
-
{({ value, getValuePercent }) => (
|
|
220
|
-
<>
|
|
221
|
-
<div class="label-row">
|
|
222
|
-
<span>Volume</span>
|
|
223
|
-
<SliderOutput />
|
|
224
|
-
</div>
|
|
225
|
-
<SliderTrack>
|
|
226
|
-
{({ isDragging }) => (
|
|
227
|
-
<div class={`track ${isDragging() ? "dragging" : ""}`}>
|
|
228
|
-
<div class="fill" style={{ width: `${getValuePercent() * 100}%` }} />
|
|
229
|
-
<SliderThumb>
|
|
230
|
-
{({ isFocusVisible }) => (
|
|
231
|
-
<div class={`thumb ${isFocusVisible() ? "focused" : ""}`} />
|
|
232
|
-
)}
|
|
233
|
-
</SliderThumb>
|
|
234
|
-
</div>
|
|
235
|
-
)}
|
|
236
|
-
</SliderTrack>
|
|
237
|
-
</>
|
|
33
|
+
<Button class="button">
|
|
34
|
+
{({ isPressed, isFocusVisible }) => (
|
|
35
|
+
<span
|
|
36
|
+
data-pressed={isPressed() || undefined}
|
|
37
|
+
data-focus-visible={isFocusVisible() || undefined}
|
|
38
|
+
>
|
|
39
|
+
Save
|
|
40
|
+
</span>
|
|
238
41
|
)}
|
|
239
|
-
</
|
|
42
|
+
</Button>
|
|
240
43
|
);
|
|
241
44
|
}
|
|
242
45
|
```
|
|
243
46
|
|
|
244
|
-
##
|
|
47
|
+
## Current Parity Evidence
|
|
245
48
|
|
|
246
|
-
|
|
49
|
+
As of the 2026-05-12 local report:
|
|
247
50
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
return <div>Selected: {state?.selectedKey()}</div>;
|
|
254
|
-
}
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
## Styling Approaches
|
|
258
|
-
|
|
259
|
-
### 1. Render Props (Most Control)
|
|
260
|
-
|
|
261
|
-
```tsx
|
|
262
|
-
<Button>
|
|
263
|
-
{({ isPressed, isHovered }) => (
|
|
264
|
-
<span style={{ background: isPressed() ? "red" : isHovered() ? "pink" : "blue" }}>
|
|
265
|
-
Click
|
|
266
|
-
</span>
|
|
267
|
-
)}
|
|
268
|
-
</Button>
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
### 2. Data Attributes (CSS)
|
|
272
|
-
|
|
273
|
-
```tsx
|
|
274
|
-
<Button class="btn">Click</Button>
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
```css
|
|
278
|
-
.btn[data-pressed] { background: red; }
|
|
279
|
-
.btn[data-hovered] { background: pink; }
|
|
280
|
-
```
|
|
51
|
+
- `vp run guard:rac-export-gap` reports `0` missing React Aria Components named
|
|
52
|
+
exports.
|
|
53
|
+
- `vp run guard:rac-parity` reports no missing required tracked symbols.
|
|
54
|
+
- The package has extra Solid exports and aliases compared with upstream RAC.
|
|
55
|
+
Treat those as local API and document intentional additions in changesets.
|
|
281
56
|
|
|
282
|
-
|
|
57
|
+
The barrel in [`src/index.ts`](src/index.ts) is the source of truth for the
|
|
58
|
+
current public surface. This README intentionally does not duplicate the full
|
|
59
|
+
export list.
|
|
283
60
|
|
|
284
|
-
|
|
285
|
-
<Button class={({ isPressed }) => isPressed() ? "pressed" : "normal"}>
|
|
286
|
-
Click
|
|
287
|
-
</Button>
|
|
288
|
-
```
|
|
61
|
+
## Verification
|
|
289
62
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
import {
|
|
296
|
-
Button,
|
|
297
|
-
type ButtonProps,
|
|
298
|
-
type ButtonRenderProps,
|
|
299
|
-
} from "@proyecto-viviana/solidaria-components";
|
|
63
|
+
```bash
|
|
64
|
+
vp run guard:rac-parity
|
|
65
|
+
vp run guard:rac-export-gap
|
|
66
|
+
vp run --filter @proyecto-viviana/solidaria-components build
|
|
67
|
+
vp test run packages
|
|
300
68
|
```
|
|
301
69
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
MIT
|
|
70
|
+
When changing behavior, add focused tests under `test/` that use semantic
|
|
71
|
+
queries and user-like interactions rather than implementation markers alone.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ActionBar component for solidaria-components
|
|
3
|
+
*
|
|
4
|
+
* Headless action bar that appears when items are selected in a collection.
|
|
5
|
+
* Shows a selection count, clear button, and action buttons.
|
|
6
|
+
*
|
|
7
|
+
* No RAC headless equivalent — this is a thin component layer that ties
|
|
8
|
+
* selection state to visibility and keyboard behavior.
|
|
9
|
+
*/
|
|
10
|
+
import { type JSX, type ParentProps } from "solid-js";
|
|
11
|
+
import type { Key } from "@proyecto-viviana/solid-stately";
|
|
12
|
+
import { type ClassNameOrFunction, type StyleOrFunction, type SlotProps } from "./utils";
|
|
13
|
+
type RefLike<T> = ((el: T) => void) | {
|
|
14
|
+
current?: T | null;
|
|
15
|
+
} | undefined;
|
|
16
|
+
export interface ActionBarRenderProps {
|
|
17
|
+
/** Whether the action bar is visible. */
|
|
18
|
+
isOpen: boolean;
|
|
19
|
+
/** The number of selected items. */
|
|
20
|
+
selectedItemCount: number | "all";
|
|
21
|
+
}
|
|
22
|
+
export interface ActionBarProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "class" | "style" | "children" | "ref" | "slot">, SlotProps {
|
|
23
|
+
/** The number of selected items. ActionBar is hidden when 0. @default 0 */
|
|
24
|
+
selectedItemCount?: number | "all";
|
|
25
|
+
/** Callback when the clear button is pressed. */
|
|
26
|
+
onClearSelection?: () => void;
|
|
27
|
+
/** Callback when an action is triggered. */
|
|
28
|
+
onAction?: (key: Key) => void;
|
|
29
|
+
/** The action buttons to display. */
|
|
30
|
+
children?: JSX.Element;
|
|
31
|
+
/** CSS class for the container. */
|
|
32
|
+
class?: ClassNameOrFunction<ActionBarRenderProps>;
|
|
33
|
+
/** Inline style for the container. */
|
|
34
|
+
style?: StyleOrFunction<ActionBarRenderProps>;
|
|
35
|
+
/** Accessible label for the action bar. @default 'Actions' */
|
|
36
|
+
"aria-label"?: string;
|
|
37
|
+
/** Identifies the element (or elements) that labels the action bar. */
|
|
38
|
+
"aria-labelledby"?: string;
|
|
39
|
+
/** Optional keydown handler on the action bar element. */
|
|
40
|
+
onKeyDown?: JSX.EventHandlerUnion<HTMLDivElement, KeyboardEvent>;
|
|
41
|
+
/** Screen reader announcement when the action bar becomes available. */
|
|
42
|
+
actionsAvailableMessage?: string;
|
|
43
|
+
/** Ref for the underlying action bar element. */
|
|
44
|
+
ref?: RefLike<HTMLDivElement>;
|
|
45
|
+
}
|
|
46
|
+
export interface ActionBarContextValue {
|
|
47
|
+
selectedItemCount: () => number | "all";
|
|
48
|
+
onClearSelection?: () => void;
|
|
49
|
+
onAction?: (key: Key) => void;
|
|
50
|
+
}
|
|
51
|
+
export declare const ActionBarContext: import("solid-js").Context<ActionBarContextValue | null>;
|
|
52
|
+
export declare function useActionBarContext(): ActionBarContextValue | null;
|
|
53
|
+
export declare function ActionBar(props: ActionBarProps): JSX.Element;
|
|
54
|
+
export interface ActionBarContainerProps extends ParentProps {
|
|
55
|
+
class?: string;
|
|
56
|
+
style?: JSX.CSSProperties;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Container that positions a collection and its ActionBar.
|
|
60
|
+
*/
|
|
61
|
+
export declare function ActionBarContainer(props: ActionBarContainerProps): JSX.Element;
|
|
62
|
+
export interface ActionBarSelectionCountProps {
|
|
63
|
+
class?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Displays the count of selected items.
|
|
67
|
+
*/
|
|
68
|
+
export declare function ActionBarSelectionCount(props: ActionBarSelectionCountProps): JSX.Element;
|
|
69
|
+
export interface ActionBarClearButtonProps {
|
|
70
|
+
class?: string;
|
|
71
|
+
children?: JSX.Element;
|
|
72
|
+
"aria-label"?: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Button to clear the current selection.
|
|
76
|
+
*/
|
|
77
|
+
export declare function ActionBarClearButton(props: ActionBarClearButtonProps): JSX.Element;
|
|
78
|
+
export {};
|
|
79
|
+
//# sourceMappingURL=ActionBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionBar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AAG,CAAC,OAAO,CAalF"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ActionGroup component for solidaria-components
|
|
3
|
+
*
|
|
4
|
+
* Pre-wired headless action group component that combines
|
|
5
|
+
* createListState + createActionGroup/createActionGroupItem.
|
|
6
|
+
* Provides proper dynamic roles (toolbar/radiogroup), keyboard
|
|
7
|
+
* navigation, and ARIA attributes.
|
|
8
|
+
*
|
|
9
|
+
* No RAC equivalent exists — this bridges solidaria ARIA hooks
|
|
10
|
+
* directly to a headless component.
|
|
11
|
+
*/
|
|
12
|
+
import { type JSX } from "solid-js";
|
|
13
|
+
import { type ListState, type Key, type SelectionMode } from "@proyecto-viviana/solid-stately";
|
|
14
|
+
import { type ClassNameOrFunction, type StyleOrFunction, type SlotProps } from "./utils";
|
|
15
|
+
export interface ActionGroupRenderProps {
|
|
16
|
+
/** The orientation of the action group. */
|
|
17
|
+
orientation: "horizontal" | "vertical";
|
|
18
|
+
/** Whether the entire group is disabled. */
|
|
19
|
+
isDisabled: boolean;
|
|
20
|
+
/** The selection mode. */
|
|
21
|
+
selectionMode: SelectionMode;
|
|
22
|
+
}
|
|
23
|
+
export interface ActionGroupItemRenderProps {
|
|
24
|
+
/** Whether the item is selected. */
|
|
25
|
+
isSelected: boolean;
|
|
26
|
+
/** Whether the item is disabled. */
|
|
27
|
+
isDisabled: boolean;
|
|
28
|
+
/** Whether the item is focused. */
|
|
29
|
+
isFocused: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface ActionGroupItem {
|
|
32
|
+
id: string;
|
|
33
|
+
label: string;
|
|
34
|
+
isDisabled?: boolean;
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
}
|
|
37
|
+
export interface ActionGroupProps<T extends ActionGroupItem = ActionGroupItem> extends SlotProps {
|
|
38
|
+
/** The items in the action group. */
|
|
39
|
+
items: T[];
|
|
40
|
+
/** The selection mode. @default 'none' */
|
|
41
|
+
selectionMode?: SelectionMode;
|
|
42
|
+
/** Orientation of the group. @default 'horizontal' */
|
|
43
|
+
orientation?: "horizontal" | "vertical";
|
|
44
|
+
/** Whether the entire group is disabled. */
|
|
45
|
+
isDisabled?: boolean;
|
|
46
|
+
/** Accessible label. */
|
|
47
|
+
"aria-label"?: string;
|
|
48
|
+
/** Labelled-by id. */
|
|
49
|
+
"aria-labelledby"?: string;
|
|
50
|
+
/** Currently selected keys (controlled). */
|
|
51
|
+
selectedKeys?: Iterable<Key>;
|
|
52
|
+
/** Default selected keys (uncontrolled). */
|
|
53
|
+
defaultSelectedKeys?: Iterable<Key>;
|
|
54
|
+
/** Handler called when selection changes. */
|
|
55
|
+
onSelectionChange?: (keys: "all" | Set<Key>) => void;
|
|
56
|
+
/** Handler called when an item action is triggered. */
|
|
57
|
+
onAction?: (key: Key) => void;
|
|
58
|
+
/** Keys of disabled items. */
|
|
59
|
+
disabledKeys?: Iterable<Key>;
|
|
60
|
+
/** Render function for each item. */
|
|
61
|
+
children: (item: T, renderProps: ActionGroupItemRenderProps) => JSX.Element;
|
|
62
|
+
/** CSS class for the container. */
|
|
63
|
+
class?: ClassNameOrFunction<ActionGroupRenderProps>;
|
|
64
|
+
/** Inline style for the container. */
|
|
65
|
+
style?: StyleOrFunction<ActionGroupRenderProps>;
|
|
66
|
+
}
|
|
67
|
+
export interface ActionGroupContextValue<T extends ActionGroupItem = ActionGroupItem> {
|
|
68
|
+
state: ListState<T>;
|
|
69
|
+
}
|
|
70
|
+
export declare const ActionGroupContext: import("solid-js").Context<ActionGroupContextValue<ActionGroupItem> | null>;
|
|
71
|
+
export declare const ActionGroupStateContext: import("solid-js").Context<ListState<ActionGroupItem> | null>;
|
|
72
|
+
export declare function ActionGroup<T extends ActionGroupItem = ActionGroupItem>(props: ActionGroupProps<T>): JSX.Element;
|
|
73
|
+
export declare function useActionGroupContext(): ActionGroupContextValue | null;
|
|
74
|
+
//# sourceMappingURL=ActionGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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semantics (role="alert")
|
|
5
|
+
* and provides render props for styling. The UI layer consumes this
|
|
6
|
+
* for styling/composition only.
|
|
7
|
+
*/
|
|
8
|
+
import { type JSX } from "solid-js";
|
|
9
|
+
import { type RenderChildren, type ClassNameOrFunction, type StyleOrFunction, type SlotProps } from "./utils";
|
|
10
|
+
import { type ButtonProps } from "./Button";
|
|
11
|
+
export type AlertVariant = "info" | "success" | "warning" | "error";
|
|
12
|
+
export interface AlertRenderProps {
|
|
13
|
+
/** The variant of the alert. */
|
|
14
|
+
variant: AlertVariant;
|
|
15
|
+
/** Whether the alert can be dismissed. */
|
|
16
|
+
isDismissible: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface AlertProps extends SlotProps {
|
|
19
|
+
/** The variant of the alert. */
|
|
20
|
+
variant?: AlertVariant;
|
|
21
|
+
/** Whether the alert can be dismissed. */
|
|
22
|
+
isDismissible?: boolean;
|
|
23
|
+
/** Handler called when the alert is dismissed. */
|
|
24
|
+
onDismiss?: () => void;
|
|
25
|
+
/** The children of the component. A function may be provided to receive render props. */
|
|
26
|
+
children?: RenderChildren<AlertRenderProps>;
|
|
27
|
+
/** The CSS className for the element. */
|
|
28
|
+
class?: ClassNameOrFunction<AlertRenderProps>;
|
|
29
|
+
/** The inline style for the element. */
|
|
30
|
+
style?: StyleOrFunction<AlertRenderProps>;
|
|
31
|
+
/** The id of the element. */
|
|
32
|
+
id?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface AlertContextValue {
|
|
35
|
+
variant: () => AlertVariant;
|
|
36
|
+
isDismissible: () => boolean;
|
|
37
|
+
onDismiss?: () => void;
|
|
38
|
+
}
|
|
39
|
+
export declare const AlertContext: import("solid-js").Context<AlertContextValue | null>;
|
|
40
|
+
/**
|
|
41
|
+
* An alert displays a brief, important message in a way that
|
|
42
|
+
* attracts the user's attention without interrupting their task.
|
|
43
|
+
*
|
|
44
|
+
* This is a headless component that provides the ARIA `role="alert"`
|
|
45
|
+
* semantics and render props for styling.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```tsx
|
|
49
|
+
* <Alert variant="error" isDismissible onDismiss={() => setVisible(false)}>
|
|
50
|
+
* {({ variant }) => <span>Something went wrong ({variant})</span>}
|
|
51
|
+
* </Alert>
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare function Alert(props: AlertProps): JSX.Element;
|
|
55
|
+
export interface AlertDismissButtonProps extends Omit<ButtonProps, "onPress"> {
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* A dismiss button for use inside an Alert.
|
|
59
|
+
* Uses the headless Button for full keyboard/a11y support.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```tsx
|
|
63
|
+
* <Alert isDismissible onDismiss={handleDismiss}>
|
|
64
|
+
* <span>Alert content</span>
|
|
65
|
+
* <AlertDismissButton aria-label="Dismiss">X</AlertDismissButton>
|
|
66
|
+
* </Alert>
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export declare function AlertDismissButton(props: AlertDismissButtonProps): JSX.Element;
|
|
70
|
+
//# sourceMappingURL=Alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../src/Alert.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,KAAK,GAAG,EAAqD,MAAM,UAAU,CAAC;AACvF,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,SAAS,EAEf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEpE,MAAM,WAAW,gBAAgB;IAC/B,gCAAgC;IAChC,OAAO,EAAE,YAAY,CAAC;IACtB,0CAA0C;IAC1C,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C,gCAAgC;IAChC,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,0CAA0C;IAC1C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,yFAAyF;IACzF,QAAQ,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAC5C,yCAAyC;IACzC,KAAK,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAC9C,wCAAwC;IACxC,KAAK,CAAC,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;IAC1C,6BAA6B;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,YAAY,CAAC;IAC5B,aAAa,EAAE,MAAM,OAAO,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,YAAY,sDAAgD,CAAC;AAE1E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,GAAG,CAAC,OAAO,CA2DpD;AAED,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;CAAG;AAEhF;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CAU9E"}
|
package/dist/Autocomplete.d.ts
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Port of react-aria-components/src/Autocomplete.tsx
|
|
8
8
|
*/
|
|
9
|
-
import { type JSX, type ParentProps } from
|
|
10
|
-
import { type AriaAutocompleteOptions, type AutocompleteInputProps, type CollectionOptions } from
|
|
11
|
-
import { type AutocompleteState, type AutocompleteStateOptions } from
|
|
12
|
-
import { type SlotProps } from
|
|
13
|
-
export interface AutocompleteProps<T = unknown> extends Omit<AutocompleteStateOptions,
|
|
9
|
+
import { type JSX, type ParentProps } from "solid-js";
|
|
10
|
+
import { type AriaAutocompleteOptions, type AutocompleteInputProps, type CollectionOptions } from "@proyecto-viviana/solidaria";
|
|
11
|
+
import { type AutocompleteState, type AutocompleteStateOptions } from "@proyecto-viviana/solid-stately";
|
|
12
|
+
import { type SlotProps } from "./utils";
|
|
13
|
+
export interface AutocompleteProps<T = unknown> extends Omit<AutocompleteStateOptions, "children">, Omit<AriaAutocompleteOptions<T>, "inputRef" | "collectionRef">, ParentProps, SlotProps {
|
|
14
14
|
}
|
|
15
15
|
export interface AutocompleteContextValue {
|
|
16
16
|
inputProps: AutocompleteInputProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../src/Autocomplete.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,KAAK,GAAG,EACR,KAAK,WAAW,EAMjB,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../src/Autocomplete.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,KAAK,GAAG,EACR,KAAK,WAAW,EAMjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC9B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,OAAO,CAC5C,SACE,IAAI,CAAC,wBAAwB,EAAE,UAAU,CAAC,EAC1C,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC,EA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