panelui-native 0.22.6 → 0.28.1
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 +1 -0
- 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 +958 -0
- package/lib/module/components/area-chart/index.js.map +1 -0
- 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 +4 -4
- 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 +994 -0
- package/lib/module/components/bar-chart/index.js.map +1 -0
- package/lib/module/components/bottom-sheet/index.js +213 -24
- package/lib/module/components/bottom-sheet/index.js.map +1 -1
- package/lib/module/components/breadcrumb/index.js +275 -0
- package/lib/module/components/breadcrumb/index.js.map +1 -0
- 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 +557 -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 +6 -6
- package/lib/module/components/chip/index.js.map +1 -1
- package/lib/module/components/date-picker/index.js +158 -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 +15 -20
- 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 +22 -5
- package/lib/module/components/frame/index.js.map +1 -1
- package/lib/module/components/heatmap-chart/index.js +28 -8
- package/lib/module/components/heatmap-chart/index.js.map +1 -1
- package/lib/module/components/input-group/index.js +5 -4
- 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 +165 -184
- package/lib/module/components/line-chart/index.js.map +1 -1
- package/lib/module/components/loader/index.js +758 -0
- package/lib/module/components/loader/index.js.map +1 -0
- package/lib/module/components/map/basemap.js +265 -0
- package/lib/module/components/map/basemap.js.map +1 -0
- package/lib/module/components/map/index.js +850 -0
- package/lib/module/components/map/index.js.map +1 -0
- package/lib/module/components/map/maplibre.js +87 -0
- package/lib/module/components/map/maplibre.js.map +1 -0
- package/lib/module/components/marker/index.js +3 -3
- package/lib/module/components/marker/index.js.map +1 -1
- package/lib/module/components/message/index.js +15 -14
- 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/otp-input/index.js +2 -2
- package/lib/module/components/popover/index.js +39 -7
- package/lib/module/components/popover/index.js.map +1 -1
- package/lib/module/components/progress/index.js +8 -2
- package/lib/module/components/progress/index.js.map +1 -1
- package/lib/module/components/radio-group/index.js +2 -2
- package/lib/module/components/radio-group/index.js.map +1 -1
- package/lib/module/components/ring-chart/index.js +423 -0
- package/lib/module/components/ring-chart/index.js.map +1 -0
- package/lib/module/components/section-rail/index.js +6 -6
- 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/separator/index.js +76 -22
- package/lib/module/components/separator/index.js.map +1 -1
- package/lib/module/components/shimmer/index.js +10 -1
- package/lib/module/components/shimmer/index.js.map +1 -1
- package/lib/module/components/slider/index.js +19 -5
- package/lib/module/components/slider/index.js.map +1 -1
- package/lib/module/components/steps/index.js +5 -5
- package/lib/module/components/steps/index.js.map +1 -1
- package/lib/module/components/switch/index.js +6 -1
- package/lib/module/components/switch/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/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 +492 -0
- package/lib/module/components/tooltip/index.js.map +1 -0
- package/lib/module/components/typography/index.js +7 -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/hooks/use-direction.js +43 -0
- package/lib/module/hooks/use-direction.js.map +1 -0
- package/lib/module/icons/index.js +180 -2
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +12 -2
- package/lib/module/index.js.map +1 -1
- 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 +55 -11
- package/lib/module/primitives/text.js.map +1 -1
- package/lib/module/utils/chart.js +279 -0
- package/lib/module/utils/chart.js.map +1 -0
- 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 +237 -0
- package/lib/typescript/src/components/area-chart/index.d.ts.map +1 -0
- package/lib/typescript/src/components/attachment/index.d.ts.map +1 -1
- package/lib/typescript/src/components/bar-chart/index.d.ts +270 -0
- package/lib/typescript/src/components/bar-chart/index.d.ts.map +1 -0
- package/lib/typescript/src/components/bottom-sheet/index.d.ts +75 -4
- package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/src/components/breadcrumb/index.d.ts +100 -0
- package/lib/typescript/src/components/breadcrumb/index.d.ts.map +1 -0
- package/lib/typescript/src/components/button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/calendar/index.d.ts +108 -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/date-picker/index.d.ts +91 -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 +11 -10
- 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 +17 -0
- package/lib/typescript/src/components/frame/index.d.ts.map +1 -1
- package/lib/typescript/src/components/heatmap-chart/index.d.ts +22 -3
- package/lib/typescript/src/components/heatmap-chart/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 +42 -2
- package/lib/typescript/src/components/line-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/loader/index.d.ts +38 -0
- package/lib/typescript/src/components/loader/index.d.ts.map +1 -0
- package/lib/typescript/src/components/map/basemap.d.ts +76 -0
- package/lib/typescript/src/components/map/basemap.d.ts.map +1 -0
- package/lib/typescript/src/components/map/index.d.ts +367 -0
- package/lib/typescript/src/components/map/index.d.ts.map +1 -0
- package/lib/typescript/src/components/map/maplibre.d.ts +193 -0
- package/lib/typescript/src/components/map/maplibre.d.ts.map +1 -0
- package/lib/typescript/src/components/marker/index.d.ts.map +1 -1
- 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/popover/index.d.ts.map +1 -1
- package/lib/typescript/src/components/progress/index.d.ts.map +1 -1
- package/lib/typescript/src/components/ring-chart/index.d.ts +156 -0
- package/lib/typescript/src/components/ring-chart/index.d.ts.map +1 -0
- package/lib/typescript/src/components/select/index.d.ts.map +1 -1
- package/lib/typescript/src/components/separator/index.d.ts +36 -1
- package/lib/typescript/src/components/separator/index.d.ts.map +1 -1
- package/lib/typescript/src/components/shimmer/index.d.ts.map +1 -1
- package/lib/typescript/src/components/slider/index.d.ts.map +1 -1
- package/lib/typescript/src/components/steps/index.d.ts.map +1 -1
- package/lib/typescript/src/components/switch/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tabs/index.d.ts.map +1 -1
- 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 +125 -0
- package/lib/typescript/src/components/tooltip/index.d.ts.map +1 -0
- package/lib/typescript/src/components/typography/index.d.ts +6 -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/hooks/use-direction.d.ts +20 -0
- package/lib/typescript/src/hooks/use-direction.d.ts.map +1 -0
- package/lib/typescript/src/icons/index.d.ts +8 -0
- package/lib/typescript/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +14 -4
- package/lib/typescript/src/index.d.ts.map +1 -1
- 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/chart.d.ts +96 -0
- package/lib/typescript/src/utils/chart.d.ts.map +1 -0
- package/lib/typescript/src/utils/date.d.ts +116 -0
- package/lib/typescript/src/utils/date.d.ts.map +1 -0
- package/package.json +9 -1
- package/src/components/accordion/index.tsx +8 -12
- package/src/components/alert/index.tsx +2 -2
- package/src/components/area-chart/index.tsx +1147 -0
- package/src/components/attachment/index.tsx +2 -2
- package/src/components/avatar/index.tsx +4 -4
- package/src/components/badge/index.tsx +6 -6
- package/src/components/bar-chart/index.tsx +1208 -0
- package/src/components/bottom-sheet/index.tsx +282 -21
- package/src/components/breadcrumb/index.tsx +363 -0
- package/src/components/button/index.tsx +12 -8
- package/src/components/calendar/index.tsx +703 -0
- package/src/components/carousel/index.tsx +788 -0
- package/src/components/chip/index.tsx +6 -8
- package/src/components/date-picker/index.tsx +237 -0
- package/src/components/dialog/index.tsx +7 -2
- package/src/components/direction/index.tsx +22 -22
- 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 +22 -7
- package/src/components/heatmap-chart/index.tsx +58 -11
- package/src/components/input-group/index.tsx +5 -4
- package/src/components/item/index.tsx +9 -9
- package/src/components/label/index.tsx +2 -2
- package/src/components/line-chart/index.tsx +194 -223
- package/src/components/loader/index.tsx +812 -0
- package/src/components/map/basemap.ts +304 -0
- package/src/components/map/index.tsx +1116 -0
- package/src/components/map/maplibre.ts +201 -0
- package/src/components/marker/index.tsx +3 -3
- package/src/components/message/index.tsx +15 -14
- package/src/components/message-scroller/index.tsx +5 -4
- package/src/components/otp-input/index.tsx +2 -2
- package/src/components/popover/index.tsx +43 -7
- package/src/components/progress/index.tsx +10 -2
- package/src/components/radio-group/index.tsx +2 -2
- package/src/components/ring-chart/index.tsx +543 -0
- package/src/components/section-rail/index.tsx +6 -6
- package/src/components/select/index.tsx +10 -4
- package/src/components/separator/index.tsx +77 -19
- package/src/components/shimmer/index.tsx +10 -1
- package/src/components/slider/index.tsx +20 -5
- package/src/components/steps/index.tsx +5 -5
- package/src/components/switch/index.tsx +6 -1
- package/src/components/tabs/index.tsx +7 -9
- 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 +610 -0
- package/src/components/typography/index.tsx +7 -2
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-back-handler.ts +37 -0
- package/src/hooks/use-direction.ts +45 -0
- package/src/icons/index.tsx +111 -0
- package/src/index.ts +129 -0
- package/src/primitives/keyboard-avoider.tsx +2 -1
- package/src/primitives/text.tsx +53 -8
- package/src/utils/chart.ts +355 -0
- package/src/utils/date.ts +446 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","forwardRef","useCallback","useContext","useMemo","useState","View","tv","Input","jsx","_jsx","inputGroupVariants","slots","root","prefix","suffix","variants","isDisabled","true","InputGroupContext","useInputGroup","InputGroupRoot","className","children","props","ref","prefixWidth","setPrefixWidth","suffixWidth","setSuffixWidth","value","Provider","displayName","createDecorator","side","Decorator","isDecorative","onLayout","group","setWidth","handleLayout","event","nativeEvent","layout","width","pointerEvents","accessibilityElementsHidden","importantForAccessibility","InputGroupPrefix","InputGroupSuffix","InputGroupInput","style","disabled","paddingLeft","paddingRight","InputGroup","Object","assign","Prefix","Suffix"],"sourceRoot":"../../../../src","sources":["components/input-group/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SACEA,aAAa,EACbC,UAAU,EACVC,WAAW,EACXC,UAAU,EACVC,OAAO,EACPC,QAAQ,QAEH,OAAO;AACd,SACEC,IAAI,QAIC,cAAc;AACrB,SAASC,EAAE,QAAQ,mBAAmB;AACtC,SAASC,KAAK,QAAyB,mBAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;
|
|
1
|
+
{"version":3,"names":["createContext","forwardRef","useCallback","useContext","useMemo","useState","View","tv","Input","textChildren","jsx","_jsx","inputGroupVariants","slots","root","prefix","suffix","variants","isDisabled","true","InputGroupContext","useInputGroup","InputGroupRoot","className","children","props","ref","prefixWidth","setPrefixWidth","suffixWidth","setSuffixWidth","value","Provider","displayName","createDecorator","side","Decorator","isDecorative","onLayout","group","setWidth","handleLayout","event","nativeEvent","layout","width","pointerEvents","accessibilityElementsHidden","importantForAccessibility","InputGroupPrefix","InputGroupSuffix","InputGroupInput","style","disabled","paddingLeft","paddingRight","InputGroup","Object","assign","Prefix","Suffix"],"sourceRoot":"../../../../src","sources":["components/input-group/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SACEA,aAAa,EACbC,UAAU,EACVC,WAAW,EACXC,UAAU,EACVC,OAAO,EACPC,QAAQ,QAEH,OAAO;AACd,SACEC,IAAI,QAIC,cAAc;AACrB,SAASC,EAAE,QAAQ,mBAAmB;AACtC,SAASC,KAAK,QAAyB,mBAAU;AACjD,SAASC,YAAY,QAAQ,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAErD,MAAMC,kBAAkB,GAAGL,EAAE,CAAC;EAC5BM,KAAK,EAAE;IACLC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE,sFAAsF;IAC9FC,MAAM,EAAE;EACV,CAAC;EACDC,QAAQ,EAAE;IACRC,UAAU,EAAE;MACVC,IAAI,EAAE;QAAEJ,MAAM,EAAE,gBAAgB;QAAEC,MAAM,EAAE;MAAiB;IAC7D;EACF;AACF,CAAC,CAAC;AAUF,MAAMI,iBAAiB,gBAAGpB,aAAa,CAAyB,IAAI,CAAC;AAErE,SAASqB,aAAaA,CAAA,EAAG;EACvB,OAAOlB,UAAU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,IAAId,KAAK,EAAErB,UAAW;IACxCkC,KAAK,EAAE;IACL;IACA;IACAb,KAAK,EAAEZ,WAAW,GAAG;MAAE2B,WAAW,EAAEf,KAAK,CAACZ;IAAY,CAAC,GAAG,IAAI,EAC9DY,KAAK,EAAEV,WAAW,GAAG;MAAE0B,YAAY,EAAEhB,KAAK,CAACV;IAAY,CAAC,GAAG,IAAI,EAC/DuB,KAAK,CACL;IAAA,GACE3B;EAAK,CACV,CAAC;AAEN,CACF,CAAC;AACD0B,eAAe,CAAClB,WAAW,GAAG,kBAAkB;AAEhD,OAAO,MAAMuB,UAAU,GAAGC,MAAM,CAACC,MAAM,CAACpC,cAAc,EAAE;EACtDqC,MAAM,EAAEV,gBAAgB;EACxBzC,KAAK,EAAE2C,eAAe;EACtBS,MAAM,EAAEV;AACV,CAAC,CAAC","ignoreList":[]}
|
|
@@ -30,7 +30,7 @@ import { createContext, forwardRef, useContext } from 'react';
|
|
|
30
30
|
import { View } from 'react-native';
|
|
31
31
|
import { tv } from 'tailwind-variants';
|
|
32
32
|
import { AnimatedPressable } from "../../primitives/animated-pressable.js";
|
|
33
|
-
import { Text } from "../../primitives/text.js";
|
|
33
|
+
import { Text, textChildren } from "../../primitives/text.js";
|
|
34
34
|
import { cn } from "../../utils/cn.js";
|
|
35
35
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
36
36
|
const itemVariants = tv({
|
|
@@ -172,7 +172,7 @@ const ItemRoot = /*#__PURE__*/forwardRef(({
|
|
|
172
172
|
className
|
|
173
173
|
}),
|
|
174
174
|
...props,
|
|
175
|
-
children: children
|
|
175
|
+
children: textChildren(children)
|
|
176
176
|
}) : /*#__PURE__*/_jsx(AnimatedPressable, {
|
|
177
177
|
ref: ref,
|
|
178
178
|
accessibilityRole: "button",
|
|
@@ -185,7 +185,7 @@ const ItemRoot = /*#__PURE__*/forwardRef(({
|
|
|
185
185
|
className
|
|
186
186
|
}),
|
|
187
187
|
...props,
|
|
188
|
-
children: children
|
|
188
|
+
children: textChildren(children)
|
|
189
189
|
});
|
|
190
190
|
return /*#__PURE__*/_jsx(ItemContext.Provider, {
|
|
191
191
|
value: {
|
|
@@ -207,7 +207,7 @@ const ItemGroup = /*#__PURE__*/forwardRef(({
|
|
|
207
207
|
accessibilityRole: "list",
|
|
208
208
|
className: cn(orientation === 'horizontal' ? 'flex-row items-stretch gap-3' : 'w-full', className),
|
|
209
209
|
...props,
|
|
210
|
-
children: children
|
|
210
|
+
children: textChildren(children)
|
|
211
211
|
}));
|
|
212
212
|
ItemGroup.displayName = 'Item.Group';
|
|
213
213
|
/** Hairline between rows in a group. */
|
|
@@ -238,7 +238,7 @@ const ItemMedia = /*#__PURE__*/forwardRef(({
|
|
|
238
238
|
className
|
|
239
239
|
}),
|
|
240
240
|
...props,
|
|
241
|
-
children: children
|
|
241
|
+
children: textChildren(children)
|
|
242
242
|
});
|
|
243
243
|
});
|
|
244
244
|
ItemMedia.displayName = 'Item.Media';
|
|
@@ -259,7 +259,7 @@ const ItemContent = /*#__PURE__*/forwardRef(({
|
|
|
259
259
|
ref: ref,
|
|
260
260
|
className: cn(orientation === 'horizontal' ? 'flex-1' : 'w-full', 'gap-0.5', className),
|
|
261
261
|
...props,
|
|
262
|
-
children: children
|
|
262
|
+
children: textChildren(children)
|
|
263
263
|
});
|
|
264
264
|
});
|
|
265
265
|
ItemContent.displayName = 'Item.Content';
|
|
@@ -314,7 +314,7 @@ const ItemActions = /*#__PURE__*/forwardRef(({
|
|
|
314
314
|
ref: ref,
|
|
315
315
|
className: cn('shrink-0 flex-row items-center gap-1.5', className),
|
|
316
316
|
...props,
|
|
317
|
-
children: children
|
|
317
|
+
children: textChildren(children)
|
|
318
318
|
}));
|
|
319
319
|
ItemActions.displayName = 'Item.Actions';
|
|
320
320
|
/**
|
|
@@ -330,7 +330,7 @@ const ItemHeader = /*#__PURE__*/forwardRef(({
|
|
|
330
330
|
ref: ref,
|
|
331
331
|
className: cn('w-full flex-row items-center justify-between gap-2', className),
|
|
332
332
|
...props,
|
|
333
|
-
children: children
|
|
333
|
+
children: textChildren(children)
|
|
334
334
|
}));
|
|
335
335
|
ItemHeader.displayName = 'Item.Header';
|
|
336
336
|
/** Full-width strip below the row's main content. */
|
|
@@ -342,7 +342,7 @@ const ItemFooter = /*#__PURE__*/forwardRef(({
|
|
|
342
342
|
ref: ref,
|
|
343
343
|
className: cn('w-full flex-row items-center gap-2', className),
|
|
344
344
|
...props,
|
|
345
|
-
children: children
|
|
345
|
+
children: textChildren(children)
|
|
346
346
|
}));
|
|
347
347
|
ItemFooter.displayName = 'Item.Footer';
|
|
348
348
|
export const Item = Object.assign(ItemRoot, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","forwardRef","useContext","View","tv","AnimatedPressable","Text","cn","jsx","_jsx","itemVariants","slots","root","title","description","variants","variant","default","outline","muted","size","sm","xs","orientation","horizontal","vertical","disabled","true","defaultVariants","ItemContext","mediaVariants","base","icon","image","compoundVariants","class","ItemRoot","className","children","onPress","props","ref","body","accessibilityState","accessibilityRole","Provider","value","displayName","ItemGroup","ItemSeparator","ItemMedia","item","ItemContent","ItemTitle","ItemDescription","ItemActions","ItemHeader","ItemFooter","Item","Object","assign","Group","Separator","Media","Content","Title","Description","Actions","Header","Footer"],"sourceRoot":"../../../../src","sources":["components/item/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,UAAU,EAAEC,UAAU,QAAwB,OAAO;AAC7E,SAASC,IAAI,QAAwB,cAAc;AACnD,SAASC,EAAE,QAA2B,mBAAmB;AACzD,SAASC,iBAAiB,QAAqC,wCAAqC;AACpG,SAASC,IAAI,
|
|
1
|
+
{"version":3,"names":["createContext","forwardRef","useContext","View","tv","AnimatedPressable","Text","textChildren","cn","jsx","_jsx","itemVariants","slots","root","title","description","variants","variant","default","outline","muted","size","sm","xs","orientation","horizontal","vertical","disabled","true","defaultVariants","ItemContext","mediaVariants","base","icon","image","compoundVariants","class","ItemRoot","className","children","onPress","props","ref","body","accessibilityState","accessibilityRole","Provider","value","displayName","ItemGroup","ItemSeparator","ItemMedia","item","ItemContent","ItemTitle","ItemDescription","ItemActions","ItemHeader","ItemFooter","Item","Object","assign","Group","Separator","Media","Content","Title","Description","Actions","Header","Footer"],"sourceRoot":"../../../../src","sources":["components/item/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,UAAU,EAAEC,UAAU,QAAwB,OAAO;AAC7E,SAASC,IAAI,QAAwB,cAAc;AACnD,SAASC,EAAE,QAA2B,mBAAmB;AACzD,SAASC,iBAAiB,QAAqC,wCAAqC;AACpG,SAASC,IAAI,EAAkBC,YAAY,QAAQ,0BAAuB;AAC1E,SAASC,EAAE,QAAQ,mBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAKpC,MAAMC,YAAY,GAAGP,EAAE,CAAC;EACtBQ,KAAK,EAAE;IACLC,IAAI,EAAE,kBAAkB;IACxBC,KAAK,EAAE,6BAA6B;IACpCC,WAAW,EAAE;EACf,CAAC;EACDC,QAAQ,EAAE;IACRC,OAAO,EAAE;MACPC,OAAO,EAAE,CAAC,CAAC;MACXC,OAAO,EAAE;QAAEN,IAAI,EAAE;MAAuB,CAAC;MACzCO,KAAK,EAAE;QAAEP,IAAI,EAAE;MAAW;IAC5B,CAAC;IACDQ,IAAI,EAAE;MACJH,OAAO,EAAE;QAAEL,IAAI,EAAE,KAAK;QAAEC,KAAK,EAAE,WAAW;QAAEC,WAAW,EAAE;MAAU,CAAC;MACpEO,EAAE,EAAE;QAAET,IAAI,EAAE,KAAK;QAAEC,KAAK,EAAE,SAAS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AERhC,YAAY,CAACgC,QAAQ;AAAC,CACnB,CAEV,CAAC;AACDkB,UAAU,CAACT,WAAW,GAAG,aAAa;AAOtC;AACA,MAAMU,UAAU,gBAAGzD,UAAU,CAC3B,CAAC;EAAEqC,SAAS;EAAEC,QAAQ;EAAE,GAAGE;AAAM,CAAC,EAAEC,GAAG,kBACrChC,IAAA,CAACP,IAAI;EACHuC,GAAG,EAAEA,GAAI;EACTJ,SAAS,EAAE9B,EAAE,CAAC,oCAAoC,EAAE8B,SAAS,CAAE;EAAA,GAC3DG,KAAK;EAAAF,QAAA,EAERhC,YAAY,CAACgC,QAAQ;AAAC,CACnB,CAEV,CAAC;AACDmB,UAAU,CAACV,WAAW,GAAG,aAAa;AAEtC,OAAO,MAAMW,IAAI,GAAGC,MAAM,CAACC,MAAM,CAACxB,QAAQ,EAAE;EAC1CyB,KAAK,EAAEb,SAAS;EAChBc,SAAS,EAAEb,aAAa;EACxBc,KAAK,EAAEb,SAAS;EAChBc,OAAO,EAAEZ,WAAW;EACpBa,KAAK,EAAEZ,SAAS;EAChBa,WAAW,EAAEZ,eAAe;EAC5Ba,OAAO,EAAEZ,WAAW;EACpBa,MAAM,EAAEZ,UAAU;EAClBa,MAAM,EAAEZ;AACV,CAAC,CAAC","ignoreList":[]}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import { createContext, forwardRef, useContext, useMemo } from 'react';
|
|
13
13
|
import { View } from 'react-native';
|
|
14
14
|
import { tv } from 'tailwind-variants';
|
|
15
|
-
import { Text } from "../../primitives/text.js";
|
|
15
|
+
import { Text, textChildren } from "../../primitives/text.js";
|
|
16
16
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
17
|
const labelVariants = tv({
|
|
18
18
|
slots: {
|
|
@@ -69,9 +69,9 @@ const LabelRoot = /*#__PURE__*/forwardRef(({
|
|
|
69
69
|
disabled: isDisabled
|
|
70
70
|
},
|
|
71
71
|
...props,
|
|
72
|
-
children:
|
|
73
|
-
children:
|
|
74
|
-
})
|
|
72
|
+
children: textChildren(children, text => /*#__PURE__*/_jsx(LabelText, {
|
|
73
|
+
children: text
|
|
74
|
+
}))
|
|
75
75
|
})
|
|
76
76
|
});
|
|
77
77
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","forwardRef","useContext","useMemo","View","tv","Text","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","labelVariants","slots","root","text","asterisk","variants","isDisabled","true","isInvalid","LabelContext","isRequired","LabelRoot","className","children","props","ref","state","Provider","value","accessibilityState","disabled","LabelText","displayName","asteriskClassName","accessibilityElementsHidden","importantForAccessibility","Label","Object","assign"],"sourceRoot":"../../../../src","sources":["components/label/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SACEA,aAAa,EACbC,UAAU,EACVC,UAAU,EACVC,OAAO,QAEF,OAAO;AACd,SAASC,IAAI,QAA6C,cAAc;AACxE,SAASC,EAAE,QAAQ,mBAAmB;AACtC,SAASC,IAAI,
|
|
1
|
+
{"version":3,"names":["createContext","forwardRef","useContext","useMemo","View","tv","Text","textChildren","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","labelVariants","slots","root","text","asterisk","variants","isDisabled","true","isInvalid","LabelContext","isRequired","LabelRoot","className","children","props","ref","state","Provider","value","accessibilityState","disabled","LabelText","displayName","asteriskClassName","accessibilityElementsHidden","importantForAccessibility","Label","Object","assign"],"sourceRoot":"../../../../src","sources":["components/label/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SACEA,aAAa,EACbC,UAAU,EACVC,UAAU,EACVC,OAAO,QAEF,OAAO;AACd,SAASC,IAAI,QAA6C,cAAc;AACxE,SAASC,EAAE,QAAQ,mBAAmB;AACtC,SAASC,IAAI,EAAkBC,YAAY,QAAQ,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QA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
|
50
50
|
import Svg, { Circle, ClipPath, Defs, G, Line as SvgLine, LinearGradient, Path, Rect, Stop } from 'react-native-svg';
|
|
51
51
|
import { useCSSVariable } from 'uniwind';
|
|
52
52
|
import { Text } from "../../primitives/text.js";
|
|
53
|
+
import { areaPath, columnValues, compactNumber, linePath, useSeriesColor, xOf, yOf } from "../../utils/chart.js";
|
|
53
54
|
import { cn } from "../../utils/cn.js";
|
|
54
55
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
55
56
|
const AnimatedPath = Animated.createAnimatedComponent(Path);
|
|
@@ -263,35 +264,47 @@ const LineChartRoot = /*#__PURE__*/forwardRef(function LineChartRoot({
|
|
|
263
264
|
[data, xDataKey, plot.width, plot.height, plot.left, plot.top, status, curve, series, registerSeries, unregisterSeries, domainMin, domainMax, activeIndex, activeIndexJS, handleActiveIndex, clipId]);
|
|
264
265
|
const {
|
|
265
266
|
svg,
|
|
266
|
-
overlay
|
|
267
|
+
overlay,
|
|
268
|
+
header
|
|
267
269
|
} = partition(children);
|
|
270
|
+
|
|
271
|
+
/*
|
|
272
|
+
* Two views, because the header is not part of the plot. `aspectRatio` and
|
|
273
|
+
* the layout measurement belong to the drawing area alone — measured on the
|
|
274
|
+
* outer view they would take in the header too, and the plot would lose as
|
|
275
|
+
* much height as the readout took while still claiming the shape asked for.
|
|
276
|
+
*/
|
|
268
277
|
return /*#__PURE__*/_jsx(LineChartContext.Provider, {
|
|
269
278
|
value: context,
|
|
270
|
-
children: /*#__PURE__*/
|
|
279
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
271
280
|
...props,
|
|
272
|
-
|
|
273
|
-
style: [{
|
|
274
|
-
aspectRatio
|
|
275
|
-
}, props.style],
|
|
281
|
+
style: props.style,
|
|
276
282
|
className: cn('w-full', className),
|
|
277
|
-
children:
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
283
|
+
children: [header, /*#__PURE__*/_jsx(View, {
|
|
284
|
+
onLayout: onLayout,
|
|
285
|
+
style: {
|
|
286
|
+
aspectRatio
|
|
287
|
+
},
|
|
288
|
+
className: "w-full",
|
|
289
|
+
children: plot.width > 0 ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
290
|
+
children: [/*#__PURE__*/_jsxs(Svg, {
|
|
291
|
+
width: "100%",
|
|
292
|
+
height: "100%",
|
|
293
|
+
style: StyleSheet.absoluteFill,
|
|
294
|
+
children: [/*#__PURE__*/_jsx(Defs, {
|
|
295
|
+
children: /*#__PURE__*/_jsx(ClipPath, {
|
|
296
|
+
id: clipId,
|
|
297
|
+
children: /*#__PURE__*/_jsx(AnimatedRect, {
|
|
298
|
+
x: plot.left,
|
|
299
|
+
y: 0,
|
|
300
|
+
height: size.height,
|
|
301
|
+
animatedProps: clipProps
|
|
302
|
+
})
|
|
290
303
|
})
|
|
291
|
-
})
|
|
292
|
-
}),
|
|
293
|
-
})
|
|
294
|
-
})
|
|
304
|
+
}), svg]
|
|
305
|
+
}), overlay]
|
|
306
|
+
}) : null
|
|
307
|
+
})]
|
|
295
308
|
})
|
|
296
309
|
});
|
|
297
310
|
});
|
|
@@ -301,10 +314,11 @@ LineChartRoot.displayName = 'LineChart';
|
|
|
301
314
|
function partition(children) {
|
|
302
315
|
const svg = [];
|
|
303
316
|
const overlay = [];
|
|
317
|
+
const header = [];
|
|
304
318
|
Children.forEach(children, (child, index) => {
|
|
305
319
|
if (! /*#__PURE__*/isValidElement(child)) return;
|
|
306
320
|
const layer = child.type.layer ?? 'svg';
|
|
307
|
-
(layer === 'overlay' ? overlay : svg).push(
|
|
321
|
+
(layer === 'header' ? header : layer === 'overlay' ? overlay : svg).push(
|
|
308
322
|
/*#__PURE__*/
|
|
309
323
|
// Children of a `Children.forEach` need keys of their own once they are
|
|
310
324
|
// put into a new array.
|
|
@@ -314,7 +328,8 @@ function partition(children) {
|
|
|
314
328
|
});
|
|
315
329
|
return {
|
|
316
330
|
svg,
|
|
317
|
-
overlay
|
|
331
|
+
overlay,
|
|
332
|
+
header
|
|
318
333
|
};
|
|
319
334
|
}
|
|
320
335
|
|
|
@@ -388,7 +403,7 @@ function LineChartLine({
|
|
|
388
403
|
registerSeries(dataKey, stroke);
|
|
389
404
|
return () => unregisterSeries(dataKey);
|
|
390
405
|
}, [dataKey, stroke, registerSeries, unregisterSeries]);
|
|
391
|
-
const values = useMemo(() =>
|
|
406
|
+
const values = useMemo(() => columnValues(data, dataKey), [data, dataKey]);
|
|
392
407
|
const loading = status === 'loading';
|
|
393
408
|
const animatedProps = useAnimatedProps(() => ({
|
|
394
409
|
d: linePath(values, plot, domainMin.value, domainMax.value, curve, loading)
|
|
@@ -459,7 +474,7 @@ function LineChartArea({
|
|
|
459
474
|
} = useChart('LineChart.Area');
|
|
460
475
|
const fill = useSeriesColor(color, colorIndex);
|
|
461
476
|
const gradientId = useRef(`panelui-area-${Math.random().toString(36).slice(2, 9)}`).current;
|
|
462
|
-
const values = useMemo(() =>
|
|
477
|
+
const values = useMemo(() => columnValues(data, dataKey), [data, dataKey]);
|
|
463
478
|
const loading = status === 'loading';
|
|
464
479
|
const animatedProps = useAnimatedProps(() => ({
|
|
465
480
|
d: areaPath(values, plot, domainMin.value, domainMax.value, curve, loading)
|
|
@@ -602,19 +617,38 @@ function LineChartXAxis({
|
|
|
602
617
|
};
|
|
603
618
|
}).filter(label => label !== null);
|
|
604
619
|
}, [data, ticks, format, xDataKey]);
|
|
620
|
+
|
|
621
|
+
/*
|
|
622
|
+
* Each label sits on its own point rather than being spread along the axis.
|
|
623
|
+
* The indices `ticks` picks are not evenly spaced — twelve months shown five
|
|
624
|
+
* at a time gives 0,3,6,8,11 — so spreading them evenly put the ones in
|
|
625
|
+
* between over the wrong part of the line.
|
|
626
|
+
*
|
|
627
|
+
* The box is backed off by half its own width rather than translated by
|
|
628
|
+
* `-50%`, which is not reliable across React Native versions.
|
|
629
|
+
*/
|
|
605
630
|
return /*#__PURE__*/_jsx(View, {
|
|
606
|
-
pointerEvents: "none",
|
|
607
631
|
style: {
|
|
608
632
|
position: 'absolute',
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
bottom: 0,
|
|
612
|
-
height: PADDING.bottom
|
|
633
|
+
inset: 0,
|
|
634
|
+
pointerEvents: 'none'
|
|
613
635
|
},
|
|
614
|
-
className: cn(
|
|
636
|
+
className: cn(className),
|
|
615
637
|
children: labels.map(label => /*#__PURE__*/_jsx(Text, {
|
|
616
638
|
size: "xs",
|
|
617
639
|
muted: true,
|
|
640
|
+
numberOfLines: 1,
|
|
641
|
+
style: {
|
|
642
|
+
position: 'absolute',
|
|
643
|
+
bottom: 0,
|
|
644
|
+
// Centred on its point, then held inside the chart. The first and
|
|
645
|
+
// last points sit on the plot's own edges, so a box centred on
|
|
646
|
+
// them hangs half its width off the side — the clamp slides those
|
|
647
|
+
// two back in rather than letting the numbers leave the frame.
|
|
648
|
+
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)),
|
|
649
|
+
width: POINT_LABEL_WIDTH,
|
|
650
|
+
textAlign: 'center'
|
|
651
|
+
},
|
|
618
652
|
children: label.text
|
|
619
653
|
}, label.key))
|
|
620
654
|
});
|
|
@@ -739,7 +773,7 @@ function LineChartTooltip({
|
|
|
739
773
|
backgroundColor: stroke
|
|
740
774
|
}, crosshairStyle]
|
|
741
775
|
}), series.map(([key, seriesColor]) => /*#__PURE__*/_jsx(TooltipDot, {
|
|
742
|
-
values:
|
|
776
|
+
values: columnValues(data, key),
|
|
743
777
|
plot: plot,
|
|
744
778
|
domainMin: domainMin,
|
|
745
779
|
domainMax: domainMax,
|
|
@@ -789,13 +823,17 @@ LineChartTooltip.displayName = 'LineChart.Tooltip';
|
|
|
789
823
|
LineChartTooltip.layer = 'overlay';
|
|
790
824
|
const LABEL_WIDTH = 112;
|
|
791
825
|
|
|
826
|
+
/**
|
|
827
|
+
* Box each x label is centred in. Wide enough for a short label to sit over
|
|
828
|
+
* its point without the neighbours colliding; a longer one is ellipsised
|
|
829
|
+
* rather than allowed to push the others out of place.
|
|
830
|
+
*/
|
|
831
|
+
const POINT_LABEL_WIDTH = 56;
|
|
832
|
+
|
|
833
|
+
/** Line height of an `xs` label, for centring one on the grid line it names. */
|
|
834
|
+
const AXIS_LABEL_HEIGHT = 16;
|
|
835
|
+
|
|
792
836
|
/** A compact number for the crosshair label: 1204 → "1.2k", 24801 → "24.8k". */
|
|
793
|
-
function compactNumber(value) {
|
|
794
|
-
const abs = Math.abs(value);
|
|
795
|
-
if (abs >= 1_000_000) return `${(value / 1_000_000).toFixed(1)}M`;
|
|
796
|
-
if (abs >= 1_000) return `${(value / 1_000).toFixed(1)}k`;
|
|
797
|
-
return `${Math.round(value)}`;
|
|
798
|
-
}
|
|
799
837
|
const DOT = 9;
|
|
800
838
|
|
|
801
839
|
/** The dot riding one series under the crosshair. */
|
|
@@ -847,172 +885,115 @@ function LineChartLegend({
|
|
|
847
885
|
const {
|
|
848
886
|
series
|
|
849
887
|
} = useChart('LineChart.Legend');
|
|
888
|
+
if (!series.length) return null;
|
|
850
889
|
return /*#__PURE__*/_jsx(View, {
|
|
851
|
-
pointerEvents: "none",
|
|
852
890
|
className: cn('absolute left-2.5 top-0 flex-row flex-wrap items-center gap-4', className),
|
|
853
891
|
...props,
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
className: "h-2 w-2 rounded-full"
|
|
861
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
862
|
-
size: "xs",
|
|
863
|
-
muted: true,
|
|
864
|
-
children: labels?.[key] ?? key
|
|
865
|
-
})]
|
|
892
|
+
style: [{
|
|
893
|
+
pointerEvents: 'none'
|
|
894
|
+
}, props.style],
|
|
895
|
+
children: series.map(([key, color]) => /*#__PURE__*/_jsx(SeriesSwatch, {
|
|
896
|
+
color: color,
|
|
897
|
+
label: labels?.[key] ?? key
|
|
866
898
|
}, key))
|
|
867
899
|
});
|
|
868
900
|
}
|
|
869
901
|
LineChartLegend.displayName = 'LineChart.Legend';
|
|
870
902
|
LineChartLegend.layer = 'overlay';
|
|
871
903
|
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
904
|
+
/** One series' colour and name. Shared by the legend and the header. */
|
|
905
|
+
function SeriesSwatch({
|
|
906
|
+
color,
|
|
907
|
+
label
|
|
908
|
+
}) {
|
|
909
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
910
|
+
className: "flex-row items-center gap-1.5",
|
|
911
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
912
|
+
style: {
|
|
913
|
+
backgroundColor: color
|
|
914
|
+
},
|
|
915
|
+
className: "h-2 w-2 rounded-full"
|
|
916
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
917
|
+
size: "xs",
|
|
918
|
+
muted: true,
|
|
919
|
+
children: label
|
|
920
|
+
})]
|
|
888
921
|
});
|
|
889
922
|
}
|
|
890
|
-
function xOf(index, total, plot) {
|
|
891
|
-
'worklet';
|
|
892
923
|
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
function yOf(value, plot, min, max) {
|
|
897
|
-
'worklet';
|
|
898
|
-
|
|
899
|
-
const span = max - min || 1;
|
|
900
|
-
return plot.top + plot.height - (value - min) / span * plot.height;
|
|
901
|
-
}
|
|
924
|
+
/* -------------------------------------------------------------------------- */
|
|
925
|
+
/* Header layer */
|
|
926
|
+
/* -------------------------------------------------------------------------- */
|
|
902
927
|
|
|
903
928
|
/**
|
|
904
|
-
*
|
|
929
|
+
* The strip above the plot: what the chart is of, what it currently reads, and
|
|
930
|
+
* what the colours mean.
|
|
905
931
|
*
|
|
906
|
-
*
|
|
907
|
-
*
|
|
908
|
-
*
|
|
932
|
+
* It belongs to the chart rather than to the card around it because it is about
|
|
933
|
+
* the *plot* — the number changes as a finger moves along the line, and the
|
|
934
|
+
* legend is the series list the chart itself is holding. The card's header is a
|
|
935
|
+
* caption on the tray the chart sits in; this is the chart introducing itself.
|
|
909
936
|
*
|
|
910
|
-
*
|
|
911
|
-
*
|
|
912
|
-
*
|
|
913
|
-
*
|
|
914
|
-
* either side of it, and a local peak or trough is given a flat one.
|
|
937
|
+
* The value is not derived here. A readout that follows the finger belongs to
|
|
938
|
+
* whoever owns the data — take it from `onActiveIndexChange` and pass the
|
|
939
|
+
* formatted string down, so one header can show a total when nothing is pressed
|
|
940
|
+
* and a point's value when something is.
|
|
915
941
|
*/
|
|
916
|
-
function
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
for (let i = 0; i < values.length; i += 1) {
|
|
960
|
-
const value = values[i];
|
|
961
|
-
if (value === null || value === undefined) {
|
|
962
|
-
if (run.length) runs.push(run);
|
|
963
|
-
run = [];
|
|
964
|
-
continue;
|
|
965
|
-
}
|
|
966
|
-
run.push({
|
|
967
|
-
x: xOf(i, values.length, plot),
|
|
968
|
-
y: yOf(value, plot, min, max)
|
|
969
|
-
});
|
|
970
|
-
}
|
|
971
|
-
if (run.length) runs.push(run);
|
|
972
|
-
return runs;
|
|
942
|
+
function LineChartHeader({
|
|
943
|
+
className,
|
|
944
|
+
title,
|
|
945
|
+
value,
|
|
946
|
+
caption,
|
|
947
|
+
labels,
|
|
948
|
+
legend = false,
|
|
949
|
+
children,
|
|
950
|
+
...props
|
|
951
|
+
}) {
|
|
952
|
+
const {
|
|
953
|
+
series
|
|
954
|
+
} = useChart('LineChart.Header');
|
|
955
|
+
const trailing = children ?? (legend && series.length ? /*#__PURE__*/_jsx(View, {
|
|
956
|
+
className: "flex-row flex-wrap items-center justify-end gap-x-3 gap-y-1",
|
|
957
|
+
children: series.map(([key, color]) => /*#__PURE__*/_jsx(SeriesSwatch, {
|
|
958
|
+
color: color,
|
|
959
|
+
label: labels?.[key] ?? key
|
|
960
|
+
}, key))
|
|
961
|
+
}) : null);
|
|
962
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
963
|
+
...props,
|
|
964
|
+
className: cn('flex-row items-start justify-between gap-3 pb-3', className),
|
|
965
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
966
|
+
className: "flex-1 gap-0.5",
|
|
967
|
+
children: [title ? /*#__PURE__*/_jsx(Text, {
|
|
968
|
+
size: "xs",
|
|
969
|
+
muted: true,
|
|
970
|
+
children: title
|
|
971
|
+
}) : null, value ? /*#__PURE__*/_jsx(Text, {
|
|
972
|
+
size: "xl",
|
|
973
|
+
weight: "bold",
|
|
974
|
+
children: value
|
|
975
|
+
}) : null, caption ? /*#__PURE__*/_jsx(Text, {
|
|
976
|
+
size: "xs",
|
|
977
|
+
muted: true,
|
|
978
|
+
children: caption
|
|
979
|
+
}) : null]
|
|
980
|
+
}), trailing ? /*#__PURE__*/_jsx(View, {
|
|
981
|
+
className: "shrink pt-1",
|
|
982
|
+
children: trailing
|
|
983
|
+
}) : null]
|
|
984
|
+
});
|
|
973
985
|
}
|
|
974
|
-
|
|
975
|
-
|
|
986
|
+
LineChartHeader.displayName = 'LineChart.Header';
|
|
987
|
+
LineChartHeader.layer = 'header';
|
|
976
988
|
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
}
|
|
981
|
-
const xs = points.map(p => p.x);
|
|
982
|
-
const ys = points.map(p => p.y);
|
|
983
|
-
const ms = tangents(xs, ys);
|
|
984
|
-
let d = `M${xs[0]},${ys[0]}`;
|
|
985
|
-
for (let i = 0; i < points.length - 1; i += 1) {
|
|
986
|
-
const dx = (xs[i + 1] - xs[i]) / 3;
|
|
987
|
-
d += ` C${xs[i] + dx},${ys[i] + ms[i] * dx} ${xs[i + 1] - dx},${ys[i + 1] - ms[i + 1] * dx} ${xs[i + 1]},${ys[i + 1]}`;
|
|
988
|
-
}
|
|
989
|
-
return d;
|
|
990
|
-
}
|
|
991
|
-
function linePath(values, plot, min, max, curve, loading) {
|
|
992
|
-
'worklet';
|
|
989
|
+
/* -------------------------------------------------------------------------- */
|
|
990
|
+
/* Scales and paths */
|
|
991
|
+
/* -------------------------------------------------------------------------- */
|
|
993
992
|
|
|
994
|
-
|
|
995
|
-
// Flat down the middle: the shape the skeleton holds, and the shape the
|
|
996
|
-
// real series grows out of once the data arrives.
|
|
997
|
-
const y = plot.top + plot.height / 2;
|
|
998
|
-
return `M${plot.left},${y} L${plot.left + plot.width},${y}`;
|
|
999
|
-
}
|
|
1000
|
-
return runsOf(values, plot, min, max).map(run => segment(run, curve)).join(' ');
|
|
1001
|
-
}
|
|
1002
|
-
function areaPath(values, plot, min, max, curve, loading) {
|
|
1003
|
-
'worklet';
|
|
993
|
+
/** Only reached if the theme CSS was never imported. */
|
|
1004
994
|
|
|
1005
|
-
if (loading || plot.width <= 0) return '';
|
|
1006
|
-
const baseline = plot.top + plot.height;
|
|
1007
|
-
return runsOf(values, plot, min, max).map(run => {
|
|
1008
|
-
const top = segment(run, curve);
|
|
1009
|
-
if (!top) return '';
|
|
1010
|
-
const first = run[0];
|
|
1011
|
-
const last = run[run.length - 1];
|
|
1012
|
-
return `${top} L${last.x},${baseline} L${first.x},${baseline} Z`;
|
|
1013
|
-
}).join(' ');
|
|
1014
|
-
}
|
|
1015
995
|
export const LineChart = Object.assign(LineChartRoot, {
|
|
996
|
+
Header: LineChartHeader,
|
|
1016
997
|
Grid: LineChartGrid,
|
|
1017
998
|
Area: LineChartArea,
|
|
1018
999
|
Line: LineChartLine,
|