@ecohouse/ui 0.1.36 → 0.1.39

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.
Files changed (43) hide show
  1. package/README.md +2 -0
  2. package/dist/index.cjs +1169 -428
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +101 -2
  5. package/dist/index.d.ts +101 -2
  6. package/dist/index.js +1092 -358
  7. package/dist/index.js.map +1 -1
  8. package/package.json +4 -3
  9. package/src/components/Accordion/Accordion.stories.tsx +47 -0
  10. package/src/components/Accordion/Accordion.tsx +165 -0
  11. package/src/components/Accordion/index.ts +2 -0
  12. package/src/components/AutocompleteInput/AutocompleteInput.stories.tsx +80 -0
  13. package/src/components/AutocompleteInput/AutocompleteInput.tsx +313 -0
  14. package/src/components/AutocompleteInput/index.ts +2 -0
  15. package/src/components/Counter/Counter.tsx +61 -26
  16. package/src/components/Drawer/Drawer.stories.tsx +79 -0
  17. package/src/components/Drawer/Drawer.tsx +239 -0
  18. package/src/components/Drawer/index.ts +2 -0
  19. package/src/components/QuantityInput/QuantityInput.stories.tsx +45 -0
  20. package/src/components/QuantityInput/QuantityInput.tsx +153 -0
  21. package/src/components/QuantityInput/index.ts +2 -0
  22. package/src/components/StatusBadge/StatusBadge.tsx +1 -1
  23. package/src/components/index.ts +12 -0
  24. package/src/icons/ArrowLeft/ArrowLeftIcon.test.ts +10 -0
  25. package/src/icons/ArrowLeft/ArrowLeftIcon.tsx +21 -0
  26. package/src/icons/ArrowLeft/ArrowLeftIcon.web.tsx +26 -0
  27. package/src/icons/ArrowLeft/arrowLeftPath.ts +3 -0
  28. package/src/icons/ArrowLeft/index.ts +1 -0
  29. package/src/icons/CalendarMinus/CalendarMinusIcon.tsx +25 -0
  30. package/src/icons/CalendarMinus/CalendarMinusIcon.web.tsx +31 -0
  31. package/src/icons/CalendarMinus/calendarMinusPath.ts +3 -0
  32. package/src/icons/CalendarMinus/index.ts +1 -0
  33. package/src/icons/CurrentLocation/CurrentLocationIcon.test.ts +10 -0
  34. package/src/icons/CurrentLocation/CurrentLocationIcon.tsx +25 -0
  35. package/src/icons/CurrentLocation/CurrentLocationIcon.web.tsx +30 -0
  36. package/src/icons/CurrentLocation/currentLocationPath.ts +3 -0
  37. package/src/icons/CurrentLocation/index.ts +1 -0
  38. package/src/icons/index.ts +3 -0
  39. package/src/icons/registry.ts +3 -0
  40. package/src/index.ts +12 -0
  41. package/src/theme/colors.test.ts +1 -0
  42. package/src/theme/colors.ts +2 -0
  43. package/src/web/styles/account-header.css +22 -0
