@kanso-labs/react-native-kanso-ui 0.8.0 → 0.10.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 +4 -3
- package/dist/autocomplete/index.js +15 -1
- package/dist/autocomplete/index.js.map +1 -1
- package/dist/badge/index.js +9 -70
- package/dist/badge/index.js.map +1 -1
- package/dist/button/group.d.ts +5 -0
- package/dist/button/group.js +115 -0
- package/dist/button/group.js.map +1 -0
- package/dist/button/index.d.ts +4 -1
- package/dist/button/index.js +45 -23
- package/dist/button/index.js.map +1 -1
- package/dist/button/palettes.d.ts +2 -0
- package/dist/button/slots.js +2 -1
- package/dist/button/slots.js.map +1 -1
- package/dist/calendar/index.js +351 -182
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/styles.js +33 -2
- package/dist/calendar/styles.js.map +1 -1
- package/dist/carousel/arrangement.d.ts +5 -0
- package/dist/carousel/arrangement.js +123 -0
- package/dist/carousel/arrangement.js.map +1 -0
- package/dist/chequer/index.js +95 -0
- package/dist/chequer/index.js.map +1 -0
- package/dist/collection/index.d.ts +157 -0
- package/dist/collection/index.js +1331 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/color-thumb/index.js +56 -0
- package/dist/color-thumb/index.js.map +1 -0
- package/dist/components/badge/index.d.ts +48 -0
- package/dist/components/badge/index.js +122 -0
- package/dist/components/badge/index.js.map +1 -0
- package/dist/{badge → components/badge}/styles.js +10 -6
- package/dist/components/badge/styles.js.map +1 -0
- package/dist/components/breadcrumbs/index.d.ts +66 -0
- package/dist/components/breadcrumbs/index.js +285 -0
- package/dist/components/breadcrumbs/index.js.map +1 -0
- package/dist/components/button/index.d.ts +4 -2
- package/dist/components/button/index.js +227 -188
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button-group/index.d.ts +87 -0
- package/dist/components/button-group/index.js +275 -0
- package/dist/components/button-group/index.js.map +1 -0
- package/dist/components/calendar/index.d.ts +11 -3
- package/dist/components/calendar/index.js +60 -45
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/carousel/index.d.ts +72 -0
- package/dist/components/carousel/index.js +496 -0
- package/dist/components/carousel/index.js.map +1 -0
- package/dist/components/checkbox/index.d.ts +7 -1
- package/dist/components/checkbox/index.js +183 -138
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox-group/index.d.ts +92 -0
- package/dist/components/checkbox-group/index.js +306 -0
- package/dist/components/checkbox-group/index.js.map +1 -0
- package/dist/components/code/index.d.ts +25 -0
- package/dist/components/code/index.js +87 -0
- package/dist/components/code/index.js.map +1 -0
- package/dist/components/color-area/index.d.ts +85 -0
- package/dist/components/color-area/index.js +630 -0
- package/dist/components/color-area/index.js.map +1 -0
- package/dist/components/color-field/index.d.ts +144 -0
- package/dist/components/color-field/index.js +516 -0
- package/dist/components/color-field/index.js.map +1 -0
- package/dist/components/color-picker/index.d.ts +74 -0
- package/dist/components/color-picker/index.js +317 -0
- package/dist/components/color-picker/index.js.map +1 -0
- package/dist/components/color-slider/index.d.ts +82 -0
- package/dist/components/color-slider/index.js +456 -0
- package/dist/components/color-slider/index.js.map +1 -0
- package/dist/components/color-swatch/index.d.ts +46 -0
- package/dist/components/color-swatch/index.js +127 -0
- package/dist/components/color-swatch/index.js.map +1 -0
- package/dist/components/color-swatch-picker/index.d.ts +81 -0
- package/dist/components/color-swatch-picker/index.js +287 -0
- package/dist/components/color-swatch-picker/index.js.map +1 -0
- package/dist/components/color-wheel/index.d.ts +71 -0
- package/dist/components/color-wheel/index.js +407 -0
- package/dist/components/color-wheel/index.js.map +1 -0
- package/dist/components/combo-box/index.d.ts +193 -0
- package/dist/components/combo-box/index.js +616 -0
- package/dist/components/combo-box/index.js.map +1 -0
- package/dist/components/container/index.d.ts +47 -0
- package/dist/components/container/index.js +85 -0
- package/dist/components/container/index.js.map +1 -0
- package/dist/components/date-field/index.d.ts +120 -0
- package/dist/components/date-field/index.js +111 -0
- package/dist/components/date-field/index.js.map +1 -0
- package/dist/components/date-picker/index.d.ts +130 -0
- package/dist/components/date-picker/index.js +310 -0
- package/dist/components/date-picker/index.js.map +1 -0
- package/dist/components/date-range-picker/index.d.ts +139 -0
- package/dist/components/date-range-picker/index.js +421 -0
- package/dist/components/date-range-picker/index.js.map +1 -0
- package/dist/components/disclosure/index.d.ts +94 -0
- package/dist/components/disclosure/index.js +365 -0
- package/dist/components/disclosure/index.js.map +1 -0
- package/dist/components/disclosure-group/index.d.ts +61 -0
- package/dist/components/disclosure-group/index.js +100 -0
- package/dist/components/disclosure-group/index.js.map +1 -0
- package/dist/components/drop-zone/index.d.ts +113 -0
- package/dist/components/drop-zone/index.js +304 -0
- package/dist/components/drop-zone/index.js.map +1 -0
- package/dist/components/fab/index.d.ts +80 -0
- package/dist/components/fab/index.js +246 -0
- package/dist/components/fab/index.js.map +1 -0
- package/dist/components/fab-menu/index.d.ts +120 -0
- package/dist/components/fab-menu/index.js +640 -0
- package/dist/components/fab-menu/index.js.map +1 -0
- package/dist/components/feed/index.d.ts +57 -0
- package/dist/components/feed/index.js +167 -0
- package/dist/components/feed/index.js.map +1 -0
- package/dist/components/form/index.d.ts +3 -2
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/icon-button/index.d.ts +4 -2
- package/dist/components/icon-button/index.js +204 -171
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/keycap/index.d.ts +27 -0
- package/dist/components/keycap/index.js +136 -0
- package/dist/components/keycap/index.js.map +1 -0
- package/dist/components/list/index.d.ts +15 -158
- package/dist/components/list/index.js +21 -1047
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list-box/index.d.ts +73 -0
- package/dist/components/list-box/index.js +82 -0
- package/dist/components/list-box/index.js.map +1 -0
- package/dist/components/loading-indicator/index.d.ts +32 -0
- package/dist/components/loading-indicator/index.js +174 -0
- package/dist/components/loading-indicator/index.js.map +1 -0
- package/dist/components/menu/index.js +1 -1
- package/dist/components/navigation-tree/index.d.ts +117 -0
- package/dist/components/navigation-tree/index.js +135 -0
- package/dist/components/navigation-tree/index.js.map +1 -0
- package/dist/components/number-field/index.js +132 -143
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/range-calendar/index.d.ts +69 -0
- package/dist/components/range-calendar/index.js +144 -0
- package/dist/components/range-calendar/index.js.map +1 -0
- package/dist/components/search-view/index.d.ts +78 -0
- package/dist/components/search-view/index.js +570 -0
- package/dist/components/search-view/index.js.map +1 -0
- package/dist/components/select/index.d.ts +152 -0
- package/dist/components/select/index.js +419 -0
- package/dist/components/select/index.js.map +1 -0
- package/dist/components/separator/index.d.ts +3 -2
- package/dist/components/separator/index.js +29 -26
- package/dist/components/separator/index.js.map +1 -1
- package/dist/components/slider/index.d.ts +111 -0
- package/dist/components/slider/index.js +673 -0
- package/dist/components/slider/index.js.map +1 -0
- package/dist/components/split-button/index.d.ts +77 -0
- package/dist/components/split-button/index.js +354 -0
- package/dist/components/split-button/index.js.map +1 -0
- package/dist/components/supporting-pane/index.d.ts +44 -0
- package/dist/components/supporting-pane/index.js +109 -0
- package/dist/components/supporting-pane/index.js.map +1 -0
- package/dist/components/tabs/index.d.ts +196 -0
- package/dist/components/tabs/index.js +1137 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/text/index.d.ts +1 -1
- package/dist/components/text/index.js +49 -21
- package/dist/components/text/index.js.map +1 -1
- package/dist/components/text-area/index.d.ts +145 -0
- package/dist/components/text-area/index.js +231 -0
- package/dist/components/text-area/index.js.map +1 -0
- package/dist/components/time-field/index.d.ts +43 -0
- package/dist/components/time-field/index.js +107 -0
- package/dist/components/time-field/index.js.map +1 -0
- package/dist/components/time-picker/index.d.ts +65 -0
- package/dist/components/time-picker/index.js +1168 -0
- package/dist/components/time-picker/index.js.map +1 -0
- package/dist/components/toolbar/index.d.ts +53 -0
- package/dist/components/toolbar/index.js +185 -0
- package/dist/components/toolbar/index.js.map +1 -0
- package/dist/components/tooltip/index.d.ts +101 -0
- package/dist/components/tooltip/index.js +223 -0
- package/dist/components/tooltip/index.js.map +1 -0
- package/dist/components/tree/index.d.ts +112 -0
- package/dist/components/tree/index.js +157 -0
- package/dist/components/tree/index.js.map +1 -0
- package/dist/control/group.js +23 -0
- package/dist/control/group.js.map +1 -0
- package/dist/disclosure/chevron.js +75 -0
- package/dist/disclosure/chevron.js.map +1 -0
- package/dist/disclosure/index.js +7 -0
- package/dist/disclosure/index.js.map +1 -0
- package/dist/drop/index.d.ts +54 -0
- package/dist/drop/index.js +161 -0
- package/dist/drop/index.js.map +1 -0
- package/dist/fab/index.d.ts +19 -0
- package/dist/fab/index.js +147 -0
- package/dist/fab/index.js.map +1 -0
- package/dist/field/chevron.js +74 -0
- package/dist/field/chevron.js.map +1 -0
- package/dist/field/index.d.ts +2 -1
- package/dist/field/index.js +350 -153
- package/dist/field/index.js.map +1 -1
- package/dist/field/styles.js +27 -0
- package/dist/field/styles.js.map +1 -1
- package/dist/files/index.d.ts +18 -0
- package/dist/files/index.js +107 -0
- package/dist/files/index.js.map +1 -0
- package/dist/form/index.d.ts +6 -4
- package/dist/form/index.js +64 -85
- package/dist/form/index.js.map +1 -1
- package/dist/glyphs/index.js +92 -1
- package/dist/glyphs/index.js.map +1 -1
- package/dist/i18n/index.js +20 -1
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/messages.js +1394 -34
- package/dist/i18n/messages.js.map +1 -1
- package/dist/index.d.ts +51 -6
- package/dist/index.js +47 -4
- package/dist/indicator/paths.js +23 -1
- package/dist/indicator/paths.js.map +1 -1
- package/dist/modal/index.js +96 -68
- package/dist/modal/index.js.map +1 -1
- package/dist/navigation/index.js +8 -5
- package/dist/navigation/index.js.map +1 -1
- package/dist/number/keyboard.js +16 -0
- package/dist/number/keyboard.js.map +1 -0
- package/dist/overlay/anchored.js +68 -38
- package/dist/overlay/anchored.js.map +1 -1
- package/dist/overlay/keyboard.js +57 -0
- package/dist/overlay/keyboard.js.map +1 -0
- package/dist/overlay/panel.js +173 -19
- package/dist/overlay/panel.js.map +1 -1
- package/dist/overlay/placement.js +16 -2
- package/dist/overlay/placement.js.map +1 -1
- package/dist/picker/index.js +322 -0
- package/dist/picker/index.js.map +1 -0
- package/dist/press/index.d.ts +2 -0
- package/dist/press/index.js +102 -100
- package/dist/press/index.js.map +1 -1
- package/dist/row/index.js +77 -69
- package/dist/row/index.js.map +1 -1
- package/dist/row/styles.js +13 -2
- package/dist/row/styles.js.map +1 -1
- package/dist/segments/field.js +277 -0
- package/dist/segments/field.js.map +1 -0
- package/dist/segments/index.js +574 -0
- package/dist/segments/index.js.map +1 -0
- package/dist/segments/styles.js +24 -0
- package/dist/segments/styles.js.map +1 -0
- package/dist/separator/index.js +7 -0
- package/dist/separator/index.js.map +1 -0
- package/dist/slider/index.js +145 -0
- package/dist/slider/index.js.map +1 -0
- package/dist/swatch/index.js +56 -0
- package/dist/swatch/index.js.map +1 -0
- package/dist/typography/size.js +14 -0
- package/dist/typography/size.js.map +1 -0
- package/package.json +11 -2
- package/dist/badge/styles.js.map +0 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useTheme } from "../../theme/scope.js";
|
|
2
2
|
import { composeStyles, themedStyles } from "../../theme/styles.js";
|
|
3
|
+
import { SeparatorOrientationContext } from "../../separator/index.js";
|
|
3
4
|
import { c } from "react/compiler-runtime";
|
|
4
5
|
import { StyleSheet, View } from "react-native";
|
|
6
|
+
import { use } from "react";
|
|
5
7
|
import { jsx } from "react/jsx-runtime";
|
|
6
8
|
//#region src/components/separator/index.tsx
|
|
7
9
|
const styles = StyleSheet.create({
|
|
@@ -58,50 +60,51 @@ const VERTICAL = { "aria-orientation": "vertical" };
|
|
|
58
60
|
*/
|
|
59
61
|
function Separator(t0) {
|
|
60
62
|
const $ = c(14);
|
|
63
|
+
let own;
|
|
61
64
|
let props;
|
|
62
65
|
let style;
|
|
63
66
|
let t1;
|
|
64
|
-
let t2;
|
|
65
67
|
if ($[0] !== t0) {
|
|
66
|
-
({inset: t1, orientation:
|
|
68
|
+
({inset: t1, orientation: own, style, ...props} = t0);
|
|
67
69
|
$[0] = t0;
|
|
68
|
-
$[1] =
|
|
69
|
-
$[2] =
|
|
70
|
-
$[3] =
|
|
71
|
-
$[4] =
|
|
70
|
+
$[1] = own;
|
|
71
|
+
$[2] = props;
|
|
72
|
+
$[3] = style;
|
|
73
|
+
$[4] = t1;
|
|
72
74
|
} else {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
own = $[1];
|
|
76
|
+
props = $[2];
|
|
77
|
+
style = $[3];
|
|
78
|
+
t1 = $[4];
|
|
77
79
|
}
|
|
78
80
|
const inset = t1 === void 0 ? "none" : t1;
|
|
79
|
-
const orientation = t2 === void 0 ? "horizontal" : t2;
|
|
80
81
|
const theme = useTheme();
|
|
81
|
-
const
|
|
82
|
-
|
|
82
|
+
const provided = use(SeparatorOrientationContext);
|
|
83
|
+
const orientation = own ?? provided ?? "horizontal";
|
|
84
|
+
const t2 = orientation === "vertical" ? VERTICAL : void 0;
|
|
85
|
+
let t3;
|
|
83
86
|
if ($[5] !== inset || $[6] !== orientation || $[7] !== style || $[8] !== theme) {
|
|
84
|
-
|
|
87
|
+
t3 = composeStyles(styles[orientation], fillOf(theme).rule, insetsOf(theme)[orientation][inset], style);
|
|
85
88
|
$[5] = inset;
|
|
86
89
|
$[6] = orientation;
|
|
87
90
|
$[7] = style;
|
|
88
91
|
$[8] = theme;
|
|
89
|
-
$[9] =
|
|
90
|
-
} else
|
|
91
|
-
let
|
|
92
|
-
if ($[10] !== props || $[11] !==
|
|
93
|
-
|
|
92
|
+
$[9] = t3;
|
|
93
|
+
} else t3 = $[9];
|
|
94
|
+
let t4;
|
|
95
|
+
if ($[10] !== props || $[11] !== t2 || $[12] !== t3) {
|
|
96
|
+
t4 = /* @__PURE__ */ jsx(View, {
|
|
94
97
|
role: "separator",
|
|
95
|
-
...
|
|
98
|
+
...t2,
|
|
96
99
|
...props,
|
|
97
|
-
style:
|
|
100
|
+
style: t3
|
|
98
101
|
});
|
|
99
102
|
$[10] = props;
|
|
100
|
-
$[11] =
|
|
101
|
-
$[12] =
|
|
102
|
-
$[13] =
|
|
103
|
-
} else
|
|
104
|
-
return
|
|
103
|
+
$[11] = t2;
|
|
104
|
+
$[12] = t3;
|
|
105
|
+
$[13] = t4;
|
|
106
|
+
} else t4 = $[13];
|
|
107
|
+
return t4;
|
|
105
108
|
}
|
|
106
109
|
//#endregion
|
|
107
110
|
export { Separator };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ComponentRef","Ref","ViewProps","ViewStyle","StyleSheet","View","useTheme","composeStyles","themedStyles","styles","create","horizontal","alignSelf","flexShrink","height","vertical","width","fillOf","colors","rule","backgroundColor","outlineVariant","insetsOf","spacing","both","marginEnd","lg","marginStart","none","start","marginBottom","marginTop","VERTICAL","SeparatorInset","SeparatorProps","inset","orientation","ref","Separator","t0","$","_c","props","style","t1","
|
|
1
|
+
{"version":3,"file":"index.js","names":["ComponentRef","Ref","ViewProps","ViewStyle","use","StyleSheet","View","SeparatorOrientationContext","useTheme","composeStyles","themedStyles","styles","create","horizontal","alignSelf","flexShrink","height","vertical","width","fillOf","colors","rule","backgroundColor","outlineVariant","insetsOf","spacing","both","marginEnd","lg","marginStart","none","start","marginBottom","marginTop","VERTICAL","SeparatorInset","SeparatorProps","inset","orientation","ref","Separator","t0","$","_c","own","props","style","t1","undefined","theme","provided","t2","t3","t4","_c"],"sources":["../../../src/components/separator/index.tsx"],"sourcesContent":["import type { ComponentRef, Ref } from 'react'\nimport type { ViewProps, ViewStyle } from 'react-native'\n\nimport { use } from 'react'\nimport { StyleSheet, View } from 'react-native'\n\nimport { SeparatorOrientationContext } from '../../separator'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\n\n// A divider is the same colour as a border, so it draws from outlineVariant\n// rather than a role of its own, as on web: the design system treats the two\n// as one decision.\n//\n// Drawn as a filled 1dp view rather than as a border, so the rule is the view\n// itself, which flex `gap` and anything measuring it can see.\n//\n// A rule has no length of its own. `alignSelf: 'stretch'` takes it from the\n// parent's cross axis: a horizontal rule spans a column, which is what a\n// `View` is by default, and a vertical one spans a row. A rule between two\n// rows should match whatever they turn out to be rather than being told a\n// length at the call site, and in a parent running the same way as the rule\n// it has none, which is the documented cost.\n//\n// The divider page gives three forms and this draws all three: full width,\n// inset by 16dp at the leading end, and middle-inset by 16dp at both. The page\n// names them \"inset\" and \"middle-inset\"; the prop says `start` and `both`, as\n// on web, since the two words say which ends move. The inset is a margin on\n// the axis the rule runs along, which shortens a stretched rule rather than\n// pushing it out of its parent. A horizontal rule's is `marginStart`, which\n// React Native puts on the right under right-to-left.\nconst styles = StyleSheet.create({\n horizontal: {\n alignSelf: 'stretch',\n flexShrink: 0,\n height: 1,\n },\n vertical: {\n alignSelf: 'stretch',\n flexShrink: 0,\n width: 1,\n },\n})\n\nconst fillOf = themedStyles(({ colors }) =>\n StyleSheet.create({\n rule: { backgroundColor: colors.outlineVariant },\n }),\n)\n\n// The page's 16dp, on the axis the rule runs along.\nconst insetsOf = themedStyles(({ spacing }) => ({\n horizontal: StyleSheet.create({\n both: { marginEnd: spacing.lg, marginStart: spacing.lg },\n none: {},\n start: { marginStart: spacing.lg },\n }),\n vertical: StyleSheet.create({\n both: { marginBottom: spacing.lg, marginTop: spacing.lg },\n none: {},\n start: { marginTop: spacing.lg },\n }),\n}))\n\n// React Native Web writes `aria-orientation` onto the element, which React\n// Native's types do not name. A horizontal rule needs none, since that is the\n// separator role's own default.\nconst VERTICAL: { readonly 'aria-orientation': 'vertical' } = {\n 'aria-orientation': 'vertical',\n}\n\ntype SeparatorInset = 'both' | 'none' | 'start'\n\ntype SeparatorProps = ViewProps & {\n /**\n * How far the rule is held off the ends it runs between. `start` holds it\n * 16dp off the leading end, which is the page's inset divider; `both` holds\n * it off each end, which is its middle-inset one. The inset follows the\n * writing direction rather than a fixed side.\n * @default 'none'\n */\n readonly inset?: SeparatorInset\n /**\n * Which way the rule runs. A rule takes its length from its parent: a\n * horizontal one spans a column, and a vertical one a row. Inside a\n * `Toolbar` it runs across the bar unless this says otherwise.\n * @default 'horizontal'\n */\n readonly orientation?: 'horizontal' | 'vertical'\n readonly ref?: Ref<ComponentRef<typeof View>>\n}\n\n/**\n * A 1dp rule between items, in the outline-variant colour, carrying the\n * separator role.\n *\n * ```tsx\n * <Stack gap=\"none\">\n * <Text>First item</Text>\n * <Separator inset=\"start\" />\n * <Text>Second item</Text>\n * </Stack>\n * ```\n *\n * `inset` holds the rule off the ends it runs between, `start` off the\n * leading one and `both` off each, which is what a rule between list rows\n * takes so it lines up with their text rather than the container's edge.\n *\n * Web draws the rule again as a border under forced colours, which neither\n * iOS nor Android has. `style`, `ref` and `testID` land on the `View`, and a\n * `style` there applies over the rule's own.\n */\nfunction Separator({\n inset = 'none',\n orientation: own,\n style,\n ...props\n}: SeparatorProps) {\n const theme = useTheme()\n const provided = use(SeparatorOrientationContext)\n const orientation = own ?? provided ?? 'horizontal'\n\n return (\n <View\n role=\"separator\"\n {...(orientation === 'vertical' ? VERTICAL : undefined)}\n {...props}\n style={composeStyles<ViewStyle>(\n styles[orientation],\n fillOf(theme).rule,\n insetsOf(theme)[orientation][inset],\n style,\n )}\n />\n )\n}\n\nexport type { SeparatorInset, SeparatorProps }\n\nexport { Separator }\n"],"mappings":";;;;;;;;AA+BA,MAAMW,SAASN,WAAWO,OAAO;CAC/BC,YAAY;EACVC,WAAW;EACXC,YAAY;EACZC,QAAQ;CACV;CACAC,UAAU;EACRH,WAAW;EACXC,YAAY;EACZG,OAAO;CACT;AACF,CAAC;AAED,MAAMC,SAAST,cAAc,EAAEU,aAC7Bf,WAAWO,OAAO,EAChBS,MAAM,EAAEC,iBAAiBF,OAAOG,eAAe,EACjD,CAAC,CACH;AAGA,MAAMC,WAAWd,cAAc,EAAEe,eAAe;CAC9CZ,YAAYR,WAAWO,OAAO;EAC5Bc,MAAM;GAAEC,WAAWF,QAAQG;GAAIC,aAAaJ,QAAQG;EAAG;EACvDE,MAAM,CAAC;EACPC,OAAO,EAAEF,aAAaJ,QAAQG,GAAG;CACnC,CAAC;CACDX,UAAUZ,WAAWO,OAAO;EAC1Bc,MAAM;GAAEM,cAAcP,QAAQG;GAAIK,WAAWR,QAAQG;EAAG;EACxDE,MAAM,CAAC;EACPC,OAAO,EAAEE,WAAWR,QAAQG,GAAG;CACjC,CAAC;AACH,EAAE;AAKF,MAAMM,WAAwD,EAC5D,oBAAoB,WACtB;;;;;;;;;;;;;;;;;;;;;AA2CA,SAAAM,UAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAmB,CAAA,CAAAJ,OAAAU,IAAAT,aAAAM,KAAAE,OAAA,GAAAD,SAAAJ;EAKFC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAH,MAAAF,EAAA;EAAAG,QAAAH,EAAA;EAAAI,QAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CAJf,MAAAL,QAAAU,OAAAC,KAAAA,IAAA,SAAAD;CAKA,MAAAE,QAAczC,SAAS;CACvB,MAAA0C,WAAiB9C,IAAIG,2BAA2B;CAChD,MAAA+B,cAAoBM,OAAAM,YAAA;CAKX,MAAAC,KAAAb,gBAAgB,aAAhBJ,WAAAc,KAAAA;CAAiD,IAAAI;CAAA,IAAAV,EAAA,OAAAL,SAAAK,EAAA,OAAAJ,eAAAI,EAAA,OAAAI,SAAAJ,EAAA,OAAAO,OAAA;EAE/CG,KAAA3C,cACLE,OAAO2B,cACPnB,OAAO8B,KAAK,CAAC,CAAA5B,MACbG,SAASyB,KAAK,CAAC,CAACX,YAAY,CAACD,QAC7BS,KACF;EAACJ,EAAA,KAAAL;EAAAK,EAAA,KAAAJ;EAAAI,EAAA,KAAAI;EAAAJ,EAAA,KAAAO;EAAAP,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,IAAAW;CAAA,IAAAX,EAAA,QAAAG,SAAAH,EAAA,QAAAS,MAAAT,EAAA,QAAAU,IAAA;EATHC,KAAA,oBAAC,MAAD;GACO,MAAA;GAAW,GACXF;GAAiD,GAClDN;GACG,OAAAO;EAKN,CAAA;EACDV,EAAA,MAAAG;EAAAH,EAAA,MAAAS;EAAAT,EAAA,MAAAU;EAAAV,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OAVFW;AAUE"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { StyleProp, View, ViewStyle } from "react-native";
|
|
2
|
+
import { ComponentRef, ReactNode, Ref } from "react";
|
|
3
|
+
//#region src/components/slider/index.d.ts
|
|
4
|
+
type SliderProps = {
|
|
5
|
+
/**
|
|
6
|
+
* The slider's name for a screen reader, when no `label` is drawn: a
|
|
7
|
+
* slider that a row labels some other way leaves `label` out and passes
|
|
8
|
+
* this instead.
|
|
9
|
+
*/
|
|
10
|
+
readonly 'aria-label'?: string;
|
|
11
|
+
/** The value the slider starts at, when it keeps its own. */
|
|
12
|
+
readonly defaultValue?: number | number[];
|
|
13
|
+
/**
|
|
14
|
+
* How the value reads, in the indicator and to a screen reader, in the
|
|
15
|
+
* provider's locale.
|
|
16
|
+
*/
|
|
17
|
+
readonly formatOptions?: Intl.NumberFormatOptions;
|
|
18
|
+
/**
|
|
19
|
+
* The page's inset icon, at the start of the active part, from `md` up:
|
|
20
|
+
* the page gives it a size at M, L and XL alone. Drawn for a single
|
|
21
|
+
* handle, and only while the active part has room for it. It reads its
|
|
22
|
+
* colour and size through `useIconStyle()`.
|
|
23
|
+
*/
|
|
24
|
+
readonly icon?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Draws the slider disabled, and takes no presses, drags or screen reader
|
|
27
|
+
* actions.
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
readonly isDisabled?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* What the slider sets. A slider that a row labels some other way leaves
|
|
33
|
+
* it out and passes `aria-label` instead.
|
|
34
|
+
*/
|
|
35
|
+
readonly label?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The largest value.
|
|
38
|
+
* @default 100
|
|
39
|
+
*/
|
|
40
|
+
readonly maxValue?: number;
|
|
41
|
+
/**
|
|
42
|
+
* The smallest value.
|
|
43
|
+
* @default 0
|
|
44
|
+
*/
|
|
45
|
+
readonly minValue?: number;
|
|
46
|
+
/** Called with the value as it moves. */
|
|
47
|
+
readonly onChange?: (value: number | number[]) => void;
|
|
48
|
+
/** Called with the value once a drag, a press or an action has ended. */
|
|
49
|
+
readonly onChangeEnd?: (value: number | number[]) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Along which axis the handle moves. A vertical slider is 240dp tall until
|
|
52
|
+
* `style` says otherwise.
|
|
53
|
+
* @default 'horizontal'
|
|
54
|
+
*/
|
|
55
|
+
readonly orientation?: 'horizontal' | 'vertical';
|
|
56
|
+
readonly ref?: Ref<ComponentRef<typeof View>>;
|
|
57
|
+
/**
|
|
58
|
+
* A stop at every step, the page's stops configuration, so the reader can
|
|
59
|
+
* see where the handle can land. Meant for a slider with a handful of
|
|
60
|
+
* steps: each stop is a 4dp dot, and a fine step draws a crowd of them.
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
readonly showStops?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* The page's sizes, by the track's thickness: 16dp at `xs`, 24dp at `sm`,
|
|
66
|
+
* 40dp at `md`, 56dp at `lg` and 96dp at `xl`, with the handle 44dp long
|
|
67
|
+
* up to `sm` and 52dp, 68dp and 108dp past it.
|
|
68
|
+
* @default 'xs'
|
|
69
|
+
*/
|
|
70
|
+
readonly size?: SliderSize;
|
|
71
|
+
/**
|
|
72
|
+
* The distance between two values the handle can land on.
|
|
73
|
+
* @default 1
|
|
74
|
+
*/
|
|
75
|
+
readonly step?: number;
|
|
76
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
77
|
+
readonly testID?: string;
|
|
78
|
+
/**
|
|
79
|
+
* A name for each handle of a range slider, in order, since two handles
|
|
80
|
+
* named by the same label cannot be told apart.
|
|
81
|
+
*/
|
|
82
|
+
readonly thumbLabels?: readonly string[];
|
|
83
|
+
/**
|
|
84
|
+
* The value, for a call site holding it itself with `onChange`: a number
|
|
85
|
+
* for one handle, or an array of numbers for a handle each.
|
|
86
|
+
*/
|
|
87
|
+
readonly value?: number | number[];
|
|
88
|
+
};
|
|
89
|
+
type SliderSize = 'lg' | 'md' | 'sm' | 'xl' | 'xs';
|
|
90
|
+
/**
|
|
91
|
+
* A slider for one value, or for a range when the value is an array. Its
|
|
92
|
+
* state is React Stately's, as web's is: pass `value` with `onChange` to
|
|
93
|
+
* control it, or `defaultValue` to let it keep its own, with `minValue`,
|
|
94
|
+
* `maxValue` and `step` to shape it and `formatOptions` to say how it reads.
|
|
95
|
+
*
|
|
96
|
+
* ```tsx
|
|
97
|
+
* <Slider defaultValue={40} label="Label" />
|
|
98
|
+
* ```
|
|
99
|
+
*
|
|
100
|
+
* A press on the track moves the nearest handle there, and a drag carries
|
|
101
|
+
* it. A screen reader hears each handle as an adjustable control named by the
|
|
102
|
+
* label, which it moves a step at a time. `style`, `ref` and `testID` land on
|
|
103
|
+
* the slider as a whole, which is the view a layout positions and the one
|
|
104
|
+
* that gives a vertical slider its height. With a `testID`, the drag and the
|
|
105
|
+
* press are registered with Gesture Handler as `<testID>-pan` and
|
|
106
|
+
* `<testID>-tap`, which its `getByGestureTestId` finds in a test.
|
|
107
|
+
*/
|
|
108
|
+
declare function Slider({ 'aria-label': ariaLabel, defaultValue, formatOptions, icon, isDisabled, label, maxValue, minValue, onChange, onChangeEnd, orientation, ref, showStops, size, step, style, testID, thumbLabels, value }: SliderProps): import("react").JSX.Element;
|
|
109
|
+
//#endregion
|
|
110
|
+
export { Slider, type SliderProps, type SliderSize };
|
|
111
|
+
//# sourceMappingURL=index.d.ts.map
|