panelui-native 0.65.0 → 0.68.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 +21 -1
- package/lib/module/components/area-chart/index.js +18 -1
- package/lib/module/components/area-chart/index.js.map +1 -1
- package/lib/module/components/bar-chart/index.js +18 -1
- package/lib/module/components/bar-chart/index.js.map +1 -1
- package/lib/module/components/bottom-sheet/index.js.map +1 -1
- package/lib/module/components/candlestick-chart/index.js +18 -1
- package/lib/module/components/candlestick-chart/index.js.map +1 -1
- package/lib/module/components/carousel/carousel-lifecycle.js +51 -0
- package/lib/module/components/carousel/carousel-lifecycle.js.map +1 -0
- package/lib/module/components/carousel/index.js +61 -24
- package/lib/module/components/carousel/index.js.map +1 -1
- package/lib/module/components/context-menu/context-menu-invocation.js +23 -0
- package/lib/module/components/context-menu/context-menu-invocation.js.map +1 -0
- package/lib/module/components/context-menu/index.js +78 -9
- package/lib/module/components/context-menu/index.js.map +1 -1
- package/lib/module/components/dialog/index.js.map +1 -1
- package/lib/module/components/drawer/index.js.map +1 -1
- package/lib/module/components/flow/flow-accessibility.js +18 -2
- package/lib/module/components/flow/flow-accessibility.js.map +1 -1
- package/lib/module/components/flow/flow-identifiers.js +81 -0
- package/lib/module/components/flow/flow-identifiers.js.map +1 -0
- package/lib/module/components/flow/index.js +12 -18
- package/lib/module/components/flow/index.js.map +1 -1
- package/lib/module/components/form/index.js +7 -5
- package/lib/module/components/form/index.js.map +1 -1
- package/lib/module/components/form/typed-form.js +11 -0
- package/lib/module/components/form/typed-form.js.map +1 -0
- package/lib/module/components/form/use-form.js +4 -0
- package/lib/module/components/form/use-form.js.map +1 -1
- package/lib/module/components/heatmap-chart/index.js +27 -1
- package/lib/module/components/heatmap-chart/index.js.map +1 -1
- package/lib/module/components/line-chart/index.js +18 -1
- package/lib/module/components/line-chart/index.js.map +1 -1
- package/lib/module/components/message-scroller/index.js +187 -17
- package/lib/module/components/message-scroller/index.js.map +1 -1
- package/lib/module/components/message-scroller/message-scroller-math.js +43 -0
- package/lib/module/components/message-scroller/message-scroller-math.js.map +1 -0
- package/lib/module/components/meter/index.js +250 -0
- package/lib/module/components/meter/index.js.map +1 -0
- package/lib/module/components/meter/meter-scale.js +88 -0
- package/lib/module/components/meter/meter-scale.js.map +1 -0
- package/lib/module/components/planner/index.js +714 -0
- package/lib/module/components/planner/index.js.map +1 -0
- package/lib/module/components/planner/planner-entries.js +124 -0
- package/lib/module/components/planner/planner-entries.js.map +1 -0
- package/lib/module/components/popover/index.js.map +1 -1
- package/lib/module/components/radar-chart/index.js +18 -1
- package/lib/module/components/radar-chart/index.js.map +1 -1
- package/lib/module/components/scatter-chart/index.js +18 -1
- package/lib/module/components/scatter-chart/index.js.map +1 -1
- package/lib/module/components/selection-mode/index.js +26 -31
- package/lib/module/components/selection-mode/index.js.map +1 -1
- package/lib/module/components/selection-mode/selection-mode-contracts.js +48 -0
- package/lib/module/components/selection-mode/selection-mode-contracts.js.map +1 -0
- package/lib/module/components/signature/index.js +62 -20
- package/lib/module/components/signature/index.js.map +1 -1
- package/lib/module/components/signature/signature-accessibility.js +58 -0
- package/lib/module/components/signature/signature-accessibility.js.map +1 -0
- package/lib/module/components/skeleton/index.js +45 -7
- package/lib/module/components/skeleton/index.js.map +1 -1
- package/lib/module/components/slider/index.js +22 -18
- package/lib/module/components/slider/index.js.map +1 -1
- package/lib/module/components/spinner/index.js +63 -14
- package/lib/module/components/spinner/index.js.map +1 -1
- package/lib/module/components/time-picker/index.js +46 -21
- package/lib/module/components/time-picker/index.js.map +1 -1
- package/lib/module/components/time-picker/ruler-window.js +25 -0
- package/lib/module/components/time-picker/ruler-window.js.map +1 -0
- package/lib/module/hooks/breakpoint-contract.js +29 -0
- package/lib/module/hooks/breakpoint-contract.js.map +1 -0
- package/lib/module/hooks/index.js +1 -1
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/use-breakpoint.js +46 -1
- package/lib/module/hooks/use-breakpoint.js.map +1 -1
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/primitives/chart-accessibility.js +68 -0
- package/lib/module/primitives/chart-accessibility.js.map +1 -0
- package/lib/module/primitives/scrim.js +94 -3
- package/lib/module/primitives/scrim.js.map +1 -1
- package/lib/typescript/src/components/area-chart/index.d.ts +2 -1
- package/lib/typescript/src/components/area-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/bar-chart/index.d.ts +2 -1
- package/lib/typescript/src/components/bar-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/bottom-sheet/index.d.ts +3 -0
- package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/src/components/candlestick-chart/index.d.ts +2 -1
- package/lib/typescript/src/components/candlestick-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/carousel/carousel-lifecycle.d.ts +23 -0
- package/lib/typescript/src/components/carousel/carousel-lifecycle.d.ts.map +1 -0
- package/lib/typescript/src/components/carousel/index.d.ts +5 -2
- package/lib/typescript/src/components/carousel/index.d.ts.map +1 -1
- package/lib/typescript/src/components/context-menu/context-menu-invocation.d.ts +20 -0
- package/lib/typescript/src/components/context-menu/context-menu-invocation.d.ts.map +1 -0
- package/lib/typescript/src/components/context-menu/index.d.ts +18 -8
- package/lib/typescript/src/components/context-menu/index.d.ts.map +1 -1
- package/lib/typescript/src/components/dialog/index.d.ts +3 -0
- package/lib/typescript/src/components/dialog/index.d.ts.map +1 -1
- package/lib/typescript/src/components/drawer/index.d.ts +3 -0
- package/lib/typescript/src/components/drawer/index.d.ts.map +1 -1
- package/lib/typescript/src/components/flow/flow-accessibility.d.ts +8 -0
- package/lib/typescript/src/components/flow/flow-accessibility.d.ts.map +1 -1
- package/lib/typescript/src/components/flow/flow-identifiers.d.ts +24 -0
- package/lib/typescript/src/components/flow/flow-identifiers.d.ts.map +1 -0
- package/lib/typescript/src/components/flow/index.d.ts +6 -5
- package/lib/typescript/src/components/flow/index.d.ts.map +1 -1
- package/lib/typescript/src/components/form/index.d.ts +18 -5
- package/lib/typescript/src/components/form/index.d.ts.map +1 -1
- package/lib/typescript/src/components/form/typed-form.d.ts +7 -0
- package/lib/typescript/src/components/form/typed-form.d.ts.map +1 -0
- package/lib/typescript/src/components/form/use-form.d.ts +4 -0
- package/lib/typescript/src/components/form/use-form.d.ts.map +1 -1
- package/lib/typescript/src/components/heatmap-chart/index.d.ts +2 -1
- package/lib/typescript/src/components/heatmap-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/line-chart/index.d.ts +2 -1
- package/lib/typescript/src/components/line-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/message-scroller/index.d.ts +30 -2
- package/lib/typescript/src/components/message-scroller/index.d.ts.map +1 -1
- package/lib/typescript/src/components/message-scroller/message-scroller-math.d.ts +18 -0
- package/lib/typescript/src/components/message-scroller/message-scroller-math.d.ts.map +1 -0
- package/lib/typescript/src/components/meter/index.d.ts +270 -0
- package/lib/typescript/src/components/meter/index.d.ts.map +1 -0
- package/lib/typescript/src/components/meter/meter-scale.d.ts +57 -0
- package/lib/typescript/src/components/meter/meter-scale.d.ts.map +1 -0
- package/lib/typescript/src/components/planner/index.d.ts +274 -0
- package/lib/typescript/src/components/planner/index.d.ts.map +1 -0
- package/lib/typescript/src/components/planner/planner-entries.d.ts +75 -0
- package/lib/typescript/src/components/planner/planner-entries.d.ts.map +1 -0
- package/lib/typescript/src/components/popover/index.d.ts +3 -0
- package/lib/typescript/src/components/popover/index.d.ts.map +1 -1
- package/lib/typescript/src/components/radar-chart/index.d.ts +4 -0
- package/lib/typescript/src/components/radar-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/scatter-chart/index.d.ts +2 -1
- package/lib/typescript/src/components/scatter-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/selection-mode/index.d.ts +6 -4
- package/lib/typescript/src/components/selection-mode/index.d.ts.map +1 -1
- package/lib/typescript/src/components/selection-mode/selection-mode-contracts.d.ts +18 -0
- package/lib/typescript/src/components/selection-mode/selection-mode-contracts.d.ts.map +1 -0
- package/lib/typescript/src/components/signature/index.d.ts +6 -0
- package/lib/typescript/src/components/signature/index.d.ts.map +1 -1
- package/lib/typescript/src/components/signature/signature-accessibility.d.ts +27 -0
- package/lib/typescript/src/components/signature/signature-accessibility.d.ts.map +1 -0
- package/lib/typescript/src/components/skeleton/index.d.ts +25 -2
- package/lib/typescript/src/components/skeleton/index.d.ts.map +1 -1
- package/lib/typescript/src/components/slider/index.d.ts.map +1 -1
- package/lib/typescript/src/components/spinner/index.d.ts +25 -2
- package/lib/typescript/src/components/spinner/index.d.ts.map +1 -1
- package/lib/typescript/src/components/time-picker/index.d.ts +5 -6
- package/lib/typescript/src/components/time-picker/index.d.ts.map +1 -1
- package/lib/typescript/src/components/time-picker/ruler-window.d.ts +12 -0
- package/lib/typescript/src/components/time-picker/ruler-window.d.ts.map +1 -0
- package/lib/typescript/src/hooks/breakpoint-contract.d.ts +6 -0
- package/lib/typescript/src/hooks/breakpoint-contract.d.ts.map +1 -0
- package/lib/typescript/src/hooks/index.d.ts +1 -1
- package/lib/typescript/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/use-breakpoint.d.ts +22 -0
- package/lib/typescript/src/hooks/use-breakpoint.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +4 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/primitives/chart-accessibility.d.ts +33 -0
- package/lib/typescript/src/primitives/chart-accessibility.d.ts.map +1 -0
- package/lib/typescript/src/primitives/scrim.d.ts +5 -3
- package/lib/typescript/src/primitives/scrim.d.ts.map +1 -1
- package/lib/typescript/types/form-api.type-test.d.ts +2 -0
- package/lib/typescript/types/form-api.type-test.d.ts.map +1 -0
- package/package.json +34 -5
- package/src/components/area-chart/index.tsx +27 -2
- package/src/components/bar-chart/index.tsx +27 -2
- package/src/components/bottom-sheet/index.tsx +3 -0
- package/src/components/candlestick-chart/index.tsx +30 -2
- package/src/components/carousel/carousel-lifecycle.ts +74 -0
- package/src/components/carousel/index.tsx +80 -25
- package/src/components/context-menu/context-menu-invocation.ts +44 -0
- package/src/components/context-menu/index.tsx +113 -13
- package/src/components/dialog/index.tsx +3 -0
- package/src/components/drawer/index.tsx +3 -0
- package/src/components/flow/flow-accessibility.ts +16 -2
- package/src/components/flow/flow-identifiers.ts +98 -0
- package/src/components/flow/index.tsx +29 -19
- package/src/components/form/index.tsx +32 -5
- package/src/components/form/typed-form.ts +13 -0
- package/src/components/form/use-form.ts +9 -0
- package/src/components/heatmap-chart/index.tsx +49 -3
- package/src/components/line-chart/index.tsx +27 -2
- package/src/components/message-scroller/index.tsx +273 -13
- package/src/components/message-scroller/message-scroller-math.ts +62 -0
- package/src/components/meter/index.tsx +318 -0
- package/src/components/meter/meter-scale.ts +109 -0
- package/src/components/planner/index.tsx +886 -0
- package/src/components/planner/planner-entries.ts +146 -0
- package/src/components/popover/index.tsx +3 -0
- package/src/components/radar-chart/index.tsx +24 -0
- package/src/components/scatter-chart/index.tsx +27 -2
- package/src/components/selection-mode/index.tsx +37 -30
- package/src/components/selection-mode/selection-mode-contracts.ts +53 -0
- package/src/components/signature/index.tsx +107 -20
- package/src/components/signature/signature-accessibility.ts +67 -0
- package/src/components/skeleton/index.tsx +59 -5
- package/src/components/slider/index.tsx +28 -18
- package/src/components/spinner/index.tsx +80 -13
- package/src/components/time-picker/index.tsx +57 -29
- package/src/components/time-picker/ruler-window.ts +24 -0
- package/src/hooks/breakpoint-contract.ts +31 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/use-breakpoint.ts +61 -10
- package/src/index.ts +32 -0
- package/src/primitives/chart-accessibility.ts +102 -0
- package/src/primitives/scrim.tsx +127 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/flow/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2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,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;IACrE,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AASD;;;;;;GAMG;AACH,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,QAAyB,EACzB,KAAW,EACX,MAAW,EACX,SAAS,GACV,EAAE,gBAAgB,+BA2GlB;kBAjHQ,WAAW;;;;AAqKpB,eAAO,MAAM,IAAI;;;;;;;;CAQf,CAAC;AAEH,YAAY,EAAE,YAAY,EAAE,qBAAqB,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -7,11 +7,8 @@
|
|
|
7
7
|
* take differently-shaped change props, and only the caller knows which one
|
|
8
8
|
* a given field needs to wire up.
|
|
9
9
|
*
|
|
10
|
-
* `
|
|
11
|
-
* field
|
|
12
|
-
* value's shape can't flow through `useContext` generically. Reach for
|
|
13
|
-
* `useField(form, name)` directly when a field's name should be checked
|
|
14
|
-
* against the form's own value type.
|
|
10
|
+
* `createForm<Values>()` binds that value shape to the same runtime components
|
|
11
|
+
* when field names and render values should stay typed through JSX.
|
|
15
12
|
*
|
|
16
13
|
* ```tsx
|
|
17
14
|
* const form = useForm({
|
|
@@ -43,6 +40,10 @@ export interface FormProps {
|
|
|
43
40
|
form: FormApi<any>;
|
|
44
41
|
children?: ReactNode;
|
|
45
42
|
}
|
|
43
|
+
export interface TypedFormProps<T extends Record<string, any>> {
|
|
44
|
+
form: FormApi<T>;
|
|
45
|
+
children?: ReactNode;
|
|
46
|
+
}
|
|
46
47
|
declare function FormRoot({ form, children }: FormProps): import("react").JSX.Element;
|
|
47
48
|
declare namespace FormRoot {
|
|
48
49
|
var displayName: string;
|
|
@@ -54,6 +55,10 @@ export interface FormFieldProps {
|
|
|
54
55
|
validateOn?: 'blur' | 'change';
|
|
55
56
|
children: (field: FormFieldRenderProps<any>) => ReactNode;
|
|
56
57
|
}
|
|
58
|
+
export interface TypedFormFieldProps<T extends Record<string, any>, K extends keyof T> extends UseFieldOptions<T, K> {
|
|
59
|
+
name: K;
|
|
60
|
+
children: (field: FormFieldRenderProps<T[K]>) => ReactNode;
|
|
61
|
+
}
|
|
57
62
|
declare function FormField({ name, validate, validateOn, children }: FormFieldProps): import("react").JSX.Element;
|
|
58
63
|
declare namespace FormField {
|
|
59
64
|
var displayName: string;
|
|
@@ -61,4 +66,12 @@ declare namespace FormField {
|
|
|
61
66
|
export declare const Form: typeof FormRoot & {
|
|
62
67
|
Field: typeof FormField;
|
|
63
68
|
};
|
|
69
|
+
export interface TypedForm<T extends Record<string, any>> {
|
|
70
|
+
(props: TypedFormProps<T>): ReactNode;
|
|
71
|
+
Field: <K extends keyof T>(props: TypedFormFieldProps<T, K>) => ReactNode;
|
|
72
|
+
useForm: (options: UseFormOptions<T>) => FormApi<T>;
|
|
73
|
+
useField: <K extends keyof T>(form: FormApi<T>, name: K, options?: UseFieldOptions<T, K>) => FormFieldRenderProps<T[K]>;
|
|
74
|
+
}
|
|
75
|
+
/** Bind a value shape to Form's existing runtime without creating new state. */
|
|
76
|
+
export declare function createForm<T extends Record<string, any>>(): TypedForm<T>;
|
|
64
77
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/index.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,KAAK,oBAAoB,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAa,C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AAI,EAAE,CAAC,CAAC;IACR,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;CAC5D;AAED,iBAAS,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,cAAc,+BAO1E;kBAPQ,SAAS;;;AAUlB,eAAO,MAAM,IAAI;;CAEf,CAAC;AAEH,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACtD,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACtC,KAAK,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC;IAC1E,OAAO,EAAE,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IACpD,QAAQ,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,EAC1B,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,CAAC,EACP,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,KAC5B,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACjC;AAED,gFAAgF;AAChF,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAExE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Attach bound helpers to the existing runtime components; no state is cloned. */
|
|
2
|
+
export declare function bindFormRuntime<Root, Field, UseForm, UseField>(root: Root, field: Field, useForm: UseForm, useField: UseField): Root & {
|
|
3
|
+
Field: Field;
|
|
4
|
+
useForm: UseForm;
|
|
5
|
+
useField: UseField;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=typed-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typed-form.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/typed-form.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,wBAAgB,eAAe,CAC7B,IAAI,EACJ,KAAK,EACL,OAAO,EACP,QAAQ,EACR,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,GACe,IAAI,GAAG;IAClF,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;CACpB,CACF"}
|
|
@@ -25,6 +25,10 @@ export interface FormApi<T extends Record<string, any>> {
|
|
|
25
25
|
setFieldValue: <K extends keyof T>(name: K, value: T[K]) => void;
|
|
26
26
|
setFieldTouched: <K extends keyof T>(name: K, touched?: boolean) => void;
|
|
27
27
|
setFieldError: <K extends keyof T>(name: K, error: string | undefined) => void;
|
|
28
|
+
/** Read the latest value, including a change made before React renders again. */
|
|
29
|
+
getValue: <K extends keyof T>(name: K) => T[K];
|
|
30
|
+
/** Read a field from this render so a component naturally follows its changes. */
|
|
31
|
+
watch: <K extends keyof T>(name: K) => T[K];
|
|
28
32
|
getFieldState: <K extends keyof T>(name: K) => FieldState<T[K]>;
|
|
29
33
|
/** Used by `useField`/`Form.Field` to attach a field's validation rule. */
|
|
30
34
|
registerValidator: <K extends keyof T>(name: K, validator?: Validator<T, K>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-form.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/use-form.ts"],"names":[],"mappings":"AAmCA,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAC9D,MAAM,MAAM,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Q,GACT,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAmNhC"}
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
*/
|
|
38
38
|
import { type ReactNode } from 'react';
|
|
39
39
|
import { View, type ViewProps } from 'react-native';
|
|
40
|
+
import { type ChartAccessibilityProps } from '../../primitives/chart-accessibility.js';
|
|
40
41
|
/**
|
|
41
42
|
* Where a part belongs in the layout. Read off the component itself, so
|
|
42
43
|
* composition stays a flat list of children instead of four nested slots the
|
|
@@ -92,7 +93,7 @@ export declare function buildHeatmapCalendar(entries: {
|
|
|
92
93
|
end?: Date;
|
|
93
94
|
weekStartDay?: number;
|
|
94
95
|
}): HeatmapColumn[];
|
|
95
|
-
export interface HeatmapChartProps extends ViewProps {
|
|
96
|
+
export interface HeatmapChartProps extends ViewProps, ChartAccessibilityProps<HeatmapCell> {
|
|
96
97
|
className?: string;
|
|
97
98
|
/** One column per period, with its row bins inside. */
|
|
98
99
|
data: HeatmapColumn[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/heatmap-chart/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAWL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAc,IAAI,EAA0B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/heatmap-chart/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAWL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAc,IAAI,EAA0B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAaxF,OAAO,EAA0B,KAAK,uBAAuB,EAAE,MAAM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MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,iDAAiD;AACjD,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,SAAkB,EAClB,SAAkB,EAClB,UAAU,GACX,EAAE,kBAAkB,+BA6BpB;kBAlCQ,aAAa;;;AAyCtB,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;GAYG;AACH,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,KAAK,EACL,KAAK,EACL,OAAO,EACP,MAAc,EACd,SAAkB,EAClB,SAAkB,EAClB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,kBAAkB,+BA2DpB;kBArEQ,aAAa;;;;AAyEtB,eAAO,MAAM,YAAY;;;;;;;;CAQvB,CAAC"}
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
*/
|
|
44
44
|
import { type ReactNode } from 'react';
|
|
45
45
|
import { type ViewProps } from 'react-native';
|
|
46
|
+
import { type ChartAccessibilityProps } from '../../primitives/chart-accessibility.js';
|
|
46
47
|
/**
|
|
47
48
|
* Which layer a part belongs to. Read off the component itself, so composition
|
|
48
49
|
* stays a flat list of children instead of two nested slots the caller has to
|
|
@@ -65,7 +66,7 @@ export declare function useLineChart(): {
|
|
|
65
66
|
activePoint: LineChartDatum | null;
|
|
66
67
|
xDataKey: string;
|
|
67
68
|
};
|
|
68
|
-
export interface LineChartProps extends ViewProps {
|
|
69
|
+
export interface LineChartProps extends ViewProps, ChartAccessibilityProps<LineChartDatum> {
|
|
69
70
|
className?: string;
|
|
70
71
|
/** The rows. Each one is a point along the x-axis. */
|
|
71
72
|
data: LineChartDatum[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/line-chart/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,EAYL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAA4C,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/line-chart/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,EAYL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAA4C,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AA2BxF,OAAO,EAA0B,KAAK,uBAAuB,EAAE,MAAM,yCAAsC,CAAC;AA2B5G;;;;GAIG;AACH,KAAK,KAAK,GAAG,KAAK,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE1C,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,OAAO,CAAC;AAClD,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,QAAQ,CAAC;AACnD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,S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;;;GAGG;AACH,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,sCAe7E;kBAfQ,eAAe;;;;AAmCxB,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;GAaG;AACH,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,KAAK,EACL,KAAK,EACL,OAAO,EACP,MAAM,EACN,MAAc,EACd,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,oBAAoB,+BAwCtB;kBAjDQ,eAAe;;;;AAqDxB,eAAO,MAAM,SAAS;;;;;;;;;;CAUpB,CAAC"}
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
* Needs a bounded height — from `flex-1` in a column, or an explicit one.
|
|
32
32
|
* Given an unbounded parent it grows to fit its content and never scrolls.
|
|
33
33
|
*/
|
|
34
|
-
import { type ReactNode } from 'react';
|
|
35
|
-
import { type ViewProps } from 'react-native';
|
|
34
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
35
|
+
import { type FlatListProps, type ListRenderItemInfo, type ViewProps } from 'react-native';
|
|
36
36
|
import { type AnimatedScrollViewProps } from 'react-native-reanimated';
|
|
37
37
|
export type MessageScrollerPosition = 'start' | 'end' | 'last-anchor';
|
|
38
38
|
/** Scroll commands, for a control that lives outside the viewport. */
|
|
@@ -93,6 +93,33 @@ declare function MessageScrollerViewport({ className, children, ...props }: Mess
|
|
|
93
93
|
declare namespace MessageScrollerViewport {
|
|
94
94
|
var displayName: string;
|
|
95
95
|
}
|
|
96
|
+
export interface MessageScrollerListItem {
|
|
97
|
+
/** Stable id used by `scrollToMessage` and as the default React key. */
|
|
98
|
+
messageId: string;
|
|
99
|
+
/** Marks the start of a turn for `last-anchor` and visibility reporting. */
|
|
100
|
+
scrollAnchor?: boolean;
|
|
101
|
+
}
|
|
102
|
+
export interface MessageScrollerListProps<T extends MessageScrollerListItem = MessageScrollerListItem> extends Omit<FlatListProps<T>, 'data' | 'renderItem' | 'keyExtractor' | 'onScroll' | 'onContentSizeChange' | 'onViewableItemsChanged' | 'maintainVisibleContentPosition' | 'onScrollToIndexFailed' | 'onScrollEndDrag' | 'onMomentumScrollEnd' | 'CellRendererComponent'> {
|
|
103
|
+
className?: string;
|
|
104
|
+
/** Classes on the virtualized list's padded transcript column. */
|
|
105
|
+
contentContainerClassName?: string;
|
|
106
|
+
/**
|
|
107
|
+
* The complete transcript. Rows outside the native render window stay
|
|
108
|
+
* unmounted; each item therefore carries its stable navigation metadata.
|
|
109
|
+
*/
|
|
110
|
+
data: readonly T[];
|
|
111
|
+
/** Draw one turn from the native list window. */
|
|
112
|
+
renderItem: (info: ListRenderItemInfo<T>) => ReactElement | null;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The real virtualized transcript path. Only its render window mounts; native
|
|
116
|
+
* visible-content maintenance keeps prepends still without measuring offscreen
|
|
117
|
+
* rows in JavaScript.
|
|
118
|
+
*/
|
|
119
|
+
declare function MessageScrollerList<T extends MessageScrollerListItem>({ className, contentContainerClassName, data, renderItem, initialNumToRender, maxToRenderPerBatch, windowSize, ...props }: MessageScrollerListProps<T>): import("react").JSX.Element;
|
|
120
|
+
declare namespace MessageScrollerList {
|
|
121
|
+
var displayName: string;
|
|
122
|
+
}
|
|
96
123
|
export interface MessageScrollerContentProps extends ViewProps {
|
|
97
124
|
className?: string;
|
|
98
125
|
children?: ReactNode;
|
|
@@ -142,6 +169,7 @@ declare namespace MessageScrollerButton {
|
|
|
142
169
|
}
|
|
143
170
|
export declare const MessageScroller: typeof MessageScrollerRoot & {
|
|
144
171
|
Viewport: typeof MessageScrollerViewport;
|
|
172
|
+
List: typeof MessageScrollerList;
|
|
145
173
|
Content: typeof MessageScrollerContent;
|
|
146
174
|
Item: typeof MessageScrollerItem;
|
|
147
175
|
Button: typeof MessageScrollerButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/message-scroller/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/message-scroller/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAQL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAGL,KAAK,aAAa,EAElB,KAAK,kBAAkB,EACvB,KAAK,SAAS,EAEf,MAAM,cAAc,CAAC;AACtB,OAAiB,EAQf,KAAK,uBAAuB,EAC7B,MAAM,yBAAyB,CAAC;AAsBjC,MAAM,MAAM,uBAAuB,GAAG,OAAO,GAAG,KAAK,GAAG,aAAa,CAAC;AA6CtE,sEAAsE;AACtE,wBAAgB,kBAAkB;6BAlBP,OAAO,KAAK,IAAI;+BACd,OAAO,KAAK,IAAI;0BACrB,MAAM,aAAa,OAAO,KAAK,IAAI;EAmB1D;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B;;;EAG3C;AAED,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;I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AAqB,CAAC,EAC7B,SAAS,EACT,MAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,0BAA0B,+BAsD5B;kBA5DQ,qBAAqB;;;AA+D9B,eAAO,MAAM,eAAe;;;;;;CAM1B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type MessageScrollerTarget = 'start' | 'end';
|
|
2
|
+
export declare const MESSAGE_SCROLLER_EDGE_THRESHOLD = 24;
|
|
3
|
+
/** Distance from the viewport to the edge a jump button targets. */
|
|
4
|
+
export declare function distanceFromMessageScrollerTarget(target: MessageScrollerTarget, contentOffsetY: number, contentHeight: number, viewportHeight: number): number;
|
|
5
|
+
/** Whether the control has enough distance to its target edge to be useful. */
|
|
6
|
+
export declare function isMessageScrollerTargetVisible(distance: number): boolean;
|
|
7
|
+
export interface MessageScrollerIndexedItem {
|
|
8
|
+
messageId: string;
|
|
9
|
+
scrollAnchor?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Index used by initial positioning and id-addressed virtualized jumps. */
|
|
12
|
+
export declare function messageScrollerIndex(items: readonly MessageScrollerIndexedItem[], id: string): number | undefined;
|
|
13
|
+
/** Initial target for a list; `undefined` means use the physical end. */
|
|
14
|
+
export declare function initialMessageScrollerIndex(items: readonly MessageScrollerIndexedItem[], position: 'start' | 'end' | 'last-anchor'): number | undefined;
|
|
15
|
+
/** Anchor at or before the first visible virtualized row. */
|
|
16
|
+
export declare function messageScrollerAnchorAt(items: readonly MessageScrollerIndexedItem[], firstVisibleIndex: number): string | null;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=message-scroller-math.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-scroller-math.d.ts","sourceRoot":"","sources":["../../../../../src/components/message-scroller/message-scroller-math.ts"],"names":[],"mappings":"AAAA,KAAK,qBAAqB,GAAG,OAAO,GAAG,KAAK,CAAC;AAE7C,eAAO,MAAM,+BAA+B,KAAK,CAAC;AAElD,oEAAoE;AACpE,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,qBAAqB,EAC7B,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,GACrB,MAAM,CAMR;AAED,+EAA+E;AAC/E,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAIxE;AAED,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,4EAA4E;AAC5E,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,0BAA0B,EAAE,EAC5C,EAAE,EAAE,MAAM,GACT,MAAM,GAAG,SAAS,CAGpB;AAED,yEAAyE;AACzE,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,SAAS,0BAA0B,EAAE,EAC5C,QAAQ,EAAE,OAAO,GAAG,KAAK,GAAG,aAAa,GACxC,MAAM,GAAG,SAAS,CAOpB;AAED,6DAA6D;AAC7D,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,SAAS,0BAA0B,EAAE,EAC5C,iBAAiB,EAAE,MAAM,GACxB,MAAM,GAAG,IAAI,CAKf"}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { View, type ViewProps } from 'react-native';
|
|
2
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
3
|
+
import { type MeterColor, type MeterThreshold } from './meter-scale.js';
|
|
4
|
+
declare const meterVariants: import("tailwind-variants").TVReturnType<{
|
|
5
|
+
color: {
|
|
6
|
+
primary: {
|
|
7
|
+
track: string;
|
|
8
|
+
indicator: string;
|
|
9
|
+
segment: string;
|
|
10
|
+
};
|
|
11
|
+
success: {
|
|
12
|
+
track: string;
|
|
13
|
+
indicator: string;
|
|
14
|
+
segment: string;
|
|
15
|
+
};
|
|
16
|
+
warning: {
|
|
17
|
+
track: string;
|
|
18
|
+
indicator: string;
|
|
19
|
+
segment: string;
|
|
20
|
+
};
|
|
21
|
+
destructive: {
|
|
22
|
+
track: string;
|
|
23
|
+
indicator: string;
|
|
24
|
+
segment: string;
|
|
25
|
+
};
|
|
26
|
+
info: {
|
|
27
|
+
track: string;
|
|
28
|
+
indicator: string;
|
|
29
|
+
segment: string;
|
|
30
|
+
};
|
|
31
|
+
muted: {
|
|
32
|
+
track: string;
|
|
33
|
+
indicator: string;
|
|
34
|
+
segment: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
size: {
|
|
38
|
+
sm: {
|
|
39
|
+
track: string;
|
|
40
|
+
segments: string;
|
|
41
|
+
segment: string;
|
|
42
|
+
};
|
|
43
|
+
md: {
|
|
44
|
+
track: string;
|
|
45
|
+
segments: string;
|
|
46
|
+
segment: string;
|
|
47
|
+
};
|
|
48
|
+
lg: {
|
|
49
|
+
track: string;
|
|
50
|
+
segments: string;
|
|
51
|
+
segment: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
}, {
|
|
55
|
+
root: string;
|
|
56
|
+
header: string;
|
|
57
|
+
track: string;
|
|
58
|
+
indicator: string;
|
|
59
|
+
segments: string;
|
|
60
|
+
segment: string;
|
|
61
|
+
}, undefined, {
|
|
62
|
+
color: {
|
|
63
|
+
primary: {
|
|
64
|
+
track: string;
|
|
65
|
+
indicator: string;
|
|
66
|
+
segment: string;
|
|
67
|
+
};
|
|
68
|
+
success: {
|
|
69
|
+
track: string;
|
|
70
|
+
indicator: string;
|
|
71
|
+
segment: string;
|
|
72
|
+
};
|
|
73
|
+
warning: {
|
|
74
|
+
track: string;
|
|
75
|
+
indicator: string;
|
|
76
|
+
segment: string;
|
|
77
|
+
};
|
|
78
|
+
destructive: {
|
|
79
|
+
track: string;
|
|
80
|
+
indicator: string;
|
|
81
|
+
segment: string;
|
|
82
|
+
};
|
|
83
|
+
info: {
|
|
84
|
+
track: string;
|
|
85
|
+
indicator: string;
|
|
86
|
+
segment: string;
|
|
87
|
+
};
|
|
88
|
+
muted: {
|
|
89
|
+
track: string;
|
|
90
|
+
indicator: string;
|
|
91
|
+
segment: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
size: {
|
|
95
|
+
sm: {
|
|
96
|
+
track: string;
|
|
97
|
+
segments: string;
|
|
98
|
+
segment: string;
|
|
99
|
+
};
|
|
100
|
+
md: {
|
|
101
|
+
track: string;
|
|
102
|
+
segments: string;
|
|
103
|
+
segment: string;
|
|
104
|
+
};
|
|
105
|
+
lg: {
|
|
106
|
+
track: string;
|
|
107
|
+
segments: string;
|
|
108
|
+
segment: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
}, {
|
|
112
|
+
root: string;
|
|
113
|
+
header: string;
|
|
114
|
+
track: string;
|
|
115
|
+
indicator: string;
|
|
116
|
+
segments: string;
|
|
117
|
+
segment: string;
|
|
118
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
119
|
+
color: {
|
|
120
|
+
primary: {
|
|
121
|
+
track: string;
|
|
122
|
+
indicator: string;
|
|
123
|
+
segment: string;
|
|
124
|
+
};
|
|
125
|
+
success: {
|
|
126
|
+
track: string;
|
|
127
|
+
indicator: string;
|
|
128
|
+
segment: string;
|
|
129
|
+
};
|
|
130
|
+
warning: {
|
|
131
|
+
track: string;
|
|
132
|
+
indicator: string;
|
|
133
|
+
segment: string;
|
|
134
|
+
};
|
|
135
|
+
destructive: {
|
|
136
|
+
track: string;
|
|
137
|
+
indicator: string;
|
|
138
|
+
segment: string;
|
|
139
|
+
};
|
|
140
|
+
info: {
|
|
141
|
+
track: string;
|
|
142
|
+
indicator: string;
|
|
143
|
+
segment: string;
|
|
144
|
+
};
|
|
145
|
+
muted: {
|
|
146
|
+
track: string;
|
|
147
|
+
indicator: string;
|
|
148
|
+
segment: string;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
size: {
|
|
152
|
+
sm: {
|
|
153
|
+
track: string;
|
|
154
|
+
segments: string;
|
|
155
|
+
segment: string;
|
|
156
|
+
};
|
|
157
|
+
md: {
|
|
158
|
+
track: string;
|
|
159
|
+
segments: string;
|
|
160
|
+
segment: string;
|
|
161
|
+
};
|
|
162
|
+
lg: {
|
|
163
|
+
track: string;
|
|
164
|
+
segments: string;
|
|
165
|
+
segment: string;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
}, {
|
|
169
|
+
root: string;
|
|
170
|
+
header: string;
|
|
171
|
+
track: string;
|
|
172
|
+
indicator: string;
|
|
173
|
+
segments: string;
|
|
174
|
+
segment: string;
|
|
175
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
176
|
+
type MeterVariantProps = VariantProps<typeof meterVariants>;
|
|
177
|
+
export interface MeterProps extends Omit<ViewProps, 'children'>, MeterVariantProps {
|
|
178
|
+
className?: string;
|
|
179
|
+
/** The measurement, somewhere between `minValue` and `maxValue`. */
|
|
180
|
+
value: number;
|
|
181
|
+
/**
|
|
182
|
+
* The bottom of the scale — the value at which the bar reads as empty.
|
|
183
|
+
* Defaults to `0`.
|
|
184
|
+
*/
|
|
185
|
+
minValue?: number;
|
|
186
|
+
/**
|
|
187
|
+
* The top of the scale — the value at which the bar reads as full. Defaults
|
|
188
|
+
* to `100`, so a bare percentage needs neither bound set.
|
|
189
|
+
*/
|
|
190
|
+
maxValue?: number;
|
|
191
|
+
/**
|
|
192
|
+
* What is being measured. Also the accessibility label, and a meter without
|
|
193
|
+
* one announces a number with nothing attached to it — "seventy-five
|
|
194
|
+
* percent" of what is not an answer. Pass `accessibilityLabel` instead only
|
|
195
|
+
* where the caption is drawn some other way.
|
|
196
|
+
*/
|
|
197
|
+
label?: string;
|
|
198
|
+
/** Draw the value above the track, opposite the label. */
|
|
199
|
+
showValueLabel?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Text for the value label. Overrides the formatted value — use it for a
|
|
202
|
+
* word where a number reads worse: `Strong`, `Almost full`.
|
|
203
|
+
*
|
|
204
|
+
* It is spoken whether or not it is drawn, so it can give a screen reader
|
|
205
|
+
* better words than the caption without changing the caption. Pair it with
|
|
206
|
+
* `showValueLabel` to draw it too.
|
|
207
|
+
*/
|
|
208
|
+
valueLabel?: string;
|
|
209
|
+
/**
|
|
210
|
+
* How to write the value, through `Intl.NumberFormat`. A `percent` style
|
|
211
|
+
* formats how far up the scale the value sits; every other style formats
|
|
212
|
+
* the value itself, so `{ style: 'unit', unit: 'gigabyte' }` against a
|
|
213
|
+
* `maxValue` of `256` reads `64 GB` rather than a percentage of it. Falls
|
|
214
|
+
* back to a rounded percent when omitted.
|
|
215
|
+
*/
|
|
216
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
217
|
+
/**
|
|
218
|
+
* Points on the scale where the colour changes, each `{ from, color }`. The
|
|
219
|
+
* highest one the reading has reached wins, so the order you list them in
|
|
220
|
+
* does not matter; below all of them the `color` prop applies.
|
|
221
|
+
*
|
|
222
|
+
* This is the difference between a meter and a bar: the colour is a
|
|
223
|
+
* judgement about the reading. Which direction is bad is yours to say —
|
|
224
|
+
* thresholds climbing to `destructive` suit a disk filling up, thresholds
|
|
225
|
+
* falling to it suit a battery running down.
|
|
226
|
+
*/
|
|
227
|
+
thresholds?: MeterThreshold[];
|
|
228
|
+
/**
|
|
229
|
+
* Draw the scale as this many discrete blocks instead of one continuous
|
|
230
|
+
* bar. Blocks are all or nothing, which is the point of them: four blocks
|
|
231
|
+
* say "three out of four" where a bar says "about seventy percent", and a
|
|
232
|
+
* password is not seventy percent strong.
|
|
233
|
+
*
|
|
234
|
+
* Any value above the floor lights at least one block, so a reading that
|
|
235
|
+
* is not empty never looks it.
|
|
236
|
+
*/
|
|
237
|
+
segments?: number;
|
|
238
|
+
/** Extra classes for the fill, or for a lit segment. */
|
|
239
|
+
indicatorClassName?: string;
|
|
240
|
+
/** Extra classes for the label + value row. */
|
|
241
|
+
headerClassName?: string;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* A measurement on a fixed scale: disk used, battery left, a score, a password's
|
|
245
|
+
* strength. The fill is driven on the UI thread, so a value change costs one
|
|
246
|
+
* render and nothing per frame.
|
|
247
|
+
*
|
|
248
|
+
* A meter is not a progress bar. Progress is a task moving towards an end that
|
|
249
|
+
* finishing is the point of; a meter is a reading that happens to sit where it
|
|
250
|
+
* sits, and may go back down. Reach for
|
|
251
|
+
* [Progress](/docs/components/progress) when something is completing.
|
|
252
|
+
*
|
|
253
|
+
* `thresholds` paint the bar by where the reading falls, and `segments` draws
|
|
254
|
+
* the scale as discrete blocks for readings that are counted rather than
|
|
255
|
+
* measured.
|
|
256
|
+
*
|
|
257
|
+
* The value is read against `minValue` / `maxValue`, which default to 0 and
|
|
258
|
+
* 100 — so a percentage needs neither. Set them and the meter speaks in
|
|
259
|
+
* whatever is being measured: bytes, degrees, points. Nothing has to be
|
|
260
|
+
* converted to a percent on the way in, and the screen reader is told the real
|
|
261
|
+
* scale rather than a derived one.
|
|
262
|
+
*
|
|
263
|
+
* React Native has no meter role, so this announces as a progress bar with its
|
|
264
|
+
* value, range and unit attached. That is the closest the platform offers, and
|
|
265
|
+
* it is why `label` matters: the role will not distinguish a reading from a
|
|
266
|
+
* task, and the name is what does.
|
|
267
|
+
*/
|
|
268
|
+
export declare const Meter: import("react").ForwardRefExoticComponent<MeterProps & import("react").RefAttributes<View>>;
|
|
269
|
+
export type { MeterColor, MeterThreshold };
|
|
270
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/meter/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAA0B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAS5E,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAML,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,kBAAe,CAAC;AAQvB,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAoCjB,CAAC;AAEH,KAAK,iBAAiB,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;AAE5D,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,EACjC,iBAAiB;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC;IACzC;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAC9B;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,+CAA+C;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AA2BD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,KAAK,6FA8HjB,CAAC;AAIF,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a reading sits on a meter's scale, and what colour it has earned.
|
|
3
|
+
*
|
|
4
|
+
* Kept apart from the component because it is the part that can be wrong
|
|
5
|
+
* without looking wrong: a threshold picked in the wrong order, or a segment
|
|
6
|
+
* count that rounds a real reading down to nothing, is a meter that lies
|
|
7
|
+
* quietly. None of it touches React, so it can be tested on its own.
|
|
8
|
+
*/
|
|
9
|
+
/** The token a meter can be painted with. */
|
|
10
|
+
export type MeterColor = 'primary' | 'success' | 'warning' | 'destructive' | 'info' | 'muted';
|
|
11
|
+
/**
|
|
12
|
+
* A point on the scale, and the colour the meter takes from there upwards.
|
|
13
|
+
*
|
|
14
|
+
* `from` is in the same units as `value` — not a percentage of the range — so
|
|
15
|
+
* a threshold on a 0–8 GB meter is written in gigabytes.
|
|
16
|
+
*/
|
|
17
|
+
export interface MeterThreshold {
|
|
18
|
+
/** The value at which this colour takes over. */
|
|
19
|
+
from: number;
|
|
20
|
+
/** What the bar is painted with at or above `from`. */
|
|
21
|
+
color: MeterColor;
|
|
22
|
+
}
|
|
23
|
+
/** `value` held inside the scale, so a stray number cannot escape the track. */
|
|
24
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
25
|
+
/**
|
|
26
|
+
* How far up the scale the value sits, 0–1. An empty or inverted range has no
|
|
27
|
+
* meaningful position in it, so it reads as empty rather than dividing by zero.
|
|
28
|
+
*/
|
|
29
|
+
export declare function fractionOf(value: number, min: number, max: number): number;
|
|
30
|
+
/**
|
|
31
|
+
* The colour the reading has earned: the highest threshold at or below the
|
|
32
|
+
* value, or the base colour when it has reached none of them.
|
|
33
|
+
*
|
|
34
|
+
* Highest-wins rather than first-wins, so the caller can list thresholds in
|
|
35
|
+
* any order and get the same answer. A rule that depended on the order would
|
|
36
|
+
* make a reordered array a silent behaviour change.
|
|
37
|
+
*/
|
|
38
|
+
export declare function colorFor(value: number, base: MeterColor | undefined, thresholds: MeterThreshold[] | undefined): MeterColor | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* How many blocks of a segmented meter are lit.
|
|
41
|
+
*
|
|
42
|
+
* Rounded up, so any reading above the floor lights at least one. Rounding
|
|
43
|
+
* down would leave the whole first block of a four-block meter dark, and "a
|
|
44
|
+
* little" looking like "none" is the reading a meter can least afford to get
|
|
45
|
+
* wrong.
|
|
46
|
+
*/
|
|
47
|
+
export declare function litSegments(fraction: number, segments: number): number;
|
|
48
|
+
/**
|
|
49
|
+
* The value caption: an explicit override, an `Intl` rendering, or a rounded
|
|
50
|
+
* percent.
|
|
51
|
+
*
|
|
52
|
+
* A `percent` style is given the fraction, because that is what a percentage
|
|
53
|
+
* of the scale means; every other style is given the value, because a byte
|
|
54
|
+
* count or a score is a quantity and not a proportion.
|
|
55
|
+
*/
|
|
56
|
+
export declare function formatValue(value: number, fraction: number, valueLabel?: string, formatOptions?: Intl.NumberFormatOptions): string;
|
|
57
|
+
//# sourceMappingURL=meter-scale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meter-scale.d.ts","sourceRoot":"","sources":["../../../../../src/components/meter/meter-scale.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,6CAA6C;AAC7C,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,SAAS,GACT,SAAS,GACT,aAAa,GACb,MAAM,GACN,OAAO,CAAC;AAEZ;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,KAAK,EAAE,UAAU,CAAC;CACnB;AAED,gFAAgF;AAChF,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAI5D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAIjE;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,UAAU,GAAG,SAAS,EAC5B,UAAU,EAAE,cAAc,EAAE,GAAG,SAAS,0BASzC;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAG7D;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,aAAa,CAAC,EAAE,IAAI,CAAC,mBAAmB,UAazC"}
|