panelui-native 0.25.0 → 0.30.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 +18 -1
- package/lib/module/components/accordion/index.js +8 -8
- package/lib/module/components/accordion/index.js.map +1 -1
- package/lib/module/components/alert/index.js +2 -2
- package/lib/module/components/alert/index.js.map +1 -1
- package/lib/module/components/area-chart/index.js +182 -50
- package/lib/module/components/area-chart/index.js.map +1 -1
- package/lib/module/components/attachment/index.js +2 -1
- package/lib/module/components/attachment/index.js.map +1 -1
- package/lib/module/components/avatar/index.js +3 -3
- package/lib/module/components/avatar/index.js.map +1 -1
- package/lib/module/components/badge/index.js +4 -4
- package/lib/module/components/badge/index.js.map +1 -1
- package/lib/module/components/bar-chart/index.js +197 -56
- package/lib/module/components/bar-chart/index.js.map +1 -1
- package/lib/module/components/bottom-sheet/index.js +15 -10
- package/lib/module/components/bottom-sheet/index.js.map +1 -1
- package/lib/module/components/breadcrumb/index.js +6 -6
- package/lib/module/components/breadcrumb/index.js.map +1 -1
- package/lib/module/components/button/index.js +11 -6
- package/lib/module/components/button/index.js.map +1 -1
- package/lib/module/components/calendar/index.js +792 -0
- package/lib/module/components/calendar/index.js.map +1 -0
- package/lib/module/components/carousel/index.js +680 -0
- package/lib/module/components/carousel/index.js.map +1 -0
- package/lib/module/components/chip/index.js +4 -4
- package/lib/module/components/chip/index.js.map +1 -1
- package/lib/module/components/code-block/highlight.js +363 -0
- package/lib/module/components/code-block/highlight.js.map +1 -0
- package/lib/module/components/code-block/index.js +313 -0
- package/lib/module/components/code-block/index.js.map +1 -0
- package/lib/module/components/date-picker/index.js +165 -0
- package/lib/module/components/date-picker/index.js.map +1 -0
- package/lib/module/components/dialog/index.js +7 -2
- package/lib/module/components/dialog/index.js.map +1 -1
- package/lib/module/components/direction/index.js +2 -1
- package/lib/module/components/direction/index.js.map +1 -1
- package/lib/module/components/empty-state/index.js +2 -2
- package/lib/module/components/empty-state/index.js.map +1 -1
- package/lib/module/components/field/index.js +5 -5
- package/lib/module/components/field/index.js.map +1 -1
- package/lib/module/components/flow/index.js +3 -3
- package/lib/module/components/flow/index.js.map +1 -1
- package/lib/module/components/frame/index.js +5 -5
- package/lib/module/components/frame/index.js.map +1 -1
- package/lib/module/components/input-group/index.js +3 -2
- package/lib/module/components/input-group/index.js.map +1 -1
- package/lib/module/components/item/index.js +9 -9
- package/lib/module/components/item/index.js.map +1 -1
- package/lib/module/components/label/index.js +4 -4
- package/lib/module/components/label/index.js.map +1 -1
- package/lib/module/components/line-chart/index.js +167 -44
- package/lib/module/components/line-chart/index.js.map +1 -1
- package/lib/module/components/map/index.js +7 -7
- package/lib/module/components/map/index.js.map +1 -1
- package/lib/module/components/marker/index.js +3 -3
- package/lib/module/components/marker/index.js.map +1 -1
- package/lib/module/components/menu/index.js +714 -0
- package/lib/module/components/menu/index.js.map +1 -0
- package/lib/module/components/message/index.js +7 -7
- package/lib/module/components/message/index.js.map +1 -1
- package/lib/module/components/message-scroller/index.js +5 -4
- package/lib/module/components/message-scroller/index.js.map +1 -1
- package/lib/module/components/plan/index.js +296 -0
- package/lib/module/components/plan/index.js.map +1 -0
- package/lib/module/components/popover/index.js +73 -10
- package/lib/module/components/popover/index.js.map +1 -1
- package/lib/module/components/radio-group/index.js +15 -10
- package/lib/module/components/radio-group/index.js.map +1 -1
- package/lib/module/components/reasoning/index.js +244 -0
- package/lib/module/components/reasoning/index.js.map +1 -0
- package/lib/module/components/section-rail/index.js +4 -4
- package/lib/module/components/section-rail/index.js.map +1 -1
- package/lib/module/components/select/index.js +10 -4
- package/lib/module/components/select/index.js.map +1 -1
- package/lib/module/components/sources/index.js +221 -0
- package/lib/module/components/sources/index.js.map +1 -0
- package/lib/module/components/steps/index.js +4 -4
- package/lib/module/components/steps/index.js.map +1 -1
- package/lib/module/components/tabs/index.js +7 -7
- package/lib/module/components/tabs/index.js.map +1 -1
- package/lib/module/components/task/index.js +300 -0
- package/lib/module/components/task/index.js.map +1 -0
- package/lib/module/components/textarea/index.js +295 -0
- package/lib/module/components/textarea/index.js.map +1 -0
- package/lib/module/components/timeline/index.js +4 -4
- package/lib/module/components/timeline/index.js.map +1 -1
- package/lib/module/components/toast/index.js +2 -2
- package/lib/module/components/toast/index.js.map +1 -1
- package/lib/module/components/toggle-button/index.js +5 -5
- package/lib/module/components/toggle-button/index.js.map +1 -1
- package/lib/module/components/tooltip/index.js +648 -0
- package/lib/module/components/tooltip/index.js.map +1 -0
- package/lib/module/components/typography/index.js +2 -2
- package/lib/module/components/typography/index.js.map +1 -1
- package/lib/module/hooks/index.js +1 -0
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/use-back-handler.js +37 -0
- package/lib/module/hooks/use-back-handler.js.map +1 -0
- package/lib/module/icons/index.js +202 -0
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +13 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/primitives/collapse.js +112 -0
- package/lib/module/primitives/collapse.js.map +1 -0
- package/lib/module/primitives/keyboard-avoider.js +2 -1
- package/lib/module/primitives/keyboard-avoider.js.map +1 -1
- package/lib/module/primitives/text.js +25 -1
- package/lib/module/primitives/text.js.map +1 -1
- package/lib/module/utils/date.js +386 -0
- package/lib/module/utils/date.js.map +1 -0
- package/lib/typescript/src/components/accordion/index.d.ts.map +1 -1
- package/lib/typescript/src/components/alert/index.d.ts.map +1 -1
- package/lib/typescript/src/components/area-chart/index.d.ts +41 -1
- package/lib/typescript/src/components/area-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/attachment/index.d.ts.map +1 -1
- package/lib/typescript/src/components/bar-chart/index.d.ts +44 -2
- package/lib/typescript/src/components/bar-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/src/components/breadcrumb/index.d.ts.map +1 -1
- package/lib/typescript/src/components/button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/calendar/index.d.ts +173 -0
- package/lib/typescript/src/components/calendar/index.d.ts.map +1 -0
- package/lib/typescript/src/components/carousel/index.d.ts +179 -0
- package/lib/typescript/src/components/carousel/index.d.ts.map +1 -0
- package/lib/typescript/src/components/chip/index.d.ts.map +1 -1
- package/lib/typescript/src/components/code-block/highlight.d.ts +39 -0
- package/lib/typescript/src/components/code-block/highlight.d.ts.map +1 -0
- package/lib/typescript/src/components/code-block/index.d.ts +113 -0
- package/lib/typescript/src/components/code-block/index.d.ts.map +1 -0
- package/lib/typescript/src/components/date-picker/index.d.ts +97 -0
- package/lib/typescript/src/components/date-picker/index.d.ts.map +1 -0
- package/lib/typescript/src/components/dialog/index.d.ts.map +1 -1
- package/lib/typescript/src/components/direction/index.d.ts.map +1 -1
- package/lib/typescript/src/components/empty-state/index.d.ts.map +1 -1
- package/lib/typescript/src/components/field/index.d.ts.map +1 -1
- package/lib/typescript/src/components/frame/index.d.ts.map +1 -1
- package/lib/typescript/src/components/input-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/item/index.d.ts.map +1 -1
- package/lib/typescript/src/components/label/index.d.ts.map +1 -1
- package/lib/typescript/src/components/line-chart/index.d.ts +41 -2
- package/lib/typescript/src/components/line-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/map/index.d.ts.map +1 -1
- package/lib/typescript/src/components/marker/index.d.ts.map +1 -1
- package/lib/typescript/src/components/menu/index.d.ts +261 -0
- package/lib/typescript/src/components/menu/index.d.ts.map +1 -0
- package/lib/typescript/src/components/message/index.d.ts.map +1 -1
- package/lib/typescript/src/components/message-scroller/index.d.ts.map +1 -1
- package/lib/typescript/src/components/plan/index.d.ts +127 -0
- package/lib/typescript/src/components/plan/index.d.ts.map +1 -0
- package/lib/typescript/src/components/popover/index.d.ts +35 -1
- package/lib/typescript/src/components/popover/index.d.ts.map +1 -1
- package/lib/typescript/src/components/radio-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/reasoning/index.d.ts +97 -0
- package/lib/typescript/src/components/reasoning/index.d.ts.map +1 -0
- package/lib/typescript/src/components/select/index.d.ts.map +1 -1
- package/lib/typescript/src/components/sources/index.d.ts +85 -0
- package/lib/typescript/src/components/sources/index.d.ts.map +1 -0
- package/lib/typescript/src/components/steps/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tabs/index.d.ts.map +1 -1
- package/lib/typescript/src/components/task/index.d.ts +103 -0
- package/lib/typescript/src/components/task/index.d.ts.map +1 -0
- package/lib/typescript/src/components/textarea/index.d.ts +175 -0
- package/lib/typescript/src/components/textarea/index.d.ts.map +1 -0
- package/lib/typescript/src/components/timeline/index.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/index.d.ts.map +1 -1
- package/lib/typescript/src/components/toggle-button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tooltip/index.d.ts +180 -0
- package/lib/typescript/src/components/tooltip/index.d.ts.map +1 -0
- package/lib/typescript/src/components/typography/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/index.d.ts +1 -0
- package/lib/typescript/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/use-back-handler.d.ts +19 -0
- package/lib/typescript/src/hooks/use-back-handler.d.ts.map +1 -0
- package/lib/typescript/src/icons/index.d.ts +17 -0
- package/lib/typescript/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +16 -4
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/primitives/collapse.d.ts +42 -0
- package/lib/typescript/src/primitives/collapse.d.ts.map +1 -0
- package/lib/typescript/src/primitives/keyboard-avoider.d.ts.map +1 -1
- package/lib/typescript/src/primitives/text.d.ts +20 -0
- package/lib/typescript/src/primitives/text.d.ts.map +1 -1
- package/lib/typescript/src/utils/date.d.ts +116 -0
- package/lib/typescript/src/utils/date.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/accordion/index.tsx +8 -12
- package/src/components/alert/index.tsx +2 -2
- package/src/components/area-chart/index.tsx +208 -55
- package/src/components/attachment/index.tsx +2 -2
- package/src/components/avatar/index.tsx +3 -3
- package/src/components/badge/index.tsx +6 -6
- package/src/components/bar-chart/index.tsx +214 -54
- package/src/components/bottom-sheet/index.tsx +17 -16
- package/src/components/breadcrumb/index.tsx +6 -8
- package/src/components/button/index.tsx +12 -8
- package/src/components/calendar/index.tsx +970 -0
- package/src/components/carousel/index.tsx +788 -0
- package/src/components/chip/index.tsx +4 -6
- package/src/components/code-block/highlight.ts +278 -0
- package/src/components/code-block/index.tsx +341 -0
- package/src/components/date-picker/index.tsx +255 -0
- package/src/components/dialog/index.tsx +7 -2
- package/src/components/direction/index.tsx +2 -1
- package/src/components/empty-state/index.tsx +2 -2
- package/src/components/field/index.tsx +3 -5
- package/src/components/flow/index.tsx +3 -3
- package/src/components/frame/index.tsx +5 -7
- package/src/components/input-group/index.tsx +3 -2
- package/src/components/item/index.tsx +9 -9
- package/src/components/label/index.tsx +2 -2
- package/src/components/line-chart/index.tsx +189 -50
- package/src/components/map/index.tsx +7 -9
- package/src/components/marker/index.tsx +3 -3
- package/src/components/menu/index.tsx +812 -0
- package/src/components/message/index.tsx +7 -7
- package/src/components/message-scroller/index.tsx +5 -4
- package/src/components/plan/index.tsx +325 -0
- package/src/components/popover/index.tsx +111 -8
- package/src/components/radio-group/index.tsx +13 -4
- package/src/components/reasoning/index.tsx +297 -0
- package/src/components/section-rail/index.tsx +4 -4
- package/src/components/select/index.tsx +10 -4
- package/src/components/sources/index.tsx +278 -0
- package/src/components/steps/index.tsx +4 -4
- package/src/components/tabs/index.tsx +7 -9
- package/src/components/task/index.tsx +329 -0
- package/src/components/textarea/index.tsx +381 -0
- package/src/components/timeline/index.tsx +4 -4
- package/src/components/toast/index.tsx +2 -2
- package/src/components/toggle-button/index.tsx +5 -7
- package/src/components/tooltip/index.tsx +793 -0
- package/src/components/typography/index.tsx +2 -2
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-back-handler.ts +37 -0
- package/src/icons/index.tsx +147 -0
- package/src/index.ts +116 -0
- package/src/primitives/collapse.tsx +128 -0
- package/src/primitives/keyboard-avoider.tsx +2 -1
- package/src/primitives/text.tsx +28 -1
- package/src/utils/date.ts +446 -0
- package/theme.css +112 -0
package/README.md
CHANGED
|
@@ -167,18 +167,26 @@ you are done. Unstyled text on a white screen means the styles are not reaching
|
|
|
167
167
|
| --- | --- |
|
|
168
168
|
| `Accordion` | Collapsible sections with single or multiple selection |
|
|
169
169
|
| `Alert` | Status message with a built-in icon |
|
|
170
|
+
| `AreaChart` | Filled bands over time, stacked or overlaid |
|
|
170
171
|
| `Attachment` | File row with upload states, built on Item |
|
|
171
172
|
| `Avatar` | User image with an initials fallback and an optional badge overlay |
|
|
172
173
|
| `Badge` | Compact status label, dot, or notification count |
|
|
174
|
+
| `BarChart` | Categories compared by length, grouped or stacked |
|
|
173
175
|
| `BottomSheet` | Draggable sheet anchored to the bottom of the screen |
|
|
174
176
|
| `Breadcrumb` | The trail of links back up the hierarchy to the current page |
|
|
175
177
|
| `Button` | Pressable action with variants, sizes, loading state and icon slots |
|
|
178
|
+
| `Calendar` | A month of days, for picking one, several, or a range |
|
|
176
179
|
| `Card` | Content surface with header, body and footer |
|
|
180
|
+
| `Carousel` | A run of slides, one at a time, dragged with a finger |
|
|
177
181
|
| `Checkbox` | Animated checkbox, as a row or a selectable card |
|
|
178
182
|
| `Chip` | Interactive pill — a filter, a tag, or a removable token |
|
|
183
|
+
| `DatePicker` | A calendar behind a button |
|
|
179
184
|
| `Dialog` | Modal dialog with a backdrop and footer actions |
|
|
180
185
|
| `Direction` | Reading direction for everything below it |
|
|
181
186
|
| `EmptyState` | Placeholder for a list or screen with no content |
|
|
187
|
+
| `Field` | Layout and validation-state kit a form control composes into |
|
|
188
|
+
| `Flow` | Pan-and-zoom canvas of draggable nodes joined by animated edges |
|
|
189
|
+
| `Form` | Form state — values, validation and submission — with no form library underneath |
|
|
182
190
|
| `Frame` | Widget shell — a card of rows sitting in a titled tray |
|
|
183
191
|
| `HeatmapChart` | Contribution grid with a themed colour ramp and a readout |
|
|
184
192
|
| `Input` | Text field with label, description and error message |
|
|
@@ -186,19 +194,27 @@ you are done. Unstyled text on a white screen means the styles are not reaching
|
|
|
186
194
|
| `Item` | Row of media, text and actions for lists and settings |
|
|
187
195
|
| `Label` | Form field label with required, invalid and disabled states |
|
|
188
196
|
| `LineChart` | Animated time series, drawn on the UI thread |
|
|
197
|
+
| `Loader` | Nine loading animations behind one variant prop |
|
|
198
|
+
| `Map` | Vector map whose basemap is drawn from your theme tokens |
|
|
189
199
|
| `Marker` | Inline note between conversation turns |
|
|
200
|
+
| `Menu` | The list of things you can do to something |
|
|
190
201
|
| `Message` | Chat turn with avatar, bubble, header and footer |
|
|
191
202
|
| `MessageScroller` | Scroll behaviour a chat transcript needs |
|
|
203
|
+
| `NumberInput` | Numeric field stepped by buttons or typed by hand |
|
|
204
|
+
| `OtpInput` | One-time-code field drawn as a row of separate cells |
|
|
192
205
|
| `Popover` | Panel anchored to the element that opened it |
|
|
193
206
|
| `Progress` | Determinate and indeterminate progress bar |
|
|
194
207
|
| `RadioGroup` | Single-select list of options |
|
|
208
|
+
| `Rating` | A row of stars to read or set a score |
|
|
209
|
+
| `RingChart` | Concentric arcs, each measured against its own target |
|
|
195
210
|
| `ScrollCanvas` | Image frame whose contents move as you scroll |
|
|
196
211
|
| `ScrollFade` | Fades the edges of a scroll container |
|
|
197
212
|
| `ScrollText` | Text that resolves word by word as you scroll |
|
|
198
213
|
| `SectionRail` | Floating section navigator for a long screen |
|
|
199
214
|
| `Select` | Picker shown in a bottom sheet, expanded in place, or floating over the page |
|
|
200
|
-
| `Separator` | Horizontal or vertical rule between content |
|
|
215
|
+
| `Separator` | Horizontal or vertical rule between content, optionally labelled |
|
|
201
216
|
| `Shimmer` | Animated highlight sweeping across content |
|
|
217
|
+
| `Signature` | Sign with a finger, and get the result back out as SVG or PNG |
|
|
202
218
|
| `Skeleton` | Shimmer placeholder for loading content |
|
|
203
219
|
| `Slider` | Pick a value by dragging a thumb along a track |
|
|
204
220
|
| `Soundwave` | What a voice looks like while an app listens |
|
|
@@ -211,6 +227,7 @@ you are done. Unstyled text on a white screen means the styles are not reaching
|
|
|
211
227
|
| `Timeline` | Vertical sequence of events |
|
|
212
228
|
| `Toast` | Transient notification queue with swipe to dismiss |
|
|
213
229
|
| `ToggleButton` | A button that stays down, on its own or in a group |
|
|
230
|
+
| `Tooltip` | A small label that names the control under your finger |
|
|
214
231
|
| `Typography` | Semantic text presets |
|
|
215
232
|
|
|
216
233
|
Plus `PanelUIProvider`, `Portal`, `AnimatedPressable`, `KeyboardAvoider`, `ScrollProgress`,
|
|
@@ -17,7 +17,7 @@ import { Pressable, View } from 'react-native';
|
|
|
17
17
|
import Animated, { LinearTransition, useAnimatedStyle, useDerivedValue, withTiming } from 'react-native-reanimated';
|
|
18
18
|
import { tv } from 'tailwind-variants';
|
|
19
19
|
import { ChevronDownIcon } from "../../icons/index.js";
|
|
20
|
-
import { Text } from "../../primitives/text.js";
|
|
20
|
+
import { Text, textChildren } from "../../primitives/text.js";
|
|
21
21
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
22
|
const accordionVariants = tv({
|
|
23
23
|
slots: {
|
|
@@ -161,7 +161,7 @@ const AccordionItem = /*#__PURE__*/forwardRef(({
|
|
|
161
161
|
className
|
|
162
162
|
}),
|
|
163
163
|
...props,
|
|
164
|
-
children: children
|
|
164
|
+
children: textChildren(children)
|
|
165
165
|
})
|
|
166
166
|
});
|
|
167
167
|
});
|
|
@@ -200,10 +200,10 @@ const AccordionTrigger = /*#__PURE__*/forwardRef(({
|
|
|
200
200
|
className
|
|
201
201
|
}),
|
|
202
202
|
...props,
|
|
203
|
-
children:
|
|
203
|
+
children: textChildren(children, text => /*#__PURE__*/_jsx(Text, {
|
|
204
204
|
className: title(),
|
|
205
|
-
children:
|
|
206
|
-
})
|
|
205
|
+
children: text
|
|
206
|
+
}))
|
|
207
207
|
});
|
|
208
208
|
});
|
|
209
209
|
AccordionTrigger.displayName = 'Accordion.Trigger';
|
|
@@ -276,10 +276,10 @@ const AccordionContent = /*#__PURE__*/forwardRef(({
|
|
|
276
276
|
className
|
|
277
277
|
}),
|
|
278
278
|
...props,
|
|
279
|
-
children:
|
|
279
|
+
children: textChildren(children, text => /*#__PURE__*/_jsx(Text, {
|
|
280
280
|
className: contentText(),
|
|
281
|
-
children:
|
|
282
|
-
})
|
|
281
|
+
children: text
|
|
282
|
+
}))
|
|
283
283
|
});
|
|
284
284
|
});
|
|
285
285
|
AccordionContent.displayName = 'Accordion.Content';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Children","createContext","forwardRef","isValidElement","useCallback","useContext","useMemo","useState","Pressable","View","Animated","LinearTransition","useAnimatedStyle","useDerivedValue","withTiming","tv","ChevronDownIcon","Text","jsx","_jsx","jsxs","_jsxs","accordionVariants","slots","root","separator","item","trigger","title","indicator","content","contentText","variants","variant","default","surface","separated","bordered","ghost","defaultVariants","AccordionContext","AccordionItemContext","useAccordion","component","context","Error","useAccordionItem","toArray","value","undefined","Array","isArray","AccordionRoot","className","selectionMode","defaultValue","onValueChange","hideSeparator","children","props","ref","internal","setInternal","isControlled","expanded","toggle","itemValue","isOpen","includes","next","filter","entry","items","Provider","layout","duration","map","child","index","length","key","displayName","AccordionItem","isDisabled","isExpanded","AccordionTrigger","accessibilityRole","accessibilityState","disabled","onPress","AccordionIndicator","rotation","style","transform","rotate","size","AccordionContent","AccordionTitle","Accordion","Object","assign","Item","Trigger","Title","Indicator","Content"],"sourceRoot":"../../../../src","sources":["components/accordion/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SACEA,QAAQ,EACRC,aAAa,EACbC,UAAU,EACVC,cAAc,EACdC,WAAW,EACXC,UAAU,EACVC,OAAO,EACPC,QAAQ,QAEH,OAAO;AACd,SAASC,SAAS,EAAEC,IAAI,QAA6C,cAAc;AACnF,OAAOC,QAAQ,IACbC,gBAAgB,EAChBC,gBAAgB,EAChBC,eAAe,EACfC,UAAU,QACL,yBAAyB;AAChC,SAASC,EAAE,QAAQ,mBAAmB;AACtC,SAASC,eAAe,QAAQ,sBAAa;AAC7C,SAASC,IAAI,
|
|
1
|
+
{"version":3,"names":["Children","createContext","forwardRef","isValidElement","useCallback","useContext","useMemo","useState","Pressable","View","Animated","LinearTransition","useAnimatedStyle","useDerivedValue","withTiming","tv","ChevronDownIcon","Text","textChildren","jsx","_jsx","jsxs","_jsxs","accordionVariants","slots","root","separator","item","trigger","title","indicator","content","contentText","variants","variant","default","surface","separated","bordered","ghost","defaultVariants","AccordionContext","AccordionItemContext","useAccordion","component","context","Error","useAccordionItem","toArray","value","undefined","Array","isArray","AccordionRoot","className","selectionMode","defaultValue","onValueChange","hideSeparator","children","props","ref","internal","setInternal","isControlled","expanded","toggle","itemValue","isOpen","includes","next","filter","entry","items","Provider","layout","duration","map","child","index","length","key","displayName","AccordionItem","isDisabled","isExpanded","AccordionTrigger","accessibilityRole","accessibilityState","disabled","onPress","text","AccordionIndicator","rotation","style","transform","rotate","size","AccordionContent","AccordionTitle","Accordion","Object","assign","Item","Trigger","Title","Indicator","Content"],"sourceRoot":"../../../../src","sources":["components/accordion/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SACEA,QAAQ,EACRC,aAAa,EACbC,UAAU,EACVC,cAAc,EACdC,WAAW,EACXC,UAAU,EACVC,OAAO,EACPC,QAAQ,QAEH,OAAO;AACd,SAASC,SAAS,EAAEC,IAAI,QAA6C,cAAc;AACnF,OAAOC,QAAQ,IACbC,gBAAgB,EAChBC,gBAAgB,EAChBC,eAAe,EACfC,UAAU,QACL,yBAAyB;AAChC,SAASC,EAAE,QAAQ,mBAAmB;AACtC,SAASC,eAAe,QAAQ,sBAAa;AAC7C,SAASC,IAAI,EAAkBC,YAAY,QAAQ,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IA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AA,GAAKM,KAAK;IAAAD,QAAA,EACzDzC,YAAY,CAACyC,QAAQ,EAAGgC,IAAI,iBAC3BvE,IAAA,CAACH,IAAI;MAACqC,SAAS,EAAEtB,WAAW,CAAC,CAAE;MAAA2B,QAAA,EAAEgC;IAAI,CAAO,CAC7C;EAAC,CACE,CAAC;AAEX,CACF,CAAC;AACDO,gBAAgB,CAAChB,WAAW,GAAG,mBAAmB;AAElD,MAAMiB,cAAc,gBAAGjG,UAAU,CAAoB,CAAC;EAAEoD,SAAS;EAAE,GAAGM;AAAM,CAAC,EAAEC,GAAG,KAAK;EACrF,MAAM;IAAE3B;EAAQ,CAAC,GAAGS,YAAY,CAAC,iBAAiB,CAAC;EACnD,MAAM;IAAEd;EAAM,CAAC,GAAGN,iBAAiB,CAAC;IAAEW;EAAQ,CAAC,CAAC;EAChD,oBAAOd,IAAA,CAACH,IAAI;IAAC4C,GAAG,EAAEA,GAAI;IAACP,SAAS,EAAEzB,KAAK,CAAC;MAAEyB;IAAU,CAAC,CAAE;IAAA,GAAKM;EAAK,CAAG,CAAC;AACvE,CAAC,CAAC;AACFuC,cAAc,CAACjB,WAAW,GAAG,iBAAiB;AAE9C,OAAO,MAAMkB,SAAS,GAAGC,MAAM,CAACC,MAAM,CAACjD,aAAa,EAAE;EACpDkD,IAAI,EAAEpB,aAAa;EACnBqB,OAAO,EAAElB,gBAAgB;EACzBmB,KAAK,EAAEN,cAAc;EACrBO,SAAS,EAAEd,kBAAkB;EAC7Be,OAAO,EAAET;AACX,CAAC,CAAC","ignoreList":[]}
|
|
@@ -12,7 +12,7 @@ import { View } from 'react-native';
|
|
|
12
12
|
import { tv } from 'tailwind-variants';
|
|
13
13
|
import { useCSSVariable } from 'uniwind';
|
|
14
14
|
import { cn } from "../../utils/cn.js";
|
|
15
|
-
import { Text } from "../../primitives/text.js";
|
|
15
|
+
import { Text, textChildren } from "../../primitives/text.js";
|
|
16
16
|
import { AlertTriangleIcon, CheckCircleIcon, InfoIcon } from "../../icons/index.js";
|
|
17
17
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
18
|
const alertVariants = tv({
|
|
@@ -97,7 +97,7 @@ const AlertRoot = /*#__PURE__*/forwardRef(({
|
|
|
97
97
|
children: icon
|
|
98
98
|
}), /*#__PURE__*/_jsx(View, {
|
|
99
99
|
className: content(),
|
|
100
|
-
children: children
|
|
100
|
+
children: textChildren(children)
|
|
101
101
|
})]
|
|
102
102
|
}) : children
|
|
103
103
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","forwardRef","useContext","View","tv","useCSSVariable","cn","Text","AlertTriangleIcon","CheckCircleIcon","InfoIcon","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","alertVariants","slots","root","indicator","content","title","description","variants","variant","default","info","success","warning","destructive","defaultVariants","AlertContext","INDICATOR_COLOR_VAR","INDICATOR_ICON","AlertRoot","className","icon","children","props","ref","Provider","value","accessibilityRole","displayName","AlertIndicator","iconProps","themeColor","Icon","color","undefined","size","AlertContent","AlertTitle","AlertDescription","Alert","Object","assign","Indicator","Content","Title","Description"],"sourceRoot":"../../../../src","sources":["components/alert/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,UAAU,EAAEC,UAAU,QAAwB,OAAO;AAC7E,SAASC,IAAI,QAA6C,cAAc;AACxE,SAASC,EAAE,QAA2B,mBAAmB;AACzD,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,EAAE,QAAQ,mBAAgB;AACnC,SAASC,IAAI,
|
|
1
|
+
{"version":3,"names":["createContext","forwardRef","useContext","View","tv","useCSSVariable","cn","Text","textChildren","AlertTriangleIcon","CheckCircleIcon","InfoIcon","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","alertVariants","slots","root","indicator","content","title","description","variants","variant","default","info","success","warning","destructive","defaultVariants","AlertContext","INDICATOR_COLOR_VAR","INDICATOR_ICON","AlertRoot","className","icon","children","props","ref","Provider","value","accessibilityRole","displayName","AlertIndicator","iconProps","themeColor","Icon","color","undefined","size","AlertContent","AlertTitle","AlertDescription","Alert","Object","assign","Indicator","Content","Title","Description"],"sourceRoot":"../../../../src","sources":["components/alert/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,UAAU,EAAEC,UAAU,QAAwB,OAAO;AAC7E,SAASC,IAAI,QAA6C,cAAc;AACxE,SAASC,EAAE,QAA2B,mBAAmB;AACzD,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,EAAE,QAAQ,mBAAgB;AACnC,SAASC,IAAI,EAAkBC,YAAY,QAAQ,0BAAuB;AAC1E,SAASC,iBAAiB,EAAEC,eAAe,EAAEC,QAAQ,QAAQ,sBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE3E,MAAMC,aAAa,GAAGd,EAAE,CAAC;EACvBe,KAAK,EAAE;IACLC,IAAI,EAAE,qDAAqD;IAC3DC,SAAS,EAAE,OAAO;IAClBC,OAAO,EAAE,gBAAgB;IACzBC,KAAK,EAAE,qBAAqB;IAC5BC,WAAW,EAAE;EACf,CAAC;EACDC,QAAQ,EAAE;IACRC,OAAO,EAAE;MACPC,OAAO,EAAE;QACPP,IAAI,EAAE,0BAA0B;QAChCG,KAAK,EAAE;MACT,CAAC;MACDK,IAAI,EAAE;QACJR,IAAI,EAAE,6BAA6B;QACnCG,KAAK,EAAE;MACT,CAAC;MACDM,OAAO,EAAE;QACPT,IAAI,EAAE,mCAAmC;QACzCG,KAAK,EAAE;MACT,CAAC;MACDO,OAAO,EAAE;QACPV,IAAI,EAAE,mCAAmC;QACzCG,KAAK,EAAE;MACT,CAAC;MACDQ,WAAW,EAAE;QACXX,IAAI,EAAE,2CAA2C;QACjDG,KAAK,EAAE;MACT;IACF;EACF,CAAC;EACDS,eAAe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S,EAAE;EAC5C;EACAuB,SAAS,EAAEb,cAAc;EACzB;EACAc,OAAO,EAAEP,YAAY;EACrBQ,KAAK,EAAEP,UAAU;EACjBQ,WAAW,EAAEP;AACf,CAAC,CAAC","ignoreList":[]}
|
|
@@ -51,10 +51,23 @@ const PADDING = {
|
|
|
51
51
|
left: 10
|
|
52
52
|
};
|
|
53
53
|
const LABEL_WIDTH = 132;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Box each x label is centred in. Wide enough for a short label to sit over
|
|
57
|
+
* its point without the neighbours colliding; a longer one is ellipsised
|
|
58
|
+
* rather than allowed to push the others out of place.
|
|
59
|
+
*/
|
|
60
|
+
const POINT_LABEL_WIDTH = 56;
|
|
61
|
+
|
|
62
|
+
/** Line height of an `xs` label, for centring one on the grid line it names. */
|
|
63
|
+
const AXIS_LABEL_HEIGHT = 16;
|
|
54
64
|
const DOT = 9;
|
|
55
65
|
|
|
56
66
|
/** Left gutter reserved when a `YAxis` is present, for its labels to sit in. */
|
|
57
|
-
const Y_AXIS_WIDTH =
|
|
67
|
+
const Y_AXIS_WIDTH = 44;
|
|
68
|
+
|
|
69
|
+
/** Gap between the value labels and the plot they sit beside. */
|
|
70
|
+
const Y_AXIS_GUTTER = 6;
|
|
58
71
|
const AreaChartContext = /*#__PURE__*/createContext(null);
|
|
59
72
|
function useChart(component) {
|
|
60
73
|
const context = useContext(AreaChartContext);
|
|
@@ -94,17 +107,19 @@ function ChildSlot({
|
|
|
94
107
|
function partition(children) {
|
|
95
108
|
const svg = [];
|
|
96
109
|
const overlay = [];
|
|
110
|
+
const header = [];
|
|
97
111
|
Children.forEach(children, (child, index) => {
|
|
98
112
|
if (! /*#__PURE__*/isValidElement(child)) return;
|
|
99
113
|
const layer = child.type.layer ?? 'svg';
|
|
100
114
|
const slot = /*#__PURE__*/_jsx(ChildSlot, {
|
|
101
115
|
children: child
|
|
102
116
|
}, index);
|
|
103
|
-
(layer === 'overlay' ? overlay : svg).push(slot);
|
|
117
|
+
(layer === 'header' ? header : layer === 'overlay' ? overlay : svg).push(slot);
|
|
104
118
|
});
|
|
105
119
|
return {
|
|
106
120
|
svg,
|
|
107
|
-
overlay
|
|
121
|
+
overlay,
|
|
122
|
+
header
|
|
108
123
|
};
|
|
109
124
|
}
|
|
110
125
|
const AreaChartRoot = /*#__PURE__*/forwardRef(function AreaChartRoot({
|
|
@@ -287,35 +302,47 @@ const AreaChartRoot = /*#__PURE__*/forwardRef(function AreaChartRoot({
|
|
|
287
302
|
[data, xDataKey, plot.width, plot.height, plot.left, plot.top, status, curve, stacked, series, registerSeries, unregisterSeries, domainMin, domainMax, extent, activeIndex, activeIndexJS, handleActiveIndex, clipId]);
|
|
288
303
|
const {
|
|
289
304
|
svg,
|
|
290
|
-
overlay
|
|
305
|
+
overlay,
|
|
306
|
+
header
|
|
291
307
|
} = partition(children);
|
|
308
|
+
|
|
309
|
+
/*
|
|
310
|
+
* Two views, because the header is not part of the plot. `aspectRatio` and
|
|
311
|
+
* the layout measurement belong to the drawing area alone — measured on the
|
|
312
|
+
* outer view they would take in the header too, and the plot would lose as
|
|
313
|
+
* much height as the readout took while still claiming the shape asked for.
|
|
314
|
+
*/
|
|
292
315
|
return /*#__PURE__*/_jsx(AreaChartContext.Provider, {
|
|
293
316
|
value: context,
|
|
294
|
-
children: /*#__PURE__*/
|
|
317
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
295
318
|
...props,
|
|
296
|
-
|
|
297
|
-
style: [{
|
|
298
|
-
aspectRatio
|
|
299
|
-
}, props.style],
|
|
319
|
+
style: props.style,
|
|
300
320
|
className: cn('w-full', className),
|
|
301
|
-
children:
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
321
|
+
children: [header, /*#__PURE__*/_jsx(View, {
|
|
322
|
+
onLayout: onLayout,
|
|
323
|
+
style: {
|
|
324
|
+
aspectRatio
|
|
325
|
+
},
|
|
326
|
+
className: "w-full",
|
|
327
|
+
children: plot.width > 0 ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
328
|
+
children: [/*#__PURE__*/_jsxs(Svg, {
|
|
329
|
+
width: "100%",
|
|
330
|
+
height: "100%",
|
|
331
|
+
style: StyleSheet.absoluteFill,
|
|
332
|
+
children: [/*#__PURE__*/_jsx(Defs, {
|
|
333
|
+
children: /*#__PURE__*/_jsx(ClipPath, {
|
|
334
|
+
id: clipId,
|
|
335
|
+
children: /*#__PURE__*/_jsx(AnimatedRect, {
|
|
336
|
+
x: plot.left,
|
|
337
|
+
y: 0,
|
|
338
|
+
height: size.height,
|
|
339
|
+
animatedProps: clipProps
|
|
340
|
+
})
|
|
314
341
|
})
|
|
315
|
-
})
|
|
316
|
-
}),
|
|
317
|
-
})
|
|
318
|
-
})
|
|
342
|
+
}), svg]
|
|
343
|
+
}), overlay]
|
|
344
|
+
}) : null
|
|
345
|
+
})]
|
|
319
346
|
})
|
|
320
347
|
});
|
|
321
348
|
});
|
|
@@ -488,19 +515,38 @@ function AreaChartXAxis({
|
|
|
488
515
|
};
|
|
489
516
|
}).filter(label => label !== null);
|
|
490
517
|
}, [data, ticks, format, xDataKey]);
|
|
518
|
+
|
|
519
|
+
/*
|
|
520
|
+
* Each label sits on its own point rather than being spread along the axis.
|
|
521
|
+
* The indices `ticks` picks are not evenly spaced — twelve months shown five
|
|
522
|
+
* at a time gives 0,3,6,8,11 — so spreading them evenly put the ones in
|
|
523
|
+
* between over the wrong part of the line.
|
|
524
|
+
*
|
|
525
|
+
* The box is backed off by half its own width rather than translated by
|
|
526
|
+
* `-50%`, which is not reliable across React Native versions.
|
|
527
|
+
*/
|
|
491
528
|
return /*#__PURE__*/_jsx(View, {
|
|
492
|
-
pointerEvents: "none",
|
|
493
529
|
style: {
|
|
494
530
|
position: 'absolute',
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
bottom: 0,
|
|
498
|
-
height: PADDING.bottom
|
|
531
|
+
inset: 0,
|
|
532
|
+
pointerEvents: 'none'
|
|
499
533
|
},
|
|
500
|
-
className: cn(
|
|
534
|
+
className: cn(className),
|
|
501
535
|
children: labels.map(label => /*#__PURE__*/_jsx(Text, {
|
|
502
536
|
size: "xs",
|
|
503
537
|
muted: true,
|
|
538
|
+
numberOfLines: 1,
|
|
539
|
+
style: {
|
|
540
|
+
position: 'absolute',
|
|
541
|
+
bottom: 0,
|
|
542
|
+
// Centred on its point, then held inside the chart. The first and
|
|
543
|
+
// last points sit on the plot's own edges, so a box centred on
|
|
544
|
+
// them hangs half its width off the side — the clamp slides those
|
|
545
|
+
// two back in rather than letting the numbers leave the frame.
|
|
546
|
+
left: Math.max(0, Math.min(xOf(label.key, data.length, plot) - POINT_LABEL_WIDTH / 2, plot.left + plot.width + PADDING.right - POINT_LABEL_WIDTH)),
|
|
547
|
+
width: POINT_LABEL_WIDTH,
|
|
548
|
+
textAlign: 'center'
|
|
549
|
+
},
|
|
504
550
|
children: label.text
|
|
505
551
|
}, label.key))
|
|
506
552
|
});
|
|
@@ -535,10 +581,17 @@ function AreaChartYAxis({
|
|
|
535
581
|
style: {
|
|
536
582
|
position: 'absolute',
|
|
537
583
|
left: 0,
|
|
538
|
-
|
|
539
|
-
|
|
584
|
+
// Centred on the grid line each label names: the strip is lifted half
|
|
585
|
+
// a label and grown by a whole one, so `justify-between` lands the
|
|
586
|
+
// text's middle on the line rather than its top edge on the first line
|
|
587
|
+
// and its bottom edge on the last.
|
|
588
|
+
top: plot.top - AXIS_LABEL_HEIGHT / 2,
|
|
589
|
+
height: plot.height + AXIS_LABEL_HEIGHT,
|
|
590
|
+
// The gutter the root reserved, less a little breathing room, so the
|
|
591
|
+
// numbers sit clear of the plot instead of against it.
|
|
592
|
+
width: Math.max(plot.left - Y_AXIS_GUTTER, 0)
|
|
540
593
|
},
|
|
541
|
-
className: cn('justify-between', className),
|
|
594
|
+
className: cn('items-end justify-between', className),
|
|
542
595
|
children: labels.map(label => /*#__PURE__*/_jsx(Text, {
|
|
543
596
|
size: "xs",
|
|
544
597
|
muted: true,
|
|
@@ -794,28 +847,107 @@ function AreaChartLegend({
|
|
|
794
847
|
const ordered = stacked ? [...series].reverse() : series;
|
|
795
848
|
return /*#__PURE__*/_jsx(View, {
|
|
796
849
|
...props,
|
|
797
|
-
|
|
850
|
+
style: [{
|
|
851
|
+
pointerEvents: 'none'
|
|
852
|
+
}, props.style],
|
|
798
853
|
className: cn('absolute right-2 top-1 flex-row gap-3', className),
|
|
799
|
-
children: ordered.map(([key, color]) => /*#__PURE__*/
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
style: {
|
|
803
|
-
width: 8,
|
|
804
|
-
height: 8,
|
|
805
|
-
borderRadius: 2,
|
|
806
|
-
backgroundColor: color
|
|
807
|
-
}
|
|
808
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
809
|
-
size: "xs",
|
|
810
|
-
muted: true,
|
|
811
|
-
children: labels?.[key] ?? key
|
|
812
|
-
})]
|
|
854
|
+
children: ordered.map(([key, color]) => /*#__PURE__*/_jsx(SeriesSwatch, {
|
|
855
|
+
color: color,
|
|
856
|
+
label: labels?.[key] ?? key
|
|
813
857
|
}, key))
|
|
814
858
|
});
|
|
815
859
|
}
|
|
816
860
|
AreaChartLegend.displayName = 'AreaChart.Legend';
|
|
817
861
|
AreaChartLegend.layer = 'overlay';
|
|
862
|
+
|
|
863
|
+
/** One series' colour and name. Shared by the legend and the header. */
|
|
864
|
+
function SeriesSwatch({
|
|
865
|
+
color,
|
|
866
|
+
label
|
|
867
|
+
}) {
|
|
868
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
869
|
+
className: "flex-row items-center gap-1.5",
|
|
870
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
871
|
+
style: {
|
|
872
|
+
backgroundColor: color
|
|
873
|
+
},
|
|
874
|
+
className: "h-2 w-2 rounded-full"
|
|
875
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
876
|
+
size: "xs",
|
|
877
|
+
muted: true,
|
|
878
|
+
children: label
|
|
879
|
+
})]
|
|
880
|
+
});
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
/* -------------------------------------------------------------------------- */
|
|
884
|
+
/* Header layer */
|
|
885
|
+
/* -------------------------------------------------------------------------- */
|
|
886
|
+
|
|
887
|
+
/**
|
|
888
|
+
* The strip above the plot: what the chart is of, what it currently reads, and
|
|
889
|
+
* what the colours mean.
|
|
890
|
+
*
|
|
891
|
+
* It belongs to the chart rather than to the card around it because it is about
|
|
892
|
+
* the *plot* — the number changes as a finger moves along the bands, and the
|
|
893
|
+
* legend is the series list the chart itself is holding. The card's header is a
|
|
894
|
+
* caption on the tray the chart sits in; this is the chart introducing itself.
|
|
895
|
+
*
|
|
896
|
+
* The value is not derived here. A readout that follows the finger belongs to
|
|
897
|
+
* whoever owns the data — take it from `onActiveIndexChange` and pass the
|
|
898
|
+
* formatted string down, so one header can show a total when nothing is pressed
|
|
899
|
+
* and a point's value when something is.
|
|
900
|
+
*/
|
|
901
|
+
function AreaChartHeader({
|
|
902
|
+
className,
|
|
903
|
+
title,
|
|
904
|
+
value,
|
|
905
|
+
caption,
|
|
906
|
+
labels,
|
|
907
|
+
legend = false,
|
|
908
|
+
children,
|
|
909
|
+
...props
|
|
910
|
+
}) {
|
|
911
|
+
const {
|
|
912
|
+
series,
|
|
913
|
+
stacked
|
|
914
|
+
} = useChart('AreaChart.Header');
|
|
915
|
+
const ordered = stacked ? [...series].reverse() : series;
|
|
916
|
+
const trailing = children ?? (legend && ordered.length ? /*#__PURE__*/_jsx(View, {
|
|
917
|
+
className: "flex-row flex-wrap items-center justify-end gap-x-3 gap-y-1",
|
|
918
|
+
children: ordered.map(([key, color]) => /*#__PURE__*/_jsx(SeriesSwatch, {
|
|
919
|
+
color: color,
|
|
920
|
+
label: labels?.[key] ?? key
|
|
921
|
+
}, key))
|
|
922
|
+
}) : null);
|
|
923
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
924
|
+
...props,
|
|
925
|
+
className: cn('flex-row items-start justify-between gap-3 pb-3', className),
|
|
926
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
927
|
+
className: "flex-1 gap-0.5",
|
|
928
|
+
children: [title ? /*#__PURE__*/_jsx(Text, {
|
|
929
|
+
size: "xs",
|
|
930
|
+
muted: true,
|
|
931
|
+
children: title
|
|
932
|
+
}) : null, value ? /*#__PURE__*/_jsx(Text, {
|
|
933
|
+
size: "xl",
|
|
934
|
+
weight: "bold",
|
|
935
|
+
children: value
|
|
936
|
+
}) : null, caption ? /*#__PURE__*/_jsx(Text, {
|
|
937
|
+
size: "xs",
|
|
938
|
+
muted: true,
|
|
939
|
+
children: caption
|
|
940
|
+
}) : null]
|
|
941
|
+
}), trailing ? /*#__PURE__*/_jsx(View, {
|
|
942
|
+
className: "shrink pt-1",
|
|
943
|
+
children: trailing
|
|
944
|
+
}) : null]
|
|
945
|
+
});
|
|
946
|
+
}
|
|
947
|
+
AreaChartHeader.displayName = 'AreaChart.Header';
|
|
948
|
+
AreaChartHeader.layer = 'header';
|
|
818
949
|
export const AreaChart = Object.assign(AreaChartRoot, {
|
|
950
|
+
Header: AreaChartHeader,
|
|
819
951
|
Grid: AreaChartGrid,
|
|
820
952
|
Area: AreaChartArea,
|
|
821
953
|
XAxis: AreaChartXAxis,
|