@ecohouse/ui 0.1.5 → 0.1.7
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 +34 -3
- package/dist/index.cjs +946 -102
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +349 -157
- package/dist/index.d.ts +349 -157
- package/dist/index.js +930 -104
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Badge/Badge.stories.tsx +52 -0
- package/src/components/Badge/Badge.tsx +131 -0
- package/src/components/Badge/index.ts +2 -0
- package/src/components/CommentCard/CommentCard.stories.tsx +31 -0
- package/src/components/CommentCard/CommentCard.tsx +209 -0
- package/src/components/CommentCard/index.ts +2 -0
- package/src/components/Counter/Counter.stories.tsx +46 -0
- package/src/components/Counter/Counter.tsx +135 -0
- package/src/components/Counter/index.ts +2 -0
- package/src/components/RatingInput/RatingInput.stories.tsx +41 -0
- package/src/components/RatingInput/RatingInput.tsx +168 -0
- package/src/components/RatingInput/index.ts +2 -0
- package/src/components/SegmentedToggle/SegmentedToggle.stories.tsx +63 -0
- package/src/components/SegmentedToggle/SegmentedToggle.tsx +221 -0
- package/src/components/SegmentedToggle/index.ts +2 -0
- package/src/components/StatCard/StatCard.stories.tsx +20 -0
- package/src/components/StatCard/StatCard.tsx +61 -0
- package/src/components/StatCard/index.ts +2 -0
- package/src/components/index.ts +18 -0
- package/src/icons/Minus/MinusIcon.tsx +20 -0
- package/src/icons/Minus/MinusIcon.web.tsx +19 -0
- package/src/icons/Minus/index.ts +1 -0
- package/src/icons/Minus/minusPath.ts +1 -0
- package/src/icons/Plus/PlusIcon.tsx +20 -0
- package/src/icons/Plus/PlusIcon.web.tsx +19 -0
- package/src/icons/Plus/index.ts +1 -0
- package/src/icons/Plus/plusPath.ts +1 -0
- package/src/icons/Sidebar/SidebarIcon.tsx +21 -0
- package/src/icons/Sidebar/SidebarIcon.web.tsx +27 -0
- package/src/icons/Sidebar/index.ts +1 -0
- package/src/icons/Sidebar/sidebarPath.ts +3 -0
- package/src/icons/Star/StarIcon.tsx +35 -0
- package/src/icons/Star/StarIcon.web.tsx +41 -0
- package/src/icons/Star/index.ts +2 -0
- package/src/icons/Star/starPath.ts +3 -0
- package/src/icons/StarFilled/StarFilledIcon.tsx +28 -0
- package/src/icons/StarFilled/StarFilledIcon.web.tsx +34 -0
- package/src/icons/StarFilled/index.ts +1 -0
- package/src/icons/UsersAlt/UsersAltIcon.tsx +14 -0
- package/src/icons/UsersAlt/UsersAltIcon.web.tsx +13 -0
- package/src/icons/UsersAlt/index.ts +1 -0
- package/src/icons/UsersAlt/usersAltPath.ts +2 -0
- package/src/icons/index.ts +7 -0
- package/src/icons/registry.ts +18 -2
- package/src/index.ts +34 -1
- package/src/theme/colors.test.ts +6 -0
- package/src/theme/colors.ts +6 -0
- package/src/theme/index.ts +6 -0
- package/src/theme/typography.ts +77 -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 {
|
|
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
|
|