portal-design-system 0.0.89 → 0.0.90
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 +57 -77
- package/dist/components/DataGrid.vue.d.ts +7 -0
- package/dist/components/Dropdown.vue.d.ts +24 -4
- package/dist/index.cjs +22 -22
- package/dist/index.js +7645 -7692
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
+
|
|
1
2
|
# Portal Design System
|
|
2
3
|
|
|
3
|
-
A type-safe Vue 3 UI component library built with Tailwind CSS
|
|
4
|
+
A type-safe Vue 3 UI component library built with Tailwind CSS and isolated styles for easy integration into projects.
|
|
4
5
|
|
|
5
|
-
##
|
|
6
|
+
## Quick Overview
|
|
6
7
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
- 🖋️ **Custom Fonts** - Inter and JetBrains Mono fonts included
|
|
12
|
-
- 📦 **Tree-shakeable** - Only import what you need
|
|
13
|
-
- 🚀 **Zero Config** - Works out of the box
|
|
8
|
+
- Framework: Vue 3 (Composition API)
|
|
9
|
+
- Styling: Tailwind CSS (prefixed utilities for isolation)
|
|
10
|
+
- Language: TypeScript
|
|
11
|
+
- Distribution: ESM / CJS + CSS + types
|
|
14
12
|
|
|
15
13
|
## Installation
|
|
16
14
|
|
|
15
|
+
Install the package from npm (or use your preferred package manager):
|
|
16
|
+
|
|
17
17
|
```bash
|
|
18
18
|
npm install portal-design-system
|
|
19
19
|
# or
|
|
20
20
|
yarn add portal-design-system
|
|
21
21
|
# or
|
|
22
22
|
pnpm add portal-design-system
|
|
23
|
-
# or
|
|
24
|
-
bun add portal-design-system
|
|
25
23
|
```
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
If you use Bun:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
bun add portal-design-system
|
|
29
|
+
```
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
## Quick Start
|
|
30
32
|
|
|
31
|
-
Import the CSS
|
|
33
|
+
1. Import the compiled CSS (one-time in your app entry, e.g. `main.ts`):
|
|
32
34
|
|
|
33
|
-
```
|
|
35
|
+
```ts
|
|
34
36
|
import 'portal-design-system/styles'
|
|
35
37
|
```
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Wrap your components with the `portal-design-system` class to ensure style isolation when used as Vue components:
|
|
39
|
+
2. Use components in your Vue app:
|
|
40
40
|
|
|
41
41
|
```vue
|
|
42
42
|
<script setup lang="ts">
|
|
@@ -45,100 +45,80 @@ import { Button } from 'portal-design-system'
|
|
|
45
45
|
|
|
46
46
|
<template>
|
|
47
47
|
<div class="portal-design-system">
|
|
48
|
-
<Button variant="primary"
|
|
49
|
-
<Button variant="secondary">Secondary Button</Button>
|
|
50
|
-
<Button variant="danger" :disabled="true">Disabled</Button>
|
|
48
|
+
<Button variant="primary">Primary</Button>
|
|
51
49
|
</div>
|
|
52
50
|
</template>
|
|
53
51
|
```
|
|
54
52
|
|
|
55
|
-
###
|
|
53
|
+
### Web Components (optional)
|
|
56
54
|
|
|
57
|
-
|
|
55
|
+
The library can expose Web Components (Shadow DOM) for full style encapsulation. Register them when needed:
|
|
58
56
|
|
|
59
57
|
```html
|
|
60
58
|
<script type="module">
|
|
61
59
|
import { defineCustomElements } from 'portal-design-system'
|
|
62
|
-
// Register all provided web components (e.g., <pds-button>)
|
|
63
60
|
defineCustomElements()
|
|
64
61
|
</script>
|
|
65
62
|
|
|
66
63
|
<pds-button variant="primary">Shadow Button</pds-button>
|
|
67
64
|
```
|
|
68
65
|
|
|
69
|
-
|
|
70
|
-
- Web components inject the library's compiled CSS directly into each ShadowRoot, so you don't need to import `portal-design-system/styles` globally for Shadow DOM usage.
|
|
71
|
-
- Attributes on the custom element are parsed as props (boolean and numbers are coerced when reasonable).
|
|
72
|
-
- The web component tag for Button is `<pds-button>`.
|
|
73
|
-
|
|
74
|
-
### TypeScript Support
|
|
75
|
-
|
|
76
|
-
The library is fully typed. You'll get autocomplete and type checking for all props:
|
|
66
|
+
## Development
|
|
77
67
|
|
|
78
|
-
|
|
79
|
-
<script setup lang="ts">
|
|
80
|
-
import { Button, type ButtonProps } from 'portal-design-system'
|
|
68
|
+
Common development tasks (scripts available in `package.json`):
|
|
81
69
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
disabled: false
|
|
86
|
-
}
|
|
87
|
-
</script>
|
|
88
|
-
```
|
|
70
|
+
```bash
|
|
71
|
+
# Start dev server
|
|
72
|
+
npm run dev
|
|
89
73
|
|
|
90
|
-
|
|
74
|
+
# Build library
|
|
75
|
+
npm run build
|
|
91
76
|
|
|
92
|
-
|
|
77
|
+
# Type check
|
|
78
|
+
npm run type-check
|
|
93
79
|
|
|
94
|
-
|
|
80
|
+
# Preview production build
|
|
81
|
+
npm run preview
|
|
82
|
+
```
|
|
95
83
|
|
|
96
|
-
|
|
84
|
+
If you prefer Bun, you can run `bun` equivalents where appropriate.
|
|
97
85
|
|
|
98
|
-
|
|
99
|
-
- `size` - `'sm' | 'md' | 'lg'` (default: `'md'`)
|
|
100
|
-
- `disabled` - `boolean` (default: `false`)
|
|
86
|
+
## Package Exports
|
|
101
87
|
|
|
102
|
-
|
|
88
|
+
The package exposes the components and styles. Import styles directly with:
|
|
103
89
|
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
<Button variant="secondary" size="sm">Small Secondary</Button>
|
|
107
|
-
<Button variant="danger" :disabled="true">Disabled Danger</Button>
|
|
90
|
+
```ts
|
|
91
|
+
import 'portal-design-system/styles'
|
|
108
92
|
```
|
|
109
93
|
|
|
110
|
-
|
|
94
|
+
Import components by name from the package root.
|
|
111
95
|
|
|
112
|
-
|
|
96
|
+
## Included Components (high level)
|
|
113
97
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
98
|
+
- `Button`
|
|
99
|
+
- `Input`, `Select`, `CountryCode` (inputs)
|
|
100
|
+
- `Tabs`, `Badge`, `Dialog`, `Dropdown`, `DataGrid`, `DurationTimeline`, `Text`, `Iconsax`
|
|
117
101
|
|
|
118
|
-
|
|
102
|
+
See the `src/components` folder for the full list and examples.
|
|
119
103
|
|
|
120
|
-
|
|
121
|
-
# Install dependencies
|
|
122
|
-
bun install
|
|
104
|
+
## Contributing
|
|
123
105
|
|
|
124
|
-
|
|
125
|
-
bun run type-check
|
|
126
|
-
|
|
127
|
-
# Build library
|
|
128
|
-
bun run build
|
|
106
|
+
Contributions are welcome. Typical workflow:
|
|
129
107
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
108
|
+
1. Fork the repo and create a branch for your change.
|
|
109
|
+
2. Install dependencies and run the dev server.
|
|
110
|
+
3. Add tests or examples for new components.
|
|
111
|
+
4. Open a PR with a clear description of your change.
|
|
133
112
|
|
|
134
|
-
|
|
113
|
+
Please run the type checker before opening a PR:
|
|
135
114
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
- TypeScript declarations (`dist/index.d.ts`)
|
|
140
|
-
- Compiled CSS (`dist/styles.css`)
|
|
115
|
+
```bash
|
|
116
|
+
npm run type-check
|
|
117
|
+
```
|
|
141
118
|
|
|
142
119
|
## License
|
|
143
120
|
|
|
144
121
|
MIT
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
If you'd like any extra sections (changelog, CI badges, examples), tell me which details to include.
|
|
@@ -24,8 +24,15 @@ type __VLS_Props = {
|
|
|
24
24
|
declare function __VLS_template(): {
|
|
25
25
|
attrs: Partial<{}>;
|
|
26
26
|
slots: Partial<Record<string, (_: any) => any>> & {
|
|
27
|
+
customRefreshButton?(_: {
|
|
28
|
+
refresh: () => Promise<void> | undefined;
|
|
29
|
+
}): any;
|
|
30
|
+
exportButton?(_: {}): any;
|
|
27
31
|
createButton?(_: {}): any;
|
|
28
32
|
toolbarLeft?(_: {}): any;
|
|
33
|
+
customColumnChooser?(_: {
|
|
34
|
+
onClick: () => void;
|
|
35
|
+
}): any;
|
|
29
36
|
toolbarRight?(_: {}): any;
|
|
30
37
|
};
|
|
31
38
|
refs: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SelectOptionType, SvgBasedIconName } from '../types';
|
|
2
|
-
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
import { DefineProps, DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
import { LooseRequired } from '@vue/shared';
|
|
3
4
|
type __VLS_Props = {
|
|
4
5
|
id: string;
|
|
5
6
|
label?: string;
|
|
@@ -16,9 +17,28 @@ type __VLS_Props = {
|
|
|
16
17
|
type __VLS_PublicProps = {
|
|
17
18
|
modelValue?: any;
|
|
18
19
|
} & __VLS_Props;
|
|
19
|
-
declare
|
|
20
|
-
|
|
20
|
+
declare function __VLS_template(): {
|
|
21
|
+
attrs: Partial<{}>;
|
|
22
|
+
slots: {
|
|
23
|
+
select?(_: {
|
|
24
|
+
selected: any;
|
|
25
|
+
props: DefineProps<LooseRequired<__VLS_Props>, "disabled">;
|
|
26
|
+
onUpdate: (value: any) => void;
|
|
27
|
+
}): any;
|
|
28
|
+
};
|
|
29
|
+
refs: {};
|
|
30
|
+
rootEl: HTMLDivElement;
|
|
31
|
+
};
|
|
32
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
33
|
+
declare const __VLS_component: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
34
|
+
"update:modelValue": (value: any) => any;
|
|
21
35
|
}, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
22
|
-
"onUpdate:modelValue"?: ((
|
|
36
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
23
37
|
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
38
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
24
39
|
export default _default;
|
|
40
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
41
|
+
new (): {
|
|
42
|
+
$slots: S;
|
|
43
|
+
};
|
|
44
|
+
};
|