@@ -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,3 @@
1
+ /** Full Arrow Left path — 24×24 viewBox. */
2
+ export const ARROW_LEFT_PATH =
3
+ "M10.1972 6.59961L4.80078 11.9994L10.1972 17.3996M4.80078 11.9965H19.202";
@@ -0,0 +1 @@
1
+ export { ArrowLeftIcon, ARROW_LEFT_PATH } from "./ArrowLeftIcon";
@@ -0,0 +1,25 @@
1
+ import Svg, { Path } from "react-native-svg";
2
+ import { CALENDAR_MINUS_PATH } from "./calendarMinusPath";
3
+ import { colors } from "../../theme";
4
+ import type { IconProps } from "../types";
5
+
6
+ export { CALENDAR_MINUS_PATH } from "./calendarMinusPath";
7
+
8
+ /** Native — react-native-svg (peer dependency). */
9
+ export function CalendarMinusIcon({
10
+ size = 20,
11
+ color = colors.grey200,
12
+ strokeWidth = 2,
13
+ }: IconProps) {
14
+ return (
15
+ <Svg width={size} height={size} viewBox="0 0 20 20" fill="none">
16
+ <Path
17
+ d={CALENDAR_MINUS_PATH}
18
+ stroke={color}
19
+ strokeWidth={strokeWidth}
20
+ strokeLinecap="round"
21
+ strokeLinejoin="round"
22
+ />
23
+ </Svg>
24
+ );
25
+ }
@@ -0,0 +1,31 @@
1
+ import { CALENDAR_MINUS_PATH } from "./calendarMinusPath";
2
+ import { colors } from "../../theme";
3
+ import type { IconProps } from "../types";
4
+
5
+ /** Web / Storybook — plain SVG (no react-native-svg). */
6
+ export function CalendarMinusIcon({
7
+ size = 20,
8
+ color = colors.grey200,
9
+ strokeWidth = 2,
10
+ }: IconProps) {
11
+ return (
12
+ <svg
13
+ width={size}
14
+ height={size}
15
+ viewBox="0 0 20 20"
16
+ fill="none"
17
+ xmlns="http://www.w3.org/2000/svg"
18
+ aria-hidden
19
+ >
20
+ <path
21
+ d={CALENDAR_MINUS_PATH}
22
+ stroke={color}
23
+ strokeWidth={strokeWidth}
24
+ strokeLinecap="round"
25
+ strokeLinejoin="round"
26
+ />
27
+ </svg>
28
+ );
29
+ }
30
+
31
+ export { CALENDAR_MINUS_PATH } from "./calendarMinusPath";
@@ -0,0 +1,3 @@
1
+ /** Calendar with minus mark — 20×20 viewBox. */
2
+ export const CALENDAR_MINUS_PATH =
3
+ "M12.5 14.9998H17.5M17.5 9.58317V7.33317C17.5 5.93304 17.5 5.23297 17.2275 4.69819C16.9878 4.22779 16.6054 3.84534 16.135 3.60565C15.6002 3.33317 14.9001 3.33317 13.5 3.33317H6.5C5.09987 3.33317 4.3998 3.33317 3.86502 3.60565C3.39462 3.84534 3.01217 4.22779 2.77248 4.69819C2.5 5.23297 2.5 5.93304 2.5 7.33317V14.3332C2.5 15.7333 2.5 16.4334 2.77248 16.9681C3.01217 17.4386 3.39462 17.821 3.86502 18.0607C4.3998 18.3332 5.09987 18.3332 6.5 18.3332H10.4167M17.5 8.33317H2.5M13.3333 1.6665V4.99984M6.66667 1.6665V4.99984";
@@ -0,0 +1 @@
1
+ export { CalendarMinusIcon, CALENDAR_MINUS_PATH } from "./CalendarMinusIcon";
@@ -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";
@@ -9,12 +9,14 @@ export { AmenityIcon } from "./Amenity";
9
9
  export type { AmenityIconProps, AmenityName } from "./Amenity";
10
10
  export { AlertTriangleIcon } from "./AlertTriangle";
11
11
  export { AppleIcon } from "./Store";
12
+ export { ArrowLeftIcon } from "./ArrowLeft";
12
13
  export { ArrowRightIcon } from "./ArrowRight";
13
14
  export { BagIcon } from "./Bag";
14
15
  export { BanIcon } from "./Ban";
15
16
  export { BellIcon } from "./Bell";
16
17
  export { BuildingIcon } from "./Building";
17
18
  export { CalendarIcon } from "./Calendar";
19
+ export { CalendarMinusIcon } from "./CalendarMinus";
18
20
  export { CalendarOutlineIcon } from "./CalendarOutline";
19
21
  export { CameraIcon } from "./Camera";
20
22
  export { CameraFilledIcon } from "./CameraFilled";
@@ -24,6 +26,7 @@ export { ChevronDownIcon } from "./ChevronDown";
24
26
  export { ChevronLeftIcon } from "./ChevronLeft";
25
27
  export { ClockIcon } from "./Clock";
26
28
  export { CloseIcon } from "./Close";
29
+ export { CurrentLocationIcon } from "./CurrentLocation";
27
30
  export { EditIcon } from "./Edit";
