@kanso-labs/react-native-kanso-ui 0.9.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/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 +44 -22
- package/dist/button/index.js.map +1 -1
- 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/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-group/index.d.ts +3 -4
- package/dist/components/checkbox-group/index.js +1 -1
- package/dist/components/checkbox-group/index.js.map +1 -1
- 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/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 +1 -1
- package/dist/components/fab/index.js +91 -76
- package/dist/components/fab/index.js.map +1 -1
- 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/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/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/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/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/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/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/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/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 +310 -154
- package/dist/field/index.js.map +1 -1
- package/dist/field/styles.js +9 -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 +5 -2
- 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 +35 -3
- package/dist/index.js +34 -3
- package/dist/indicator/paths.js +23 -1
- package/dist/indicator/paths.js.map +1 -1
- package/dist/modal/index.js +92 -77
- package/dist/modal/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 +13 -1
- 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/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/package.json +11 -2
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { useTheme } from "../theme/scope.js";
|
|
2
|
+
import { ChevronDownGlyph } from "../glyphs/index.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import Animated, { Easing, useAnimatedStyle, useReducedMotion, useSharedValue, withTiming } from "react-native-reanimated";
|
|
5
|
+
import { useEffect } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/field/chevron.tsx
|
|
8
|
+
const OPEN_TURN = -180;
|
|
9
|
+
/**
|
|
10
|
+
* The chevron in the trailing slot of a field that opens a list, pointing
|
|
11
|
+
* down at the list and turned to point up while it is open, on the step the
|
|
12
|
+
* list arrives on, short3 on the standard curve, and at once under reduced
|
|
13
|
+
* motion. It is the down chevron turned half a turn rather than web's end
|
|
14
|
+
* chevron turned a quarter either way, which draws the same two states; the
|
|
15
|
+
* down one does not mirror under right-to-left, so the turn needs no second
|
|
16
|
+
* direction. It takes its colour and size from the slot.
|
|
17
|
+
*/
|
|
18
|
+
function FieldChevron(t0) {
|
|
19
|
+
const $ = c(9);
|
|
20
|
+
const { isOpen } = t0;
|
|
21
|
+
const { motion } = useTheme();
|
|
22
|
+
const reduceMotion = useReducedMotion();
|
|
23
|
+
const turn = isOpen ? OPEN_TURN : 0;
|
|
24
|
+
const angle = useSharedValue(turn);
|
|
25
|
+
let t1;
|
|
26
|
+
let t2;
|
|
27
|
+
if ($[0] !== angle || $[1] !== motion || $[2] !== reduceMotion || $[3] !== turn) {
|
|
28
|
+
t1 = () => {
|
|
29
|
+
angle.set(reduceMotion ? turn : withTiming(turn, {
|
|
30
|
+
duration: motion.durationShort3,
|
|
31
|
+
easing: Easing.bezier(...motion.easingStandard)
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
34
|
+
t2 = [
|
|
35
|
+
angle,
|
|
36
|
+
motion,
|
|
37
|
+
reduceMotion,
|
|
38
|
+
turn
|
|
39
|
+
];
|
|
40
|
+
$[0] = angle;
|
|
41
|
+
$[1] = motion;
|
|
42
|
+
$[2] = reduceMotion;
|
|
43
|
+
$[3] = turn;
|
|
44
|
+
$[4] = t1;
|
|
45
|
+
$[5] = t2;
|
|
46
|
+
} else {
|
|
47
|
+
t1 = $[4];
|
|
48
|
+
t2 = $[5];
|
|
49
|
+
}
|
|
50
|
+
useEffect(t1, t2);
|
|
51
|
+
const turned = useAnimatedStyle(() => {
|
|
52
|
+
"worklet";
|
|
53
|
+
return { transform: [{ rotate: `${angle.get()}deg` }] };
|
|
54
|
+
});
|
|
55
|
+
let t3;
|
|
56
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
57
|
+
t3 = /* @__PURE__ */ jsx(ChevronDownGlyph, {});
|
|
58
|
+
$[6] = t3;
|
|
59
|
+
} else t3 = $[6];
|
|
60
|
+
let t4;
|
|
61
|
+
if ($[7] !== turned) {
|
|
62
|
+
t4 = /* @__PURE__ */ jsx(Animated.View, {
|
|
63
|
+
style: turned,
|
|
64
|
+
children: t3
|
|
65
|
+
});
|
|
66
|
+
$[7] = turned;
|
|
67
|
+
$[8] = t4;
|
|
68
|
+
} else t4 = $[8];
|
|
69
|
+
return t4;
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
export { FieldChevron };
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=chevron.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chevron.js","names":["useEffect","Animated","Easing","useAnimatedStyle","useReducedMotion","useSharedValue","withTiming","ChevronDownGlyph","useTheme","OPEN_TURN","FieldChevron","t0","$","_c","isOpen","motion","reduceMotion","turn","angle","t1","t2","set","duration","durationShort3","easing","bezier","easingStandard","turned","transform","rotate","get","t3","Symbol","for","t4","_c"],"sources":["../../src/field/chevron.tsx"],"sourcesContent":["import { useEffect } from 'react'\nimport Animated, {\n Easing,\n useAnimatedStyle,\n useReducedMotion,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated'\n\nimport { ChevronDownGlyph } from '../glyphs'\nimport { useTheme } from '../theme/scope'\n\n// How far the chevron turns while the list is open: half a turn, against\n// the clock as web's end chevron turns from pointing down to pointing up.\nconst OPEN_TURN = -180\n\n/**\n * The chevron in the trailing slot of a field that opens a list, pointing\n * down at the list and turned to point up while it is open, on the step the\n * list arrives on, short3 on the standard curve, and at once under reduced\n * motion. It is the down chevron turned half a turn rather than web's end\n * chevron turned a quarter either way, which draws the same two states; the\n * down one does not mirror under right-to-left, so the turn needs no second\n * direction. It takes its colour and size from the slot.\n */\nfunction FieldChevron({ isOpen }: { readonly isOpen: boolean }) {\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const turn = isOpen ? OPEN_TURN : 0\n const angle = useSharedValue(turn)\n\n useEffect(() => {\n angle.set(\n reduceMotion\n ? turn\n : withTiming(turn, {\n duration: motion.durationShort3,\n easing: Easing.bezier(...motion.easingStandard),\n }),\n )\n }, [angle, motion, reduceMotion, turn])\n\n const turned = useAnimatedStyle(() => {\n 'worklet'\n return { transform: [{ rotate: `${angle.get()}deg` }] }\n })\n\n return (\n <Animated.View style={turned}>\n <ChevronDownGlyph />\n </Animated.View>\n )\n}\n\nexport { FieldChevron }\n"],"mappings":";;;;;;;AAcA,MAAMS,YAAY;;;;;;;;;;AAWlB,SAAAC,aAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAsB,MAAA,EAAAC,WAAAH;CACpB,MAAA,EA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
|
-
import
|
|
1
|
+
import "../form/index.js";
|
|
2
|
+
import { HostInstance, StyleProp, TextInput, TextInputProps, ViewProps, ViewStyle } from "react-native";
|
|
2
3
|
import "react-native-reanimated";
|
|
3
4
|
import { ComponentRef, ReactNode, Ref, RefObject } from "react";
|
|
4
5
|
//#region src/field/index.d.ts
|