@ecohouse/ui 0.1.35 → 0.1.38
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 +3 -0
- package/dist/index.cjs +1221 -531
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +231 -128
- package/dist/index.d.ts +231 -128
- package/dist/index.js +1144 -463
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.stories.tsx +47 -0
- package/src/components/Accordion/Accordion.tsx +165 -0
- package/src/components/Accordion/index.ts +2 -0
- package/src/components/AutocompleteInput/AutocompleteInput.stories.tsx +80 -0
- package/src/components/AutocompleteInput/AutocompleteInput.tsx +313 -0
- package/src/components/AutocompleteInput/index.ts +2 -0
- package/src/components/Counter/Counter.tsx +61 -26
- package/src/components/QuantityInput/QuantityInput.stories.tsx +45 -0
- package/src/components/QuantityInput/QuantityInput.tsx +153 -0
- package/src/components/QuantityInput/index.ts +2 -0
- package/src/components/SegmentedToggle/SegmentedToggle.stories.tsx +9 -0
- package/src/components/SegmentedToggle/SegmentedToggle.tsx +19 -13
- package/src/components/index.ts +9 -0
- package/src/icons/ArrowLeft/ArrowLeftIcon.test.ts +10 -0
- package/src/icons/ArrowLeft/ArrowLeftIcon.tsx +21 -0
- package/src/icons/ArrowLeft/ArrowLeftIcon.web.tsx +26 -0
- package/src/icons/ArrowLeft/arrowLeftPath.ts +3 -0
- package/src/icons/ArrowLeft/index.ts +1 -0
- package/src/icons/CurrentLocation/CurrentLocationIcon.test.ts +10 -0
- package/src/icons/CurrentLocation/CurrentLocationIcon.tsx +25 -0
- package/src/icons/CurrentLocation/CurrentLocationIcon.web.tsx +30 -0
- package/src/icons/CurrentLocation/currentLocationPath.ts +3 -0
- package/src/icons/CurrentLocation/index.ts +1 -0
- package/src/icons/MoreHorizontal/MoreHorizontalIcon.tsx +26 -0
- package/src/icons/MoreHorizontal/MoreHorizontalIcon.web.tsx +25 -0
- package/src/icons/MoreHorizontal/index.ts +1 -0
- package/src/icons/MoreHorizontal/moreHorizontalPath.ts +2 -0
- package/src/icons/TableView/TableViewIcon.tsx +20 -0
- package/src/icons/TableView/TableViewIcon.web.tsx +26 -0
- package/src/icons/TableView/index.ts +1 -0
- package/src/icons/TableView/tableViewPath.ts +2 -0
- package/src/icons/index.ts +4 -0
- package/src/icons/registry.ts +12 -0
- package/src/index.ts +15 -0
- package/src/primitives/IconStatusBadge/IconStatusBadge.stories.tsx +21 -0
- package/src/primitives/IconStatusBadge/IconStatusBadge.tsx +76 -0
- package/src/primitives/IconStatusBadge/index.ts +2 -0
- package/src/primitives/InfoCardV2/InfoCardV2.stories.tsx +64 -0
- package/src/primitives/InfoCardV2/InfoCardV2.tsx +116 -0
- package/src/primitives/InfoCardV2/index.ts +2 -0
- package/src/primitives/index.ts +7 -0
- package/src/theme/colors.test.ts +1 -0
- package/src/theme/colors.ts +1 -0
|
@@ -23,6 +23,8 @@ export interface CounterProps extends Omit<ViewProps, "style" | "children"> {
|
|
|
23
23
|
max?: number;
|
|
24
24
|
step?: number;
|
|
25
25
|
disabled?: boolean;
|
|
26
|
+
/** Places the value before both controls for use inside input-like fields. */
|
|
27
|
+
layout?: "controls-around" | "value-first";
|
|
26
28
|
style?: StyleProp<ViewStyle>;
|
|
27
29
|
className?: string;
|
|
28
30
|
hitSlop?: PressableProps["hitSlop"];
|
|
@@ -51,6 +53,7 @@ export const Counter = forwardRef<ComponentRef<typeof View>, CounterProps>(funct
|
|
|
51
53
|
max,
|
|
52
54
|
step = 1,
|
|
53
55
|
disabled = false,
|
|
56
|
+
layout = "controls-around",
|
|
54
57
|
style,
|
|
55
58
|
className,
|
|
56
59
|
hitSlop,
|
|
@@ -78,33 +81,57 @@ export const Counter = forwardRef<ComponentRef<typeof View>, CounterProps>(funct
|
|
|
78
81
|
onValueChange?.(next);
|
|
79
82
|
};
|
|
80
83
|
|
|
81
|
-
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
84
|
+
const decrement = (
|
|
85
|
+
<Pressable
|
|
86
|
+
disabled={decrementDisabled}
|
|
87
|
+
hitSlop={hitSlop}
|
|
88
|
+
onPress={() => updateValue(resolvedValue - step)}
|
|
89
|
+
accessibilityRole="button"
|
|
90
|
+
accessibilityLabel="Decrease value"
|
|
91
|
+
accessibilityState={{ disabled: decrementDisabled }}
|
|
92
|
+
style={[styles.button, webBlurStyle, decrementDisabled && styles.buttonDisabled]}
|
|
93
|
+
>
|
|
94
|
+
<MinusIcon />
|
|
95
|
+
</Pressable>
|
|
96
|
+
);
|
|
97
|
+
const increment = (
|
|
98
|
+
<Pressable
|
|
99
|
+
disabled={incrementDisabled}
|
|
100
|
+
hitSlop={hitSlop}
|
|
101
|
+
onPress={() => updateValue(resolvedValue + step)}
|
|
102
|
+
accessibilityRole="button"
|
|
103
|
+
accessibilityLabel="Increase value"
|
|
104
|
+
accessibilityState={{ disabled: incrementDisabled }}
|
|
105
|
+
style={[styles.button, webBlurStyle, incrementDisabled && styles.buttonDisabled]}
|
|
106
|
+
>
|
|
107
|
+
<PlusIcon />
|
|
108
|
+
</Pressable>
|
|
109
|
+
);
|
|
110
|
+
const valueNode = (
|
|
111
|
+
<Text style={[styles.value, layout === "value-first" && styles.leadingValue]}>
|
|
112
|
+
{resolvedValue}
|
|
113
|
+
</Text>
|
|
114
|
+
);
|
|
96
115
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
116
|
+
return (
|
|
117
|
+
<View
|
|
118
|
+
{...rest}
|
|
119
|
+
ref={setContainerRef}
|
|
120
|
+
style={[styles.base, layout === "value-first" && styles.valueFirst, style]}
|
|
121
|
+
>
|
|
122
|
+
{layout === "value-first" ? (
|
|
123
|
+
<>
|
|
124
|
+
{valueNode}
|
|
125
|
+
{decrement}
|
|
126
|
+
{increment}
|
|
127
|
+
</>
|
|
128
|
+
) : (
|
|
129
|
+
<>
|
|
130
|
+
{decrement}
|
|
131
|
+
{valueNode}
|
|
132
|
+
{increment}
|
|
133
|
+
</>
|
|
134
|
+
)}
|
|
108
135
|
</View>
|
|
109
136
|
);
|
|
110
137
|
});
|
|
@@ -116,6 +143,11 @@ const styles = StyleSheet.create({
|
|
|
116
143
|
alignSelf: "flex-start",
|
|
117
144
|
gap: 17,
|
|
118
145
|
},
|
|
146
|
+
valueFirst: {
|
|
147
|
+
alignSelf: "stretch",
|
|
148
|
+
flex: 1,
|
|
149
|
+
gap: 6,
|
|
150
|
+
},
|
|
119
151
|
button: {
|
|
120
152
|
width: BUTTON_SIZE,
|
|
121
153
|
height: BUTTON_SIZE,
|
|
@@ -132,4 +164,7 @@ const styles = StyleSheet.create({
|
|
|
132
164
|
...counterTypography,
|
|
133
165
|
color: colors.white,
|
|
134
166
|
},
|
|
167
|
+
leadingValue: {
|
|
168
|
+
flex: 1,
|
|
169
|
+
},
|
|
135
170
|
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import { GuestsIcon } from "../../icons";
|
|
4
|
+
import { QuantityInput } from "./QuantityInput";
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Components/QuantityInput",
|
|
8
|
+
component: QuantityInput,
|
|
9
|
+
args: {
|
|
10
|
+
label: "Maximum guests",
|
|
11
|
+
icon: GuestsIcon,
|
|
12
|
+
defaultValue: 1,
|
|
13
|
+
min: 1,
|
|
14
|
+
},
|
|
15
|
+
parameters: {
|
|
16
|
+
backgrounds: { default: "black" },
|
|
17
|
+
},
|
|
18
|
+
} satisfies Meta<typeof QuantityInput>;
|
|
19
|
+
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj<typeof meta>;
|
|
22
|
+
|
|
23
|
+
export const Default: Story = {};
|
|
24
|
+
|
|
25
|
+
export const WithError: Story = {
|
|
26
|
+
args: { error: true, hint: "Choose at least one guest" },
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
function ControlledQuantityInput() {
|
|
30
|
+
const [value, setValue] = useState(1);
|
|
31
|
+
return (
|
|
32
|
+
<QuantityInput
|
|
33
|
+
icon={GuestsIcon}
|
|
34
|
+
label="Maximum guests"
|
|
35
|
+
max={20}
|
|
36
|
+
min={1}
|
|
37
|
+
onValueChange={setValue}
|
|
38
|
+
value={value}
|
|
39
|
+
/>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const Controlled: Story = {
|
|
44
|
+
render: () => <ControlledQuantityInput />,
|
|
45
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { forwardRef, useMemo, useRef, type ComponentRef } from "react";
|
|
2
|
+
import {
|
|
3
|
+
StyleSheet,
|
|
4
|
+
Text,
|
|
5
|
+
View,
|
|
6
|
+
type StyleProp,
|
|
7
|
+
type ViewProps,
|
|
8
|
+
type ViewStyle,
|
|
9
|
+
} from "react-native";
|
|
10
|
+
import type { IconComponent, IconProps } from "../../icons";
|
|
11
|
+
import { colors, fonts } from "../../theme";
|
|
12
|
+
import { mergeRefs } from "../../utils/mergeRefs";
|
|
13
|
+
import { useApplyWebClassName } from "../../utils/useApplyWebClassName";
|
|
14
|
+
import { Counter } from "../Counter";
|
|
15
|
+
|
|
16
|
+
export interface QuantityInputProps extends Omit<ViewProps, "style" | "children"> {
|
|
17
|
+
label: string;
|
|
18
|
+
icon: IconComponent;
|
|
19
|
+
iconProps?: Omit<IconProps, "size">;
|
|
20
|
+
iconSize?: number;
|
|
21
|
+
value?: number;
|
|
22
|
+
defaultValue?: number;
|
|
23
|
+
onValueChange?: (value: number) => void;
|
|
24
|
+
min?: number;
|
|
25
|
+
max?: number;
|
|
26
|
+
step?: number;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
error?: boolean;
|
|
29
|
+
hint?: string;
|
|
30
|
+
showHint?: boolean;
|
|
31
|
+
style?: StyleProp<ViewStyle>;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Input-like labeled quantity control with an icon and increment/decrement actions. */
|
|
36
|
+
export const QuantityInput = forwardRef<ComponentRef<typeof View>, QuantityInputProps>(
|
|
37
|
+
function QuantityInput(
|
|
38
|
+
{
|
|
39
|
+
label,
|
|
40
|
+
icon: Icon,
|
|
41
|
+
iconProps,
|
|
42
|
+
iconSize = 20,
|
|
43
|
+
value,
|
|
44
|
+
defaultValue,
|
|
45
|
+
onValueChange,
|
|
46
|
+
min = 1,
|
|
47
|
+
max,
|
|
48
|
+
step = 1,
|
|
49
|
+
disabled = false,
|
|
50
|
+
error = false,
|
|
51
|
+
hint,
|
|
52
|
+
showHint = true,
|
|
53
|
+
style,
|
|
54
|
+
className,
|
|
55
|
+
accessibilityLabel,
|
|
56
|
+
...rest
|
|
57
|
+
},
|
|
58
|
+
forwardedRef,
|
|
59
|
+
) {
|
|
60
|
+
const rootRef = useRef<ComponentRef<typeof View>>(null);
|
|
61
|
+
const setRootRef = useMemo(() => mergeRefs(rootRef, forwardedRef), [forwardedRef]);
|
|
62
|
+
|
|
63
|
+
useApplyWebClassName(rootRef, className?.trim() || undefined);
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<View
|
|
67
|
+
{...rest}
|
|
68
|
+
ref={setRootRef}
|
|
69
|
+
accessibilityLabel={accessibilityLabel ?? label}
|
|
70
|
+
accessibilityState={{ disabled }}
|
|
71
|
+
style={[styles.root, disabled && styles.disabled, style]}
|
|
72
|
+
>
|
|
73
|
+
<Text style={[styles.label, error && styles.errorText]}>{label}</Text>
|
|
74
|
+
<View style={[styles.field, error && styles.errorField]}>
|
|
75
|
+
<View style={styles.iconSlot}>
|
|
76
|
+
<Icon
|
|
77
|
+
{...iconProps}
|
|
78
|
+
color={iconProps?.color ?? (error ? colors.red : colors.grey150)}
|
|
79
|
+
size={iconSize}
|
|
80
|
+
/>
|
|
81
|
+
</View>
|
|
82
|
+
<Counter
|
|
83
|
+
defaultValue={defaultValue}
|
|
84
|
+
disabled={disabled}
|
|
85
|
+
layout="value-first"
|
|
86
|
+
max={max}
|
|
87
|
+
min={min}
|
|
88
|
+
onValueChange={onValueChange}
|
|
89
|
+
step={step}
|
|
90
|
+
value={value}
|
|
91
|
+
/>
|
|
92
|
+
</View>
|
|
93
|
+
{showHint && hint ? (
|
|
94
|
+
<Text style={[styles.hint, error && styles.errorText]}>{hint}</Text>
|
|
95
|
+
) : null}
|
|
96
|
+
</View>
|
|
97
|
+
);
|
|
98
|
+
},
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
const styles = StyleSheet.create({
|
|
102
|
+
root: {
|
|
103
|
+
alignSelf: "stretch",
|
|
104
|
+
flexDirection: "column",
|
|
105
|
+
gap: 8,
|
|
106
|
+
minWidth: 0,
|
|
107
|
+
},
|
|
108
|
+
label: {
|
|
109
|
+
color: colors.white,
|
|
110
|
+
fontFamily: fonts.sans,
|
|
111
|
+
fontSize: 12,
|
|
112
|
+
fontWeight: "500",
|
|
113
|
+
letterSpacing: -0.24,
|
|
114
|
+
lineHeight: 12,
|
|
115
|
+
},
|
|
116
|
+
field: {
|
|
117
|
+
alignItems: "center",
|
|
118
|
+
alignSelf: "stretch",
|
|
119
|
+
backgroundColor: colors.grey700,
|
|
120
|
+
borderColor: colors.grey700,
|
|
121
|
+
borderRadius: 60,
|
|
122
|
+
borderWidth: 1,
|
|
123
|
+
flexDirection: "row",
|
|
124
|
+
gap: 10,
|
|
125
|
+
height: 44,
|
|
126
|
+
paddingLeft: 16,
|
|
127
|
+
paddingRight: 6,
|
|
128
|
+
paddingVertical: 5,
|
|
129
|
+
},
|
|
130
|
+
iconSlot: {
|
|
131
|
+
alignItems: "center",
|
|
132
|
+
flexShrink: 0,
|
|
133
|
+
height: 20,
|
|
134
|
+
justifyContent: "center",
|
|
135
|
+
width: 20,
|
|
136
|
+
},
|
|
137
|
+
hint: {
|
|
138
|
+
color: colors.grey100,
|
|
139
|
+
fontFamily: fonts.sans,
|
|
140
|
+
fontSize: 12,
|
|
141
|
+
fontWeight: "400",
|
|
142
|
+
lineHeight: 12,
|
|
143
|
+
},
|
|
144
|
+
errorField: {
|
|
145
|
+
borderColor: colors.redMuted,
|
|
146
|
+
},
|
|
147
|
+
errorText: {
|
|
148
|
+
color: colors.red,
|
|
149
|
+
},
|
|
150
|
+
disabled: {
|
|
151
|
+
opacity: 0.6,
|
|
152
|
+
},
|
|
153
|
+
});
|
|
@@ -52,6 +52,15 @@ type Story = StoryObj<typeof meta>;
|
|
|
52
52
|
|
|
53
53
|
export const WithIcons: Story = {};
|
|
54
54
|
|
|
55
|
+
export const IconOnly: Story = {
|
|
56
|
+
args: {
|
|
57
|
+
options: [
|
|
58
|
+
{ value: "grid", label: "Grid view", icon: LayoutGridIcon, showLabel: false },
|
|
59
|
+
{ value: "list", label: "List view", icon: ListViewIcon, showLabel: false },
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
55
64
|
export const WithoutIcons: Story = {
|
|
56
65
|
args: { options: optionsWithoutIcons, defaultValue: "first" },
|
|
57
66
|
};
|
|
@@ -20,6 +20,8 @@ export interface SegmentedToggleOption {
|
|
|
20
20
|
value: string;
|
|
21
21
|
label: string;
|
|
22
22
|
icon?: IconComponent;
|
|
23
|
+
/** Hides the visual label while retaining it as the accessible name. */
|
|
24
|
+
showLabel?: boolean;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
export interface SegmentedToggleProps extends Omit<ViewProps, "style" | "children"> {
|
|
@@ -163,7 +165,7 @@ export const SegmentedToggle = forwardRef<ComponentRef<typeof View>, SegmentedTo
|
|
|
163
165
|
accessibilityRole="radiogroup"
|
|
164
166
|
>
|
|
165
167
|
{!fullWidth
|
|
166
|
-
? options.map(({ value: optionValue, label, icon: Icon }, index) => (
|
|
168
|
+
? options.map(({ value: optionValue, label, icon: Icon, showLabel = true }, index) => (
|
|
167
169
|
<View
|
|
168
170
|
key={`${optionValue}-measurement`}
|
|
169
171
|
pointerEvents="none"
|
|
@@ -182,7 +184,9 @@ export const SegmentedToggle = forwardRef<ComponentRef<typeof View>, SegmentedTo
|
|
|
182
184
|
style={styles.optionMeasurement}
|
|
183
185
|
>
|
|
184
186
|
{Icon ? <Icon size={ICON_SIZE} /> : null}
|
|
185
|
-
|
|
187
|
+
{showLabel ? (
|
|
188
|
+
<Text style={[styles.label, styles.contentWidthLabel]}>{label}</Text>
|
|
189
|
+
) : null}
|
|
186
190
|
</View>
|
|
187
191
|
))
|
|
188
192
|
: null}
|
|
@@ -195,7 +199,7 @@ export const SegmentedToggle = forwardRef<ComponentRef<typeof View>, SegmentedTo
|
|
|
195
199
|
]}
|
|
196
200
|
/>
|
|
197
201
|
) : null}
|
|
198
|
-
{options.map(({ value: optionValue, label, icon: Icon }, index) => {
|
|
202
|
+
{options.map(({ value: optionValue, label, icon: Icon, showLabel = true }, index) => {
|
|
199
203
|
const selected = optionValue === selectedValue;
|
|
200
204
|
const iconColor = selected ? colors.primary : colors.whiteAlpha20;
|
|
201
205
|
const labelColor = selected ? colors.whiteAlpha86 : colors.whiteAlpha40;
|
|
@@ -219,16 +223,18 @@ export const SegmentedToggle = forwardRef<ComponentRef<typeof View>, SegmentedTo
|
|
|
219
223
|
>
|
|
220
224
|
<View style={styles.optionContent}>
|
|
221
225
|
{Icon ? <Icon size={ICON_SIZE} color={iconColor} /> : null}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
226
|
+
{showLabel ? (
|
|
227
|
+
<Text
|
|
228
|
+
numberOfLines={fullWidth ? 1 : undefined}
|
|
229
|
+
style={[
|
|
230
|
+
styles.label,
|
|
231
|
+
!fullWidth && styles.contentWidthLabel,
|
|
232
|
+
{ color: labelColor },
|
|
233
|
+
]}
|
|
234
|
+
>
|
|
235
|
+
{label}
|
|
236
|
+
</Text>
|
|
237
|
+
) : null}
|
|
232
238
|
</View>
|
|
233
239
|
</Pressable>
|
|
234
240
|
);
|
package/src/components/index.ts
CHANGED
|
@@ -28,12 +28,18 @@ export type { ContactInfoCardProps } from "./ContactInfoCard";
|
|
|
28
28
|
export { AccordionItem } from "./AccordionItem";
|
|
29
29
|
export type { AccordionItemProps } from "./AccordionItem";
|
|
30
30
|
|
|
31
|
+
export { Accordion } from "./Accordion";
|
|
32
|
+
export type { AccordionProps } from "./Accordion";
|
|
33
|
+
|
|
31
34
|
export { StepList } from "./StepList";
|
|
32
35
|
export type { StepListProps } from "./StepList";
|
|
33
36
|
|
|
34
37
|
export { Counter } from "./Counter";
|
|
35
38
|
export type { CounterProps } from "./Counter";
|
|
36
39
|
|
|
40
|
+
export { QuantityInput } from "./QuantityInput";
|
|
41
|
+
export type { QuantityInputProps } from "./QuantityInput";
|
|
42
|
+
|
|
37
43
|
export { SegmentedToggle } from "./SegmentedToggle";
|
|
38
44
|
export type { SegmentedToggleOption, SegmentedToggleProps } from "./SegmentedToggle";
|
|
39
45
|
|
|
@@ -74,6 +80,9 @@ export type { ModalProps } from "./Modal";
|
|
|
74
80
|
export { Input } from "./Input";
|
|
75
81
|
export type { InputIcon, InputProps, InputSize } from "./Input";
|
|
76
82
|
|
|
83
|
+
export { AutocompleteInput } from "./AutocompleteInput";
|
|
84
|
+
export type { AutocompleteInputProps, AutocompleteOption } from "./AutocompleteInput";
|
|
85
|
+
|
|
77
86
|
export { VerificationCodeInput } from "./VerificationCodeInput";
|
|
78
87
|
export type {
|
|
79
88
|
VerificationCodeInputHandle,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { ARROW_LEFT_PATH } from "./arrowLeftPath";
|
|
3
|
+
|
|
4
|
+
describe("ArrowLeftIcon", () => {
|
|
5
|
+
it("uses the approved 24px path", () => {
|
|
6
|
+
expect(ARROW_LEFT_PATH).toBe(
|
|
7
|
+
"M10.1972 6.59961L4.80078 11.9994L10.1972 17.3996M4.80078 11.9965H19.202",
|
|
8
|
+
);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import Svg, { Path } from "react-native-svg";
|
|
2
|
+
import { colors } from "../../theme";
|
|
3
|
+
import type { IconProps } from "../types";
|
|
4
|
+
import { ARROW_LEFT_PATH } from "./arrowLeftPath";
|
|
5
|
+
|
|
6
|
+
export { ARROW_LEFT_PATH } from "./arrowLeftPath";
|
|
7
|
+
|
|
8
|
+
/** Native — react-native-svg (peer dependency). */
|
|
9
|
+
export function ArrowLeftIcon({ size = 24, color = colors.white, strokeWidth = 1.35 }: IconProps) {
|
|
10
|
+
return (
|
|
11
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
12
|
+
<Path
|
|
13
|
+
d={ARROW_LEFT_PATH}
|
|
14
|
+
stroke={color}
|
|
15
|
+
strokeWidth={strokeWidth}
|
|
16
|
+
strokeLinecap="round"
|
|
17
|
+
strokeLinejoin="round"
|
|
18
|
+
/>
|
|
19
|
+
</Svg>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { colors } from "../../theme";
|
|
2
|
+
import type { IconProps } from "../types";
|
|
3
|
+
import { ARROW_LEFT_PATH } from "./arrowLeftPath";
|
|
4
|
+
|
|
5
|
+
export function ArrowLeftIcon({ size = 24, color = colors.white, strokeWidth = 1.35 }: IconProps) {
|
|
6
|
+
return (
|
|
7
|
+
<svg
|
|
8
|
+
aria-hidden
|
|
9
|
+
fill="none"
|
|
10
|
+
height={size}
|
|
11
|
+
viewBox="0 0 24 24"
|
|
12
|
+
width={size}
|
|
13
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
+
>
|
|
15
|
+
<path
|
|
16
|
+
d={ARROW_LEFT_PATH}
|
|
17
|
+
stroke={color}
|
|
18
|
+
strokeLinecap="round"
|
|
19
|
+
strokeLinejoin="round"
|
|
20
|
+
strokeWidth={strokeWidth}
|
|
21
|
+
/>
|
|
22
|
+
</svg>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { ARROW_LEFT_PATH } from "./arrowLeftPath";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ArrowLeftIcon, ARROW_LEFT_PATH } from "./ArrowLeftIcon";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { CURRENT_LOCATION_PATH } from "./currentLocationPath";
|
|
3
|
+
|
|
4
|
+
describe("CurrentLocationIcon", () => {
|
|
5
|
+
it("uses the approved 19px path", () => {
|
|
6
|
+
expect(CURRENT_LOCATION_PATH).toBe(
|
|
7
|
+
"M17.4167 9.08333H14.0833M4.08333 9.08333H0.75M9.08333 4.08333V0.75M9.08333 17.4167V14.0833M15.75 9.08333C15.75 12.7652 12.7652 15.75 9.08333 15.75C5.40144 15.75 2.41667 12.7652 2.41667 9.08333C2.41667 5.40144 5.40144 2.41667 9.08333 2.41667C12.7652 2.41667 15.75 5.40144 15.75 9.08333ZM11.5833 9.08333C11.5833 10.464 10.464 11.5833 9.08333 11.5833C7.70262 11.5833 6.58333 10.464 6.58333 9.08333C6.58333 7.70262 7.70262 6.58333 9.08333 6.58333C10.464 6.58333 11.5833 7.70262 11.5833 9.08333Z",
|
|
8
|
+
);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Svg, { Path } from "react-native-svg";
|
|
2
|
+
import { colors } from "../../theme";
|
|
3
|
+
import type { IconProps } from "../types";
|
|
4
|
+
import { CURRENT_LOCATION_PATH } from "./currentLocationPath";
|
|
5
|
+
|
|
6
|
+
export { CURRENT_LOCATION_PATH } from "./currentLocationPath";
|
|
7
|
+
|
|
8
|
+
/** Native — react-native-svg (peer dependency). */
|
|
9
|
+
export function CurrentLocationIcon({
|
|
10
|
+
size = 19,
|
|
11
|
+
color = colors.primary,
|
|
12
|
+
strokeWidth = 1.5,
|
|
13
|
+
}: IconProps) {
|
|
14
|
+
return (
|
|
15
|
+
<Svg width={size} height={size} viewBox="0 0 19 19" fill="none">
|
|
16
|
+
<Path
|
|
17
|
+
d={CURRENT_LOCATION_PATH}
|
|
18
|
+
stroke={color}
|
|
19
|
+
strokeWidth={strokeWidth}
|
|
20
|
+
strokeLinecap="round"
|
|
21
|
+
strokeLinejoin="round"
|
|
22
|
+
/>
|
|
23
|
+
</Svg>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { colors } from "../../theme";
|
|
2
|
+
import type { IconProps } from "../types";
|
|
3
|
+
import { CURRENT_LOCATION_PATH } from "./currentLocationPath";
|
|
4
|
+
|
|
5
|
+
export function CurrentLocationIcon({
|
|
6
|
+
size = 19,
|
|
7
|
+
color = colors.primary,
|
|
8
|
+
strokeWidth = 1.5,
|
|
9
|
+
}: IconProps) {
|
|
10
|
+
return (
|
|
11
|
+
<svg
|
|
12
|
+
aria-hidden
|
|
13
|
+
fill="none"
|
|
14
|
+
height={size}
|
|
15
|
+
viewBox="0 0 19 19"
|
|
16
|
+
width={size}
|
|
17
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
18
|
+
>
|
|
19
|
+
<path
|
|
20
|
+
d={CURRENT_LOCATION_PATH}
|
|
21
|
+
stroke={color}
|
|
22
|
+
strokeLinecap="round"
|
|
23
|
+
strokeLinejoin="round"
|
|
24
|
+
strokeWidth={strokeWidth}
|
|
25
|
+
/>
|
|
26
|
+
</svg>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { CURRENT_LOCATION_PATH } from "./currentLocationPath";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Current-location crosshair path — 19×19 viewBox. */
|
|
2
|
+
export const CURRENT_LOCATION_PATH =
|
|
3
|
+
"M17.4167 9.08333H14.0833M4.08333 9.08333H0.75M9.08333 4.08333V0.75M9.08333 17.4167V14.0833M15.75 9.08333C15.75 12.7652 12.7652 15.75 9.08333 15.75C5.40144 15.75 2.41667 12.7652 2.41667 9.08333C2.41667 5.40144 5.40144 2.41667 9.08333 2.41667C12.7652 2.41667 15.75 5.40144 15.75 9.08333ZM11.5833 9.08333C11.5833 10.464 10.464 11.5833 9.08333 11.5833C7.70262 11.5833 6.58333 10.464 6.58333 9.08333C6.58333 7.70262 7.70262 6.58333 9.08333 6.58333C10.464 6.58333 11.5833 7.70262 11.5833 9.08333Z";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CurrentLocationIcon, CURRENT_LOCATION_PATH } from "./CurrentLocationIcon";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Svg, { Path } from "react-native-svg";
|
|
2
|
+
import { colors } from "../../theme";
|
|
3
|
+
import type { IconProps } from "../types";
|
|
4
|
+
import { MORE_HORIZONTAL_PATH } from "./moreHorizontalPath";
|
|
5
|
+
|
|
6
|
+
export { MORE_HORIZONTAL_PATH } from "./moreHorizontalPath";
|
|
7
|
+
|
|
8
|
+
const ASPECT_RATIO = 4 / 13;
|
|
9
|
+
|
|
10
|
+
export function MoreHorizontalIcon({
|
|
11
|
+
size = 13,
|
|
12
|
+
color = colors.white,
|
|
13
|
+
strokeWidth = 2,
|
|
14
|
+
}: IconProps) {
|
|
15
|
+
return (
|
|
16
|
+
<Svg width={size} height={size * ASPECT_RATIO} viewBox="0 0 13 4" fill="none">
|
|
17
|
+
<Path
|
|
18
|
+
d={MORE_HORIZONTAL_PATH}
|
|
19
|
+
stroke={color}
|
|
20
|
+
strokeWidth={strokeWidth}
|
|
21
|
+
strokeLinecap="round"
|
|
22
|
+
strokeLinejoin="round"
|
|
23
|
+
/>
|
|
24
|
+
</Svg>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { colors } from "../../theme";
|
|
2
|
+
import type { IconProps } from "../types";
|
|
3
|
+
import { MORE_HORIZONTAL_PATH } from "./moreHorizontalPath";
|
|
4
|
+
|
|
5
|
+
export { MORE_HORIZONTAL_PATH } from "./moreHorizontalPath";
|
|
6
|
+
|
|
7
|
+
const ASPECT_RATIO = 4 / 13;
|
|
8
|
+
|
|
9
|
+
export function MoreHorizontalIcon({
|
|
10
|
+
size = 13,
|
|
11
|
+
color = colors.white,
|
|
12
|
+
strokeWidth = 2,
|
|
13
|
+
}: IconProps) {
|
|
14
|
+
return (
|
|
15
|
+
<svg width={size} height={size * ASPECT_RATIO} viewBox="0 0 13 4" fill="none" aria-hidden>
|
|
16
|
+
<path
|
|
17
|
+
d={MORE_HORIZONTAL_PATH}
|
|
18
|
+
stroke={color}
|
|
19
|
+
strokeWidth={strokeWidth}
|
|
20
|
+
strokeLinecap="round"
|
|
21
|
+
strokeLinejoin="round"
|
|
22
|
+
/>
|
|
23
|
+
</svg>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MoreHorizontalIcon, MORE_HORIZONTAL_PATH } from "./MoreHorizontalIcon";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const MORE_HORIZONTAL_PATH =
|
|
2
|
+
"M6.33333 2.33333C6.70152 2.33333 7 2.03486 7 1.66667C7 1.29848 6.70152 1 6.33333 1C5.96514 1 5.66667 1.29848 5.66667 1.66667C5.66667 2.03486 5.96514 2.33333 6.33333 2.33333ZM11 2.33333C11.3682 2.33333 11.6667 2.03486 11.6667 1.66667C11.6667 1.29848 11.3682 1 11 1C10.6318 1 10.3333 1.29848 10.3333 1.66667C10.3333 2.03486 10.6318 2.33333 11 2.33333ZM1.66667 2.33333C2.03486 2.33333 2.33333 2.03486 2.33333 1.66667C2.33333 1.29848 2.03486 1 1.66667 1C1.29848 1 1 1.29848 1 1.66667C1 2.03486 1.29848 2.33333 1.66667 2.33333Z";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Svg, { Path } from "react-native-svg";
|
|
2
|
+
import { colors } from "../../theme";
|
|
3
|
+
import type { IconProps } from "../types";
|
|
4
|
+
import { TABLE_VIEW_PATH } from "./tableViewPath";
|
|
5
|
+
|
|
6
|
+
export { TABLE_VIEW_PATH } from "./tableViewPath";
|
|
7
|
+
|
|
8
|
+
export function TableViewIcon({ size = 17, color = colors.grey400, strokeWidth = 2 }: IconProps) {
|
|
9
|
+
return (
|
|
10
|
+
<Svg width={size} height={size} viewBox="0 0 17 17" fill="none">
|
|
11
|
+
<Path
|
|
12
|
+
d={TABLE_VIEW_PATH}
|
|
13
|
+
stroke={color}
|
|
14
|
+
strokeWidth={strokeWidth}
|
|
15
|
+
strokeLinecap="round"
|
|
16
|
+
strokeLinejoin="round"
|
|
17
|
+
/>
|
|
18
|
+
</Svg>
|
|
19
|
+
);
|
|
20
|
+
}
|