@thewhileloop/whileui 0.1.2 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +283 -38
- package/dist/blocks/layout/action-bar.d.ts +8 -0
- package/dist/blocks/layout/action-bar.d.ts.map +1 -0
- package/dist/blocks/layout/action-bar.js +10 -0
- package/dist/blocks/layout/action-bar.js.map +1 -0
- package/dist/blocks/layout/confirm-action-sheet.d.ts +24 -0
- package/dist/blocks/layout/confirm-action-sheet.d.ts.map +1 -0
- package/dist/blocks/layout/confirm-action-sheet.js +41 -0
- package/dist/blocks/layout/confirm-action-sheet.js.map +1 -0
- package/dist/blocks/layout/index.d.ts +2 -0
- package/dist/blocks/layout/index.d.ts.map +1 -1
- package/dist/blocks/layout/index.js +2 -0
- package/dist/blocks/layout/index.js.map +1 -1
- package/dist/blocks/navigation/index.d.ts +1 -0
- package/dist/blocks/navigation/index.d.ts.map +1 -1
- package/dist/blocks/navigation/index.js +1 -0
- package/dist/blocks/navigation/index.js.map +1 -1
- package/dist/blocks/navigation/navigation-sidebar.d.ts +23 -0
- package/dist/blocks/navigation/navigation-sidebar.d.ts.map +1 -0
- package/dist/blocks/navigation/navigation-sidebar.js +11 -0
- package/dist/blocks/navigation/navigation-sidebar.js.map +1 -0
- package/dist/components/card/card.d.ts +81 -2
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/card/card.js +27 -6
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/card/index.d.ts.map +1 -1
- package/dist/components/card/index.js +1 -1
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/data-row/data-row.d.ts +69 -0
- package/dist/components/data-row/data-row.d.ts.map +1 -0
- package/dist/components/data-row/data-row.js +89 -0
- package/dist/components/data-row/data-row.js.map +1 -0
- package/dist/components/data-row/index.d.ts +2 -0
- package/dist/components/data-row/index.d.ts.map +1 -0
- package/dist/components/data-row/index.js +2 -0
- package/dist/components/data-row/index.js.map +1 -0
- package/dist/components/form-field/form-field.d.ts +124 -0
- package/dist/components/form-field/form-field.d.ts.map +1 -0
- package/dist/components/form-field/form-field.js +68 -0
- package/dist/components/form-field/form-field.js.map +1 -0
- package/dist/components/form-field/index.d.ts +2 -0
- package/dist/components/form-field/index.d.ts.map +1 -0
- package/dist/components/form-field/index.js +2 -0
- package/dist/components/form-field/index.js.map +1 -0
- package/dist/components/labeled-field/index.d.ts +2 -0
- package/dist/components/labeled-field/index.d.ts.map +1 -0
- package/dist/components/labeled-field/index.js +2 -0
- package/dist/components/labeled-field/index.js.map +1 -0
- package/dist/components/labeled-field/labeled-field.d.ts +19 -0
- package/dist/components/labeled-field/labeled-field.d.ts.map +1 -0
- package/dist/components/labeled-field/labeled-field.js +15 -0
- package/dist/components/labeled-field/labeled-field.js.map +1 -0
- package/dist/components/numeric-input/index.d.ts +2 -0
- package/dist/components/numeric-input/index.d.ts.map +1 -0
- package/dist/components/numeric-input/index.js +2 -0
- package/dist/components/numeric-input/index.js.map +1 -0
- package/dist/components/numeric-input/numeric-input.d.ts +119 -0
- package/dist/components/numeric-input/numeric-input.d.ts.map +1 -0
- package/dist/components/numeric-input/numeric-input.js +129 -0
- package/dist/components/numeric-input/numeric-input.js.map +1 -0
- package/dist/components/segmented-control/index.d.ts +2 -0
- package/dist/components/segmented-control/index.d.ts.map +1 -0
- package/dist/components/segmented-control/index.js +2 -0
- package/dist/components/segmented-control/index.js.map +1 -0
- package/dist/components/segmented-control/segmented-control.d.ts +281 -0
- package/dist/components/segmented-control/segmented-control.d.ts.map +1 -0
- package/dist/components/segmented-control/segmented-control.js +112 -0
- package/dist/components/segmented-control/segmented-control.js.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/theme-bridge.d.ts +29 -0
- package/dist/lib/theme-bridge.d.ts.map +1 -0
- package/dist/lib/theme-bridge.js +79 -0
- package/dist/lib/theme-bridge.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { FormControl, FormField, FormHint, FormLabel, FormMessage, } from '../form-field';
|
|
5
|
+
import { cn } from '../../lib/cn';
|
|
6
|
+
function LabeledField({ label, hint, error, leftSlot, rightSlot, children, controlWrapperClassName, required, disabled, invalid, ...props }) {
|
|
7
|
+
const isInvalid = invalid ?? Boolean(error);
|
|
8
|
+
return (_jsxs(FormField, { required: required, disabled: disabled, invalid: isInvalid, ...props, children: [label ? _jsx(FormLabel, { children: label }) : null, _jsx(FormControl, { children: _jsxs(View, { className: cn('flex-row items-center gap-2 rounded-md border border-input bg-background px-3', isInvalid && 'border-destructive', disabled && 'opacity-60', controlWrapperClassName), children: [leftSlot ? _jsx(View, { className: "shrink-0", children: leftSlot }) : null, _jsx(View, { className: "min-h-10 min-w-0 flex-1 justify-center", children: children }), rightSlot ? _jsx(View, { className: "shrink-0", children: rightSlot }) : null] }) }), error ? _jsx(FormMessage, { children: error }) : hint ? _jsx(FormHint, { children: hint }) : null] }));
|
|
9
|
+
}
|
|
10
|
+
const LabeledFieldControl = React.forwardRef(({ className, ...props }, ref) => {
|
|
11
|
+
return _jsx(View, { ref: ref, className: cn('min-w-0 flex-1', className), ...props });
|
|
12
|
+
});
|
|
13
|
+
LabeledFieldControl.displayName = 'LabeledFieldControl';
|
|
14
|
+
export { LabeledField, LabeledFieldControl };
|
|
15
|
+
//# sourceMappingURL=labeled-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labeled-field.js","sourceRoot":"","sources":["../../../src/components/labeled-field/labeled-field.tsx"],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AAQ,cAAE,IAAI,GAAY,CAAC,CAAC,CAAC,IAAI,IAC7E,CACb,CAAC;AACJ,CAAC;AAED,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAC1C,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC/B,OAAO,KAAC,IAAI,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AACnF,CAAC,CACF,CAAC;AAEF,mBAAmB,CAAC,WAAW,GAAG,qBAAqB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/numeric-input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,wBAAwB,EACxB,KAAK,iBAAiB,GACvB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/numeric-input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,wBAAwB,GAEzB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextInput, type TextInputProps } from 'react-native';
|
|
3
|
+
import { type VariantProps } from '../../lib/tv';
|
|
4
|
+
declare const numericInputVariants: import("tailwind-variants").TVReturnType<{
|
|
5
|
+
variant: {
|
|
6
|
+
default: string;
|
|
7
|
+
error: string;
|
|
8
|
+
};
|
|
9
|
+
size: {
|
|
10
|
+
default: string;
|
|
11
|
+
compact: string;
|
|
12
|
+
};
|
|
13
|
+
}, undefined, "w-full flex-row items-center rounded-md border bg-background", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
14
|
+
variant: {
|
|
15
|
+
default: string;
|
|
16
|
+
error: string;
|
|
17
|
+
};
|
|
18
|
+
size: {
|
|
19
|
+
default: string;
|
|
20
|
+
compact: string;
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
variant: {
|
|
24
|
+
default: string;
|
|
25
|
+
error: string;
|
|
26
|
+
};
|
|
27
|
+
size: {
|
|
28
|
+
default: string;
|
|
29
|
+
compact: string;
|
|
30
|
+
};
|
|
31
|
+
}>, {
|
|
32
|
+
variant: {
|
|
33
|
+
default: string;
|
|
34
|
+
error: string;
|
|
35
|
+
};
|
|
36
|
+
size: {
|
|
37
|
+
default: string;
|
|
38
|
+
compact: string;
|
|
39
|
+
};
|
|
40
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
41
|
+
variant: {
|
|
42
|
+
default: string;
|
|
43
|
+
error: string;
|
|
44
|
+
};
|
|
45
|
+
size: {
|
|
46
|
+
default: string;
|
|
47
|
+
compact: string;
|
|
48
|
+
};
|
|
49
|
+
}, undefined, "w-full flex-row items-center rounded-md border bg-background", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
50
|
+
variant: {
|
|
51
|
+
default: string;
|
|
52
|
+
error: string;
|
|
53
|
+
};
|
|
54
|
+
size: {
|
|
55
|
+
default: string;
|
|
56
|
+
compact: string;
|
|
57
|
+
};
|
|
58
|
+
}, {
|
|
59
|
+
variant: {
|
|
60
|
+
default: string;
|
|
61
|
+
error: string;
|
|
62
|
+
};
|
|
63
|
+
size: {
|
|
64
|
+
default: string;
|
|
65
|
+
compact: string;
|
|
66
|
+
};
|
|
67
|
+
}>, unknown, unknown, undefined>>;
|
|
68
|
+
declare const numericInputTextVariants: import("tailwind-variants").TVReturnType<{
|
|
69
|
+
size: {
|
|
70
|
+
default: string;
|
|
71
|
+
compact: string;
|
|
72
|
+
};
|
|
73
|
+
}, undefined, "flex-1 px-3 py-2 text-foreground", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
74
|
+
size: {
|
|
75
|
+
default: string;
|
|
76
|
+
compact: string;
|
|
77
|
+
};
|
|
78
|
+
}, {
|
|
79
|
+
size: {
|
|
80
|
+
default: string;
|
|
81
|
+
compact: string;
|
|
82
|
+
};
|
|
83
|
+
}>, {
|
|
84
|
+
size: {
|
|
85
|
+
default: string;
|
|
86
|
+
compact: string;
|
|
87
|
+
};
|
|
88
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
89
|
+
size: {
|
|
90
|
+
default: string;
|
|
91
|
+
compact: string;
|
|
92
|
+
};
|
|
93
|
+
}, undefined, "flex-1 px-3 py-2 text-foreground", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
94
|
+
size: {
|
|
95
|
+
default: string;
|
|
96
|
+
compact: string;
|
|
97
|
+
};
|
|
98
|
+
}, {
|
|
99
|
+
size: {
|
|
100
|
+
default: string;
|
|
101
|
+
compact: string;
|
|
102
|
+
};
|
|
103
|
+
}>, unknown, unknown, undefined>>;
|
|
104
|
+
export interface NumericInputProps extends Omit<TextInputProps, 'value' | 'defaultValue' | 'onChangeText' | 'keyboardType'>, VariantProps<typeof numericInputVariants> {
|
|
105
|
+
className?: string;
|
|
106
|
+
inputClassName?: string;
|
|
107
|
+
prefix?: React.ReactNode;
|
|
108
|
+
suffix?: React.ReactNode;
|
|
109
|
+
value?: number | null;
|
|
110
|
+
defaultValue?: number;
|
|
111
|
+
onValueChange?: (value: number | null) => void;
|
|
112
|
+
min?: number;
|
|
113
|
+
max?: number;
|
|
114
|
+
step?: number;
|
|
115
|
+
showSteppers?: boolean;
|
|
116
|
+
}
|
|
117
|
+
declare const NumericInput: React.ForwardRefExoticComponent<NumericInputProps & React.RefAttributes<TextInput>>;
|
|
118
|
+
export { NumericInput, numericInputVariants, numericInputTextVariants };
|
|
119
|
+
//# sourceMappingURL=numeric-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numeric-input.d.ts","sourceRoot":"","sources":["../../../src/components/numeric-input/numeric-input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3
|
+
import { Pressable, Text, TextInput, View } from 'react-native';
|
|
4
|
+
import { cn } from '../../lib/cn';
|
|
5
|
+
import { tv } from '../../lib/tv';
|
|
6
|
+
const numericInputVariants = tv({
|
|
7
|
+
base: 'w-full flex-row items-center rounded-md border bg-background',
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: 'border-input',
|
|
11
|
+
error: 'border-destructive',
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
default: 'h-10',
|
|
15
|
+
compact: 'h-9',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
variant: 'default',
|
|
20
|
+
size: 'default',
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
const numericInputTextVariants = tv({
|
|
24
|
+
base: 'flex-1 px-3 py-2 text-foreground',
|
|
25
|
+
variants: {
|
|
26
|
+
size: {
|
|
27
|
+
default: 'text-sm',
|
|
28
|
+
compact: 'text-xs',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
size: 'default',
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
const stepperButtonVariants = tv({
|
|
36
|
+
base: 'h-full w-11 items-center justify-center active:opacity-70',
|
|
37
|
+
variants: {
|
|
38
|
+
size: {
|
|
39
|
+
default: 'px-3',
|
|
40
|
+
compact: 'px-2',
|
|
41
|
+
},
|
|
42
|
+
disabled: {
|
|
43
|
+
true: 'opacity-40',
|
|
44
|
+
false: '',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
defaultVariants: {
|
|
48
|
+
size: 'default',
|
|
49
|
+
disabled: false,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
function toInputText(value) {
|
|
53
|
+
if (value === null || value === undefined) {
|
|
54
|
+
return '';
|
|
55
|
+
}
|
|
56
|
+
return Number.isFinite(value) ? String(value) : '';
|
|
57
|
+
}
|
|
58
|
+
function parseNumericText(text) {
|
|
59
|
+
const normalized = text.replace(',', '.').trim();
|
|
60
|
+
if (!normalized || normalized === '-' || normalized === '.' || normalized === '-.') {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
const parsed = Number.parseFloat(normalized);
|
|
64
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
65
|
+
}
|
|
66
|
+
function clampValue(value, min, max) {
|
|
67
|
+
let next = value;
|
|
68
|
+
if (min !== undefined && next < min) {
|
|
69
|
+
next = min;
|
|
70
|
+
}
|
|
71
|
+
if (max !== undefined && next > max) {
|
|
72
|
+
next = max;
|
|
73
|
+
}
|
|
74
|
+
return next;
|
|
75
|
+
}
|
|
76
|
+
const NumericInput = React.forwardRef(({ className, inputClassName, prefix, suffix, value, defaultValue, onValueChange, min, max, step = 1, showSteppers = false, variant = 'default', size = 'default', editable = true, placeholderTextColor = '#737373', onBlur, ...props }, ref) => {
|
|
77
|
+
const [internalText, setInternalText] = useState(() => toInputText(defaultValue));
|
|
78
|
+
const isControlled = value !== undefined;
|
|
79
|
+
const textValue = isControlled ? toInputText(value) : internalText;
|
|
80
|
+
const currentValue = useMemo(() => parseNumericText(textValue), [textValue]);
|
|
81
|
+
const setTextAndValue = useCallback((nextText) => {
|
|
82
|
+
if (!isControlled) {
|
|
83
|
+
setInternalText(nextText);
|
|
84
|
+
}
|
|
85
|
+
onValueChange?.(parseNumericText(nextText));
|
|
86
|
+
}, [isControlled, onValueChange]);
|
|
87
|
+
const applyNumericValue = useCallback((nextValue) => {
|
|
88
|
+
if (nextValue === null) {
|
|
89
|
+
if (!isControlled) {
|
|
90
|
+
setInternalText('');
|
|
91
|
+
}
|
|
92
|
+
onValueChange?.(null);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const clamped = clampValue(nextValue, min, max);
|
|
96
|
+
if (!isControlled) {
|
|
97
|
+
setInternalText(toInputText(clamped));
|
|
98
|
+
}
|
|
99
|
+
onValueChange?.(clamped);
|
|
100
|
+
}, [isControlled, max, min, onValueChange]);
|
|
101
|
+
const handleTextChange = (nextText) => {
|
|
102
|
+
const isNumericLike = /^-?\d*(?:[.,]\d*)?$/.test(nextText);
|
|
103
|
+
if (!isNumericLike) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
setTextAndValue(nextText);
|
|
107
|
+
};
|
|
108
|
+
const handleBlur = (event) => {
|
|
109
|
+
const parsed = parseNumericText(textValue);
|
|
110
|
+
if (parsed !== null) {
|
|
111
|
+
const clamped = clampValue(parsed, min, max);
|
|
112
|
+
if (!isControlled) {
|
|
113
|
+
setInternalText(toInputText(clamped));
|
|
114
|
+
}
|
|
115
|
+
onValueChange?.(clamped);
|
|
116
|
+
}
|
|
117
|
+
onBlur?.(event);
|
|
118
|
+
};
|
|
119
|
+
const canDecrease = editable && (min === undefined || currentValue === null || currentValue > min);
|
|
120
|
+
const canIncrease = editable && (max === undefined || currentValue === null || currentValue < max);
|
|
121
|
+
const nudge = (delta) => {
|
|
122
|
+
const baseline = currentValue ?? min ?? 0;
|
|
123
|
+
applyNumericValue(baseline + delta * step);
|
|
124
|
+
};
|
|
125
|
+
return (_jsxs(View, { className: cn(numericInputVariants({ variant, size }), !editable && 'opacity-50', className), children: [prefix ? _jsx(View, { className: "shrink-0 pl-3", children: prefix }) : null, _jsx(TextInput, { ref: ref, className: cn(numericInputTextVariants({ size }), inputClassName), value: textValue, onChangeText: handleTextChange, onBlur: handleBlur, keyboardType: "decimal-pad", editable: editable, placeholderTextColor: placeholderTextColor, ...props }), suffix ? _jsx(View, { className: "shrink-0 pr-3", children: suffix }) : null, showSteppers ? (_jsxs(View, { className: "ml-1 h-full flex-row border-l border-input", children: [_jsx(Pressable, { className: cn(stepperButtonVariants({ size, disabled: !canDecrease })), onPress: () => nudge(-1), disabled: !canDecrease, hitSlop: 4, accessibilityRole: "button", accessibilityLabel: "Decrease value", children: _jsx(Text, { className: "text-base font-medium text-foreground", children: "-" }) }), _jsx(Pressable, { className: cn(stepperButtonVariants({ size, disabled: !canIncrease })), onPress: () => nudge(1), disabled: !canIncrease, hitSlop: 4, accessibilityRole: "button", accessibilityLabel: "Increase value", children: _jsx(Text, { className: "text-base font-medium text-foreground", children: "+" }) })] })) : null] }));
|
|
126
|
+
});
|
|
127
|
+
NumericInput.displayName = 'NumericInput';
|
|
128
|
+
export { NumericInput, numericInputVariants, numericInputTextVariants };
|
|
129
|
+
//# sourceMappingURL=numeric-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numeric-input.js","sourceRoot":"","sources":["../../../src/components/numeric-input/numeric-input.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAuB,MAAM,cAAc,CAAC;AACrF,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,EAAE,EAAqB,MAAM,cAAc,CAAC;AAErD,MAAM,oBAAoB,GAAG,EAAE,CAAC;IAC9B,IAAI,EAAE,8DAA8D;IACpE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,cAAc;YACvB,KAAK,EAAE,oBAAoB;SAC5B;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM;YACf,OAAO,EAAE,KAAK;SACf;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,SAAS;KAChB;CACF,CAAC,CAAC;AAEH,MAAM,wBAAwB,GAAG,EAAE,CAAC;IAClC,IAAI,EAAE,kCAAkC;IACxC,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE,SAAS;YAClB,OAAO,EAAE,SAAS;SACnB;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,SAAS;KAChB;CACF,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAAG,EAAE,CAAC;IAC/B,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,CAAC,CAAC,CAAC,CAAC,EACxB,QAAQ,EAAE,CAAC,WAAW,EACtB,OAAO,EAAE,CAAC,EACV,iBAAiB,EAAC,QAAQ,EAC1B,kBAAkB,EAAC,gBAAgB,YAEnC,KAAC,IAAI,IAAC,SAAS,EAAC,uCAAuC,kBAAS,GACtD,EACZ,KAAC,SAAS,IACR,SAAS,EAAE,EAAE,CAAC,qBAAqB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,EACtE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EACvB,QAAQ,EAAE,CAAC,WAAW,EACtB,OAAO,EAAE,CAAC,EACV,iBAAiB,EAAC,QAAQ,EAC1B,kBAAkB,EAAC,gBAAgB,YAEnC,KAAC,IAAI,IAAC,SAAS,EAAC,uCAAuC,kBAAS,GACtD,IACP,CACR,CAAC,CAAC,CAAC,IAAI,IACH,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { SegmentedControl, SegmentedControlItem, SegmentedControlItemText, segmentedControlVariants, segmentedControlItemVariants, segmentedControlItemTextVariants, type SegmentedControlProps, type SegmentedControlItemProps, type SegmentedControlItemTextProps, } from './segmented-control';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/segmented-control/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,gCAAgC,EAChC,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,6BAA6B,GACnC,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/segmented-control/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,gCAAgC,GAIjC,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type PressableProps, type TextProps, type ViewProps } from 'react-native';
|
|
3
|
+
declare const segmentedControlVariants: import("tailwind-variants").TVReturnType<{
|
|
4
|
+
wrap: {
|
|
5
|
+
true: string;
|
|
6
|
+
false: string;
|
|
7
|
+
};
|
|
8
|
+
size: {
|
|
9
|
+
default: string;
|
|
10
|
+
compact: string;
|
|
11
|
+
};
|
|
12
|
+
}, undefined, "w-full flex-row items-center rounded-lg bg-muted p-1", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
13
|
+
wrap: {
|
|
14
|
+
true: string;
|
|
15
|
+
false: string;
|
|
16
|
+
};
|
|
17
|
+
size: {
|
|
18
|
+
default: string;
|
|
19
|
+
compact: string;
|
|
20
|
+
};
|
|
21
|
+
}, {
|
|
22
|
+
wrap: {
|
|
23
|
+
true: string;
|
|
24
|
+
false: string;
|
|
25
|
+
};
|
|
26
|
+
size: {
|
|
27
|
+
default: string;
|
|
28
|
+
compact: string;
|
|
29
|
+
};
|
|
30
|
+
}>, {
|
|
31
|
+
wrap: {
|
|
32
|
+
true: string;
|
|
33
|
+
false: string;
|
|
34
|
+
};
|
|
35
|
+
size: {
|
|
36
|
+
default: string;
|
|
37
|
+
compact: string;
|
|
38
|
+
};
|
|
39
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
40
|
+
wrap: {
|
|
41
|
+
true: string;
|
|
42
|
+
false: string;
|
|
43
|
+
};
|
|
44
|
+
size: {
|
|
45
|
+
default: string;
|
|
46
|
+
compact: string;
|
|
47
|
+
};
|
|
48
|
+
}, undefined, "w-full flex-row items-center rounded-lg bg-muted p-1", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
49
|
+
wrap: {
|
|
50
|
+
true: string;
|
|
51
|
+
false: string;
|
|
52
|
+
};
|
|
53
|
+
size: {
|
|
54
|
+
default: string;
|
|
55
|
+
compact: string;
|
|
56
|
+
};
|
|
57
|
+
}, {
|
|
58
|
+
wrap: {
|
|
59
|
+
true: string;
|
|
60
|
+
false: string;
|
|
61
|
+
};
|
|
62
|
+
size: {
|
|
63
|
+
default: string;
|
|
64
|
+
compact: string;
|
|
65
|
+
};
|
|
66
|
+
}>, unknown, unknown, undefined>>;
|
|
67
|
+
declare const segmentedControlItemVariants: import("tailwind-variants").TVReturnType<{
|
|
68
|
+
selected: {
|
|
69
|
+
true: string;
|
|
70
|
+
false: string;
|
|
71
|
+
};
|
|
72
|
+
size: {
|
|
73
|
+
default: string;
|
|
74
|
+
compact: string;
|
|
75
|
+
};
|
|
76
|
+
disabled: {
|
|
77
|
+
true: string;
|
|
78
|
+
false: string;
|
|
79
|
+
};
|
|
80
|
+
wrap: {
|
|
81
|
+
true: string;
|
|
82
|
+
false: string;
|
|
83
|
+
};
|
|
84
|
+
}, undefined, "min-h-10 min-w-0 flex-row items-center justify-center rounded-md px-3 active:opacity-70", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
85
|
+
selected: {
|
|
86
|
+
true: string;
|
|
87
|
+
false: string;
|
|
88
|
+
};
|
|
89
|
+
size: {
|
|
90
|
+
default: string;
|
|
91
|
+
compact: string;
|
|
92
|
+
};
|
|
93
|
+
disabled: {
|
|
94
|
+
true: string;
|
|
95
|
+
false: string;
|
|
96
|
+
};
|
|
97
|
+
wrap: {
|
|
98
|
+
true: string;
|
|
99
|
+
false: string;
|
|
100
|
+
};
|
|
101
|
+
}, {
|
|
102
|
+
selected: {
|
|
103
|
+
true: string;
|
|
104
|
+
false: string;
|
|
105
|
+
};
|
|
106
|
+
size: {
|
|
107
|
+
default: string;
|
|
108
|
+
compact: string;
|
|
109
|
+
};
|
|
110
|
+
disabled: {
|
|
111
|
+
true: string;
|
|
112
|
+
false: string;
|
|
113
|
+
};
|
|
114
|
+
wrap: {
|
|
115
|
+
true: string;
|
|
116
|
+
false: string;
|
|
117
|
+
};
|
|
118
|
+
}>, {
|
|
119
|
+
selected: {
|
|
120
|
+
true: string;
|
|
121
|
+
false: string;
|
|
122
|
+
};
|
|
123
|
+
size: {
|
|
124
|
+
default: string;
|
|
125
|
+
compact: string;
|
|
126
|
+
};
|
|
127
|
+
disabled: {
|
|
128
|
+
true: string;
|
|
129
|
+
false: string;
|
|
130
|
+
};
|
|
131
|
+
wrap: {
|
|
132
|
+
true: string;
|
|
133
|
+
false: string;
|
|
134
|
+
};
|
|
135
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
136
|
+
selected: {
|
|
137
|
+
true: string;
|
|
138
|
+
false: string;
|
|
139
|
+
};
|
|
140
|
+
size: {
|
|
141
|
+
default: string;
|
|
142
|
+
compact: string;
|
|
143
|
+
};
|
|
144
|
+
disabled: {
|
|
145
|
+
true: string;
|
|
146
|
+
false: string;
|
|
147
|
+
};
|
|
148
|
+
wrap: {
|
|
149
|
+
true: string;
|
|
150
|
+
false: string;
|
|
151
|
+
};
|
|
152
|
+
}, undefined, "min-h-10 min-w-0 flex-row items-center justify-center rounded-md px-3 active:opacity-70", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
153
|
+
selected: {
|
|
154
|
+
true: string;
|
|
155
|
+
false: string;
|
|
156
|
+
};
|
|
157
|
+
size: {
|
|
158
|
+
default: string;
|
|
159
|
+
compact: string;
|
|
160
|
+
};
|
|
161
|
+
disabled: {
|
|
162
|
+
true: string;
|
|
163
|
+
false: string;
|
|
164
|
+
};
|
|
165
|
+
wrap: {
|
|
166
|
+
true: string;
|
|
167
|
+
false: string;
|
|
168
|
+
};
|
|
169
|
+
}, {
|
|
170
|
+
selected: {
|
|
171
|
+
true: string;
|
|
172
|
+
false: string;
|
|
173
|
+
};
|
|
174
|
+
size: {
|
|
175
|
+
default: string;
|
|
176
|
+
compact: string;
|
|
177
|
+
};
|
|
178
|
+
disabled: {
|
|
179
|
+
true: string;
|
|
180
|
+
false: string;
|
|
181
|
+
};
|
|
182
|
+
wrap: {
|
|
183
|
+
true: string;
|
|
184
|
+
false: string;
|
|
185
|
+
};
|
|
186
|
+
}>, unknown, unknown, undefined>>;
|
|
187
|
+
declare const segmentedControlItemTextVariants: import("tailwind-variants").TVReturnType<{
|
|
188
|
+
selected: {
|
|
189
|
+
true: string;
|
|
190
|
+
false: string;
|
|
191
|
+
};
|
|
192
|
+
size: {
|
|
193
|
+
default: string;
|
|
194
|
+
compact: string;
|
|
195
|
+
};
|
|
196
|
+
}, undefined, "font-medium", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
197
|
+
selected: {
|
|
198
|
+
true: string;
|
|
199
|
+
false: string;
|
|
200
|
+
};
|
|
201
|
+
size: {
|
|
202
|
+
default: string;
|
|
203
|
+
compact: string;
|
|
204
|
+
};
|
|
205
|
+
}, {
|
|
206
|
+
selected: {
|
|
207
|
+
true: string;
|
|
208
|
+
false: string;
|
|
209
|
+
};
|
|
210
|
+
size: {
|
|
211
|
+
default: string;
|
|
212
|
+
compact: string;
|
|
213
|
+
};
|
|
214
|
+
}>, {
|
|
215
|
+
selected: {
|
|
216
|
+
true: string;
|
|
217
|
+
false: string;
|
|
218
|
+
};
|
|
219
|
+
size: {
|
|
220
|
+
default: string;
|
|
221
|
+
compact: string;
|
|
222
|
+
};
|
|
223
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
224
|
+
selected: {
|
|
225
|
+
true: string;
|
|
226
|
+
false: string;
|
|
227
|
+
};
|
|
228
|
+
size: {
|
|
229
|
+
default: string;
|
|
230
|
+
compact: string;
|
|
231
|
+
};
|
|
232
|
+
}, undefined, "font-medium", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
233
|
+
selected: {
|
|
234
|
+
true: string;
|
|
235
|
+
false: string;
|
|
236
|
+
};
|
|
237
|
+
size: {
|
|
238
|
+
default: string;
|
|
239
|
+
compact: string;
|
|
240
|
+
};
|
|
241
|
+
}, {
|
|
242
|
+
selected: {
|
|
243
|
+
true: string;
|
|
244
|
+
false: string;
|
|
245
|
+
};
|
|
246
|
+
size: {
|
|
247
|
+
default: string;
|
|
248
|
+
compact: string;
|
|
249
|
+
};
|
|
250
|
+
}>, unknown, unknown, undefined>>;
|
|
251
|
+
export interface SegmentedControlProps extends ViewProps {
|
|
252
|
+
value?: string;
|
|
253
|
+
defaultValue?: string;
|
|
254
|
+
onValueChange?: (value: string) => void;
|
|
255
|
+
wrap?: boolean | 'auto';
|
|
256
|
+
size?: 'default' | 'compact';
|
|
257
|
+
disabled?: boolean;
|
|
258
|
+
className?: string;
|
|
259
|
+
}
|
|
260
|
+
export interface SegmentedControlItemProps extends Omit<PressableProps, 'children'> {
|
|
261
|
+
value: string;
|
|
262
|
+
children?: React.ReactNode;
|
|
263
|
+
className?: string;
|
|
264
|
+
}
|
|
265
|
+
export interface SegmentedControlItemTextProps extends TextProps {
|
|
266
|
+
className?: string;
|
|
267
|
+
}
|
|
268
|
+
declare function SegmentedControl({ value: controlledValue, defaultValue, onValueChange, wrap, size, disabled, className, children, ...props }: SegmentedControlProps): import("react/jsx-runtime").JSX.Element;
|
|
269
|
+
declare namespace SegmentedControl {
|
|
270
|
+
var displayName: string;
|
|
271
|
+
}
|
|
272
|
+
declare function SegmentedControlItem({ value: itemValue, className, children, disabled: itemDisabled, ...props }: SegmentedControlItemProps): import("react/jsx-runtime").JSX.Element;
|
|
273
|
+
declare namespace SegmentedControlItem {
|
|
274
|
+
var displayName: string;
|
|
275
|
+
}
|
|
276
|
+
declare function SegmentedControlItemText({ className, ...props }: SegmentedControlItemTextProps): import("react/jsx-runtime").JSX.Element;
|
|
277
|
+
declare namespace SegmentedControlItemText {
|
|
278
|
+
var displayName: string;
|
|
279
|
+
}
|
|
280
|
+
export { SegmentedControl, SegmentedControlItem, SegmentedControlItemText, segmentedControlVariants, segmentedControlItemVariants, segmentedControlItemTextVariants, };
|
|
281
|
+
//# sourceMappingURL=segmented-control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segmented-control.d.ts","sourceRoot":"","sources":["../../../src/components/segmented-control/segmented-control.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAC5E,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAItB,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAgB5B,CAAC;AAEH,QAAA,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCA0BhC,CAAC;AAEH,QAAA,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAgBpC,CAAC;AA4BH,MAAM,WAAW,qBAAsB,SAAQ,SAAS;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,yBAA0B,SAAQ,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC;IACjF,KAAK,EAAE,MAAM,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