panelui-native 0.25.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -1
- package/lib/module/components/accordion/index.js +8 -8
- package/lib/module/components/accordion/index.js.map +1 -1
- package/lib/module/components/alert/index.js +2 -2
- package/lib/module/components/alert/index.js.map +1 -1
- package/lib/module/components/area-chart/index.js +182 -50
- package/lib/module/components/area-chart/index.js.map +1 -1
- package/lib/module/components/attachment/index.js +2 -1
- package/lib/module/components/attachment/index.js.map +1 -1
- package/lib/module/components/avatar/index.js +3 -3
- package/lib/module/components/avatar/index.js.map +1 -1
- package/lib/module/components/badge/index.js +4 -4
- package/lib/module/components/badge/index.js.map +1 -1
- package/lib/module/components/bar-chart/index.js +197 -56
- package/lib/module/components/bar-chart/index.js.map +1 -1
- package/lib/module/components/bottom-sheet/index.js +15 -10
- package/lib/module/components/bottom-sheet/index.js.map +1 -1
- package/lib/module/components/breadcrumb/index.js +6 -6
- package/lib/module/components/breadcrumb/index.js.map +1 -1
- package/lib/module/components/button/index.js +11 -6
- package/lib/module/components/button/index.js.map +1 -1
- package/lib/module/components/calendar/index.js +792 -0
- package/lib/module/components/calendar/index.js.map +1 -0
- package/lib/module/components/carousel/index.js +680 -0
- package/lib/module/components/carousel/index.js.map +1 -0
- package/lib/module/components/chip/index.js +4 -4
- package/lib/module/components/chip/index.js.map +1 -1
- package/lib/module/components/code-block/highlight.js +363 -0
- package/lib/module/components/code-block/highlight.js.map +1 -0
- package/lib/module/components/code-block/index.js +313 -0
- package/lib/module/components/code-block/index.js.map +1 -0
- package/lib/module/components/date-picker/index.js +165 -0
- package/lib/module/components/date-picker/index.js.map +1 -0
- package/lib/module/components/dialog/index.js +7 -2
- package/lib/module/components/dialog/index.js.map +1 -1
- package/lib/module/components/direction/index.js +2 -1
- package/lib/module/components/direction/index.js.map +1 -1
- package/lib/module/components/empty-state/index.js +2 -2
- package/lib/module/components/empty-state/index.js.map +1 -1
- package/lib/module/components/field/index.js +5 -5
- package/lib/module/components/field/index.js.map +1 -1
- package/lib/module/components/flow/index.js +3 -3
- package/lib/module/components/flow/index.js.map +1 -1
- package/lib/module/components/frame/index.js +5 -5
- package/lib/module/components/frame/index.js.map +1 -1
- package/lib/module/components/input-group/index.js +3 -2
- package/lib/module/components/input-group/index.js.map +1 -1
- package/lib/module/components/item/index.js +9 -9
- package/lib/module/components/item/index.js.map +1 -1
- package/lib/module/components/label/index.js +4 -4
- package/lib/module/components/label/index.js.map +1 -1
- package/lib/module/components/line-chart/index.js +167 -44
- package/lib/module/components/line-chart/index.js.map +1 -1
- package/lib/module/components/map/index.js +7 -7
- package/lib/module/components/map/index.js.map +1 -1
- package/lib/module/components/marker/index.js +3 -3
- package/lib/module/components/marker/index.js.map +1 -1
- package/lib/module/components/menu/index.js +714 -0
- package/lib/module/components/menu/index.js.map +1 -0
- package/lib/module/components/message/index.js +7 -7
- package/lib/module/components/message/index.js.map +1 -1
- package/lib/module/components/message-scroller/index.js +5 -4
- package/lib/module/components/message-scroller/index.js.map +1 -1
- package/lib/module/components/plan/index.js +296 -0
- package/lib/module/components/plan/index.js.map +1 -0
- package/lib/module/components/popover/index.js +73 -10
- package/lib/module/components/popover/index.js.map +1 -1
- package/lib/module/components/radio-group/index.js +15 -10
- package/lib/module/components/radio-group/index.js.map +1 -1
- package/lib/module/components/reasoning/index.js +244 -0
- package/lib/module/components/reasoning/index.js.map +1 -0
- package/lib/module/components/section-rail/index.js +4 -4
- package/lib/module/components/section-rail/index.js.map +1 -1
- package/lib/module/components/select/index.js +10 -4
- package/lib/module/components/select/index.js.map +1 -1
- package/lib/module/components/sources/index.js +221 -0
- package/lib/module/components/sources/index.js.map +1 -0
- package/lib/module/components/steps/index.js +4 -4
- package/lib/module/components/steps/index.js.map +1 -1
- package/lib/module/components/tabs/index.js +7 -7
- package/lib/module/components/tabs/index.js.map +1 -1
- package/lib/module/components/task/index.js +300 -0
- package/lib/module/components/task/index.js.map +1 -0
- package/lib/module/components/textarea/index.js +295 -0
- package/lib/module/components/textarea/index.js.map +1 -0
- package/lib/module/components/timeline/index.js +4 -4
- package/lib/module/components/timeline/index.js.map +1 -1
- package/lib/module/components/toast/index.js +2 -2
- package/lib/module/components/toast/index.js.map +1 -1
- package/lib/module/components/toggle-button/index.js +5 -5
- package/lib/module/components/toggle-button/index.js.map +1 -1
- package/lib/module/components/tooltip/index.js +648 -0
- package/lib/module/components/tooltip/index.js.map +1 -0
- package/lib/module/components/typography/index.js +2 -2
- package/lib/module/components/typography/index.js.map +1 -1
- package/lib/module/hooks/index.js +1 -0
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/use-back-handler.js +37 -0
- package/lib/module/hooks/use-back-handler.js.map +1 -0
- package/lib/module/icons/index.js +202 -0
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +13 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/primitives/collapse.js +112 -0
- package/lib/module/primitives/collapse.js.map +1 -0
- package/lib/module/primitives/keyboard-avoider.js +2 -1
- package/lib/module/primitives/keyboard-avoider.js.map +1 -1
- package/lib/module/primitives/text.js +25 -1
- package/lib/module/primitives/text.js.map +1 -1
- package/lib/module/utils/date.js +386 -0
- package/lib/module/utils/date.js.map +1 -0
- package/lib/typescript/src/components/accordion/index.d.ts.map +1 -1
- package/lib/typescript/src/components/alert/index.d.ts.map +1 -1
- package/lib/typescript/src/components/area-chart/index.d.ts +41 -1
- package/lib/typescript/src/components/area-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/attachment/index.d.ts.map +1 -1
- package/lib/typescript/src/components/bar-chart/index.d.ts +44 -2
- package/lib/typescript/src/components/bar-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/src/components/breadcrumb/index.d.ts.map +1 -1
- package/lib/typescript/src/components/button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/calendar/index.d.ts +173 -0
- package/lib/typescript/src/components/calendar/index.d.ts.map +1 -0
- package/lib/typescript/src/components/carousel/index.d.ts +179 -0
- package/lib/typescript/src/components/carousel/index.d.ts.map +1 -0
- package/lib/typescript/src/components/chip/index.d.ts.map +1 -1
- package/lib/typescript/src/components/code-block/highlight.d.ts +39 -0
- package/lib/typescript/src/components/code-block/highlight.d.ts.map +1 -0
- package/lib/typescript/src/components/code-block/index.d.ts +113 -0
- package/lib/typescript/src/components/code-block/index.d.ts.map +1 -0
- package/lib/typescript/src/components/date-picker/index.d.ts +97 -0
- package/lib/typescript/src/components/date-picker/index.d.ts.map +1 -0
- package/lib/typescript/src/components/dialog/index.d.ts.map +1 -1
- package/lib/typescript/src/components/direction/index.d.ts.map +1 -1
- package/lib/typescript/src/components/empty-state/index.d.ts.map +1 -1
- package/lib/typescript/src/components/field/index.d.ts.map +1 -1
- package/lib/typescript/src/components/frame/index.d.ts.map +1 -1
- package/lib/typescript/src/components/input-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/item/index.d.ts.map +1 -1
- package/lib/typescript/src/components/label/index.d.ts.map +1 -1
- package/lib/typescript/src/components/line-chart/index.d.ts +41 -2
- package/lib/typescript/src/components/line-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/map/index.d.ts.map +1 -1
- package/lib/typescript/src/components/marker/index.d.ts.map +1 -1
- package/lib/typescript/src/components/menu/index.d.ts +261 -0
- package/lib/typescript/src/components/menu/index.d.ts.map +1 -0
- package/lib/typescript/src/components/message/index.d.ts.map +1 -1
- package/lib/typescript/src/components/message-scroller/index.d.ts.map +1 -1
- package/lib/typescript/src/components/plan/index.d.ts +127 -0
- package/lib/typescript/src/components/plan/index.d.ts.map +1 -0
- package/lib/typescript/src/components/popover/index.d.ts +35 -1
- package/lib/typescript/src/components/popover/index.d.ts.map +1 -1
- package/lib/typescript/src/components/radio-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/reasoning/index.d.ts +97 -0
- package/lib/typescript/src/components/reasoning/index.d.ts.map +1 -0
- package/lib/typescript/src/components/select/index.d.ts.map +1 -1
- package/lib/typescript/src/components/sources/index.d.ts +85 -0
- package/lib/typescript/src/components/sources/index.d.ts.map +1 -0
- package/lib/typescript/src/components/steps/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tabs/index.d.ts.map +1 -1
- package/lib/typescript/src/components/task/index.d.ts +103 -0
- package/lib/typescript/src/components/task/index.d.ts.map +1 -0
- package/lib/typescript/src/components/textarea/index.d.ts +175 -0
- package/lib/typescript/src/components/textarea/index.d.ts.map +1 -0
- package/lib/typescript/src/components/timeline/index.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/index.d.ts.map +1 -1
- package/lib/typescript/src/components/toggle-button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tooltip/index.d.ts +180 -0
- package/lib/typescript/src/components/tooltip/index.d.ts.map +1 -0
- package/lib/typescript/src/components/typography/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/index.d.ts +1 -0
- package/lib/typescript/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/use-back-handler.d.ts +19 -0
- package/lib/typescript/src/hooks/use-back-handler.d.ts.map +1 -0
- package/lib/typescript/src/icons/index.d.ts +17 -0
- package/lib/typescript/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +16 -4
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/primitives/collapse.d.ts +42 -0
- package/lib/typescript/src/primitives/collapse.d.ts.map +1 -0
- package/lib/typescript/src/primitives/keyboard-avoider.d.ts.map +1 -1
- package/lib/typescript/src/primitives/text.d.ts +20 -0
- package/lib/typescript/src/primitives/text.d.ts.map +1 -1
- package/lib/typescript/src/utils/date.d.ts +116 -0
- package/lib/typescript/src/utils/date.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/accordion/index.tsx +8 -12
- package/src/components/alert/index.tsx +2 -2
- package/src/components/area-chart/index.tsx +208 -55
- package/src/components/attachment/index.tsx +2 -2
- package/src/components/avatar/index.tsx +3 -3
- package/src/components/badge/index.tsx +6 -6
- package/src/components/bar-chart/index.tsx +214 -54
- package/src/components/bottom-sheet/index.tsx +17 -16
- package/src/components/breadcrumb/index.tsx +6 -8
- package/src/components/button/index.tsx +12 -8
- package/src/components/calendar/index.tsx +970 -0
- package/src/components/carousel/index.tsx +788 -0
- package/src/components/chip/index.tsx +4 -6
- package/src/components/code-block/highlight.ts +278 -0
- package/src/components/code-block/index.tsx +341 -0
- package/src/components/date-picker/index.tsx +255 -0
- package/src/components/dialog/index.tsx +7 -2
- package/src/components/direction/index.tsx +2 -1
- package/src/components/empty-state/index.tsx +2 -2
- package/src/components/field/index.tsx +3 -5
- package/src/components/flow/index.tsx +3 -3
- package/src/components/frame/index.tsx +5 -7
- package/src/components/input-group/index.tsx +3 -2
- package/src/components/item/index.tsx +9 -9
- package/src/components/label/index.tsx +2 -2
- package/src/components/line-chart/index.tsx +189 -50
- package/src/components/map/index.tsx +7 -9
- package/src/components/marker/index.tsx +3 -3
- package/src/components/menu/index.tsx +812 -0
- package/src/components/message/index.tsx +7 -7
- package/src/components/message-scroller/index.tsx +5 -4
- package/src/components/plan/index.tsx +325 -0
- package/src/components/popover/index.tsx +111 -8
- package/src/components/radio-group/index.tsx +13 -4
- package/src/components/reasoning/index.tsx +297 -0
- package/src/components/section-rail/index.tsx +4 -4
- package/src/components/select/index.tsx +10 -4
- package/src/components/sources/index.tsx +278 -0
- package/src/components/steps/index.tsx +4 -4
- package/src/components/tabs/index.tsx +7 -9
- package/src/components/task/index.tsx +329 -0
- package/src/components/textarea/index.tsx +381 -0
- package/src/components/timeline/index.tsx +4 -4
- package/src/components/toast/index.tsx +2 -2
- package/src/components/toggle-button/index.tsx +5 -7
- package/src/components/tooltip/index.tsx +793 -0
- package/src/components/typography/index.tsx +2 -2
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-back-handler.ts +37 -0
- package/src/icons/index.tsx +147 -0
- package/src/index.ts +116 -0
- package/src/primitives/collapse.tsx +128 -0
- package/src/primitives/keyboard-avoider.tsx +2 -1
- package/src/primitives/text.tsx +28 -1
- package/src/utils/date.ts +446 -0
- package/theme.css +112 -0
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
import { type ReactNode } from 'react';
|
|
33
33
|
import { type ViewProps } from 'react-native';
|
|
34
34
|
import { type ChartCurve, type SeriesColorIndex } from '../../utils/chart.js';
|
|
35
|
-
type Layer = 'svg' | 'overlay';
|
|
35
|
+
type Layer = 'svg' | 'overlay' | 'header';
|
|
36
36
|
export type AreaChartStatus = 'loading' | 'ready';
|
|
37
37
|
export type AreaChartDatum = Record<string, string | number | null | undefined>;
|
|
38
38
|
/**
|
|
@@ -185,7 +185,47 @@ declare namespace AreaChartLegend {
|
|
|
185
185
|
var displayName: string;
|
|
186
186
|
var layer: Layer;
|
|
187
187
|
}
|
|
188
|
+
export interface AreaChartHeaderProps extends ViewProps {
|
|
189
|
+
className?: string;
|
|
190
|
+
/** Small line above the value — what the chart is of. */
|
|
191
|
+
title?: string;
|
|
192
|
+
/** The readout. The largest thing on the card, and the first thing read. */
|
|
193
|
+
value?: string;
|
|
194
|
+
/** One muted line under the value — a period, a comparison, a total. */
|
|
195
|
+
caption?: string;
|
|
196
|
+
/** Prettier names for the series keys, as the legend takes. */
|
|
197
|
+
labels?: Record<string, string>;
|
|
198
|
+
/**
|
|
199
|
+
* Draw a swatch and a name per series along the trailing edge, in the order
|
|
200
|
+
* the bands appear on a stack. Prefer this to `AreaChart.Legend` on a chart
|
|
201
|
+
* that has a header: the legend floats over the plot, where a tall band and a
|
|
202
|
+
* key end up in the same corner.
|
|
203
|
+
*/
|
|
204
|
+
legend?: boolean;
|
|
205
|
+
/** Trailing slot — a control, a badge, a range picker. Wins over `legend`. */
|
|
206
|
+
children?: ReactNode;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* The strip above the plot: what the chart is of, what it currently reads, and
|
|
210
|
+
* what the colours mean.
|
|
211
|
+
*
|
|
212
|
+
* It belongs to the chart rather than to the card around it because it is about
|
|
213
|
+
* the *plot* — the number changes as a finger moves along the bands, and the
|
|
214
|
+
* legend is the series list the chart itself is holding. The card's header is a
|
|
215
|
+
* caption on the tray the chart sits in; this is the chart introducing itself.
|
|
216
|
+
*
|
|
217
|
+
* The value is not derived here. A readout that follows the finger belongs to
|
|
218
|
+
* whoever owns the data — take it from `onActiveIndexChange` and pass the
|
|
219
|
+
* formatted string down, so one header can show a total when nothing is pressed
|
|
220
|
+
* and a point's value when something is.
|
|
221
|
+
*/
|
|
222
|
+
declare function AreaChartHeader({ className, title, value, caption, labels, legend, children, ...props }: AreaChartHeaderProps): import("react").JSX.Element;
|
|
223
|
+
declare namespace AreaChartHeader {
|
|
224
|
+
var displayName: string;
|
|
225
|
+
var layer: Layer;
|
|
226
|
+
}
|
|
188
227
|
export declare const AreaChart: import("react").ForwardRefExoticComponent<AreaChartProps & import("react").RefAttributes<AreaChartHandle>> & {
|
|
228
|
+
Header: typeof AreaChartHeader;
|
|
189
229
|
Grid: typeof AreaChartGrid;
|
|
190
230
|
Area: typeof AreaChartArea;
|
|
191
231
|
XAxis: typeof AreaChartXAxis;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/area-chart/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAYL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAA4C,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAyBxF,OAAO,EAQL,KAAK,UAAU,EAEf,KAAK,gBAAgB,EACtB,MAAM,sBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/area-chart/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAYL,KAAK,SAAS,EACf,MAAM,OAAO,CA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;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC;;;;;OAKG;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,+BAyCtB;kBAlDQ,eAAe;;;;AAsDxB,eAAO,MAAM,SAAS;;;;;;;;CAQpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/attachment/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAyC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,wCAAqC,CAAC;AACrG,OAAO,EAAQ,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/attachment/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAyC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,wCAAqC,CAAC;AACrG,OAAO,EAAQ,KAAK,SAAS,EAAgB,MAAM,0BAAuB,CAAC;AAK3E,MAAM,MAAM,e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QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAqBD,MAAM,WAAW,sBAAuB,SAAQ,SAAS;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAWD,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,UAAU,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAyBD,eAAO,MAAM,UAAU;;;;;;;;CAQrB,CAAC"}
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
import { type ReactNode } from 'react';
|
|
39
39
|
import { type ViewProps } from 'react-native';
|
|
40
40
|
import { type SeriesColorIndex } from '../../utils/chart.js';
|
|
41
|
-
type Layer = 'svg' | 'overlay';
|
|
41
|
+
type Layer = 'svg' | 'overlay' | 'header';
|
|
42
42
|
export type BarChartStatus = 'loading' | 'ready';
|
|
43
43
|
export type BarChartOrientation = 'vertical' | 'horizontal';
|
|
44
44
|
export type BarChartDatum = Record<string, string | number | null | undefined>;
|
|
@@ -151,7 +151,10 @@ declare namespace BarChartBar {
|
|
|
151
151
|
var layer: Layer;
|
|
152
152
|
}
|
|
153
153
|
export interface BarChartXAxisProps {
|
|
154
|
-
/**
|
|
154
|
+
/**
|
|
155
|
+
* How many labels to show. Every category by default, thinned only when the
|
|
156
|
+
* bands get too narrow to read — pass a number to force it lower.
|
|
157
|
+
*/
|
|
155
158
|
ticks?: number;
|
|
156
159
|
/** Turn a row into its label. Defaults to the value at `xDataKey`. */
|
|
157
160
|
format?: (datum: BarChartDatum, index: number) => string;
|
|
@@ -216,7 +219,46 @@ declare namespace BarChartLegend {
|
|
|
216
219
|
var displayName: string;
|
|
217
220
|
var layer: Layer;
|
|
218
221
|
}
|
|
222
|
+
export interface BarChartHeaderProps extends ViewProps {
|
|
223
|
+
className?: string;
|
|
224
|
+
/** Small line above the value — what the chart is of. */
|
|
225
|
+
title?: string;
|
|
226
|
+
/** The readout. The largest thing on the card, and the first thing read. */
|
|
227
|
+
value?: string;
|
|
228
|
+
/** One muted line under the value — a period, a comparison, a total. */
|
|
229
|
+
caption?: string;
|
|
230
|
+
/** Prettier names for the series keys, as the legend takes. */
|
|
231
|
+
labels?: Record<string, string>;
|
|
232
|
+
/**
|
|
233
|
+
* Draw a swatch and a name per series along the trailing edge. Prefer this to
|
|
234
|
+
* `BarChart.Legend` on a chart that has a header: the legend floats over the
|
|
235
|
+
* plot, where it competes with the bars for the same corner.
|
|
236
|
+
*/
|
|
237
|
+
legend?: boolean;
|
|
238
|
+
/** Trailing slot — a control, a badge, a range picker. Wins over `legend`. */
|
|
239
|
+
children?: ReactNode;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* The strip above the plot: what the chart is of, what it currently reads, and
|
|
243
|
+
* what the colours mean.
|
|
244
|
+
*
|
|
245
|
+
* It belongs to the chart rather than to the card around it because it is about
|
|
246
|
+
* the *plot* — the number changes as a finger moves along the bars, and the
|
|
247
|
+
* legend is the series list the chart itself is holding. The card's header is a
|
|
248
|
+
* caption on the tray the chart sits in; this is the chart introducing itself.
|
|
249
|
+
*
|
|
250
|
+
* The value is not derived here. A readout that follows the finger belongs to
|
|
251
|
+
* whoever owns the data — take it from `onActiveIndexChange` and pass the
|
|
252
|
+
* formatted string down, so one header can show a total when nothing is pressed
|
|
253
|
+
* and a band's value when something is.
|
|
254
|
+
*/
|
|
255
|
+
declare function BarChartHeader({ className, title, value, caption, labels, legend, children, ...props }: BarChartHeaderProps): import("react").JSX.Element;
|
|
256
|
+
declare namespace BarChartHeader {
|
|
257
|
+
var displayName: string;
|
|
258
|
+
var layer: Layer;
|
|
259
|
+
}
|
|
219
260
|
export declare const BarChart: import("react").ForwardRefExoticComponent<BarChartProps & import("react").RefAttributes<BarChartHandle>> & {
|
|
261
|
+
Header: typeof BarChartHeader;
|
|
220
262
|
Grid: typeof BarChartGrid;
|
|
221
263
|
Bar: typeof BarChartBar;
|
|
222
264
|
XAxis: typeof BarChartXAxis;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/bar-chart/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAWL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAA4C,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAexF,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/bar-chart/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAWL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAA4C,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAexF,OAAO,EAOL,KAAK,gBAAgB,EACtB,MAAM,sBAAmB,CAAC;AA4B3B,KAAK,KAAK,GAAG,KAAK,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE1C,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC;AACjD,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,YAAY,CAAC;AAC5D,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAuC/E;;;;GAIG;AACH,wBAAgB,WAAW;;;;EAO1B;AAED,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;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-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/bottom-sheet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpF,OAAO,QAYN,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/bottom-sheet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpF,OAAO,QAYN,MAAM,yBAAyB,CAAC;AAgDjC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;CAC9E;AA8DD,iBAAS,eAAe,CAAC,EACvB,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,WAAmB,EACnB,MAAM,EACN,UAAU,GACX,EAAE,gBAAgB,+BA+BlB;AAED,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,YAAY,CAAC;QAAE,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;KAAE,CAAC,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AQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;GASG;AACH,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,oBAAoB,+BA2CtB;kBAhDQ,eAAe;;;AAmDxB,MAAM,WAAW,sBAAuB,SAAQ,SAAS;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;GAIG;AACH,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,sBAAsB,+BASxB;kBAbQ,iBAAiB;;;AAgB1B,eAAO,MAAM,WAAW;;;;;;CAMtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/breadcrumb/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpD,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,wCAAqC,CAAC;AAC7C,OAAO,EAAQ,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/breadcrumb/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpD,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,wCAAqC,CAAC;AAC7C,OAAO,EAAQ,KAAK,SAAS,EAAgB,MAAM,0BAAuB,CAAC;AAG3E,K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AAM,8FAiGlB,CAAC"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { type ViewProps } from 'react-native';
|
|
2
|
+
import { type CalendarSystem, type DateLocale } from '../../utils/date.js';
|
|
3
|
+
export type CalendarMode = 'single' | 'multiple' | 'range';
|
|
4
|
+
export type CalendarCaptionLayout = 'label' | 'dropdown';
|
|
5
|
+
/** A range under construction: `to` is undefined between the two taps. */
|
|
6
|
+
export interface DateRange {
|
|
7
|
+
from: Date;
|
|
8
|
+
to?: Date;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* What a `mode` selects. Written as a map so the root, the parts and the
|
|
12
|
+
* caller all read the same association rather than each casting their own way.
|
|
13
|
+
*/
|
|
14
|
+
export interface CalendarSelection {
|
|
15
|
+
single: Date | undefined;
|
|
16
|
+
multiple: Date[];
|
|
17
|
+
range: DateRange | undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Which days cannot be picked. A list, a span, or a rule — a rule because
|
|
21
|
+
* "no weekends" and "not in the past" are the two most common cases and
|
|
22
|
+
* neither can be written as a list that stays right tomorrow.
|
|
23
|
+
*/
|
|
24
|
+
export type CalendarDisabled = Date[] | {
|
|
25
|
+
from: Date;
|
|
26
|
+
to: Date;
|
|
27
|
+
} | ((date: Date) => boolean);
|
|
28
|
+
export interface CalendarProps<Mode extends CalendarMode = 'single'> extends Omit<ViewProps, 'children'> {
|
|
29
|
+
className?: string;
|
|
30
|
+
/** One day, several, or a span with two ends. */
|
|
31
|
+
mode?: Mode;
|
|
32
|
+
/** Controlled selection. Its shape follows `mode`. */
|
|
33
|
+
selected?: CalendarSelection[Mode];
|
|
34
|
+
/** Starting selection when uncontrolled. */
|
|
35
|
+
defaultSelected?: CalendarSelection[Mode];
|
|
36
|
+
onSelect?: (selected: CalendarSelection[Mode]) => void;
|
|
37
|
+
/** Controlled visible month. Any day inside it will do. */
|
|
38
|
+
month?: Date;
|
|
39
|
+
/** Month shown first when uncontrolled. Defaults to the selection, or today. */
|
|
40
|
+
defaultMonth?: Date;
|
|
41
|
+
onMonthChange?: (month: Date) => void;
|
|
42
|
+
/** Months side by side. Two is what picking a range across a boundary wants. */
|
|
43
|
+
numberOfMonths?: number;
|
|
44
|
+
/**
|
|
45
|
+
* `dropdown` turns the caption into month and year pickers, which is the
|
|
46
|
+
* difference between choosing a birthday in four taps and in four hundred.
|
|
47
|
+
*/
|
|
48
|
+
captionLayout?: CalendarCaptionLayout;
|
|
49
|
+
/** Days that cannot be picked: a list, a span, or a rule. */
|
|
50
|
+
disabled?: CalendarDisabled;
|
|
51
|
+
/** Earliest selectable day. Also stops the caption paging back past it. */
|
|
52
|
+
minDate?: Date;
|
|
53
|
+
/** Latest selectable day. */
|
|
54
|
+
maxDate?: Date;
|
|
55
|
+
/**
|
|
56
|
+
* Earliest month the caption's pickers offer. Defaults to `minDate`, and to
|
|
57
|
+
* a hundred years back when there is none.
|
|
58
|
+
*
|
|
59
|
+
* Separate from `minDate` because they answer different questions: `minDate`
|
|
60
|
+
* is about which days can be picked, this is about how far the month and year
|
|
61
|
+
* lists reach. A birthday picker wants a century of years on offer and no
|
|
62
|
+
* bound at all on the days inside them.
|
|
63
|
+
*/
|
|
64
|
+
startMonth?: Date;
|
|
65
|
+
/** Latest month the caption's pickers offer. Defaults to `maxDate`, else ten years on. */
|
|
66
|
+
endMonth?: Date;
|
|
67
|
+
/** `0` is Sunday. */
|
|
68
|
+
weekStartsOn?: number;
|
|
69
|
+
/** Draw the neighbouring months' days rather than leaving the cells blank. */
|
|
70
|
+
showOutsideDays?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Let a tap on a neighbouring month's day select it. Off by default: those
|
|
73
|
+
* cells exist to keep the grid six rows tall, and a tap on one is far more
|
|
74
|
+
* often a misfire than an attempt to reach into July from June. Paging to the
|
|
75
|
+
* month is the way to pick a day in it.
|
|
76
|
+
*/
|
|
77
|
+
selectOutsideDays?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Draw the calendar's own panel — a rounded, bordered card. On by default,
|
|
80
|
+
* for a calendar standing on a page. Turn it off when it is already inside
|
|
81
|
+
* something that draws one, which is what `DatePicker` does.
|
|
82
|
+
*/
|
|
83
|
+
bordered?: boolean;
|
|
84
|
+
/** BCP 47 tag for the month and weekday names. The device's own by default. */
|
|
85
|
+
locale?: DateLocale;
|
|
86
|
+
/**
|
|
87
|
+
* Which calendar the months and the day numbers are counted in.
|
|
88
|
+
*
|
|
89
|
+
* `gregory` by default rather than `auto`: a grid whose month boundaries move
|
|
90
|
+
* with the device's language is a surprise, and it is the caller — not the
|
|
91
|
+
* locale — who knows whether the dates being picked are Hijri ones. `auto`
|
|
92
|
+
* follows the locale for the cases where they are the same question.
|
|
93
|
+
*/
|
|
94
|
+
calendar?: CalendarSystem;
|
|
95
|
+
}
|
|
96
|
+
declare function CalendarRoot<Mode extends CalendarMode = 'single'>({ className, mode, selected, defaultSelected, onSelect, month: monthProp, defaultMonth, onMonthChange, numberOfMonths, captionLayout, disabled, minDate, maxDate, startMonth, endMonth, weekStartsOn, showOutsideDays, selectOutsideDays, bordered, locale, calendar, ...props }: CalendarProps<Mode>): import("react").JSX.Element;
|
|
97
|
+
declare namespace CalendarRoot {
|
|
98
|
+
var displayName: string;
|
|
99
|
+
}
|
|
100
|
+
export interface CalendarHeaderProps {
|
|
101
|
+
/** Which month of the run this header sits over. `0` is the first. */
|
|
102
|
+
offset?: number;
|
|
103
|
+
/** The last offset in the run, so the header knows whether it owns the arrow. */
|
|
104
|
+
lastOffset?: number;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The row over a month: an arrow at each edge and the month's name between
|
|
108
|
+
* them.
|
|
109
|
+
*
|
|
110
|
+
* The arrows are pinned to the edges of the calendar rather than packed around
|
|
111
|
+
* the label, so the two targets are as far apart as the panel allows and the
|
|
112
|
+
* name sits centred over its own grid. With several months shown they are split
|
|
113
|
+
* across the run — back on the first, forward on the last — because both sets
|
|
114
|
+
* on both headers would page the whole run and give two ways to do one thing.
|
|
115
|
+
* The month that owns neither still lays out a spacer, or its name would slide
|
|
116
|
+
* off centre.
|
|
117
|
+
*/
|
|
118
|
+
declare function CalendarHeader({ offset, lastOffset }: CalendarHeaderProps): import("react").JSX.Element;
|
|
119
|
+
export interface CalendarNavProps {
|
|
120
|
+
direction: 'previous' | 'next';
|
|
121
|
+
disabled?: boolean;
|
|
122
|
+
onPress?: () => void;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* One paging arrow.
|
|
126
|
+
*
|
|
127
|
+
* Borderless: two bordered squares at the ends of a bordered panel read as a
|
|
128
|
+
* row of boxes rather than as controls, and the chevron is legible enough on
|
|
129
|
+
* its own. The target is still 32px with another 8 of slop around it.
|
|
130
|
+
*/
|
|
131
|
+
declare function CalendarNav({ direction, disabled, onPress }: CalendarNavProps): import("react").JSX.Element;
|
|
132
|
+
interface GridProps {
|
|
133
|
+
month: Date;
|
|
134
|
+
mode: CalendarMode;
|
|
135
|
+
value: unknown;
|
|
136
|
+
onSelect: (date: Date) => void;
|
|
137
|
+
disabled?: CalendarDisabled;
|
|
138
|
+
minDate?: Date;
|
|
139
|
+
maxDate?: Date;
|
|
140
|
+
weekStartsOn: number;
|
|
141
|
+
showOutsideDays: boolean;
|
|
142
|
+
selectOutsideDays?: boolean;
|
|
143
|
+
locale: DateLocale;
|
|
144
|
+
system: 'gregory' | 'islamic';
|
|
145
|
+
}
|
|
146
|
+
declare function CalendarGrid({ month, mode, value, onSelect, disabled, minDate, maxDate, weekStartsOn, showOutsideDays, selectOutsideDays, locale, system, }: GridProps): import("react").JSX.Element;
|
|
147
|
+
interface DayProps {
|
|
148
|
+
date: Date;
|
|
149
|
+
outside: boolean;
|
|
150
|
+
selected: boolean;
|
|
151
|
+
/** Anywhere inside the range, ends included. */
|
|
152
|
+
inRange: boolean;
|
|
153
|
+
rangeStart?: boolean;
|
|
154
|
+
rangeEnd?: boolean;
|
|
155
|
+
today: boolean;
|
|
156
|
+
disabled: boolean;
|
|
157
|
+
/** The band carries on past this cell's leading edge. */
|
|
158
|
+
openStart: boolean;
|
|
159
|
+
/** The band carries on past this cell's trailing edge. */
|
|
160
|
+
openEnd: boolean;
|
|
161
|
+
locale: DateLocale;
|
|
162
|
+
system: 'gregory' | 'islamic';
|
|
163
|
+
onPress: () => void;
|
|
164
|
+
}
|
|
165
|
+
declare function CalendarDay({ date, outside, selected, inRange, rangeStart, rangeEnd, today, disabled, openStart, openEnd, locale, system, onPress, }: DayProps): import("react").JSX.Element;
|
|
166
|
+
export declare const Calendar: typeof CalendarRoot & {
|
|
167
|
+
Header: typeof CalendarHeader;
|
|
168
|
+
Nav: typeof CalendarNav;
|
|
169
|
+
Grid: typeof CalendarGrid;
|
|
170
|
+
Day: typeof CalendarDay;
|
|
171
|
+
};
|
|
172
|
+
export {};
|
|
173
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/calendar/index.tsx"],"names":[],"mappings":"AA6CA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAY3E,OAAO,EAiBL,KAAK,cAAc,EACnB,KAAK,UAAU,EAChB,MAAM,qBAAkB,CAAC;AAE1B,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;AAC3D,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,UAAU,CAAC;AAEzD,0EAA0E;AAC1E,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,EAAE,CAAC,EAAE,IAAI,CAAC;CACX;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,IAAI,GAAG,SAAS,CAAC;IACzB,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjB,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;CAC9B;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,G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ED,eAAO,MAAM,QAAQ;;;;;CAKnB,CAAC"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Carousel — a run of slides, one at a time, dragged with a finger.
|
|
3
|
+
*
|
|
4
|
+
* ```tsx
|
|
5
|
+
* <Carousel loop>
|
|
6
|
+
* <Carousel.Content className="h-56">
|
|
7
|
+
* {photos.map((photo) => (
|
|
8
|
+
* <Carousel.Item key={photo.id}>
|
|
9
|
+
* <Image source={{ uri: photo.uri }} className="h-full w-full" />
|
|
10
|
+
* </Carousel.Item>
|
|
11
|
+
* ))}
|
|
12
|
+
* </Carousel.Content>
|
|
13
|
+
* <Carousel.Controls />
|
|
14
|
+
* </Carousel>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* ## One shared value, four layouts
|
|
18
|
+
*
|
|
19
|
+
* Everything is driven from a single `progress` — the position in the run, as a
|
|
20
|
+
* fractional index. `2.4` is two-fifths of the way from the third slide to the
|
|
21
|
+
* fourth, and every slide styles itself from its own distance to that number.
|
|
22
|
+
* A pan writes to it, a spring settles it onto a whole number, and the dots
|
|
23
|
+
* read it.
|
|
24
|
+
*
|
|
25
|
+
* That is why the track is a pan gesture rather than a paging `ScrollView`. A
|
|
26
|
+
* scroll view carries its offset natively and would serve `default` well
|
|
27
|
+
* enough, but `coverflow` and `stack` do not lay their slides along a track at
|
|
28
|
+
* all — they hold them in one place and pull them apart with transforms — so
|
|
29
|
+
* there would be nothing for it to scroll. One mechanism all four read beats a
|
|
30
|
+
* native scroller for one of them and something else for the rest.
|
|
31
|
+
*
|
|
32
|
+
* ## What each layout is for
|
|
33
|
+
*
|
|
34
|
+
* - **`default`** — a track. The honest choice for content that is read rather
|
|
35
|
+
* than admired: a row of cards, a gallery, an onboarding run.
|
|
36
|
+
* - **`interactive`** — the run fans out around the middle slide and tilts away
|
|
37
|
+
* on both sides, opening wider while a finger is down. For a small set worth
|
|
38
|
+
* showing off.
|
|
39
|
+
* - **`coverflow`** — the neighbours turn away from you in perspective. Best
|
|
40
|
+
* with art: covers, posters, photographs.
|
|
41
|
+
* - **`stack`** — a deck. The active card is on top with the next two peeking
|
|
42
|
+
* out behind it, and dragging takes the top one away. For cards dealt with
|
|
43
|
+
* one at a time, where the pile is the point.
|
|
44
|
+
*
|
|
45
|
+
* Depth is carried by scale, opacity and z-order rather than by moving slides
|
|
46
|
+
* along z: React Native's transform has `perspective` and `rotateY` but no
|
|
47
|
+
* `translateZ`, so a slide is made to *look* further away rather than put there.
|
|
48
|
+
*/
|
|
49
|
+
import { type ReactNode } from 'react';
|
|
50
|
+
import { type ViewProps } from 'react-native';
|
|
51
|
+
export type CarouselVariant = 'default' | 'interactive' | 'coverflow' | 'stack';
|
|
52
|
+
export type CarouselOrientation = 'horizontal' | 'vertical';
|
|
53
|
+
export type CarouselAlign = 'start' | 'center';
|
|
54
|
+
/** Position and controls, for a control of your own outside the built-in ones. */
|
|
55
|
+
export declare function useCarouselState(): {
|
|
56
|
+
index: number;
|
|
57
|
+
count: number;
|
|
58
|
+
scrollTo: (index: number) => void;
|
|
59
|
+
next: () => void;
|
|
60
|
+
previous: () => void;
|
|
61
|
+
};
|
|
62
|
+
export interface CarouselProps extends ViewProps {
|
|
63
|
+
className?: string;
|
|
64
|
+
/** How the slides are arranged, and how they move. */
|
|
65
|
+
variant?: CarouselVariant;
|
|
66
|
+
/** Which way the run travels. `stack` is always dealt sideways. */
|
|
67
|
+
orientation?: CarouselOrientation;
|
|
68
|
+
/** Run past the last slide back to the first, and the other way. */
|
|
69
|
+
loop?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Where the active slide sits. `center` is what the fanned layouts want;
|
|
72
|
+
* `start` suits a row of cards running off the trailing edge. `coverflow`
|
|
73
|
+
* and `stack` are always centred.
|
|
74
|
+
*/
|
|
75
|
+
align?: CarouselAlign;
|
|
76
|
+
/**
|
|
77
|
+
* Length of one slide along the direction of travel, in points. Measured from
|
|
78
|
+
* the carousel's own box when omitted, which is what a full-width slide
|
|
79
|
+
* wants; set it for a run that shows more than one at a time.
|
|
80
|
+
*/
|
|
81
|
+
itemSize?: number;
|
|
82
|
+
/** Advance on a timer. Stops for good the first time a finger lands. */
|
|
83
|
+
autoplay?: boolean;
|
|
84
|
+
/** Milliseconds each slide is held when `autoplay` is set. */
|
|
85
|
+
autoplayInterval?: number;
|
|
86
|
+
/** Controlled active slide. */
|
|
87
|
+
index?: number;
|
|
88
|
+
/** Starting slide when uncontrolled. */
|
|
89
|
+
defaultIndex?: number;
|
|
90
|
+
onIndexChange?: (index: number) => void;
|
|
91
|
+
/** Let go of the gesture, for a carousel inside something else that drags. */
|
|
92
|
+
scrollEnabled?: boolean;
|
|
93
|
+
children?: ReactNode;
|
|
94
|
+
}
|
|
95
|
+
/** Imperative handle, for driving the run from outside its own controls. */
|
|
96
|
+
export interface CarouselHandle {
|
|
97
|
+
next: () => void;
|
|
98
|
+
previous: () => void;
|
|
99
|
+
scrollTo: (index: number) => void;
|
|
100
|
+
}
|
|
101
|
+
export interface CarouselContentProps extends ViewProps {
|
|
102
|
+
className?: string;
|
|
103
|
+
children?: ReactNode;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The box the slides live in. Give it a height — nothing inside it is in the
|
|
107
|
+
* layout flow, so it has no height of its own to take.
|
|
108
|
+
*
|
|
109
|
+
* It does not move. Every slide places itself from `progress`, which is what
|
|
110
|
+
* lets `default` and `coverflow` be one component with different arithmetic
|
|
111
|
+
* rather than two different trees. The alignment here is the *resting* place
|
|
112
|
+
* every slide is offset from.
|
|
113
|
+
*/
|
|
114
|
+
declare function CarouselContent({ className, children, ...props }: CarouselContentProps): import("react").JSX.Element;
|
|
115
|
+
export interface CarouselItemProps extends ViewProps {
|
|
116
|
+
className?: string;
|
|
117
|
+
children?: ReactNode;
|
|
118
|
+
}
|
|
119
|
+
/** One slide. Its transform is whatever the root's `variant` asks for. */
|
|
120
|
+
declare function CarouselItem({ className, children, style, ...props }: CarouselItemProps): import("react").JSX.Element;
|
|
121
|
+
export interface CarouselCaptionProps extends ViewProps {
|
|
122
|
+
className?: string;
|
|
123
|
+
children?: ReactNode;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* A slide's label, shown only while that slide is the active one.
|
|
127
|
+
*
|
|
128
|
+
* It lives inside the slide rather than beside the run, so it travels with what
|
|
129
|
+
* it names — a caption that stays put while the picture moves belongs to the
|
|
130
|
+
* carousel rather than to the picture.
|
|
131
|
+
*/
|
|
132
|
+
declare function CarouselCaption({ className, children, ...props }: CarouselCaptionProps): import("react").JSX.Element;
|
|
133
|
+
export interface CarouselDotsProps extends ViewProps {
|
|
134
|
+
className?: string;
|
|
135
|
+
/** Lay the dots down the side instead of across. */
|
|
136
|
+
orientation?: CarouselOrientation;
|
|
137
|
+
/** Jump to a slide by tapping its dot. */
|
|
138
|
+
interactive?: boolean;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* One dot per slide, the active one drawn as a bar.
|
|
142
|
+
*
|
|
143
|
+
* Length rather than colour alone carries the position: a row that differs only
|
|
144
|
+
* in opacity is unreadable at a glance, and invisible to anyone who cannot
|
|
145
|
+
* separate the two greys.
|
|
146
|
+
*/
|
|
147
|
+
declare function CarouselDots({ className, orientation, interactive, ...props }: CarouselDotsProps): import("react").JSX.Element | null;
|
|
148
|
+
export interface CarouselArrowProps extends ViewProps {
|
|
149
|
+
className?: string;
|
|
150
|
+
children?: ReactNode;
|
|
151
|
+
}
|
|
152
|
+
export interface CarouselControlsProps extends ViewProps {
|
|
153
|
+
className?: string;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The arrows and the dots in one pill.
|
|
157
|
+
*
|
|
158
|
+
* Together rather than scattered, because they answer the same question — where
|
|
159
|
+
* am I in this, and how do I move — and a bar that reads as one object can sit
|
|
160
|
+
* over the content instead of taking a strip of the layout for itself.
|
|
161
|
+
*/
|
|
162
|
+
declare function CarouselControls({ className, ...props }: CarouselControlsProps): import("react").JSX.Element;
|
|
163
|
+
export declare const Carousel: import("react").ForwardRefExoticComponent<CarouselProps & import("react").RefAttributes<CarouselHandle>> & {
|
|
164
|
+
Content: typeof CarouselContent;
|
|
165
|
+
Item: typeof CarouselItem;
|
|
166
|
+
Caption: typeof CarouselCaption;
|
|
167
|
+
Dots: typeof CarouselDots;
|
|
168
|
+
Previous: {
|
|
169
|
+
({ className, children, ...props }: CarouselArrowProps): import("react").JSX.Element;
|
|
170
|
+
displayName: string;
|
|
171
|
+
};
|
|
172
|
+
Next: {
|
|
173
|
+
({ className, children, ...props }: CarouselArrowProps): import("react").JSX.Element;
|
|
174
|
+
displayName: string;
|
|
175
|
+
};
|
|
176
|
+
Controls: typeof CarouselControls;
|
|
177
|
+
};
|
|
178
|
+
export {};
|
|
179
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/carousel/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,OAAO,EAUL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAA2C,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAgDvF,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,OAAO,CAAC;AAChF,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,UAAU,CAAC;AAC5D,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,CAAC;AAyC/C,kFAAkF;AAClF,wBAAgB,gBAAgB;;;sBA/BZ,MAAM,KAAK,IAAI;gBACrB,IAAI;oBACA,IAAI;EAgCrB;AA8BD,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,mEAAmE;IACnE,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gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;AACnE,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;AAoB7D,UAAU,cAAc;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB;AASD;;;GAGG;AACH,wBAAgB,OAAO,IAAI,cAAc,CAMxC;AAMD,MAAM,WAAW,SACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,UAAU,GAAG,UAAU,CAAC,EAC3D,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;IAC9D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kDAAkD;IAClD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AA6HD,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;GAIG;AACH,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,cAAc,+BAMzD;kBANQ,SAAS;;;AASlB,eAAO,MAAM,IAAI;;CAEf,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A small syntax highlighter, sized for a phone.
|
|
3
|
+
*
|
|
4
|
+
* The web answer to this problem is a real tokenizer with a grammar per
|
|
5
|
+
* language, which is megabytes of WASM and a worker. That is the wrong shape
|
|
6
|
+
* here twice over: a chat renders short fragments rather than files, and the
|
|
7
|
+
* fragments arrive a token at a time, so whatever runs has to run again on
|
|
8
|
+
* every frame of a stream. This trades exactness for a single pass of regex
|
|
9
|
+
* that costs nothing and never blocks.
|
|
10
|
+
*
|
|
11
|
+
* What it therefore does *not* do: nested languages, template-literal
|
|
12
|
+
* interpolation, or anything requiring a parser to know it. What it does do is
|
|
13
|
+
* make a keyword look like a keyword, which is the whole of the value in a
|
|
14
|
+
* twelve-line snippet.
|
|
15
|
+
*
|
|
16
|
+
* Anything it does not recognise is returned as one plain token per line, so
|
|
17
|
+
* an unknown language renders as clean monospace rather than as a guess.
|
|
18
|
+
*/
|
|
19
|
+
/** The kinds a token can be. Each maps to one theme colour. */
|
|
20
|
+
export type TokenKind = 'plain' | 'keyword' | 'string' | 'number' | 'comment' | 'function' | 'property' | 'punctuation' | 'inserted' | 'deleted';
|
|
21
|
+
export interface Token {
|
|
22
|
+
text: string;
|
|
23
|
+
kind: TokenKind;
|
|
24
|
+
}
|
|
25
|
+
/** The languages that get more than plain monospace. */
|
|
26
|
+
export type CodeLanguage = 'ts' | 'tsx' | 'js' | 'jsx' | 'json' | 'bash' | 'python' | 'css' | 'html' | 'sql' | 'markdown' | 'diff' | 'text';
|
|
27
|
+
/** Resolves a caller's language string. Unknown spellings become `text`. */
|
|
28
|
+
export declare function resolveLanguage(language: string | undefined): CodeLanguage;
|
|
29
|
+
/**
|
|
30
|
+
* Splits code into lines of tokens.
|
|
31
|
+
*
|
|
32
|
+
* Line by line, so a stream that has just gained a character only makes the
|
|
33
|
+
* work grow with the code and never with time. The cost of that choice is that
|
|
34
|
+
* a block comment spanning several lines is only coloured on its first — an
|
|
35
|
+
* acceptable trade for a snippet, and the reason this is not sold as a
|
|
36
|
+
* highlighter for a file.
|
|
37
|
+
*/
|
|
38
|
+
export declare function highlight(code: string, language: string | undefined): Token[][];
|
|
39
|
+
//# sourceMappingURL=highlight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../../../../../src/components/code-block/highlight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,+DAA+D;AAC/D,MAAM,MAAM,SAAS,GACjB,OAAO,GACP,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,UAAU,GACV,UAAU,GACV,aAAa,GACb,UAAU,GACV,SAAS,CAAC;AAEd,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,wDAAwD;AACxD,MAAM,MAAM,YAAY,GACpB,IAAI,GACJ,KAAK,GACL,IAAI,GACJ,KAAK,GACL,MAAM,GACN,MAAM,GACN,QAAQ,GACR,KAAK,GACL,MAAM,GACN,KAAK,GACL,UAAU,GACV,MAAM,GACN,MAAM,CAAC;AAkCX,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,CAG1E;AA2KD;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,KAAK,EAAE,EAAE,CAQ/E"}
|