@tolle_/tolle-ui 0.0.1-beta
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 +35 -0
- package/esm2022/lib/accordion-item.component.mjs +78 -0
- package/esm2022/lib/accordion.component.mjs +60 -0
- package/esm2022/lib/badge.component.mjs +76 -0
- package/esm2022/lib/button-group.component.mjs +25 -0
- package/esm2022/lib/button.component.mjs +70 -0
- package/esm2022/lib/calendar.component.mjs +315 -0
- package/esm2022/lib/card.component.mjs +94 -0
- package/esm2022/lib/checkbox.component.mjs +100 -0
- package/esm2022/lib/data-table.component.mjs +332 -0
- package/esm2022/lib/date-picker.component.mjs +232 -0
- package/esm2022/lib/date-range-picker.component.mjs +208 -0
- package/esm2022/lib/input.component.mjs +134 -0
- package/esm2022/lib/masked-input.component.mjs +179 -0
- package/esm2022/lib/modal-ref.mjs +31 -0
- package/esm2022/lib/modal-stack.service.mjs +26 -0
- package/esm2022/lib/modal.component.mjs +98 -0
- package/esm2022/lib/modal.mjs +27 -0
- package/esm2022/lib/modal.service.mjs +65 -0
- package/esm2022/lib/multi-select.component.mjs +231 -0
- package/esm2022/lib/pagination.component.mjs +279 -0
- package/esm2022/lib/range-calendar.component.mjs +285 -0
- package/esm2022/lib/select-group.component.mjs +28 -0
- package/esm2022/lib/select-item.component.mjs +84 -0
- package/esm2022/lib/select-separator.component.mjs +24 -0
- package/esm2022/lib/select.component.mjs +261 -0
- package/esm2022/lib/select.service.mjs +21 -0
- package/esm2022/lib/skeleton.component.mjs +34 -0
- package/esm2022/lib/switch.component.mjs +133 -0
- package/esm2022/lib/toast.service.mjs +59 -0
- package/esm2022/lib/tolle-cell.directive.mjs +22 -0
- package/esm2022/lib/tolle-config.mjs +11 -0
- package/esm2022/lib/tooltip.directive.mjs +71 -0
- package/esm2022/lib/types/date-range.mjs +2 -0
- package/esm2022/lib/utils/cn.mjs +6 -0
- package/esm2022/public-api.mjs +36 -0
- package/esm2022/tolle_-tolle-ui.mjs +5 -0
- package/fesm2022/tolle_-tolle-ui.mjs +3553 -0
- package/fesm2022/tolle_-tolle-ui.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/accordion-item.component.d.ts +13 -0
- package/lib/accordion.component.d.ts +14 -0
- package/lib/badge.component.d.ts +14 -0
- package/lib/button-group.component.d.ts +8 -0
- package/lib/button.component.d.ts +16 -0
- package/lib/calendar.component.d.ts +35 -0
- package/lib/card.component.d.ts +32 -0
- package/lib/checkbox.component.d.ts +23 -0
- package/lib/data-table.component.d.ts +45 -0
- package/lib/date-picker.component.d.ts +35 -0
- package/lib/date-range-picker.component.d.ts +36 -0
- package/lib/input.component.d.ts +27 -0
- package/lib/masked-input.component.d.ts +36 -0
- package/lib/modal-ref.d.ts +16 -0
- package/lib/modal-stack.service.d.ts +12 -0
- package/lib/modal.component.d.ts +19 -0
- package/lib/modal.d.ts +29 -0
- package/lib/modal.service.d.ts +18 -0
- package/lib/multi-select.component.d.ts +47 -0
- package/lib/pagination.component.d.ts +36 -0
- package/lib/range-calendar.component.d.ts +37 -0
- package/lib/select-group.component.d.ts +8 -0
- package/lib/select-item.component.d.ts +18 -0
- package/lib/select-separator.component.d.ts +8 -0
- package/lib/select.component.d.ts +45 -0
- package/lib/select.service.d.ts +10 -0
- package/lib/skeleton.component.d.ts +10 -0
- package/lib/switch.component.d.ts +39 -0
- package/lib/toast.service.d.ts +24 -0
- package/lib/tolle-cell.directive.d.ts +9 -0
- package/lib/tolle-config.d.ts +9 -0
- package/lib/tooltip.directive.d.ts +15 -0
- package/lib/types/date-range.d.ts +4 -0
- package/lib/utils/cn.d.ts +2 -0
- package/package.json +32 -0
- package/public-api.d.ts +32 -0
- package/theme.css +211 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class TolleCellDirective {
|
|
4
|
+
template: TemplateRef<any>;
|
|
5
|
+
name: string;
|
|
6
|
+
constructor(template: TemplateRef<any>);
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TolleCellDirective, never>;
|
|
8
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TolleCellDirective, "[tolleCell]", never, { "name": { "alias": "tolleCell"; "required": false; }; }, {}, never, never, true, never>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InjectionToken, Provider } from '@angular/core';
|
|
2
|
+
export interface TolleConfig {
|
|
3
|
+
primaryColor?: string;
|
|
4
|
+
radius?: string;
|
|
5
|
+
defaultToastDuration?: number;
|
|
6
|
+
darkByDefault?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const TOLLE_CONFIG: InjectionToken<TolleConfig>;
|
|
9
|
+
export declare function provideTolleConfig(config: TolleConfig): Provider[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ElementRef, OnDestroy } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class TooltipDirective implements OnDestroy {
|
|
4
|
+
private el;
|
|
5
|
+
content: string;
|
|
6
|
+
placement: 'top' | 'bottom' | 'left' | 'right';
|
|
7
|
+
private tooltipEl;
|
|
8
|
+
private cleanup?;
|
|
9
|
+
constructor(el: ElementRef);
|
|
10
|
+
show(): void;
|
|
11
|
+
hide(): void;
|
|
12
|
+
ngOnDestroy(): void;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TooltipDirective, never>;
|
|
14
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[tolleTooltip]", never, { "content": { "alias": "tolleTooltip"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; }, {}, never, never, true, never>;
|
|
15
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tolle_/tolle-ui",
|
|
3
|
+
"version": "0.0.1-beta",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"description": "A high-performance Angular UI library.",
|
|
8
|
+
"author": "Bernard Kojo Ossei-Agyei <bernard.ossei@gmail.com>",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"peerDependencies": {
|
|
11
|
+
"@angular/common": "^18.2.0",
|
|
12
|
+
"@angular/core": "^18.2.0",
|
|
13
|
+
"@floating-ui/dom": "^1.7.4"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"tslib": "^2.3.0"
|
|
17
|
+
},
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"module": "fesm2022/tolle_-tolle-ui.mjs",
|
|
20
|
+
"typings": "index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
"./package.json": {
|
|
23
|
+
"default": "./package.json"
|
|
24
|
+
},
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./index.d.ts",
|
|
27
|
+
"esm2022": "./esm2022/tolle_-tolle-ui.mjs",
|
|
28
|
+
"esm": "./esm2022/tolle_-tolle-ui.mjs",
|
|
29
|
+
"default": "./fesm2022/tolle_-tolle-ui.mjs"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export * from './lib/utils/cn';
|
|
2
|
+
export * from './lib/button.component';
|
|
3
|
+
export * from './lib/input.component';
|
|
4
|
+
export * from './lib/card.component';
|
|
5
|
+
export * from './lib/select.component';
|
|
6
|
+
export * from './lib/select-item.component';
|
|
7
|
+
export * from './lib/select-group.component';
|
|
8
|
+
export * from './lib/select-separator.component';
|
|
9
|
+
export * from './lib/switch.component';
|
|
10
|
+
export * from './lib/badge.component';
|
|
11
|
+
export * from './lib/skeleton.component';
|
|
12
|
+
export * from './lib/checkbox.component';
|
|
13
|
+
export * from './lib/tooltip.directive';
|
|
14
|
+
export * from './lib/toast.service';
|
|
15
|
+
export * from './lib/tolle-config';
|
|
16
|
+
export * from './lib/multi-select.component';
|
|
17
|
+
export * from './lib/calendar.component';
|
|
18
|
+
export * from './lib/masked-input.component';
|
|
19
|
+
export * from './lib/date-picker.component';
|
|
20
|
+
export * from './lib/pagination.component';
|
|
21
|
+
export * from './lib/data-table.component';
|
|
22
|
+
export * from './lib/tolle-cell.directive';
|
|
23
|
+
export * from './lib/accordion-item.component';
|
|
24
|
+
export * from './lib/accordion.component';
|
|
25
|
+
export * from './lib/modal.component';
|
|
26
|
+
export * from './lib/modal-ref';
|
|
27
|
+
export * from './lib/modal.service';
|
|
28
|
+
export * from './lib/modal-stack.service';
|
|
29
|
+
export * from './lib/modal';
|
|
30
|
+
export * from './lib/button-group.component';
|
|
31
|
+
export * from './lib/date-range-picker.component';
|
|
32
|
+
export * from './lib/range-calendar.component';
|
package/theme.css
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/* Import CDK overlay styles */
|
|
2
|
+
@tailwind base;
|
|
3
|
+
@tailwind components;
|
|
4
|
+
@tailwind utilities;
|
|
5
|
+
|
|
6
|
+
:root {
|
|
7
|
+
/* --- 1. CONFIGURATION (The only things you change) --- */
|
|
8
|
+
/* Blue-600 as default primary */
|
|
9
|
+
--primary: #2563eb;
|
|
10
|
+
--radius: 0.5rem;
|
|
11
|
+
|
|
12
|
+
/* --- 2. AUTO-GENERATION (Do not touch unless tweaking logic) --- */
|
|
13
|
+
|
|
14
|
+
/* Foreground: White text on primary */
|
|
15
|
+
--primary-foreground: #ffffff;
|
|
16
|
+
/* Secondary: Mix Primary with 85% White */
|
|
17
|
+
--secondary: color-mix(in srgb, var(--primary), #ffffff 85%);
|
|
18
|
+
--secondary-foreground: color-mix(in srgb, var(--primary), #000000 80%);
|
|
19
|
+
|
|
20
|
+
/* Muted: Mix Primary with 92% Light Gray */
|
|
21
|
+
--muted: color-mix(in srgb, var(--primary), #f3f4f6 92%);
|
|
22
|
+
--muted-foreground: color-mix(in srgb, var(--primary), #4b5563 40%);
|
|
23
|
+
--muted-foreground: #71717a;
|
|
24
|
+
/* Accent: Very light wash of primary (for hovers) */
|
|
25
|
+
--accent: color-mix(in srgb, var(--primary), transparent 90%);
|
|
26
|
+
--accent-foreground: var(--primary);
|
|
27
|
+
|
|
28
|
+
/* Borders */
|
|
29
|
+
--border: #dddddd;
|
|
30
|
+
--input: #e4e4e7;
|
|
31
|
+
|
|
32
|
+
/* Base */
|
|
33
|
+
--background: #ffffff;
|
|
34
|
+
--foreground: #020817;
|
|
35
|
+
--ring: color-mix(in srgb, var(--primary), transparent 75%);
|
|
36
|
+
--destructive: #ef4444;
|
|
37
|
+
--destructive-foreground: #f8fafc;
|
|
38
|
+
--input-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.dark {
|
|
42
|
+
/* --- Google Dark Mode Palette --- */
|
|
43
|
+
--background: #121212; /* Base Background */
|
|
44
|
+
--foreground: #e3e3e3; /* Soft white/gray text */
|
|
45
|
+
|
|
46
|
+
/* Secondary: Elevated surface (Google's "Surface" color) */
|
|
47
|
+
--secondary: #1f1f1f;
|
|
48
|
+
--secondary-foreground: #ffffff;
|
|
49
|
+
|
|
50
|
+
/* Muted: Used for tags or inactive backgrounds */
|
|
51
|
+
--muted: #2a2a2a;
|
|
52
|
+
--muted-foreground: #9aa0a6; /* Google's muted gray text */
|
|
53
|
+
|
|
54
|
+
/* Borders: Very subtle against the charcoal background */
|
|
55
|
+
--border: #3c4043;
|
|
56
|
+
--input: #3c4043;
|
|
57
|
+
|
|
58
|
+
/* Popover/Dropdown: Matches elevated surfaces */
|
|
59
|
+
--popover: #1f1f1f;
|
|
60
|
+
--popover-foreground: #e3e3e3;
|
|
61
|
+
|
|
62
|
+
/* Accent: Hover states */
|
|
63
|
+
--accent: rgba(255, 255, 255, 0.04);
|
|
64
|
+
--accent-foreground: var(--primary);
|
|
65
|
+
|
|
66
|
+
/* Primary Ring: Lower opacity for charcoal backgrounds */
|
|
67
|
+
--ring: color-mix(in srgb, var(--primary), transparent 40%);
|
|
68
|
+
--input-shadow: 0 0 #0000;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.dark tolle-card {
|
|
72
|
+
background-color: var(--secondary); /* #1f1f1f */
|
|
73
|
+
border-color: var(--border);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.dark tolle-input, .dark tolle-select button {
|
|
77
|
+
background-color: transparent; /* Google inputs often have a transparent or very dark base */
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
tolle-button svg {
|
|
81
|
+
@apply w-4 h-4; /* Default Lucide/Radix icon size */
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.h-8 svg {
|
|
85
|
+
@apply w-3.5 h-3.5;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@layer base {
|
|
89
|
+
/* This ensures Remix Icons are centered and sized relative to text */
|
|
90
|
+
i[class^="ri-"], i[class*=" ri-"] {
|
|
91
|
+
display: inline-flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
vertical-align: middle;
|
|
95
|
+
line-height: 1;
|
|
96
|
+
/* Standardized icon size for buttons/inputs */
|
|
97
|
+
font-size: 1.2rem;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Handle spacing when an icon is next to text */
|
|
101
|
+
.tolle-button-content {
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
gap: 0.5rem;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* Scale icons down for XS and SM containers */
|
|
108
|
+
.size-xs i[class^="ri-"],
|
|
109
|
+
.size-xs i[class*=" ri-"],
|
|
110
|
+
.size-sm i[class^="ri-"],
|
|
111
|
+
.size-sm i[class*=" ri-"] {
|
|
112
|
+
font-size: 1rem;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@layer components {
|
|
117
|
+
/* Target the internal input and button elements */
|
|
118
|
+
tolle-input input,
|
|
119
|
+
tolle-select button,
|
|
120
|
+
tolle-masked-input input,
|
|
121
|
+
tolle-date-picker tolle-masked-input input {
|
|
122
|
+
box-shadow: var(--input-shadow);
|
|
123
|
+
transition: box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* Remove shadow on focus to let the 'ring' effect take over cleanly */
|
|
127
|
+
tolle-input input:focus,
|
|
128
|
+
tolle-select button:focus,
|
|
129
|
+
tolle-masked-input input:focus {
|
|
130
|
+
box-shadow: 0 0 #0000;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* Compact dropdown items when select is xs/sm */
|
|
135
|
+
.size-xs tolle-select-item > div { padding: 4px 8px 4px 32px; font-size: 12px; }
|
|
136
|
+
.size-sm tolle-select-item > div { padding: 6px 12px 6px 32px; }
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
/* Ensure the backdrop covers the screen */
|
|
141
|
+
.cdk-overlay-backdrop {
|
|
142
|
+
position: fixed;
|
|
143
|
+
top: 0;
|
|
144
|
+
left: 0;
|
|
145
|
+
right: 0;
|
|
146
|
+
bottom: 0;
|
|
147
|
+
pointer-events: auto;
|
|
148
|
+
-webkit-tap-highlight-color: transparent;
|
|
149
|
+
transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* Our custom backdrop style from earlier */
|
|
153
|
+
.tolle-modal-backdrop {
|
|
154
|
+
background-color: rgba(0, 0, 0, 0.8);
|
|
155
|
+
backdrop-filter: blur(4px);
|
|
156
|
+
z-index: 50;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
/* --- Core Overlay Container --- */
|
|
161
|
+
.cdk-overlay-container {
|
|
162
|
+
position: fixed;
|
|
163
|
+
z-index: 1000;
|
|
164
|
+
top: 0;
|
|
165
|
+
left: 0;
|
|
166
|
+
width: 100%;
|
|
167
|
+
height: 100%;
|
|
168
|
+
pointer-events: none;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* --- The Individual Overlay Pane (The Modal Window) --- */
|
|
172
|
+
.cdk-overlay-pane {
|
|
173
|
+
position: absolute;
|
|
174
|
+
pointer-events: auto;
|
|
175
|
+
box-sizing: border-box;
|
|
176
|
+
z-index: 1001; /* Must be HIGHER than the backdrop */
|
|
177
|
+
display: flex;
|
|
178
|
+
flex-direction: column;
|
|
179
|
+
align-items: center;
|
|
180
|
+
justify-content: center;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* --- The Backdrop --- */
|
|
184
|
+
.cdk-overlay-backdrop {
|
|
185
|
+
position: absolute;
|
|
186
|
+
top: 0;
|
|
187
|
+
bottom: 0;
|
|
188
|
+
left: 0;
|
|
189
|
+
right: 0;
|
|
190
|
+
z-index: 1000; /* Must be LOWER than the pane */
|
|
191
|
+
pointer-events: auto;
|
|
192
|
+
-webkit-tap-highlight-color: transparent;
|
|
193
|
+
transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);
|
|
194
|
+
opacity: 0;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.cdk-overlay-backdrop-showing {
|
|
198
|
+
opacity: 1;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/* Utility to ensure the flex centering works */
|
|
202
|
+
.cdk-global-overlay-wrapper {
|
|
203
|
+
display: flex;
|
|
204
|
+
position: absolute;
|
|
205
|
+
z-index: 1001;
|
|
206
|
+
top: 0;
|
|
207
|
+
left: 0;
|
|
208
|
+
width: 100%;
|
|
209
|
+
height: 100%;
|
|
210
|
+
pointer-events: none;
|
|
211
|
+
}
|