portal-design-system 0.0.970 → 0.0.972
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 +311 -48
- package/dist/components/Pagination.vue.d.ts +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +2155 -2163
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,14 +1,41 @@
|
|
|
1
|
-
|
|
2
1
|
# Portal Design System
|
|
3
2
|
|
|
4
|
-
A type-safe Vue 3 UI component library built with Tailwind CSS and isolated styles for easy integration into projects.
|
|
3
|
+
A type-safe, production-ready Vue 3 UI component library built with Tailwind CSS, TypeScript, and isolated styles for easy integration into projects. Features a comprehensive collection of reusable components, composables, directives, and utilities.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Features](#features)
|
|
8
|
+
- [Quick Overview](#quick-overview)
|
|
9
|
+
- [Installation](#installation)
|
|
10
|
+
- [Quick Start](#quick-start)
|
|
11
|
+
- [Components](#components)
|
|
12
|
+
- [Inputs](#inputs)
|
|
13
|
+
- [Overlays](#overlays)
|
|
14
|
+
- [Directives](#directives)
|
|
15
|
+
- [Composables](#composables)
|
|
16
|
+
- [Styling & CSS](#styling--css)
|
|
17
|
+
- [Development](#development)
|
|
18
|
+
- [Contributing](#contributing)
|
|
19
|
+
- [License](#license)
|
|
20
|
+
|
|
21
|
+
## Features
|
|
22
|
+
|
|
23
|
+
- **Vue 3 + TypeScript** - Full type safety with modern Vue 3 Composition API
|
|
24
|
+
- **Tailwind CSS** - Utility-first styling with prefixed classes for isolation
|
|
25
|
+
- **ESM/CJS Distribution** - Works with all module systems
|
|
26
|
+
- **Component Flexibility** - Regular Vue components + Web Components support
|
|
27
|
+
- **Icon Support** - Integrated Iconsax icons with customizable styling
|
|
28
|
+
- **Accessible** - Built with accessibility in mind
|
|
29
|
+
- **Production Ready** - Thoroughly tested components with real-world use cases
|
|
5
30
|
|
|
6
31
|
## Quick Overview
|
|
7
32
|
|
|
8
|
-
- Framework
|
|
9
|
-
- Styling
|
|
10
|
-
- Language
|
|
11
|
-
-
|
|
33
|
+
- **Framework:** Vue 3 (Composition API)
|
|
34
|
+
- **Styling:** Tailwind CSS 4+ (prefixed utilities for isolation)
|
|
35
|
+
- **Language:** TypeScript 5+
|
|
36
|
+
- **Build Tool:** Vite 6
|
|
37
|
+
- **Distribution:** ESM / CJS + CSS + Type Definitions
|
|
38
|
+
- **Package Version:** 0.0.972
|
|
12
39
|
|
|
13
40
|
## Installation
|
|
14
41
|
|
|
@@ -20,11 +47,7 @@ npm install portal-design-system
|
|
|
20
47
|
yarn add portal-design-system
|
|
21
48
|
# or
|
|
22
49
|
pnpm add portal-design-system
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
If you use Bun:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
50
|
+
# or
|
|
28
51
|
bun add portal-design-system
|
|
29
52
|
```
|
|
30
53
|
|
|
@@ -56,29 +79,32 @@ import { Button } from 'portal-design-system'
|
|
|
56
79
|
|
|
57
80
|
## Quick Start
|
|
58
81
|
|
|
59
|
-
1. Import
|
|
82
|
+
### 1. Import Styles (one-time in your app entry)
|
|
60
83
|
|
|
61
84
|
```ts
|
|
85
|
+
// main.ts
|
|
62
86
|
import 'portal-design-system/styles'
|
|
63
87
|
```
|
|
64
88
|
|
|
65
|
-
2. Use
|
|
89
|
+
### 2. Use Components in Your Vue App
|
|
66
90
|
|
|
67
91
|
```vue
|
|
68
92
|
<script setup lang="ts">
|
|
69
|
-
import { Button } from 'portal-design-system'
|
|
93
|
+
import { Button, Input, Select } from 'portal-design-system'
|
|
70
94
|
</script>
|
|
71
95
|
|
|
72
96
|
<template>
|
|
73
|
-
<div
|
|
74
|
-
<Button variant="primary"
|
|
97
|
+
<div>
|
|
98
|
+
<Button variant="primary" text="Click Me" />
|
|
99
|
+
<Input placeholder="Enter text..." />
|
|
100
|
+
<Select :options="options" />
|
|
75
101
|
</div>
|
|
76
102
|
</template>
|
|
77
103
|
```
|
|
78
104
|
|
|
79
|
-
### Web Components (
|
|
105
|
+
### 3. Optional: Web Components (Shadow DOM)
|
|
80
106
|
|
|
81
|
-
|
|
107
|
+
For full style encapsulation with Web Components:
|
|
82
108
|
|
|
83
109
|
```html
|
|
84
110
|
<script type="module">
|
|
@@ -89,62 +115,299 @@ The library can expose Web Components (Shadow DOM) for full style encapsulation.
|
|
|
89
115
|
<pds-button variant="primary">Shadow Button</pds-button>
|
|
90
116
|
```
|
|
91
117
|
|
|
118
|
+
## Components
|
|
119
|
+
|
|
120
|
+
### Core Components
|
|
121
|
+
|
|
122
|
+
#### **Button**
|
|
123
|
+
- Versatile button component with multiple variants, sizes, and states
|
|
124
|
+
- Props: `variant` (primary, secondary, etc.), `size`, `radius`, `loading`, `disabled`, `text`, `icon`
|
|
125
|
+
- Supports icons, loading states, and router links
|
|
126
|
+
- Customizable appearance with `classList` and `iconConfig`
|
|
127
|
+
|
|
128
|
+
#### **Badge**
|
|
129
|
+
- Lightweight label component for tagging and highlighting
|
|
130
|
+
- Props: `color`, `text`, `icon`, `iconPosition`, `size`
|
|
131
|
+
- Supports custom icons (Iconsax) with color customization
|
|
132
|
+
- Flexible sizing and styling
|
|
133
|
+
|
|
134
|
+
#### **Text**
|
|
135
|
+
- Typography component for consistent text styling
|
|
136
|
+
- Supports various text sizes and font weights
|
|
137
|
+
- Built for semantic HTML and accessibility
|
|
138
|
+
|
|
139
|
+
#### **Iconsax**
|
|
140
|
+
- Icon component wrapper for Iconsax icon library
|
|
141
|
+
- Props: `name`, `color`, `size`, `type` (linear, outline, bold, bulk, broken, two-tone)
|
|
142
|
+
- Seamless integration with other components
|
|
143
|
+
|
|
144
|
+
#### **IconsaxFont**
|
|
145
|
+
- Alternative Iconsax implementation using font-based icons
|
|
146
|
+
|
|
147
|
+
#### **Tabs**
|
|
148
|
+
- Tab navigation component with animated indicator
|
|
149
|
+
- Features: Smooth sliding indicator, responsive spacing, customizable colors
|
|
150
|
+
- Generic TypeScript support for flexible tab data structures
|
|
151
|
+
- Props: `tabs`, `indicatorColor`, `spacing`
|
|
152
|
+
- v-model support for active tab state
|
|
153
|
+
|
|
154
|
+
#### **Dropdown**
|
|
155
|
+
- Dropdown/menu component for filtering and selection
|
|
156
|
+
- Customizable trigger and menu items
|
|
157
|
+
- Position-aware placement
|
|
158
|
+
|
|
159
|
+
#### **Pagination**
|
|
160
|
+
- Navigation component for paginated content
|
|
161
|
+
- Props: `currentPage`, `totalPages`, `pageSize`
|
|
162
|
+
- Event handlers for page changes
|
|
163
|
+
|
|
164
|
+
#### **DurationTimeline**
|
|
165
|
+
- Timeline visualization component
|
|
166
|
+
- Ideal for showing time-based events or durations
|
|
167
|
+
- Customizable styling and event markers
|
|
168
|
+
|
|
169
|
+
#### **DataGrid**
|
|
170
|
+
- Enterprise-grade data table component (requires DevExtreme)
|
|
171
|
+
- Full support for sorting, filtering, paging
|
|
172
|
+
- Exported separately to keep main bundle lightweight
|
|
173
|
+
|
|
174
|
+
## Inputs
|
|
175
|
+
|
|
176
|
+
Located in `src/components/inputs/`, these form control components provide flexible input handling:
|
|
177
|
+
|
|
178
|
+
#### **Input**
|
|
179
|
+
- Basic text input field
|
|
180
|
+
- Props: `placeholder`, `disabled`, `readonly`, `type`, `value`
|
|
181
|
+
- Validation support with Error component
|
|
182
|
+
- Full accessibility features
|
|
183
|
+
|
|
184
|
+
#### **Select**
|
|
185
|
+
- Dropdown select component
|
|
186
|
+
- Props: `options`, `modelValue`, `placeholder`, `disabled`, `multiple`
|
|
187
|
+
- Type-safe with `SelectOptionType` interface
|
|
188
|
+
- Supports custom slots for option rendering
|
|
189
|
+
|
|
190
|
+
#### **DateInput**
|
|
191
|
+
- Date picker component
|
|
192
|
+
- Built-in calendar UI
|
|
193
|
+
- Customizable date format
|
|
194
|
+
- Min/max date validation support
|
|
195
|
+
|
|
196
|
+
#### **CountryCode**
|
|
197
|
+
- Specialized select for country code selection
|
|
198
|
+
- Pre-populated with country data
|
|
199
|
+
- Flag emoji display support
|
|
200
|
+
- Props: `modelValue` for selected country code
|
|
201
|
+
|
|
202
|
+
#### **RadioGroup**
|
|
203
|
+
- Radio button group component
|
|
204
|
+
- Props: `options`, `modelValue`
|
|
205
|
+
- Grouped radio options for single selection
|
|
206
|
+
- Supports custom styling
|
|
207
|
+
|
|
208
|
+
#### **Label**
|
|
209
|
+
- Form label component
|
|
210
|
+
- Associated with form inputs via `for` attribute
|
|
211
|
+
- Proper accessibility support
|
|
212
|
+
|
|
213
|
+
#### **Error**
|
|
214
|
+
- Error message display component
|
|
215
|
+
- Integrates with form validation
|
|
216
|
+
- Styling for error states
|
|
217
|
+
|
|
218
|
+
## Overlays
|
|
219
|
+
|
|
220
|
+
Located in `src/components/overlays/`, these modal and panel components:
|
|
221
|
+
|
|
222
|
+
#### **Dialog**
|
|
223
|
+
- Modal dialog component for important user interactions
|
|
224
|
+
- Features: Backdrop overlay, close on escape, customizable content
|
|
225
|
+
- Props: `title`, `visible`, `closable`, `backdropClosable`
|
|
226
|
+
- Slot-based content structure
|
|
227
|
+
|
|
228
|
+
#### **Drawer**
|
|
229
|
+
- Side panel component sliding from edge
|
|
230
|
+
- Props: `title`, `visible`, `position` (left, right, top, bottom)
|
|
231
|
+
- Similar slot structure to Dialog
|
|
232
|
+
- Smooth animations and transitions
|
|
233
|
+
|
|
234
|
+
#### **Heading**
|
|
235
|
+
- Dialog/Drawer title component
|
|
236
|
+
- Semantic heading element with consistent styling
|
|
237
|
+
|
|
238
|
+
## Directives
|
|
239
|
+
|
|
240
|
+
### **v-tooltip**
|
|
241
|
+
- Tooltip directive for displaying contextual help text
|
|
242
|
+
- Usage:
|
|
243
|
+
```vue
|
|
244
|
+
<button v-tooltip="'Help text'">Hover me</button>
|
|
245
|
+
<!-- or -->
|
|
246
|
+
<button v-tooltip="{ content: 'Help text', placement: 'top' }">Hover me</button>
|
|
247
|
+
```
|
|
248
|
+
- Modifiers: `.top`, `.bottom`, `.left`, `.right`, `.auto`
|
|
249
|
+
- Sub-modifiers: `.start`, `.end` (for positioning variants)
|
|
250
|
+
- Props: `delay`, `offset`, `class`, `placement`
|
|
251
|
+
- **Default z-index:** 100000 (high stacking context)
|
|
252
|
+
- Features: Smooth transitions, arrow indicator, customizable styling
|
|
253
|
+
|
|
254
|
+
### **tooltip.ts**
|
|
255
|
+
- Core tooltip class implementation
|
|
256
|
+
- Uses PopperJS for intelligent positioning
|
|
257
|
+
- Handles show/hide logic with delay support
|
|
258
|
+
|
|
259
|
+
## Composables
|
|
260
|
+
|
|
261
|
+
Located in `src/components/composables/`, reusable Vue 3 Composition API utilities:
|
|
262
|
+
|
|
263
|
+
### **useOutsideClick**
|
|
264
|
+
- Detects clicks outside of a DOM element
|
|
265
|
+
- Usage:
|
|
266
|
+
```ts
|
|
267
|
+
const elementRef = ref<HTMLElement>()
|
|
268
|
+
useOutsideClick(elementRef, () => {
|
|
269
|
+
// Handle outside click
|
|
270
|
+
})
|
|
271
|
+
```
|
|
272
|
+
- Useful for closing dropdowns, modals, and menus
|
|
273
|
+
|
|
274
|
+
### **useOverlay**
|
|
275
|
+
- Manages overlay/modal state and behavior
|
|
276
|
+
- Handles backdrop interaction logic
|
|
277
|
+
|
|
278
|
+
### **useWindowScroll**
|
|
279
|
+
- Detects and reacts to window scroll events
|
|
280
|
+
- Props: `element`, `callback`, `options`
|
|
281
|
+
- Useful for lazy loading and infinite scroll patterns
|
|
282
|
+
|
|
283
|
+
## Styling & CSS
|
|
284
|
+
|
|
285
|
+
The library includes comprehensive CSS organization:
|
|
286
|
+
|
|
287
|
+
### **styles.css**
|
|
288
|
+
- Main stylesheet
|
|
289
|
+
- Contains base styles, resets, and Tailwind imports
|
|
290
|
+
- One-time import in app entry point
|
|
291
|
+
|
|
292
|
+
### **tooltip.css**
|
|
293
|
+
- Tooltip-specific styles
|
|
294
|
+
- Classes: `.h-tooltip`, `.vue-tooltip-hidden`, `.vue-tooltip-visible`
|
|
295
|
+
- Includes arrow styling and placement modifiers
|
|
296
|
+
- **Z-index:** 100000
|
|
297
|
+
|
|
298
|
+
### **transition.css**
|
|
299
|
+
- Vue transition classes
|
|
300
|
+
- Smooth animations for component entry/exit
|
|
301
|
+
|
|
302
|
+
### **vue-datepicker.css**
|
|
303
|
+
- Datepicker calendar styling
|
|
304
|
+
- Integration with DateInput component
|
|
305
|
+
|
|
306
|
+
### **dev-express.css**
|
|
307
|
+
- DevExtreme DataGrid styling customizations
|
|
308
|
+
- Required when using DataGrid component
|
|
309
|
+
|
|
310
|
+
## Types
|
|
311
|
+
|
|
312
|
+
Located in `src/types/`, comprehensive TypeScript definitions:
|
|
313
|
+
|
|
314
|
+
- `button-types.ts` - Button variant and size enums
|
|
315
|
+
- `text-types.ts` - Typography type definitions
|
|
316
|
+
- `iconsax-types.ts` - Icon name types
|
|
317
|
+
- `dev-express-types.ts` - DataGrid type definitions
|
|
318
|
+
- `index.ts` - Core interface definitions (e.g., `SelectOptionType`)
|
|
319
|
+
- `components.d.ts` - Vue component auto-registration types
|
|
320
|
+
- `vue.d.ts` - Vue augmentation types
|
|
321
|
+
|
|
92
322
|
## Development
|
|
93
323
|
|
|
94
324
|
Common development tasks (scripts available in `package.json`):
|
|
95
325
|
|
|
96
326
|
```bash
|
|
97
|
-
# Start dev server
|
|
327
|
+
# Start dev server with Vite
|
|
98
328
|
npm run dev
|
|
329
|
+
# or with Bun
|
|
330
|
+
bun run dev
|
|
99
331
|
|
|
100
|
-
# Build library
|
|
332
|
+
# Build library for production
|
|
101
333
|
npm run build
|
|
102
334
|
|
|
103
|
-
# Type check
|
|
335
|
+
# Type check entire codebase
|
|
104
336
|
npm run type-check
|
|
105
337
|
|
|
106
|
-
# Preview production build
|
|
338
|
+
# Preview production build locally
|
|
107
339
|
npm run preview
|
|
108
340
|
```
|
|
109
341
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
## Package Exports
|
|
113
|
-
|
|
114
|
-
The package exposes the components and styles. Import styles directly with:
|
|
342
|
+
### Project Structure
|
|
115
343
|
|
|
116
|
-
```
|
|
117
|
-
|
|
344
|
+
```
|
|
345
|
+
src/
|
|
346
|
+
├── components/ # Vue components
|
|
347
|
+
│ ├── inputs/ # Form input components
|
|
348
|
+
│ ├── overlays/ # Modal/panel components
|
|
349
|
+
│ ├── composables/ # Vue 3 Composition API utilities
|
|
350
|
+
│ ├── examples/ # Component usage examples
|
|
351
|
+
│ └── *.vue # Core components
|
|
352
|
+
├── directives/ # Vue directives (tooltip)
|
|
353
|
+
├── types/ # TypeScript type definitions
|
|
354
|
+
├── css/ # Stylesheets
|
|
355
|
+
│ ├── styles.css
|
|
356
|
+
│ ├── tooltip.css
|
|
357
|
+
│ ├── transition.css
|
|
358
|
+
│ └── vue-datepicker.css
|
|
359
|
+
├── utils/ # Utility functions (currently empty)
|
|
360
|
+
├── index.ts # Main entry point
|
|
361
|
+
└── example.ts # Example usage
|
|
118
362
|
```
|
|
119
363
|
|
|
120
|
-
|
|
364
|
+
### Build Output
|
|
121
365
|
|
|
122
|
-
|
|
366
|
+
The library builds to `dist/` with:
|
|
367
|
+
- `dist/index.js` - ES Module
|
|
368
|
+
- `dist/index.cjs` - CommonJS
|
|
369
|
+
- `dist/index.d.ts` - Type Definitions
|
|
370
|
+
- `dist/styles.css` - Compiled Styles
|
|
123
371
|
|
|
124
|
-
|
|
125
|
-
- `Input`, `Select`, `CountryCode` (inputs)
|
|
126
|
-
- `Tabs`, `Badge`, `Dialog`, `Dropdown`, `DataGrid`, `DurationTimeline`, `Text`, `Iconsax`
|
|
372
|
+
### Configuration Files
|
|
127
373
|
|
|
128
|
-
|
|
374
|
+
- `vite.config.ts` - Vite build configuration
|
|
375
|
+
- `tailwind.config.js` - Tailwind CSS configuration
|
|
376
|
+
- `tsconfig.json` - TypeScript configuration
|
|
377
|
+
- `package.json` - Dependencies and scripts
|
|
129
378
|
|
|
130
379
|
## Contributing
|
|
131
380
|
|
|
132
|
-
Contributions are welcome
|
|
133
|
-
|
|
134
|
-
1. Fork the
|
|
135
|
-
2. Install dependencies and run the dev server
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
```
|
|
381
|
+
Contributions are welcome! Typical workflow:
|
|
382
|
+
|
|
383
|
+
1. Fork the repository and create a feature branch
|
|
384
|
+
2. Install dependencies and run the dev server:
|
|
385
|
+
```bash
|
|
386
|
+
npm install
|
|
387
|
+
npm run dev
|
|
388
|
+
```
|
|
389
|
+
3. Make your changes to components, directives, or utilities
|
|
390
|
+
4. Add examples or update component documentation
|
|
391
|
+
5. Run type checker to ensure no TypeScript errors:
|
|
392
|
+
```bash
|
|
393
|
+
npm run type-check
|
|
394
|
+
```
|
|
395
|
+
6. Test your changes in the dev environment
|
|
396
|
+
7. Open a Pull Request with a clear description of changes
|
|
397
|
+
|
|
398
|
+
### Before Submitting a PR
|
|
399
|
+
|
|
400
|
+
Please ensure:
|
|
401
|
+
- All TypeScript errors are resolved
|
|
402
|
+
- Components follow existing patterns and conventions
|
|
403
|
+
- Props are properly typed with interfaces
|
|
404
|
+
- Documentation comments are added for complex logic
|
|
405
|
+
- CSS follows Tailwind utility-first approach with logical properties (RTL-safe)
|
|
144
406
|
|
|
145
407
|
## License
|
|
146
408
|
|
|
147
409
|
MIT
|
|
148
410
|
|
|
149
411
|
---
|
|
150
|
-
|
|
412
|
+
|
|
413
|
+
For questions, feature requests, or bug reports, please open an issue on the repository.
|