@ecohouse/ui 0.1.5 → 0.1.6

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 (44) hide show
  1. package/README.md +34 -3
  2. package/dist/index.cjs +592 -102
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +263 -162
  5. package/dist/index.d.ts +263 -162
  6. package/dist/index.js +582 -104
  7. package/dist/index.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/components/Badge/Badge.stories.tsx +52 -0
  10. package/src/components/Badge/Badge.tsx +131 -0
  11. package/src/components/Badge/index.ts +2 -0
  12. package/src/components/Counter/Counter.stories.tsx +46 -0
  13. package/src/components/Counter/Counter.tsx +135 -0
  14. package/src/components/Counter/index.ts +2 -0
  15. package/src/components/SegmentedToggle/SegmentedToggle.stories.tsx +63 -0
  16. package/src/components/SegmentedToggle/SegmentedToggle.tsx +221 -0
  17. package/src/components/SegmentedToggle/index.ts +2 -0
  18. package/src/components/StatCard/StatCard.stories.tsx +20 -0
  19. package/src/components/StatCard/StatCard.tsx +61 -0
  20. package/src/components/StatCard/index.ts +2 -0
  21. package/src/components/index.ts +12 -0
  22. package/src/icons/Minus/MinusIcon.tsx +20 -0
  23. package/src/icons/Minus/MinusIcon.web.tsx +19 -0
  24. package/src/icons/Minus/index.ts +1 -0
  25. package/src/icons/Minus/minusPath.ts +1 -0
  26. package/src/icons/Plus/PlusIcon.tsx +20 -0
  27. package/src/icons/Plus/PlusIcon.web.tsx +19 -0
  28. package/src/icons/Plus/index.ts +1 -0
  29. package/src/icons/Plus/plusPath.ts +1 -0
  30. package/src/icons/Sidebar/SidebarIcon.tsx +21 -0
  31. package/src/icons/Sidebar/SidebarIcon.web.tsx +27 -0
  32. package/src/icons/Sidebar/index.ts +1 -0
  33. package/src/icons/Sidebar/sidebarPath.ts +3 -0
  34. package/src/icons/UsersAlt/UsersAltIcon.tsx +14 -0
  35. package/src/icons/UsersAlt/UsersAltIcon.web.tsx +13 -0
  36. package/src/icons/UsersAlt/index.ts +1 -0
  37. package/src/icons/UsersAlt/usersAltPath.ts +2 -0
  38. package/src/icons/index.ts +4 -0
  39. package/src/icons/registry.ts +12 -2
  40. package/src/index.ts +18 -0
  41. package/src/theme/colors.test.ts +6 -0
  42. package/src/theme/colors.ts +6 -0
  43. package/src/theme/index.ts +4 -0
  44. package/src/theme/typography.ts +36 -0
package/README.md CHANGED
@@ -7,6 +7,7 @@ Cross-platform UI component library for EcoHouse. Built with React Native primit
7
7
  | Component | Description |
8
8
  | ------------ | ----------------------------------------------------------------------------- |
9
9
  | `Button` | Pill CTA — `primary` / `secondary`, sizes `lg` / `sm`, optional arrow badge |
10
+ | `Badge` | Pill label chip — `default` / `transparent`, optional leading icon |
10
11
  | `Input` | Text field with label, hint, left/right icons, error & disabled states |
11
12
  | `Checkbox` | Square checkbox with optional label, controlled or uncontrolled |
12
13
  | `Toggle` | Animated on/off switch with optional label |
@@ -123,13 +124,15 @@ import "@ecohouse/ui/web/typography.css";
123
124
  ## Usage
124
125
 
125
126
  ```tsx
126
- import { Button, Input, Icon, UserIcon, ShowIcon, colors } from "@ecohouse/ui";
127
+ import { Button, Badge, Input, Icon, HomeIcon, UserIcon, ShowIcon, colors } from "@ecohouse/ui";
127
128
 
128
129
  export function Example() {
129
130
  return (
130
131
  <>
131
132
  <Button title="Continue" variant="primary" size="lg" showIcon onPress={() => {}} />
132
133
 
134
+ <Badge label="Home" icon={HomeIcon} variant="transparent" />
135
+
133
136
  <Input
134
137
  label="Password"
135
138
  placeholder="••••••••"
@@ -151,7 +154,7 @@ Same API on web and mobile.
151
154
 
152
155
  ## API
153
156
 
154
- Quick reference for `Button`, `Input`, and `Icon` below. Full API for `Checkbox`, `Toggle`, `Select`, `DatePicker`, `Textarea`, `Avatar`, and `MenuItem` lives in [`docs/components.md`](./docs/components.md).
157
+ Quick reference for `Button`, `Badge`, `Input`, and `Icon` below. Full API for `Checkbox`, `Toggle`, `Select`, `DatePicker`, `Textarea`, `Avatar`, and `MenuItem` lives in [`docs/components.md`](./docs/components.md).
155
158
 
156
159
  ### `Button`
157
160
 
@@ -172,6 +175,26 @@ Pill CTA — sizes `lg` (44px) / `sm` (32px). Secondary fill uses `colors.grey50
172
175
  <Button title="Cancel" variant="secondary" size="sm" onPress={() => {}} />
173
176
  ```
174
177
 
178
+ ### `Badge`
179
+
180
+ Pill label chip — `default` / `transparent`. Optional leading `HomeIcon` (color follows the variant).
181
+
182
+ | Prop | Type | Default | Description |
183
+ | --------- | ---------------------------- | ----------- | -------------------------- |
184
+ | `label` | `string` | required | Chip text |
185
+ | `variant` | `"default" \| "transparent"` | `"default"` | Fill / border / icon color |
186
+ | `icon` | `IconComponent` | — | Optional leading icon |
187
+
188
+ | Variant | Fill | Border | Icon color |
189
+ | ------------- | --------- | --------------- | ---------- |
190
+ | `default` | `grey750` | none | white |
191
+ | `transparent` | white 5% | 1px `#FFFFFF0D` | primary |
192
+
193
+ ```tsx
194
+ <Badge label="Label" />
195
+ <Badge label="Label" icon={HomeIcon} variant="transparent" />
196
+ ```
197
+
175
198
  ### `Input`
176
199
 
177
200
  Extends React Native `TextInput` props. Default size `lg` (44px pill, radius 60).
@@ -216,7 +239,14 @@ More: [`docs/icons.md`](./docs/icons.md), [`docs/components.md`](./docs/componen
216
239
  ## Design tokens
217
240
 
218
241
  ```tsx
219
- import { colors, grey, fonts, buttonTypography, inputTypography } from "@ecohouse/ui";
242
+ import {
243
+ colors,
244
+ grey,
245
+ fonts,
246
+ badgeTypography,
247
+ buttonTypography,
248
+ inputTypography,
249
+ } from "@ecohouse/ui";
220
250
  ```
221
251
 
222
252
  | Token | Value | Use |
@@ -227,6 +257,7 @@ import { colors, grey, fonts, buttonTypography, inputTypography } from "@ecohous
227
257
  | `red` | `#A63E3E` | Error text / icons / `LogOutIcon` default |
228
258
  | `redMuted` | `#A63E3E0F` | Input error border / subtle danger row |
229
259
  | `redHover` | `#A63E3E33` | Danger row hover background |
260
+ | `green` | `#34A853` | Success / positive |
230
261
  | `black` / `white` | `#000` / `#fff` | Surfaces / labels |
231
262
  | `grey0` … `grey950` | Grey scale | e.g. `grey700` = `#171717` |
232
263