@africode/core 5.0.5 → 5.0.7
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/AGENTS.md +583 -0
- package/AGENT_INSTRUCTIONS.md +595 -0
- package/README.md +2 -0
- package/components/breadcrumb.js +72 -0
- package/components/carousel.js +32 -0
- package/components/cart-drawer.js +28 -0
- package/components/code-block.js +20 -0
- package/components/contact-form.js +25 -0
- package/components/cookie-consent.js +23 -0
- package/components/cta-banner.js +38 -0
- package/components/dashboard-activity-list.js +103 -0
- package/components/dashboard-card.js +85 -0
- package/components/dashboard-metric.js +81 -0
- package/components/dashboard-shell.js +85 -0
- package/components/dashboard-topbar.js +84 -0
- package/components/faq-accordion.js +23 -0
- package/components/feature-grid.js +85 -0
- package/components/file-uploader.js +22 -0
- package/components/filter-bar.js +19 -0
- package/components/footer.js +113 -0
- package/components/gallery.js +22 -0
- package/components/index.js +42 -0
- package/components/newsletter-signup.js +24 -0
- package/components/pagination.js +31 -0
- package/components/pricing-card.js +100 -0
- package/components/product-card.js +41 -0
- package/components/search-box.js +24 -0
- package/components/simple-chart.js +22 -0
- package/components/stepper.js +28 -0
- package/components/team-grid.js +23 -0
- package/components/testimonial.js +94 -0
- package/components/ui-avatar.js +79 -0
- package/components/ui-chip.js +87 -0
- package/components/ui-popover.js +84 -0
- package/components/ui-progress-ring.js +60 -0
- package/components/ui-select.js +85 -0
- package/components/ui-stat.js +75 -0
- package/components/ui-table.js +69 -0
- package/components/ui-tabs.js +99 -0
- package/components/ui-tag.js +64 -0
- package/components/ui-textarea.js +84 -0
- package/components/ui-tooltip.js +66 -0
- package/components/video-player.js +22 -0
- package/dist/africode.js +1480 -549
- package/dist/africode.js.map +25 -4
- package/dist/build-info.json +3 -3
- package/dist/components.js +1506 -575
- package/dist/components.js.map +25 -4
- package/package.json +3 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AfriCode UI Textarea
|
|
3
|
+
*
|
|
4
|
+
* Styled textarea component for forms and content entry.
|
|
5
|
+
* @module components/ui-textarea
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { AfriCodeComponent, registerComponent, html } from './base.js';
|
|
9
|
+
|
|
10
|
+
export class AfriUITextarea extends AfriCodeComponent {
|
|
11
|
+
static get observedAttributes() {
|
|
12
|
+
return ['label', 'placeholder', 'rows', 'disabled', 'error'];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
this.render();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
connectedCallback() {
|
|
21
|
+
this._attachListeners();
|
|
22
|
+
this.loadStyles();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
attributeChangedCallback() {
|
|
26
|
+
this.render();
|
|
27
|
+
this._attachListeners();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
_attachListeners() {
|
|
31
|
+
const textarea = this.shadowRoot.querySelector('textarea');
|
|
32
|
+
if (!textarea) return;
|
|
33
|
+
textarea.addEventListener('input', () => {
|
|
34
|
+
this.emit('af-ui-textarea', { value: textarea.value });
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
render() {
|
|
39
|
+
const label = this.getAttribute('label') || '';
|
|
40
|
+
const placeholder = this.getAttribute('placeholder') || '';
|
|
41
|
+
const rows = this.getAttribute('rows') || '4';
|
|
42
|
+
const disabled = this.hasAttribute('disabled');
|
|
43
|
+
const error = this.getAttribute('error') || '';
|
|
44
|
+
|
|
45
|
+
this.shadowRoot.innerHTML = html`
|
|
46
|
+
<style>
|
|
47
|
+
:host { display: block; font-family: 'Inter', system-ui, sans-serif; }
|
|
48
|
+
|
|
49
|
+
.field { display: grid; gap: 0.5rem; }
|
|
50
|
+
label { font-size: 0.85rem; font-weight: 600; color: #111827; }
|
|
51
|
+
textarea {
|
|
52
|
+
width: 100%;
|
|
53
|
+
min-height: 120px;
|
|
54
|
+
border: 1px solid #d1d5db;
|
|
55
|
+
border-radius: 0.75rem;
|
|
56
|
+
padding: 1rem;
|
|
57
|
+
font-size: 0.95rem;
|
|
58
|
+
font-family: inherit;
|
|
59
|
+
color: #111827;
|
|
60
|
+
resize: vertical;
|
|
61
|
+
background: #fff;
|
|
62
|
+
transition: border-color 150ms ease, box-shadow 150ms ease;
|
|
63
|
+
}
|
|
64
|
+
textarea:focus {
|
|
65
|
+
border-color: #2563eb;
|
|
66
|
+
box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
|
|
67
|
+
outline: none;
|
|
68
|
+
}
|
|
69
|
+
textarea:disabled { background: #f8fafc; cursor: not-allowed; }
|
|
70
|
+
|
|
71
|
+
.error { color: #dc2626; font-size: 0.8rem; min-height: 1rem; }
|
|
72
|
+
</style>
|
|
73
|
+
|
|
74
|
+
<div class="field">
|
|
75
|
+
${label ? html`<label>${label}</label>` : ''}
|
|
76
|
+
<textarea rows="${rows}" placeholder="${placeholder}" ${disabled ? 'disabled' : ''}></textarea>
|
|
77
|
+
<div class="error">${error}</div>
|
|
78
|
+
</div>
|
|
79
|
+
`;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
registerComponent('af-ui-textarea', AfriUITextarea);
|
|
84
|
+
export default AfriUITextarea;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AfriCode UI Tooltip
|
|
3
|
+
*
|
|
4
|
+
* Lightweight tooltip component for inline help and hover hints.
|
|
5
|
+
* @module components/ui-tooltip
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { AfriCodeComponent, registerComponent, html } from './base.js';
|
|
9
|
+
|
|
10
|
+
export class AfriUITooltip extends AfriCodeComponent {
|
|
11
|
+
static get observedAttributes() {
|
|
12
|
+
return ['text', 'position'];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
this.render();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
attributeChangedCallback() {
|
|
21
|
+
this.render();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
render() {
|
|
25
|
+
const text = this.getAttribute('text') || '';
|
|
26
|
+
const position = this.getAttribute('position') || 'top';
|
|
27
|
+
|
|
28
|
+
this.shadowRoot.innerHTML = html`
|
|
29
|
+
<style>
|
|
30
|
+
:host { position: relative; display: inline-flex; }
|
|
31
|
+
|
|
32
|
+
.tooltip {
|
|
33
|
+
position: absolute;
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
padding: 0.55rem 0.75rem;
|
|
36
|
+
background: rgba(15, 23, 42, 0.95);
|
|
37
|
+
color: #fff;
|
|
38
|
+
border-radius: 0.65rem;
|
|
39
|
+
font-size: 0.75rem;
|
|
40
|
+
transform: translateY(-8px);
|
|
41
|
+
opacity: 0;
|
|
42
|
+
pointer-events: none;
|
|
43
|
+
transition: opacity 0.2s ease, transform 0.2s ease;
|
|
44
|
+
z-index: 100;
|
|
45
|
+
}
|
|
46
|
+
:host(:hover) .tooltip { opacity: 1; transform: translateY(0); }
|
|
47
|
+
.tooltip::after {
|
|
48
|
+
content: '';
|
|
49
|
+
position: absolute;
|
|
50
|
+
width: 0;
|
|
51
|
+
height: 0;
|
|
52
|
+
border-style: solid;
|
|
53
|
+
}
|
|
54
|
+
.tooltip.top { bottom: 100%; left: 50%; transform: translate(-50%, -8px); }
|
|
55
|
+
.tooltip.top::after { top: 100%; left: 50%; transform: translateX(-50%); border-width: 6px 6px 0 6px; border-color: rgba(15,23,42,0.95) transparent transparent transparent; }
|
|
56
|
+
.tooltip.bottom { top: 100%; left: 50%; transform: translate(-50%, 8px); }
|
|
57
|
+
.tooltip.bottom::after { bottom: 100%; left: 50%; transform: translateX(-50%); border-width: 0 6px 6px 6px; border-color: transparent transparent rgba(15,23,42,0.95) transparent; }
|
|
58
|
+
</style>
|
|
59
|
+
<slot></slot>
|
|
60
|
+
<div class="tooltip ${position}" role="tooltip">${text}</div>
|
|
61
|
+
`;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
registerComponent('af-ui-tooltip', AfriUITooltip);
|
|
66
|
+
export default AfriUITooltip;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AfriCode Video Player
|
|
3
|
+
*
|
|
4
|
+
* Lightweight video player wrapper.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { AfriCodeComponent, registerComponent, html } from './base.js';
|
|
8
|
+
|
|
9
|
+
export class AfriVideoPlayer extends AfriCodeComponent {
|
|
10
|
+
static get observedAttributes(){return ['src','poster']}
|
|
11
|
+
constructor(){ super(); this.render(); }
|
|
12
|
+
attributeChangedCallback(){ this.render(); }
|
|
13
|
+
render(){ const src=this.getAttribute('src')||''; const poster=this.getAttribute('poster')||''; this.shadowRoot.innerHTML = html`
|
|
14
|
+
<style>
|
|
15
|
+
video{width:100%;border-radius:12px;background:#000}
|
|
16
|
+
</style>
|
|
17
|
+
<video controls src="${src}" poster="${poster}"></video>
|
|
18
|
+
` }
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
registerComponent('af-video-player', AfriVideoPlayer);
|
|
22
|
+
export default AfriVideoPlayer;
|