@scalably/ui 0.3.0 → 0.4.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 +76 -20
- package/dist/index.d.cts +340 -119
- package/dist/index.d.ts +340 -119
- package/dist/index.esm.js +3 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -1
- package/dist/group-avatar-SDBXEZTD.svg +0 -14
- package/dist/image-placeholder-XP67WFED.svg +0 -5
- package/dist/profile-avatar-6OK7NBEZ.svg +0 -5
- package/dist/scalably-app-OLHCIWQX.png +0 -0
- package/dist/scalably-app-S22I6VRA.svg +0 -23
- package/dist/scalably-campaign-5AY7VBOH.png +0 -0
- package/dist/scalably-campaign-RDHRQF3F.svg +0 -31
- package/dist/scalably-icon-4F2BCRV7.png +0 -0
- package/dist/scalably-icon-CSNKYSCD.svg +0 -8
- package/dist/scalably-icon-big-ACP74XKY.png +0 -0
- package/dist/scalably-membership-E4EHTRKR.png +0 -0
- package/dist/scalably-membership-YGZ7UT3R.svg +0 -33
package/README.md
CHANGED
|
@@ -11,9 +11,12 @@ A modern, accessible, and fully isolated React component library built with Type
|
|
|
11
11
|
- **TypeScript First**: Full type safety with comprehensive prop interfaces
|
|
12
12
|
- **Accessible**: Built with accessibility best practices and WCAG compliance
|
|
13
13
|
- **Modern**: Uses latest React patterns and modern build tools (tsup, Vite, Storybook)
|
|
14
|
+
- **Rich Text Editing**: TipTap-based editor with character counting, media embeds, and formatting toolbar
|
|
14
15
|
- **Customizable**: Flexible variant system with class-variance-authority
|
|
15
16
|
- **Comprehensive**: 20+ production-ready components with full documentation
|
|
16
17
|
- **Production Ready**: Complete build pipeline with CommonJS and ES modules
|
|
18
|
+
- **Icons & Assets**: First-class icon set, avatar placeholders, and logo assets
|
|
19
|
+
- **Utilities & Helpers**: Shared date helpers, form helpers, and utility functions (`cn`, `debounce`, `throttle`, `scopeClass`)
|
|
17
20
|
|
|
18
21
|
## 📦 Installation
|
|
19
22
|
|
|
@@ -100,26 +103,33 @@ import type { SVGProps } from "react";
|
|
|
100
103
|
```
|
|
101
104
|
|
|
102
105
|
### Helper Functions
|
|
103
|
-
- Date helpers
|
|
104
|
-
- Form helpers
|
|
106
|
+
- **Date helpers**: `addMonths`, `clampDate`, `daysGrid`, `endOfMonth`, `formatDateLocalized`, `isSameDay`, `monthsForLocale`, `startOfMonth`, `toDateKey`, `weekdaysForLocale`
|
|
107
|
+
- **Form helpers**: `fieldErrorToProps`, `zodErrorsToSummary` and `type FieldErrorLike`
|
|
108
|
+
- **Utilities**: `cn` (Tailwind-aware className helper), `debounce`, `throttle`, `scopeClass` for safely building `sui-*` class strings
|
|
105
109
|
|
|
106
110
|
### Example Usage
|
|
107
111
|
|
|
108
112
|
```tsx
|
|
109
|
-
import {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
import {
|
|
114
|
+
AuthPrompt,
|
|
115
|
+
BackToTop,
|
|
116
|
+
Button,
|
|
113
117
|
CheckboxGroup,
|
|
114
118
|
DatePicker,
|
|
119
|
+
FileUpload,
|
|
120
|
+
Input,
|
|
121
|
+
Pagination,
|
|
122
|
+
RichTextEditor,
|
|
123
|
+
Select,
|
|
115
124
|
Toast,
|
|
116
|
-
|
|
117
|
-
|
|
125
|
+
ToastContainer,
|
|
126
|
+
ViewToggle,
|
|
127
|
+
} from '@scalably/ui';
|
|
118
128
|
|
|
119
129
|
// Button with variants
|
|
120
|
-
<Button variant="destructive">Delete</Button
|
|
121
|
-
<Button variant="outline">Cancel</Button
|
|
122
|
-
<Button loading>Loading...</Button
|
|
130
|
+
<Button variant="destructive">Delete</Button>;
|
|
131
|
+
<Button variant="outline">Cancel</Button>;
|
|
132
|
+
<Button loading>Loading...</Button>;
|
|
123
133
|
|
|
124
134
|
// Input with validation
|
|
125
135
|
<Input
|
|
@@ -127,23 +137,61 @@ import {
|
|
|
127
137
|
type="email"
|
|
128
138
|
placeholder="Enter your email"
|
|
129
139
|
error="Please enter a valid email"
|
|
130
|
-
|
|
140
|
+
/>;
|
|
131
141
|
|
|
132
142
|
// Date picker
|
|
133
143
|
<DatePicker
|
|
134
144
|
mode="single"
|
|
135
145
|
placeholder="Select a date"
|
|
136
146
|
onChange={(date) => console.log(date)}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
// Toast notifications
|
|
140
|
-
<
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
147
|
+
/>;
|
|
148
|
+
|
|
149
|
+
// Toast notifications (declarative)
|
|
150
|
+
<ToastContainer>
|
|
151
|
+
<Toast
|
|
152
|
+
status="success"
|
|
153
|
+
title="Success!"
|
|
154
|
+
description="Your changes have been saved."
|
|
155
|
+
/>
|
|
156
|
+
</ToastContainer>;
|
|
157
|
+
|
|
158
|
+
// Rich text editor
|
|
159
|
+
<RichTextEditor
|
|
160
|
+
value="<p>Start writing...</p>"
|
|
161
|
+
onChange={(value) => console.log(value)}
|
|
162
|
+
maxCharacters={5000}
|
|
163
|
+
/>;
|
|
164
|
+
|
|
165
|
+
// Marketing-style auth prompt card
|
|
166
|
+
<AuthPrompt
|
|
167
|
+
title="Welcome back"
|
|
168
|
+
description="Log in to manage your campaigns."
|
|
169
|
+
primaryActionLabel="Log in"
|
|
170
|
+
onPrimaryAction={() => console.log('login')}
|
|
171
|
+
/>;
|
|
172
|
+
|
|
173
|
+
// Toggle between list and grid views
|
|
174
|
+
<ViewToggle view="list" onViewChange={(v) => console.log(v)} />;
|
|
175
|
+
|
|
176
|
+
// Scroll-to-top helper
|
|
177
|
+
<BackToTop />;
|
|
145
178
|
```
|
|
146
179
|
|
|
180
|
+
## 🧩 Components & APIs Overview
|
|
181
|
+
|
|
182
|
+
This library exposes a set of composable, production-ready primitives. The full list of exports is available in `src/index.ts`, but the main groups are:
|
|
183
|
+
|
|
184
|
+
- **Form primitives**: `Form`, `FormField`, `FormErrorSummary`, `Input`, `SearchInput`, `QuantityInput`, `CheckBox`, `CheckBoxGroup`, `Radio`, `RadioGroup`, `Select`, `Switch`, `FileUpload`, `DateInput`, `DatePicker`, `TimePicker`
|
|
185
|
+
- **Feedback & status**: `StatusBadge`, `Toast`, `ToastContainer`, `Skeleton`, `SkeletonText`, `Countdown`
|
|
186
|
+
- **Layout & navigation**: `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent`, `Pagination`, `BackToTop`, `ViewToggle`, `Divider`
|
|
187
|
+
- **Content & rich text**: `RichTextEditor`, `RichTextViewer`, `Tooltip`, `AuthPrompt`, `LoadingScreen`, `WelcomeBackground`
|
|
188
|
+
- **Media & brand**: `AvatarPlaceholder`, `Logo`, `logoAssets`, `defaultAssets`, `welcomeAssets` (all inline React SVGs—no static paths required)
|
|
189
|
+
- **Icons**: All icons from `@/icons` and `@/icons/company` are re-exported, e.g. `SearchIcon`, `CalendarIcon`, `SuccessIcon`, `ErrorIcon`, `DiscordIcon`, `FacebookIcon`, `XIcon`, `YoutubeIcon`, and more.
|
|
190
|
+
|
|
191
|
+
## 🖼️ Assets
|
|
192
|
+
|
|
193
|
+
All library assets are inline React SVG components (welcome background, logos, avatar placeholders). You can use them directly via the exported asset maps (`welcomeAssets`, `logoAssets`, `defaultAssets`) or override props (size, className, aria-label). If you prefer external URLs (e.g., CDN), pass your own `backgroundImage`, `ellipsesData`, or `linesSrc` to `WelcomeBackground`.
|
|
194
|
+
|
|
147
195
|
## 🎨 Styling
|
|
148
196
|
|
|
149
197
|
### Style Isolation
|
|
@@ -223,6 +271,8 @@ Visit our Storybook documentation for:
|
|
|
223
271
|
- Accessibility testing with axe-core
|
|
224
272
|
- Design tokens and theming
|
|
225
273
|
|
|
274
|
+
You can access the latest published Storybook at: `https://scalably.com/dev/storybook`.
|
|
275
|
+
|
|
226
276
|
## 🎨 Design System
|
|
227
277
|
|
|
228
278
|
### Colors
|
|
@@ -244,6 +294,10 @@ Visit our Storybook documentation for:
|
|
|
244
294
|
|
|
245
295
|
## 🔧 Configuration
|
|
246
296
|
|
|
297
|
+
### Fonts
|
|
298
|
+
|
|
299
|
+
The library uses the **Poppins** font family (with **Inter** and system fonts as fallbacks) and loads Poppins via Google Fonts from within the bundled CSS. In most setups you do **not** need to add additional font imports, but if your build pipeline blocks remote `@import` rules, you can alternatively include Poppins yourself (e.g., via Google Fonts or `@fontsource/poppins`) to ensure consistent typography.
|
|
300
|
+
|
|
247
301
|
### Tailwind Config
|
|
248
302
|
|
|
249
303
|
The library uses a custom Tailwind configuration with:
|
|
@@ -327,6 +381,8 @@ The library includes comprehensive testing setup:
|
|
|
327
381
|
- `date-fns` - Date manipulation utilities
|
|
328
382
|
- `clsx` - Conditional class names
|
|
329
383
|
- `tailwind-merge` - Tailwind class merging
|
|
384
|
+
- `@tiptap/react` & `@tiptap/starter-kit` - Rich text editor foundation
|
|
385
|
+
- `@tiptap/extension-*` - Rich text extensions (character count, image, alignment, placeholder, YouTube, etc.)
|
|
330
386
|
|
|
331
387
|
---
|
|
332
388
|
|