28
31
  export {
29
32
  BathroomsIcon,
@@ -6,6 +6,7 @@ import { BanIcon } from "./Ban";
6
6
  import { BellIcon } from "./Bell";
7
7
  import { BuildingIcon } from "./Building";
8
8
  import { CalendarIcon } from "./Calendar";
9
+ import { CalendarMinusIcon } from "./CalendarMinus";
9
10
  import { CalendarOutlineIcon } from "./CalendarOutline";
10
11
  import { CameraIcon } from "./Camera";
11
12
  import { CameraFilledIcon } from "./CameraFilled";
@@ -91,6 +92,7 @@ export const icons = {
91
92
  bell: BellIcon,
92
93
  building: BuildingIcon,
93
94
  calendar: CalendarIcon,
95
+ calendarMinus: CalendarMinusIcon,
94
96
  calendarOutline: CalendarOutlineIcon,
95
97
  camera: CameraIcon,
96
98
  cameraFilled: CameraFilledIcon,
@@ -202,6 +204,7 @@ export const iconGroups = {
202
204
  "download",
203
205
  "search",
204
206
  "calendar",
207
+ "calendarMinus",
205
208
  "calendarOutline",
206
209
  "close",
207
210
  "edit",
package/src/index.ts CHANGED
@@ -9,8 +9,10 @@ export {
9
9
  InfoTile,
10
10
  ContactInfoCard,
11
11
  AccordionItem,
12
+ Accordion,
12
13
  StepList,
13
14
  Counter,
15
+ QuantityInput,
14
16
  SegmentedToggle,
15
17
  Sidebar,
16
18
  LanguageSwitcher,
@@ -21,7 +23,9 @@ export {
21
23
  DatePicker,
22
24
  FloatingActionButton,
23
25
  Modal,
26
+ Drawer,
24
27
  Input,
28
+ AutocompleteInput,
25
29
  VerificationCodeInput,
26
30
  Select,
27
31
  Textarea,
@@ -45,8 +49,10 @@ export type {
45
49
  InfoTileProps,
46
50
  ContactInfoCardProps,
47
51
  AccordionItemProps,
52
+ AccordionProps,
48
53
  StepListProps,
49
54
  CounterProps,
55
+ QuantityInputProps,
50
56
  SegmentedToggleOption,
51
57
  SegmentedToggleProps,
52
58
  SidebarProps,
@@ -68,9 +74,12 @@ export type {
68
74
  DateRange,
69
75
  FloatingActionButtonProps,
70
76
  ModalProps,
77
+ DrawerProps,
71
78
  InputIcon,
72
79
  InputProps,
73
80
  InputSize,
81
+ AutocompleteInputProps,
82
+ AutocompleteOption,
74
83
  VerificationCodeInputHandle,
75
84
  VerificationCodeInputProps,
76
85
  SelectIcon,
@@ -119,12 +128,14 @@ export {
119
128
  iconGroups,
120
129
  iconGroupNames,
121
130
  getIconsByGroup,
131
+ ArrowLeftIcon,
122
132
  ArrowRightIcon,
123
133
  BagIcon,
124
134
  BanIcon,
125
135
  BellIcon,
126
136
  BuildingIcon,
127
137
  CalendarIcon,
138
+ CalendarMinusIcon,
128
139
  CalendarOutlineIcon,
129
140
  CameraIcon,
130
141
  CameraFilledIcon,
@@ -134,6 +145,7 @@ export {
134
145
  ChevronLeftIcon,
135
146
  ClockIcon,
136
147
  CloseIcon,
148
+ CurrentLocationIcon,
137
149
  EditIcon,
138
150
  BathroomsIcon,
139
151
  BedroomsIcon,
@@ -16,6 +16,7 @@ describe("design tokens", () => {
16
16
  expect(colors.whiteAlpha86).toBe("#FFFFFFDB");
17
17
  expect(colors.whiteAlpha40).toBe("#FFFFFF66");
18
18
  expect(colors.whiteAlpha20).toBe("#FFFFFF33");
19
+ expect(colors.whiteAlpha1).toBe("#FFFFFF03");
19
20
  expect(colors.whiteAlpha6).toBe("#FFFFFF0F");
20
21
  expect(colors.whiteAlpha10).toBe("#FFFFFF1A");
21
22
  expect(colors.whiteAlpha5).toBe("#FFFFFF0D");
@@ -20,12 +20,14 @@ export type GreyStep = keyof typeof grey;
20
20
 
21
21
  export const colors = {
22
22
  primary: "#B46436",
23
+ primaryLight: "#E38E5E",
23
24
  black: "#000000",
24
25
  white: "#ffffff",
25
26
  whiteAlpha86: "#FFFFFFDB",
26
27
  whiteAlpha60: "#FFFFFF99",
27
28
  whiteAlpha40: "#FFFFFF66",
28
29
  whiteAlpha20: "#FFFFFF33",
30
+ whiteAlpha1: "#FFFFFF03",
29
31
  whiteAlpha6: "#FFFFFF0F",
30
32
  whiteAlpha10: "#FFFFFF1A",
31
33
  whiteAlpha5: "#FFFFFF0D",
@@ -0,0 +1,22 @@
1
+ /**
2
+ * AccountHeader (web) — keep the menu control mounted to avoid a mobile refresh flash,
3
+ * but hide it on desktop (≥1024px) where the persistent sidebar is shown.
4
+ *
5
+ * Requires `menuClassName="account-header-menu"` (or rely on `#account-header-menu`).
6
+ */
7
+ @media (min-width: 1024px) {
8
+ #account-header-menu,
9
+ .account-header-menu {
10
+ display: none !important;
11
+ width: 0 !important;
12
+ height: 0 !important;
13
+ min-width: 0 !important;
14
+ min-height: 0 !important;
15
+ margin: 0 !important;
16
+ padding: 0 !important;
17
+ overflow: hidden !important;
18
+ opacity: 0 !important;
19
+ pointer-events: none !important;
20
+ position: absolute !important;
21
+ }
22
+ }