@kya-os/consent 0.1.0
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/dist/constants/auth-modes.d.ts +54 -0
- package/dist/constants/auth-modes.d.ts.map +1 -0
- package/dist/constants/auth-modes.js +128 -0
- package/dist/constants/auth-modes.js.map +1 -0
- package/dist/constants/colors.d.ts +38 -0
- package/dist/constants/colors.d.ts.map +1 -0
- package/dist/constants/colors.js +40 -0
- package/dist/constants/colors.js.map +1 -0
- package/dist/constants/defaults.d.ts +112 -0
- package/dist/constants/defaults.d.ts.map +1 -0
- package/dist/constants/defaults.js +146 -0
- package/dist/constants/defaults.js.map +1 -0
- package/dist/constants/index.d.ts +11 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +37 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/resolution/index.d.ts +12 -0
- package/dist/resolution/index.d.ts.map +1 -0
- package/dist/resolution/index.js +28 -0
- package/dist/resolution/index.js.map +1 -0
- package/dist/resolution/resolve-branding.d.ts +70 -0
- package/dist/resolution/resolve-branding.d.ts.map +1 -0
- package/dist/resolution/resolve-branding.js +159 -0
- package/dist/resolution/resolve-branding.js.map +1 -0
- package/dist/resolution/resolve-config.d.ts +81 -0
- package/dist/resolution/resolve-config.d.ts.map +1 -0
- package/dist/resolution/resolve-config.js +254 -0
- package/dist/resolution/resolve-config.js.map +1 -0
- package/dist/resolution/resolve-copy.d.ts +53 -0
- package/dist/resolution/resolve-copy.d.ts.map +1 -0
- package/dist/resolution/resolve-copy.js +136 -0
- package/dist/resolution/resolve-copy.js.map +1 -0
- package/dist/schemas/api.schemas.d.ts +984 -0
- package/dist/schemas/api.schemas.d.ts.map +1 -0
- package/dist/schemas/api.schemas.js +153 -0
- package/dist/schemas/api.schemas.js.map +1 -0
- package/dist/schemas/branding.schemas.d.ts +100 -0
- package/dist/schemas/branding.schemas.d.ts.map +1 -0
- package/dist/schemas/branding.schemas.js +57 -0
- package/dist/schemas/branding.schemas.js.map +1 -0
- package/dist/schemas/config.schemas.d.ts +1182 -0
- package/dist/schemas/config.schemas.d.ts.map +1 -0
- package/dist/schemas/config.schemas.js +147 -0
- package/dist/schemas/config.schemas.js.map +1 -0
- package/dist/schemas/index.d.ts +13 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +29 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/modes.schemas.d.ts +406 -0
- package/dist/schemas/modes.schemas.d.ts.map +1 -0
- package/dist/schemas/modes.schemas.js +107 -0
- package/dist/schemas/modes.schemas.js.map +1 -0
- package/dist/security/escape.d.ts +114 -0
- package/dist/security/escape.d.ts.map +1 -0
- package/dist/security/escape.js +202 -0
- package/dist/security/escape.js.map +1 -0
- package/dist/security/index.d.ts +10 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +26 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/validators.d.ts +98 -0
- package/dist/security/validators.d.ts.map +1 -0
- package/dist/security/validators.js +210 -0
- package/dist/security/validators.js.map +1 -0
- package/dist/styles/css-variables.d.ts +78 -0
- package/dist/styles/css-variables.d.ts.map +1 -0
- package/dist/styles/css-variables.js +129 -0
- package/dist/styles/css-variables.js.map +1 -0
- package/dist/styles/index.d.ts +12 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/styles/index.js +28 -0
- package/dist/styles/index.js.map +1 -0
- package/dist/styles/stylesheet.d.ts +57 -0
- package/dist/styles/stylesheet.d.ts.map +1 -0
- package/dist/styles/stylesheet.js +204 -0
- package/dist/styles/stylesheet.js.map +1 -0
- package/dist/styles/tokens.d.ts +141 -0
- package/dist/styles/tokens.d.ts.map +1 -0
- package/dist/styles/tokens.js +183 -0
- package/dist/styles/tokens.js.map +1 -0
- package/dist/templates/base/base-template.d.ts +81 -0
- package/dist/templates/base/base-template.d.ts.map +1 -0
- package/dist/templates/base/base-template.js +282 -0
- package/dist/templates/base/base-template.js.map +1 -0
- package/dist/templates/base/components.d.ts +120 -0
- package/dist/templates/base/components.d.ts.map +1 -0
- package/dist/templates/base/components.js +295 -0
- package/dist/templates/base/components.js.map +1 -0
- package/dist/templates/base/index.d.ts +8 -0
- package/dist/templates/base/index.d.ts.map +1 -0
- package/dist/templates/base/index.js +26 -0
- package/dist/templates/base/index.js.map +1 -0
- package/dist/templates/index.d.ts +18 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +34 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/modes/consent-only.template.d.ts +36 -0
- package/dist/templates/modes/consent-only.template.d.ts.map +1 -0
- package/dist/templates/modes/consent-only.template.js +74 -0
- package/dist/templates/modes/consent-only.template.js.map +1 -0
- package/dist/templates/modes/credentials.template.d.ts +65 -0
- package/dist/templates/modes/credentials.template.d.ts.map +1 -0
- package/dist/templates/modes/credentials.template.js +414 -0
- package/dist/templates/modes/credentials.template.js.map +1 -0
- package/dist/templates/modes/index.d.ts +14 -0
- package/dist/templates/modes/index.d.ts.map +1 -0
- package/dist/templates/modes/index.js +24 -0
- package/dist/templates/modes/index.js.map +1 -0
- package/dist/templates/modes/magic-link.template.d.ts +33 -0
- package/dist/templates/modes/magic-link.template.d.ts.map +1 -0
- package/dist/templates/modes/magic-link.template.js +196 -0
- package/dist/templates/modes/magic-link.template.js.map +1 -0
- package/dist/templates/modes/oauth.template.d.ts +40 -0
- package/dist/templates/modes/oauth.template.d.ts.map +1 -0
- package/dist/templates/modes/oauth.template.js +153 -0
- package/dist/templates/modes/oauth.template.js.map +1 -0
- package/dist/templates/modes/otp.template.d.ts +35 -0
- package/dist/templates/modes/otp.template.d.ts.map +1 -0
- package/dist/templates/modes/otp.template.js +316 -0
- package/dist/templates/modes/otp.template.js.map +1 -0
- package/dist/templates/modes/success.template.d.ts +41 -0
- package/dist/templates/modes/success.template.d.ts.map +1 -0
- package/dist/templates/modes/success.template.js +140 -0
- package/dist/templates/modes/success.template.js.map +1 -0
- package/dist/templates/registry.d.ts +62 -0
- package/dist/templates/registry.d.ts.map +1 -0
- package/dist/templates/registry.js +135 -0
- package/dist/templates/registry.js.map +1 -0
- package/dist/types/api.types.d.ts +134 -0
- package/dist/types/api.types.d.ts.map +1 -0
- package/dist/types/api.types.js +10 -0
- package/dist/types/api.types.js.map +1 -0
- package/dist/types/branding.types.d.ts +53 -0
- package/dist/types/branding.types.d.ts.map +1 -0
- package/dist/types/branding.types.js +10 -0
- package/dist/types/branding.types.js.map +1 -0
- package/dist/types/config.types.d.ts +201 -0
- package/dist/types/config.types.d.ts.map +1 -0
- package/dist/types/config.types.js +10 -0
- package/dist/types/config.types.js.map +1 -0
- package/dist/types/copy.types.d.ts +109 -0
- package/dist/types/copy.types.d.ts.map +1 -0
- package/dist/types/copy.types.js +10 -0
- package/dist/types/copy.types.js.map +1 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +31 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/modes.types.d.ts +197 -0
- package/dist/types/modes.types.d.ts.map +1 -0
- package/dist/types/modes.types.js +35 -0
- package/dist/types/modes.types.js.map +1 -0
- package/dist/types/page.types.d.ts +120 -0
- package/dist/types/page.types.d.ts.map +1 -0
- package/dist/types/page.types.js +10 -0
- package/dist/types/page.types.js.map +1 -0
- package/package.json +83 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Stylesheet Generation
|
|
4
|
+
*
|
|
5
|
+
* Generates complete CSS stylesheets for consent pages.
|
|
6
|
+
*
|
|
7
|
+
* @module @kya-os/consent/styles/stylesheet
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.TRANSITION_STYLES = exports.SPINNER_STYLES = exports.INPUT_STYLES = exports.CHECKBOX_STYLES = void 0;
|
|
11
|
+
exports.generateStylesheet = generateStylesheet;
|
|
12
|
+
exports.generateInlineStyles = generateInlineStyles;
|
|
13
|
+
exports.generateComponentStyles = generateComponentStyles;
|
|
14
|
+
exports.generateHeadStyles = generateHeadStyles;
|
|
15
|
+
const css_variables_1 = require("./css-variables");
|
|
16
|
+
/**
|
|
17
|
+
* Custom checkbox styles that work with Tailwind's appearance-none
|
|
18
|
+
*
|
|
19
|
+
* Creates a checkmark using CSS that appears when checked.
|
|
20
|
+
*/
|
|
21
|
+
exports.CHECKBOX_STYLES = `
|
|
22
|
+
/* Custom checkbox checkmark */
|
|
23
|
+
input[type="checkbox"]:checked::before {
|
|
24
|
+
content: '';
|
|
25
|
+
position: absolute;
|
|
26
|
+
left: 50%;
|
|
27
|
+
top: 50%;
|
|
28
|
+
width: 5px;
|
|
29
|
+
height: 9px;
|
|
30
|
+
border: solid white;
|
|
31
|
+
border-width: 0 2px 2px 0;
|
|
32
|
+
transform: translate(-50%, -60%) rotate(45deg);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Focus ring for accessibility */
|
|
36
|
+
input[type="checkbox"]:focus-visible {
|
|
37
|
+
outline: 2px solid var(--consent-primary);
|
|
38
|
+
outline-offset: 2px;
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
/**
|
|
42
|
+
* Form input focus styles
|
|
43
|
+
*/
|
|
44
|
+
exports.INPUT_STYLES = `
|
|
45
|
+
/* Input focus states */
|
|
46
|
+
input:focus,
|
|
47
|
+
select:focus,
|
|
48
|
+
textarea:focus {
|
|
49
|
+
outline: none;
|
|
50
|
+
ring: 2px;
|
|
51
|
+
ring-color: var(--consent-primary);
|
|
52
|
+
border-color: transparent;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Password visibility toggle button */
|
|
56
|
+
.password-toggle {
|
|
57
|
+
position: absolute;
|
|
58
|
+
right: 12px;
|
|
59
|
+
top: 50%;
|
|
60
|
+
transform: translateY(-50%);
|
|
61
|
+
background: none;
|
|
62
|
+
border: none;
|
|
63
|
+
padding: 4px;
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
color: #6B7280;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.password-toggle:hover {
|
|
69
|
+
color: #374151;
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
/**
|
|
73
|
+
* Loading spinner animation
|
|
74
|
+
*/
|
|
75
|
+
exports.SPINNER_STYLES = `
|
|
76
|
+
/* Loading spinner */
|
|
77
|
+
@keyframes spin {
|
|
78
|
+
to {
|
|
79
|
+
transform: rotate(360deg);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.animate-spin {
|
|
84
|
+
animation: spin 1s linear infinite;
|
|
85
|
+
}
|
|
86
|
+
`;
|
|
87
|
+
/**
|
|
88
|
+
* Smooth transitions
|
|
89
|
+
*/
|
|
90
|
+
exports.TRANSITION_STYLES = `
|
|
91
|
+
/* Smooth transitions */
|
|
92
|
+
.transition-opacity {
|
|
93
|
+
transition-property: opacity;
|
|
94
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
95
|
+
transition-duration: 150ms;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.transition-colors {
|
|
99
|
+
transition-property: color, background-color, border-color;
|
|
100
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
101
|
+
transition-duration: 150ms;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.transition-shadow {
|
|
105
|
+
transition-property: box-shadow;
|
|
106
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
107
|
+
transition-duration: 150ms;
|
|
108
|
+
}
|
|
109
|
+
`;
|
|
110
|
+
/**
|
|
111
|
+
* Generate a complete stylesheet for consent pages
|
|
112
|
+
*
|
|
113
|
+
* @param branding - Branding configuration
|
|
114
|
+
* @returns Complete CSS stylesheet string
|
|
115
|
+
*/
|
|
116
|
+
function generateStylesheet(branding) {
|
|
117
|
+
const rootVars = (0, css_variables_1.generateRootCSSBlock)(branding);
|
|
118
|
+
return `
|
|
119
|
+
/* Consent Page Styles - Generated by @kya-os/consent */
|
|
120
|
+
|
|
121
|
+
${rootVars}
|
|
122
|
+
|
|
123
|
+
${exports.CHECKBOX_STYLES}
|
|
124
|
+
|
|
125
|
+
${exports.INPUT_STYLES}
|
|
126
|
+
|
|
127
|
+
${exports.SPINNER_STYLES}
|
|
128
|
+
|
|
129
|
+
${exports.TRANSITION_STYLES}
|
|
130
|
+
|
|
131
|
+
/* Button hover states with primary color */
|
|
132
|
+
button[type="submit"]:not(:disabled):hover,
|
|
133
|
+
.btn-primary:not(:disabled):hover {
|
|
134
|
+
opacity: 0.9;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Disabled states */
|
|
138
|
+
button:disabled,
|
|
139
|
+
input:disabled {
|
|
140
|
+
opacity: 0.5;
|
|
141
|
+
cursor: not-allowed;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Link with primary color */
|
|
145
|
+
a.consent-link {
|
|
146
|
+
color: var(--consent-primary);
|
|
147
|
+
text-decoration: none;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
a.consent-link:hover {
|
|
151
|
+
text-decoration: underline;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* Scope badge with derived colors */
|
|
155
|
+
.scope-badge {
|
|
156
|
+
background-color: var(--consent-secondary);
|
|
157
|
+
color: var(--consent-primary);
|
|
158
|
+
}
|
|
159
|
+
`.trim();
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Generate minimal inline styles (for embedding in HTML)
|
|
163
|
+
*
|
|
164
|
+
* @param branding - Branding configuration
|
|
165
|
+
* @returns Minimal CSS for inline <style> tag
|
|
166
|
+
*/
|
|
167
|
+
function generateInlineStyles(branding) {
|
|
168
|
+
const rootVars = (0, css_variables_1.generateRootCSSBlock)(branding);
|
|
169
|
+
return `
|
|
170
|
+
${rootVars}
|
|
171
|
+
${exports.CHECKBOX_STYLES}
|
|
172
|
+
input:focus { outline: none; box-shadow: 0 0 0 2px var(--consent-primary); }
|
|
173
|
+
`.trim();
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Generate styles for a specific component
|
|
177
|
+
*
|
|
178
|
+
* @param component - Component name
|
|
179
|
+
* @returns Component-specific CSS
|
|
180
|
+
*/
|
|
181
|
+
function generateComponentStyles(component) {
|
|
182
|
+
switch (component) {
|
|
183
|
+
case "checkbox":
|
|
184
|
+
return exports.CHECKBOX_STYLES;
|
|
185
|
+
case "input":
|
|
186
|
+
return exports.INPUT_STYLES;
|
|
187
|
+
case "spinner":
|
|
188
|
+
return exports.SPINNER_STYLES;
|
|
189
|
+
case "all":
|
|
190
|
+
return [exports.CHECKBOX_STYLES, exports.INPUT_STYLES, exports.SPINNER_STYLES, exports.TRANSITION_STYLES].join("\n");
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Generate styles for the <head> section of consent pages
|
|
195
|
+
*
|
|
196
|
+
* This is an alias for generateStylesheet for compatibility with templates.
|
|
197
|
+
*
|
|
198
|
+
* @param branding - Branding configuration
|
|
199
|
+
* @returns CSS styles for <style> tag in <head>
|
|
200
|
+
*/
|
|
201
|
+
function generateHeadStyles(branding) {
|
|
202
|
+
return generateStylesheet(branding);
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=stylesheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stylesheet.js","sourceRoot":"","sources":["../../src/styles/stylesheet.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AA6GH,gDA6CC;AAQD,oDAQC;AAQD,0DAaC;AAUD,gDAEC;AAxMD,mDAAuD;AAEvD;;;;GAIG;AACU,QAAA,eAAe,GAAG;;;;;;;;;;;;;;;;;;;CAmB9B,CAAC;AAEF;;GAEG;AACU,QAAA,YAAY,GAAG;;;;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th for all Tailwind classes used in consent pages.
|
|
5
|
+
* CRITICAL: These MUST match AgentShield preview components exactly.
|
|
6
|
+
*
|
|
7
|
+
* Divergences identified and fixed:
|
|
8
|
+
* - Button: py-2 → py-3, rounded-md → rounded-lg (match AgentShield)
|
|
9
|
+
* - Checkbox: w-5 h-5 → w-4 h-4 (match AgentShield)
|
|
10
|
+
* - Container: max-w-md → max-w-[512px] (match AgentShield)
|
|
11
|
+
*
|
|
12
|
+
* @module @kya-os/consent/styles/tokens
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* CONSENT_CLASSES - Canonical CSS classes for consent UI components
|
|
16
|
+
*
|
|
17
|
+
* All classes are Tailwind CSS utilities that match AgentShield exactly.
|
|
18
|
+
*/
|
|
19
|
+
export declare const CONSENT_CLASSES: {
|
|
20
|
+
/** Main container wrapper - background with centered content */
|
|
21
|
+
readonly wrapper: "bg-gray-50 min-h-screen flex items-center justify-center p-4";
|
|
22
|
+
/** Card container - MUST be max-w-[512px] not max-w-md (448px) */
|
|
23
|
+
readonly container: "bg-white rounded-[20px] border border-black/10 shadow-xl overflow-hidden max-w-[512px] w-full";
|
|
24
|
+
/** Header section with logo and agent info */
|
|
25
|
+
readonly header: "p-6 pb-0";
|
|
26
|
+
/** Main content area */
|
|
27
|
+
readonly content: "p-6 pt-4 space-y-6";
|
|
28
|
+
/** Footer with buttons */
|
|
29
|
+
readonly footer: "p-6 pt-0 flex gap-3";
|
|
30
|
+
/** Primary action button (Allow access) */
|
|
31
|
+
readonly buttonPrimary: "px-4 py-3 h-11 rounded-lg text-white font-medium transition-opacity hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed";
|
|
32
|
+
/** Secondary action button (Cancel) */
|
|
33
|
+
readonly buttonSecondary: "px-4 py-3 h-11 rounded-lg border border-gray-300 text-gray-700 font-medium hover:bg-gray-50 transition-colors";
|
|
34
|
+
/** Full width button variant */
|
|
35
|
+
readonly buttonFull: "w-full py-3 px-4 h-11 rounded-lg text-white font-medium transition-opacity hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed";
|
|
36
|
+
/** OAuth/Social login button */
|
|
37
|
+
readonly buttonOAuth: "w-full py-3 px-4 h-11 rounded-lg border border-gray-300 text-gray-700 font-medium hover:bg-gray-50 transition-colors flex items-center justify-center gap-2";
|
|
38
|
+
/** Icon button (small) */
|
|
39
|
+
readonly buttonIcon: "p-2 rounded-lg hover:bg-gray-100 transition-colors";
|
|
40
|
+
/** Button group container (for multiple buttons) */
|
|
41
|
+
readonly buttonGroup: "flex gap-3 mt-6";
|
|
42
|
+
/** Checkbox input - custom styled */
|
|
43
|
+
readonly checkbox: "w-4 h-4 rounded border border-gray-300 bg-white checked:bg-[var(--consent-primary)] checked:border-[var(--consent-primary)] appearance-none cursor-pointer relative flex-shrink-0";
|
|
44
|
+
/** Checkbox container with label */
|
|
45
|
+
readonly checkboxContainer: "flex items-start gap-3 cursor-pointer";
|
|
46
|
+
/** Checkbox label text */
|
|
47
|
+
readonly checkboxLabel: "text-sm text-gray-700 select-none";
|
|
48
|
+
/** Checkbox wrapper for proper alignment */
|
|
49
|
+
readonly checkboxWrapper: "flex items-center h-5";
|
|
50
|
+
/** Checkbox text (alias for checkboxLabel) */
|
|
51
|
+
readonly checkboxText: "text-sm text-gray-700 select-none";
|
|
52
|
+
/** Input field (text, email, password) */
|
|
53
|
+
readonly input: "w-full px-4 py-3 h-11 rounded-lg border border-gray-300 text-gray-900 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-[var(--consent-primary)] focus:border-transparent transition-shadow";
|
|
54
|
+
/** Input with error state */
|
|
55
|
+
readonly inputError: "w-full px-4 py-3 h-11 rounded-lg border border-red-500 text-gray-900 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-transparent";
|
|
56
|
+
/** Form label */
|
|
57
|
+
readonly label: "block text-sm font-medium text-gray-700 mb-1.5";
|
|
58
|
+
/** Form field container */
|
|
59
|
+
readonly fieldGroup: "space-y-1.5";
|
|
60
|
+
/** Error message text */
|
|
61
|
+
readonly errorText: "text-sm text-red-600 mt-1";
|
|
62
|
+
/** Help text */
|
|
63
|
+
readonly helpText: "text-sm text-gray-500 mt-1";
|
|
64
|
+
/** Input focus ring class */
|
|
65
|
+
readonly inputFocus: "focus:outline-none focus:ring-2 focus:ring-[var(--consent-primary)] focus:border-transparent";
|
|
66
|
+
/** Page title */
|
|
67
|
+
readonly title: "text-xl font-semibold text-gray-900";
|
|
68
|
+
/** Page description / subtitle */
|
|
69
|
+
readonly description: "text-sm text-gray-600 mt-1";
|
|
70
|
+
/** Subtitle (alternative name for description) */
|
|
71
|
+
readonly subtitle: "text-sm text-gray-600 mt-1";
|
|
72
|
+
/** Section header */
|
|
73
|
+
readonly sectionHeader: "text-sm font-medium text-gray-700";
|
|
74
|
+
/** Body text */
|
|
75
|
+
readonly bodyText: "text-sm text-gray-700";
|
|
76
|
+
/** Muted / secondary text */
|
|
77
|
+
readonly mutedText: "text-sm text-gray-500";
|
|
78
|
+
/** Link styling */
|
|
79
|
+
readonly link: "text-[var(--consent-primary)] hover:underline cursor-pointer";
|
|
80
|
+
/** Header centered text */
|
|
81
|
+
readonly headerCenter: "text-center";
|
|
82
|
+
/** Permissions section container */
|
|
83
|
+
readonly permissionsContainer: "space-y-2";
|
|
84
|
+
/** Permissions header text */
|
|
85
|
+
readonly permissionsHeader: "text-sm font-medium text-gray-700 mb-2";
|
|
86
|
+
/** Permissions list wrapper */
|
|
87
|
+
readonly permissionsList: "space-y-2";
|
|
88
|
+
/** Single permission item */
|
|
89
|
+
readonly permissionItem: "flex items-center gap-2 text-sm text-gray-700 bg-gray-50 px-3 py-2 rounded-lg";
|
|
90
|
+
/** Permission icon */
|
|
91
|
+
readonly permissionIcon: "w-4 h-4 text-[var(--consent-primary)] flex-shrink-0";
|
|
92
|
+
/** Scope badge */
|
|
93
|
+
readonly scopeBadge: "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800";
|
|
94
|
+
/** Agent info container */
|
|
95
|
+
readonly agentContainer: "flex items-start gap-4";
|
|
96
|
+
/** Agent info wrapper (alternative name) */
|
|
97
|
+
readonly agentWrapper: "flex items-start gap-4";
|
|
98
|
+
/** Agent avatar/logo */
|
|
99
|
+
readonly agentAvatar: "w-12 h-12 rounded-xl bg-gray-100 flex items-center justify-center text-gray-400 flex-shrink-0";
|
|
100
|
+
/** Agent icon container (alternative to avatar) */
|
|
101
|
+
readonly agentIcon: "w-12 h-12 rounded-xl bg-gray-100 flex items-center justify-center text-gray-400 flex-shrink-0";
|
|
102
|
+
/** Agent details wrapper */
|
|
103
|
+
readonly agentDetails: "flex-1 min-w-0";
|
|
104
|
+
/** Agent name */
|
|
105
|
+
readonly agentName: "font-medium text-gray-900 truncate";
|
|
106
|
+
/** Agent description text */
|
|
107
|
+
readonly agentDescription: "text-sm text-gray-600 mt-1";
|
|
108
|
+
/** Agent DID (truncated) */
|
|
109
|
+
readonly agentDid: "text-xs text-gray-500 font-mono truncate";
|
|
110
|
+
/** Success icon container */
|
|
111
|
+
readonly successIcon: "w-16 h-16 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-4";
|
|
112
|
+
/** Success checkmark */
|
|
113
|
+
readonly successCheck: "w-8 h-8 text-green-600";
|
|
114
|
+
/** Credential display box */
|
|
115
|
+
readonly credentialBox: "bg-gray-50 rounded-lg p-4 font-mono text-sm text-gray-700 break-all";
|
|
116
|
+
/** Loading spinner */
|
|
117
|
+
readonly spinner: "animate-spin w-5 h-5 text-white";
|
|
118
|
+
/** Loading overlay */
|
|
119
|
+
readonly loadingOverlay: "absolute inset-0 bg-white/80 flex items-center justify-center";
|
|
120
|
+
/** Horizontal divider */
|
|
121
|
+
readonly divider: "border-t border-gray-200";
|
|
122
|
+
/** Divider with text (OR) */
|
|
123
|
+
readonly dividerWithText: "relative flex items-center my-4";
|
|
124
|
+
/** Divider text styling */
|
|
125
|
+
readonly dividerText: "absolute inset-0 flex items-center justify-center text-sm text-gray-500 bg-white px-4";
|
|
126
|
+
/** Info alert */
|
|
127
|
+
readonly alertInfo: "bg-blue-50 border border-blue-200 rounded-lg p-4 text-sm text-blue-800";
|
|
128
|
+
/** Warning alert */
|
|
129
|
+
readonly alertWarning: "bg-amber-50 border border-amber-200 rounded-lg p-4 text-sm text-amber-800";
|
|
130
|
+
/** Error alert */
|
|
131
|
+
readonly alertError: "bg-red-50 border border-red-200 rounded-lg p-4 text-sm text-red-800";
|
|
132
|
+
/** Success alert */
|
|
133
|
+
readonly alertSuccess: "bg-green-50 border border-green-200 rounded-lg p-4 text-sm text-green-800";
|
|
134
|
+
/** Expiration notice wrapper */
|
|
135
|
+
readonly expirationWrapper: "flex items-center gap-2 text-sm text-gray-500 mt-4";
|
|
136
|
+
/** Error container (hidden by default) */
|
|
137
|
+
readonly errorContainer: "hidden";
|
|
138
|
+
};
|
|
139
|
+
export type ConsentClassesType = typeof CONSENT_CLASSES;
|
|
140
|
+
export type ConsentClassKey = keyof typeof CONSENT_CLASSES;
|
|
141
|
+
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/styles/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH,eAAO,MAAM,eAAe;IAI1B,gEAAgE;;IAGhE,kEAAkE;;IAIlE,8CAA8C;;IAG9C,wBAAwB;;IAGxB,0BAA0B;;IAO1B,2CAA2C;;IAI3C,uCAAuC;;IAIvC,gCAAgC;;IAIhC,gCAAgC;;IAIhC,0BAA0B;;IAG1B,oDAAoD;;IAOpD,qCAAqC;;IAIrC,oCAAoC;;IAGpC,0BAA0B;;IAG1B,4CAA4C;;IAG5C,8CAA8C;;IAM9C,0CAA0C;;IAI1C,6BAA6B;;IAI7B,iBAAiB;;IAGjB,2BAA2B;;IAG3B,yBAAyB;;IAGzB,gBAAgB;;IAGhB,6BAA6B;;IAM7B,iBAAiB;;IAGjB,kCAAkC;;IAGlC,kDAAkD;;IAGlD,qBAAqB;;IAGrB,gBAAgB;;IAGhB,6BAA6B;;IAG7B,mBAAmB;;IAGnB,2BAA2B;;IAM3B,oCAAoC;;IAGpC,8BAA8B;;IAG9B,+BAA+B;;IAG/B,6BAA6B;;IAI7B,sBAAsB;;IAGtB,kBAAkB;;IAOlB,2BAA2B;;IAG3B,4CAA4C;;IAG5C,wBAAwB;;IAIxB,mDAAmD;;IAInD,4BAA4B;;IAG5B,iBAAiB;;IAGjB,6BAA6B;;IAG7B,4BAA4B;;IAM5B,6BAA6B;;IAI7B,wBAAwB;;IAGxB,6BAA6B;;IAO7B,sBAAsB;;IAGtB,sBAAsB;;IAOtB,yBAAyB;;IAGzB,6BAA6B;;IAG7B,2BAA2B;;IAO3B,iBAAiB;;IAGjB,oBAAoB;;IAIpB,kBAAkB;;IAGlB,oBAAoB;;IAOpB,gCAAgC;;IAMhC,0CAA0C;;CAElC,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,OAAO,eAAe,CAAC;AACxD,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,eAAe,CAAC"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Consent CSS Class Tokens
|
|
4
|
+
*
|
|
5
|
+
* Single source of truth for all Tailwind classes used in consent pages.
|
|
6
|
+
* CRITICAL: These MUST match AgentShield preview components exactly.
|
|
7
|
+
*
|
|
8
|
+
* Divergences identified and fixed:
|
|
9
|
+
* - Button: py-2 → py-3, rounded-md → rounded-lg (match AgentShield)
|
|
10
|
+
* - Checkbox: w-5 h-5 → w-4 h-4 (match AgentShield)
|
|
11
|
+
* - Container: max-w-md → max-w-[512px] (match AgentShield)
|
|
12
|
+
*
|
|
13
|
+
* @module @kya-os/consent/styles/tokens
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.CONSENT_CLASSES = void 0;
|
|
17
|
+
/**
|
|
18
|
+
* CONSENT_CLASSES - Canonical CSS classes for consent UI components
|
|
19
|
+
*
|
|
20
|
+
* All classes are Tailwind CSS utilities that match AgentShield exactly.
|
|
21
|
+
*/
|
|
22
|
+
exports.CONSENT_CLASSES = {
|
|
23
|
+
// =========================================================================
|
|
24
|
+
// Container / Shell - Matches AgentShield PreviewShell.tsx
|
|
25
|
+
// =========================================================================
|
|
26
|
+
/** Main container wrapper - background with centered content */
|
|
27
|
+
wrapper: "bg-gray-50 min-h-screen flex items-center justify-center p-4",
|
|
28
|
+
/** Card container - MUST be max-w-[512px] not max-w-md (448px) */
|
|
29
|
+
container: "bg-white rounded-[20px] border border-black/10 shadow-xl overflow-hidden max-w-[512px] w-full",
|
|
30
|
+
/** Header section with logo and agent info */
|
|
31
|
+
header: "p-6 pb-0",
|
|
32
|
+
/** Main content area */
|
|
33
|
+
content: "p-6 pt-4 space-y-6",
|
|
34
|
+
/** Footer with buttons */
|
|
35
|
+
footer: "p-6 pt-0 flex gap-3",
|
|
36
|
+
// =========================================================================
|
|
37
|
+
// Buttons - Matches AgentShield PreviewButton.tsx
|
|
38
|
+
// CRITICAL: h-11, py-3, rounded-lg (NOT py-2, rounded-md)
|
|
39
|
+
// =========================================================================
|
|
40
|
+
/** Primary action button (Allow access) */
|
|
41
|
+
buttonPrimary: "px-4 py-3 h-11 rounded-lg text-white font-medium transition-opacity hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
42
|
+
/** Secondary action button (Cancel) */
|
|
43
|
+
buttonSecondary: "px-4 py-3 h-11 rounded-lg border border-gray-300 text-gray-700 font-medium hover:bg-gray-50 transition-colors",
|
|
44
|
+
/** Full width button variant */
|
|
45
|
+
buttonFull: "w-full py-3 px-4 h-11 rounded-lg text-white font-medium transition-opacity hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
46
|
+
/** OAuth/Social login button */
|
|
47
|
+
buttonOAuth: "w-full py-3 px-4 h-11 rounded-lg border border-gray-300 text-gray-700 font-medium hover:bg-gray-50 transition-colors flex items-center justify-center gap-2",
|
|
48
|
+
/** Icon button (small) */
|
|
49
|
+
buttonIcon: "p-2 rounded-lg hover:bg-gray-100 transition-colors",
|
|
50
|
+
/** Button group container (for multiple buttons) */
|
|
51
|
+
buttonGroup: "flex gap-3 mt-6",
|
|
52
|
+
// =========================================================================
|
|
53
|
+
// Checkbox - Matches AgentShield PreviewCheckbox.tsx
|
|
54
|
+
// CRITICAL: w-4 h-4 (NOT w-5 h-5)
|
|
55
|
+
// =========================================================================
|
|
56
|
+
/** Checkbox input - custom styled */
|
|
57
|
+
checkbox: "w-4 h-4 rounded border border-gray-300 bg-white checked:bg-[var(--consent-primary)] checked:border-[var(--consent-primary)] appearance-none cursor-pointer relative flex-shrink-0",
|
|
58
|
+
/** Checkbox container with label */
|
|
59
|
+
checkboxContainer: "flex items-start gap-3 cursor-pointer",
|
|
60
|
+
/** Checkbox label text */
|
|
61
|
+
checkboxLabel: "text-sm text-gray-700 select-none",
|
|
62
|
+
/** Checkbox wrapper for proper alignment */
|
|
63
|
+
checkboxWrapper: "flex items-center h-5",
|
|
64
|
+
/** Checkbox text (alias for checkboxLabel) */
|
|
65
|
+
checkboxText: "text-sm text-gray-700 select-none",
|
|
66
|
+
// =========================================================================
|
|
67
|
+
// Form Elements
|
|
68
|
+
// =========================================================================
|
|
69
|
+
/** Input field (text, email, password) */
|
|
70
|
+
input: "w-full px-4 py-3 h-11 rounded-lg border border-gray-300 text-gray-900 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-[var(--consent-primary)] focus:border-transparent transition-shadow",
|
|
71
|
+
/** Input with error state */
|
|
72
|
+
inputError: "w-full px-4 py-3 h-11 rounded-lg border border-red-500 text-gray-900 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-transparent",
|
|
73
|
+
/** Form label */
|
|
74
|
+
label: "block text-sm font-medium text-gray-700 mb-1.5",
|
|
75
|
+
/** Form field container */
|
|
76
|
+
fieldGroup: "space-y-1.5",
|
|
77
|
+
/** Error message text */
|
|
78
|
+
errorText: "text-sm text-red-600 mt-1",
|
|
79
|
+
/** Help text */
|
|
80
|
+
helpText: "text-sm text-gray-500 mt-1",
|
|
81
|
+
/** Input focus ring class */
|
|
82
|
+
inputFocus: "focus:outline-none focus:ring-2 focus:ring-[var(--consent-primary)] focus:border-transparent",
|
|
83
|
+
// =========================================================================
|
|
84
|
+
// Typography
|
|
85
|
+
// =========================================================================
|
|
86
|
+
/** Page title */
|
|
87
|
+
title: "text-xl font-semibold text-gray-900",
|
|
88
|
+
/** Page description / subtitle */
|
|
89
|
+
description: "text-sm text-gray-600 mt-1",
|
|
90
|
+
/** Subtitle (alternative name for description) */
|
|
91
|
+
subtitle: "text-sm text-gray-600 mt-1",
|
|
92
|
+
/** Section header */
|
|
93
|
+
sectionHeader: "text-sm font-medium text-gray-700",
|
|
94
|
+
/** Body text */
|
|
95
|
+
bodyText: "text-sm text-gray-700",
|
|
96
|
+
/** Muted / secondary text */
|
|
97
|
+
mutedText: "text-sm text-gray-500",
|
|
98
|
+
/** Link styling */
|
|
99
|
+
link: "text-[var(--consent-primary)] hover:underline cursor-pointer",
|
|
100
|
+
/** Header centered text */
|
|
101
|
+
headerCenter: "text-center",
|
|
102
|
+
// =========================================================================
|
|
103
|
+
// Permissions List
|
|
104
|
+
// =========================================================================
|
|
105
|
+
/** Permissions section container */
|
|
106
|
+
permissionsContainer: "space-y-2",
|
|
107
|
+
/** Permissions header text */
|
|
108
|
+
permissionsHeader: "text-sm font-medium text-gray-700 mb-2",
|
|
109
|
+
/** Permissions list wrapper */
|
|
110
|
+
permissionsList: "space-y-2",
|
|
111
|
+
/** Single permission item */
|
|
112
|
+
permissionItem: "flex items-center gap-2 text-sm text-gray-700 bg-gray-50 px-3 py-2 rounded-lg",
|
|
113
|
+
/** Permission icon */
|
|
114
|
+
permissionIcon: "w-4 h-4 text-[var(--consent-primary)] flex-shrink-0",
|
|
115
|
+
/** Scope badge */
|
|
116
|
+
scopeBadge: "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800",
|
|
117
|
+
// =========================================================================
|
|
118
|
+
// Agent Info Section
|
|
119
|
+
// =========================================================================
|
|
120
|
+
/** Agent info container */
|
|
121
|
+
agentContainer: "flex items-start gap-4",
|
|
122
|
+
/** Agent info wrapper (alternative name) */
|
|
123
|
+
agentWrapper: "flex items-start gap-4",
|
|
124
|
+
/** Agent avatar/logo */
|
|
125
|
+
agentAvatar: "w-12 h-12 rounded-xl bg-gray-100 flex items-center justify-center text-gray-400 flex-shrink-0",
|
|
126
|
+
/** Agent icon container (alternative to avatar) */
|
|
127
|
+
agentIcon: "w-12 h-12 rounded-xl bg-gray-100 flex items-center justify-center text-gray-400 flex-shrink-0",
|
|
128
|
+
/** Agent details wrapper */
|
|
129
|
+
agentDetails: "flex-1 min-w-0",
|
|
130
|
+
/** Agent name */
|
|
131
|
+
agentName: "font-medium text-gray-900 truncate",
|
|
132
|
+
/** Agent description text */
|
|
133
|
+
agentDescription: "text-sm text-gray-600 mt-1",
|
|
134
|
+
/** Agent DID (truncated) */
|
|
135
|
+
agentDid: "text-xs text-gray-500 font-mono truncate",
|
|
136
|
+
// =========================================================================
|
|
137
|
+
// Success Page
|
|
138
|
+
// =========================================================================
|
|
139
|
+
/** Success icon container */
|
|
140
|
+
successIcon: "w-16 h-16 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-4",
|
|
141
|
+
/** Success checkmark */
|
|
142
|
+
successCheck: "w-8 h-8 text-green-600",
|
|
143
|
+
/** Credential display box */
|
|
144
|
+
credentialBox: "bg-gray-50 rounded-lg p-4 font-mono text-sm text-gray-700 break-all",
|
|
145
|
+
// =========================================================================
|
|
146
|
+
// Loading States
|
|
147
|
+
// =========================================================================
|
|
148
|
+
/** Loading spinner */
|
|
149
|
+
spinner: "animate-spin w-5 h-5 text-white",
|
|
150
|
+
/** Loading overlay */
|
|
151
|
+
loadingOverlay: "absolute inset-0 bg-white/80 flex items-center justify-center",
|
|
152
|
+
// =========================================================================
|
|
153
|
+
// Dividers
|
|
154
|
+
// =========================================================================
|
|
155
|
+
/** Horizontal divider */
|
|
156
|
+
divider: "border-t border-gray-200",
|
|
157
|
+
/** Divider with text (OR) */
|
|
158
|
+
dividerWithText: "relative flex items-center my-4",
|
|
159
|
+
/** Divider text styling */
|
|
160
|
+
dividerText: "absolute inset-0 flex items-center justify-center text-sm text-gray-500 bg-white px-4",
|
|
161
|
+
// =========================================================================
|
|
162
|
+
// Alerts / Messages
|
|
163
|
+
// =========================================================================
|
|
164
|
+
/** Info alert */
|
|
165
|
+
alertInfo: "bg-blue-50 border border-blue-200 rounded-lg p-4 text-sm text-blue-800",
|
|
166
|
+
/** Warning alert */
|
|
167
|
+
alertWarning: "bg-amber-50 border border-amber-200 rounded-lg p-4 text-sm text-amber-800",
|
|
168
|
+
/** Error alert */
|
|
169
|
+
alertError: "bg-red-50 border border-red-200 rounded-lg p-4 text-sm text-red-800",
|
|
170
|
+
/** Success alert */
|
|
171
|
+
alertSuccess: "bg-green-50 border border-green-200 rounded-lg p-4 text-sm text-green-800",
|
|
172
|
+
// =========================================================================
|
|
173
|
+
// Expiration Notice
|
|
174
|
+
// =========================================================================
|
|
175
|
+
/** Expiration notice wrapper */
|
|
176
|
+
expirationWrapper: "flex items-center gap-2 text-sm text-gray-500 mt-4",
|
|
177
|
+
// =========================================================================
|
|
178
|
+
// Error Container
|
|
179
|
+
// =========================================================================
|
|
180
|
+
/** Error container (hidden by default) */
|
|
181
|
+
errorContainer: "hidden",
|
|
182
|
+
};
|
|
183
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../src/styles/tokens.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH;;;;GAIG;AACU,QAAA,eAAe,GAAG;IAC7B,4EAA4E;IAC5E,2DAA2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iCAAiC;IAE1C,sBAAsB;IACtB,cAAc,EACZ,+DAA+D;IAEjE,4EAA4E;IAC5E,WAAW;IACX,4EAA4E;IAC5E,yBAAyB;IACzB,OAAO,EAAE,0BAA0B;IAEnC,6BAA6B;IAC7B,eAAe,EAAE,iCAAiC;IAElD,2BAA2B;IAC3B,WAAW,EACT,uFAAuF;IAEzF,4EAA4E;IAC5E,oBAAoB;IACpB,4EAA4E;IAC5E,iBAAiB;IACjB,SAAS,EAAE,wEAAwE;IAEnF,oBAAoB;IACpB,YAAY,EACV,2EAA2E;IAE7E,kBAAkB;IAClB,UAAU,EAAE,qEAAqE;IAEjF,oBAAoB;IACpB,YAAY,EACV,2EAA2E;IAE7E,4EAA4E;IAC5E,oBAAoB;IACpB,4EAA4E;IAC5E,gCAAgC;IAChC,iBAAiB,EAAE,oDAAoD;IAEvE,4EAA4E;IAC5E,kBAAkB;IAClB,4EAA4E;IAC5E,0CAA0C;IAC1C,cAAc,EAAE,QAAQ;CAChB,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base Consent Template
|
|
3
|
+
*
|
|
4
|
+
* Abstract class implementing the Template Method pattern.
|
|
5
|
+
* Defines the overall page structure, subclasses implement auth-specific content.
|
|
6
|
+
*
|
|
7
|
+
* @module @kya-os/consent/templates/base/base-template
|
|
8
|
+
*/
|
|
9
|
+
import type { ResolvedConsentConfig } from "../../types/config.types";
|
|
10
|
+
import type { ExtendedConsentPageConfig } from "../../types/page.types";
|
|
11
|
+
import type { AuthMode } from "../../types/modes.types";
|
|
12
|
+
/**
|
|
13
|
+
* Abstract base class for consent page templates.
|
|
14
|
+
*
|
|
15
|
+
* Implements the Template Method pattern:
|
|
16
|
+
* - `render()` defines the overall structure
|
|
17
|
+
* - Subclasses override `renderAuthContent()` for mode-specific UI
|
|
18
|
+
* - Other methods can be overridden for customization
|
|
19
|
+
*/
|
|
20
|
+
export declare abstract class BaseConsentTemplate {
|
|
21
|
+
protected config: ExtendedConsentPageConfig;
|
|
22
|
+
protected resolved: ResolvedConsentConfig;
|
|
23
|
+
constructor(config: ExtendedConsentPageConfig, resolved: ResolvedConsentConfig);
|
|
24
|
+
/**
|
|
25
|
+
* Get the auth mode identifier for this template.
|
|
26
|
+
*/
|
|
27
|
+
abstract get authMode(): AuthMode;
|
|
28
|
+
/**
|
|
29
|
+
* Render the auth-specific content section.
|
|
30
|
+
* Must be implemented by subclasses.
|
|
31
|
+
*/
|
|
32
|
+
abstract renderAuthContent(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Optional: Render mode-specific scripts.
|
|
35
|
+
* Override in subclasses if needed.
|
|
36
|
+
*/
|
|
37
|
+
protected renderModeScript(): string;
|
|
38
|
+
/**
|
|
39
|
+
* Main render method - Template Method Pattern.
|
|
40
|
+
* Defines the overall page structure.
|
|
41
|
+
*/
|
|
42
|
+
render(): string;
|
|
43
|
+
/**
|
|
44
|
+
* Render the <head> section with meta tags, styles, and scripts.
|
|
45
|
+
*/
|
|
46
|
+
protected renderHead(): string;
|
|
47
|
+
/**
|
|
48
|
+
* Get the page title.
|
|
49
|
+
*/
|
|
50
|
+
protected getPageTitle(): string;
|
|
51
|
+
/**
|
|
52
|
+
* Render the page header with logo, company name, and title.
|
|
53
|
+
*/
|
|
54
|
+
protected renderPageHeader(): string;
|
|
55
|
+
/**
|
|
56
|
+
* Render the agent info section with description.
|
|
57
|
+
* Uses config.toolDescription if provided, otherwise falls back to resolved copy.
|
|
58
|
+
*/
|
|
59
|
+
protected renderAgentSection(): string;
|
|
60
|
+
/**
|
|
61
|
+
* Render custom fields section.
|
|
62
|
+
*/
|
|
63
|
+
protected renderCustomFields(): string;
|
|
64
|
+
/**
|
|
65
|
+
* Render the terms acceptance section.
|
|
66
|
+
*/
|
|
67
|
+
protected renderTermsSection(): string;
|
|
68
|
+
/**
|
|
69
|
+
* Render the action buttons (cancel/submit).
|
|
70
|
+
*/
|
|
71
|
+
protected renderActionButtons(): string;
|
|
72
|
+
/**
|
|
73
|
+
* Render the hidden form with common fields.
|
|
74
|
+
*/
|
|
75
|
+
protected renderForm(): string;
|
|
76
|
+
/**
|
|
77
|
+
* Render the base JavaScript for form handling.
|
|
78
|
+
*/
|
|
79
|
+
protected renderBaseScript(): string;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=base-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-template.d.ts","sourceRoot":"","sources":["../../../src/templates/base/base-template.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH,OAAO,KAAK,EAAsB,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAC1F,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD;;;;;;;GAOG;AACH,8BAAsB,mBAAmB;IACvC,SAAS,CAAC,MAAM,EAAE,yBAAyB,CAAC;IAC5C,SAAS,CAAC,QAAQ,EAAE,qBAAqB,CAAC;gBAGxC,MAAM,EAAE,yBAAyB,EACjC,QAAQ,EAAE,qBAAqB;IAMjC;;OAEG;IACH,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC;IAElC;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,IAAI,MAAM;IAEpC;;;OAGG;IACH,SAAS,CAAC,gBAAgB,IAAI,MAAM;IAIpC;;;OAGG;IACH,MAAM,IAAI,MAAM;IAwBhB;;OAEG;IACH,SAAS,CAAC,UAAU,IAAI,MAAM;IAc9B;;OAEG;IACH,SAAS,CAAC,YAAY,IAAI,MAAM;IAIhC;;OAEG;IACH,SAAS,CAAC,gBAAgB,IAAI,MAAM;IAUpC;;;OAGG;IACH,SAAS,CAAC,kBAAkB,IAAI,MAAM;IAQtC;;OAEG;IACH,SAAS,CAAC,kBAAkB,IAAI,MAAM;IA4DtC;;OAEG;IACH,SAAS,CAAC,kBAAkB,IAAI,MAAM;IAoBtC;;OAEG;IACH,SAAS,CAAC,mBAAmB,IAAI,MAAM;IAKvC;;OAEG;IACH,SAAS,CAAC,UAAU,IAAI,MAAM;IAyB9B;;OAEG;IACH,SAAS,CAAC,gBAAgB,IAAI,MAAM;CA6ErC"}
|