@neural-ui/core 1.2.0 → 1.3.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/README.md +56 -88
- package/accordion/package.json +4 -0
- package/alert/package.json +4 -0
- package/autocomplete/package.json +4 -0
- package/avatar/package.json +4 -0
- package/badge/package.json +4 -0
- package/block-ui/package.json +4 -0
- package/breadcrumb/package.json +4 -0
- package/button/package.json +4 -0
- package/card/package.json +4 -0
- package/chart/package.json +4 -0
- package/checkbox/package.json +4 -0
- package/chip/package.json +4 -0
- package/code-block/package.json +4 -0
- package/color-picker/package.json +4 -0
- package/command-palette/package.json +4 -0
- package/confirm-dialog/package.json +4 -0
- package/context-menu/package.json +4 -0
- package/dashboard-grid/package.json +4 -0
- package/date-input/package.json +4 -0
- package/divider/package.json +4 -0
- package/empty-state/package.json +4 -0
- package/fesm2022/neural-ui-core-accordion.mjs +162 -0
- package/fesm2022/neural-ui-core-accordion.mjs.map +1 -0
- package/fesm2022/neural-ui-core-alert.mjs +116 -0
- package/fesm2022/neural-ui-core-alert.mjs.map +1 -0
- package/fesm2022/neural-ui-core-autocomplete.mjs +332 -0
- package/fesm2022/neural-ui-core-autocomplete.mjs.map +1 -0
- package/fesm2022/neural-ui-core-avatar.mjs +109 -0
- package/fesm2022/neural-ui-core-avatar.mjs.map +1 -0
- package/fesm2022/neural-ui-core-badge.mjs +54 -0
- package/fesm2022/neural-ui-core-badge.mjs.map +1 -0
- package/fesm2022/neural-ui-core-block-ui.mjs +95 -0
- package/fesm2022/neural-ui-core-block-ui.mjs.map +1 -0
- package/fesm2022/neural-ui-core-breadcrumb.mjs +84 -0
- package/fesm2022/neural-ui-core-breadcrumb.mjs.map +1 -0
- package/fesm2022/neural-ui-core-button.mjs +125 -0
- package/fesm2022/neural-ui-core-button.mjs.map +1 -0
- package/fesm2022/neural-ui-core-card.mjs +69 -0
- package/fesm2022/neural-ui-core-card.mjs.map +1 -0
- package/fesm2022/neural-ui-core-chart.mjs +287 -0
- package/fesm2022/neural-ui-core-chart.mjs.map +1 -0
- package/fesm2022/neural-ui-core-checkbox.mjs +138 -0
- package/fesm2022/neural-ui-core-checkbox.mjs.map +1 -0
- package/fesm2022/neural-ui-core-chip.mjs +130 -0
- package/fesm2022/neural-ui-core-chip.mjs.map +1 -0
- package/fesm2022/neural-ui-core-code-block.mjs +250 -0
- package/fesm2022/neural-ui-core-code-block.mjs.map +1 -0
- package/fesm2022/neural-ui-core-color-picker.mjs +435 -0
- package/fesm2022/neural-ui-core-color-picker.mjs.map +1 -0
- package/fesm2022/neural-ui-core-command-palette.mjs +235 -0
- package/fesm2022/neural-ui-core-command-palette.mjs.map +1 -0
- package/fesm2022/neural-ui-core-confirm-dialog.mjs +118 -0
- package/fesm2022/neural-ui-core-confirm-dialog.mjs.map +1 -0
- package/fesm2022/neural-ui-core-context-menu.mjs +158 -0
- package/fesm2022/neural-ui-core-context-menu.mjs.map +1 -0
- package/fesm2022/neural-ui-core-dashboard-grid.mjs +144 -0
- package/fesm2022/neural-ui-core-dashboard-grid.mjs.map +1 -0
- package/fesm2022/neural-ui-core-date-input.mjs +1332 -0
- package/fesm2022/neural-ui-core-date-input.mjs.map +1 -0
- package/fesm2022/neural-ui-core-divider.mjs +54 -0
- package/fesm2022/neural-ui-core-divider.mjs.map +1 -0
- package/fesm2022/neural-ui-core-empty-state.mjs +84 -0
- package/fesm2022/neural-ui-core-empty-state.mjs.map +1 -0
- package/fesm2022/neural-ui-core-filter-bar.mjs +118 -0
- package/fesm2022/neural-ui-core-filter-bar.mjs.map +1 -0
- package/fesm2022/neural-ui-core-icon.mjs +50 -0
- package/fesm2022/neural-ui-core-icon.mjs.map +1 -0
- package/fesm2022/neural-ui-core-image-viewer.mjs +309 -0
- package/fesm2022/neural-ui-core-image-viewer.mjs.map +1 -0
- package/fesm2022/neural-ui-core-input-otp.mjs +192 -0
- package/fesm2022/neural-ui-core-input-otp.mjs.map +1 -0
- package/fesm2022/neural-ui-core-input.mjs +320 -0
- package/fesm2022/neural-ui-core-input.mjs.map +1 -0
- package/fesm2022/neural-ui-core-knob.mjs +323 -0
- package/fesm2022/neural-ui-core-knob.mjs.map +1 -0
- package/fesm2022/neural-ui-core-meter-group.mjs +122 -0
- package/fesm2022/neural-ui-core-meter-group.mjs.map +1 -0
- package/fesm2022/neural-ui-core-modal.mjs +156 -0
- package/fesm2022/neural-ui-core-modal.mjs.map +1 -0
- package/fesm2022/neural-ui-core-multiselect.mjs +748 -0
- package/fesm2022/neural-ui-core-multiselect.mjs.map +1 -0
- package/fesm2022/neural-ui-core-nav.mjs +952 -0
- package/fesm2022/neural-ui-core-nav.mjs.map +1 -0
- package/fesm2022/neural-ui-core-notification-center.mjs +264 -0
- package/fesm2022/neural-ui-core-notification-center.mjs.map +1 -0
- package/fesm2022/neural-ui-core-number-input.mjs +331 -0
- package/fesm2022/neural-ui-core-number-input.mjs.map +1 -0
- package/fesm2022/neural-ui-core-pagination.mjs +198 -0
- package/fesm2022/neural-ui-core-pagination.mjs.map +1 -0
- package/fesm2022/neural-ui-core-popover.mjs +207 -0
- package/fesm2022/neural-ui-core-popover.mjs.map +1 -0
- package/fesm2022/neural-ui-core-progress-bar.mjs +105 -0
- package/fesm2022/neural-ui-core-progress-bar.mjs.map +1 -0
- package/fesm2022/neural-ui-core-radio.mjs +171 -0
- package/fesm2022/neural-ui-core-radio.mjs.map +1 -0
- package/fesm2022/neural-ui-core-rating.mjs +151 -0
- package/fesm2022/neural-ui-core-rating.mjs.map +1 -0
- package/fesm2022/neural-ui-core-select.mjs +638 -0
- package/fesm2022/neural-ui-core-select.mjs.map +1 -0
- package/fesm2022/neural-ui-core-sidebar.mjs +214 -0
- package/fesm2022/neural-ui-core-sidebar.mjs.map +1 -0
- package/fesm2022/neural-ui-core-skeleton.mjs +40 -0
- package/fesm2022/neural-ui-core-skeleton.mjs.map +1 -0
- package/fesm2022/neural-ui-core-slider.mjs +146 -0
- package/fesm2022/neural-ui-core-slider.mjs.map +1 -0
- package/fesm2022/neural-ui-core-spinner.mjs +113 -0
- package/fesm2022/neural-ui-core-spinner.mjs.map +1 -0
- package/fesm2022/neural-ui-core-split-button.mjs +252 -0
- package/fesm2022/neural-ui-core-split-button.mjs.map +1 -0
- package/fesm2022/neural-ui-core-splitter.mjs +174 -0
- package/fesm2022/neural-ui-core-splitter.mjs.map +1 -0
- package/fesm2022/neural-ui-core-stats-card.mjs +163 -0
- package/fesm2022/neural-ui-core-stats-card.mjs.map +1 -0
- package/fesm2022/neural-ui-core-stepper.mjs +204 -0
- package/fesm2022/neural-ui-core-stepper.mjs.map +1 -0
- package/fesm2022/neural-ui-core-switch.mjs +111 -0
- package/fesm2022/neural-ui-core-switch.mjs.map +1 -0
- package/fesm2022/neural-ui-core-table.mjs +1860 -0
- package/fesm2022/neural-ui-core-table.mjs.map +1 -0
- package/fesm2022/neural-ui-core-tabs.mjs +246 -0
- package/fesm2022/neural-ui-core-tabs.mjs.map +1 -0
- package/fesm2022/neural-ui-core-textarea.mjs +188 -0
- package/fesm2022/neural-ui-core-textarea.mjs.map +1 -0
- package/fesm2022/neural-ui-core-timeline.mjs +117 -0
- package/fesm2022/neural-ui-core-timeline.mjs.map +1 -0
- package/fesm2022/neural-ui-core-toast.mjs +171 -0
- package/fesm2022/neural-ui-core-toast.mjs.map +1 -0
- package/fesm2022/neural-ui-core-toggle-button-group.mjs +162 -0
- package/fesm2022/neural-ui-core-toggle-button-group.mjs.map +1 -0
- package/fesm2022/neural-ui-core-toolbar.mjs +67 -0
- package/fesm2022/neural-ui-core-toolbar.mjs.map +1 -0
- package/fesm2022/neural-ui-core-tooltip.mjs +151 -0
- package/fesm2022/neural-ui-core-tooltip.mjs.map +1 -0
- package/fesm2022/neural-ui-core-url-state.mjs +96 -0
- package/fesm2022/neural-ui-core-url-state.mjs.map +1 -0
- package/fesm2022/neural-ui-core-virtual-list.mjs +126 -0
- package/fesm2022/neural-ui-core-virtual-list.mjs.map +1 -0
- package/fesm2022/neural-ui-core.mjs +11 -8544
- package/fesm2022/neural-ui-core.mjs.map +1 -1
- package/filter-bar/package.json +4 -0
- package/icon/package.json +4 -0
- package/image-viewer/package.json +4 -0
- package/input/package.json +4 -0
- package/input-otp/package.json +4 -0
- package/knob/package.json +4 -0
- package/meter-group/package.json +4 -0
- package/modal/package.json +4 -0
- package/multiselect/package.json +4 -0
- package/nav/package.json +4 -0
- package/notification-center/package.json +4 -0
- package/number-input/package.json +4 -0
- package/package.json +252 -5
- package/pagination/package.json +4 -0
- package/popover/package.json +4 -0
- package/progress-bar/package.json +4 -0
- package/radio/package.json +4 -0
- package/rating/package.json +4 -0
- package/select/package.json +4 -0
- package/sidebar/package.json +4 -0
- package/skeleton/package.json +4 -0
- package/slider/package.json +4 -0
- package/spinner/package.json +4 -0
- package/split-button/package.json +4 -0
- package/splitter/package.json +4 -0
- package/stats-card/package.json +4 -0
- package/stepper/package.json +4 -0
- package/styles/_tokens.scss +209 -7
- package/styles.scss +1 -0
- package/switch/package.json +4 -0
- package/table/package.json +4 -0
- package/tabs/package.json +4 -0
- package/textarea/package.json +4 -0
- package/timeline/package.json +4 -0
- package/toast/package.json +4 -0
- package/toggle-button-group/package.json +4 -0
- package/toolbar/package.json +4 -0
- package/tooltip/package.json +4 -0
- package/types/neural-ui-core-accordion.d.ts +55 -0
- package/types/neural-ui-core-alert.d.ts +47 -0
- package/types/neural-ui-core-autocomplete.d.ts +69 -0
- package/types/neural-ui-core-avatar.d.ts +39 -0
- package/types/neural-ui-core-badge.d.ts +36 -0
- package/types/neural-ui-core-block-ui.d.ts +46 -0
- package/types/neural-ui-core-breadcrumb.d.ts +38 -0
- package/types/neural-ui-core-button.d.ts +55 -0
- package/types/neural-ui-core-card.d.ts +37 -0
- package/types/neural-ui-core-chart.d.ts +236 -0
- package/types/neural-ui-core-checkbox.d.ts +33 -0
- package/types/neural-ui-core-chip.d.ts +53 -0
- package/types/neural-ui-core-code-block.d.ts +55 -0
- package/types/neural-ui-core-color-picker.d.ts +55 -0
- package/types/neural-ui-core-command-palette.d.ts +56 -0
- package/types/neural-ui-core-confirm-dialog.d.ts +50 -0
- package/types/neural-ui-core-context-menu.d.ts +66 -0
- package/types/neural-ui-core-dashboard-grid.d.ts +41 -0
- package/types/neural-ui-core-date-input.d.ts +178 -0
- package/types/neural-ui-core-divider.d.ts +20 -0
- package/types/neural-ui-core-empty-state.d.ts +32 -0
- package/types/neural-ui-core-filter-bar.d.ts +49 -0
- package/types/neural-ui-core-icon.d.ts +33 -0
- package/types/neural-ui-core-image-viewer.d.ts +67 -0
- package/types/neural-ui-core-input-otp.d.ts +49 -0
- package/types/neural-ui-core-input.d.ts +86 -0
- package/types/neural-ui-core-knob.d.ts +68 -0
- package/types/neural-ui-core-meter-group.d.ts +52 -0
- package/types/neural-ui-core-modal.d.ts +54 -0
- package/types/neural-ui-core-multiselect.d.ts +129 -0
- package/types/neural-ui-core-nav.d.ts +69 -0
- package/types/neural-ui-core-notification-center.d.ts +60 -0
- package/types/neural-ui-core-number-input.d.ts +63 -0
- package/types/neural-ui-core-pagination.d.ts +30 -0
- package/types/neural-ui-core-popover.d.ts +73 -0
- package/types/neural-ui-core-progress-bar.d.ts +35 -0
- package/types/neural-ui-core-radio.d.ts +51 -0
- package/types/neural-ui-core-rating.d.ts +34 -0
- package/types/neural-ui-core-select.d.ts +161 -0
- package/types/neural-ui-core-sidebar.d.ts +57 -0
- package/types/neural-ui-core-skeleton.d.ts +22 -0
- package/types/neural-ui-core-slider.d.ts +42 -0
- package/types/neural-ui-core-spinner.d.ts +38 -0
- package/types/neural-ui-core-split-button.d.ts +65 -0
- package/types/neural-ui-core-splitter.d.ts +28 -0
- package/types/neural-ui-core-stats-card.d.ts +39 -0
- package/types/neural-ui-core-stepper.d.ts +51 -0
- package/types/neural-ui-core-switch.d.ts +34 -0
- package/types/neural-ui-core-table.d.ts +282 -0
- package/types/neural-ui-core-tabs.d.ts +76 -0
- package/types/neural-ui-core-textarea.d.ts +52 -0
- package/types/neural-ui-core-timeline.d.ts +33 -0
- package/types/neural-ui-core-toast.d.ts +70 -0
- package/types/neural-ui-core-toggle-button-group.d.ts +63 -0
- package/types/neural-ui-core-toolbar.d.ts +36 -0
- package/types/neural-ui-core-tooltip.d.ts +48 -0
- package/types/neural-ui-core-url-state.d.ts +58 -0
- package/types/neural-ui-core-virtual-list.d.ts +60 -0
- package/types/neural-ui-core.d.ts +5 -2107
- package/url-state/package.json +4 -0
- package/virtual-list/package.json +4 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, output, computed, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* NeuralUI Chip Component
|
|
6
|
+
*
|
|
7
|
+
* Etiqueta compacta seleccionable y/o eliminable. Ideal para filtros,
|
|
8
|
+
* listas de tags y multiselección visual.
|
|
9
|
+
*
|
|
10
|
+
* Uso:
|
|
11
|
+
* <neu-chip>Angular</neu-chip>
|
|
12
|
+
* <neu-chip [removable]="true" (removed)="onRemove()">CSS</neu-chip>
|
|
13
|
+
* <neu-chip [selected]="true" (selectedChange)="toggle()">TypeScript</neu-chip>
|
|
14
|
+
*/
|
|
15
|
+
class NeuChipComponent {
|
|
16
|
+
/** Variante de color / Color variant */
|
|
17
|
+
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
18
|
+
/** Tamaño / Size */
|
|
19
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
20
|
+
/** Estado seleccionado / Selected state */
|
|
21
|
+
selected = input(false, ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
22
|
+
/** Muestra botón de cierre / Shows close button */
|
|
23
|
+
removable = input(false, ...(ngDevMode ? [{ debugName: "removable" }] : /* istanbul ignore next */ []));
|
|
24
|
+
/** Deshabilitado / Disabled */
|
|
25
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
26
|
+
/** Aria-label del botón de eliminar / Aria-label for the delete button */
|
|
27
|
+
removeAriaLabel = input('Eliminar', ...(ngDevMode ? [{ debugName: "removeAriaLabel" }] : /* istanbul ignore next */ []));
|
|
28
|
+
/** Emite al hacer clic o pulsar espacio/enter / Emits on click or space/enter press */
|
|
29
|
+
selectedChange = output();
|
|
30
|
+
/** Emite al pulsar el botón de cierre / Emits when the close button is pressed */
|
|
31
|
+
removed = output();
|
|
32
|
+
hostClasses = computed(() => ({
|
|
33
|
+
'neu-chip': true,
|
|
34
|
+
[`neu-chip--${this.variant()}`]: true,
|
|
35
|
+
[`neu-chip--${this.size()}`]: true,
|
|
36
|
+
'neu-chip--selected': this.selected(),
|
|
37
|
+
'neu-chip--removable': this.removable(),
|
|
38
|
+
'neu-chip--disabled': this.disabled(),
|
|
39
|
+
}), ...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
40
|
+
/** Rol ARIA del host: 'button' cuando seleccionable, 'group' cuando también eliminable / Host ARIA role: 'button' when selectable, 'group' when removable */
|
|
41
|
+
_hostRole = computed(() => (this.removable() ? 'group' : 'button'), ...(ngDevMode ? [{ debugName: "_hostRole" }] : /* istanbul ignore next */ []));
|
|
42
|
+
/** aria-pressed solo cuando actúa como botón toggle / aria-pressed only when acting as toggle button */
|
|
43
|
+
_hostAriaPressed = computed(() => this.removable() ? null : this.selected(), ...(ngDevMode ? [{ debugName: "_hostAriaPressed" }] : /* istanbul ignore next */ []));
|
|
44
|
+
/** tabindex nulo en el host grupo para no saturar el orden de foco / null tabindex on group host to not saturate focus order */
|
|
45
|
+
_hostTabindex = computed(() => {
|
|
46
|
+
if (this.removable())
|
|
47
|
+
return null;
|
|
48
|
+
return this.disabled() ? -1 : 0;
|
|
49
|
+
}, ...(ngDevMode ? [{ debugName: "_hostTabindex" }] : /* istanbul ignore next */ []));
|
|
50
|
+
onToggle() {
|
|
51
|
+
if (!this.disabled() && !this.removable()) {
|
|
52
|
+
this.selectedChange.emit(!this.selected());
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
onRemove() {
|
|
56
|
+
if (!this.disabled()) {
|
|
57
|
+
this.removed.emit();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: NeuChipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
61
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: NeuChipComponent, isStandalone: true, selector: "neu-chip", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, removeAriaLabel: { classPropertyName: "removeAriaLabel", publicName: "removeAriaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedChange: "selectedChange", removed: "removed" }, host: { listeners: { "keydown.space": "onToggle()", "keydown.enter": "onToggle()" }, properties: { "class": "hostClasses()", "attr.role": "_hostRole()", "attr.aria-pressed": "_hostAriaPressed()", "attr.tabindex": "_hostTabindex()" } }, ngImport: i0, template: `
|
|
62
|
+
<ng-content />
|
|
63
|
+
@if (removable()) {
|
|
64
|
+
<button
|
|
65
|
+
class="neu-chip__remove"
|
|
66
|
+
type="button"
|
|
67
|
+
[disabled]="disabled()"
|
|
68
|
+
(click)="$event.stopPropagation(); onRemove()"
|
|
69
|
+
[attr.aria-label]="removeAriaLabel()"
|
|
70
|
+
>
|
|
71
|
+
<svg
|
|
72
|
+
width="10"
|
|
73
|
+
height="10"
|
|
74
|
+
viewBox="0 0 24 24"
|
|
75
|
+
fill="none"
|
|
76
|
+
stroke="currentColor"
|
|
77
|
+
stroke-width="2.5"
|
|
78
|
+
stroke-linecap="round"
|
|
79
|
+
aria-hidden="true"
|
|
80
|
+
>
|
|
81
|
+
<line x1="18" y1="6" x2="6" y2="18" />
|
|
82
|
+
<line x1="6" y1="6" x2="18" y2="18" />
|
|
83
|
+
</svg>
|
|
84
|
+
</button>
|
|
85
|
+
}
|
|
86
|
+
`, isInline: true, styles: [".neu-chip{display:inline-flex;align-items:center;gap:6px;font-family:var(--neu-font-sans);font-weight:500;white-space:nowrap;cursor:pointer;border:1.5px solid transparent;transition:background var(--neu-transition),border-color var(--neu-transition),color var(--neu-transition),box-shadow var(--neu-transition);-webkit-user-select:none;user-select:none;outline:none}.neu-chip:focus-visible{outline:2px solid var(--neu-primary);outline-offset:2px}.neu-chip--sm{padding:3px 10px;font-size:var(--neu-text-xs);border-radius:var(--neu-radius-full)}.neu-chip--md{padding:5px 14px;font-size:var(--neu-text-sm);border-radius:var(--neu-radius-full)}.neu-chip--default{background:var(--neu-surface-2);color:var(--neu-text-muted);border-color:var(--neu-border)}.neu-chip--default:hover:not(.neu-chip--disabled){background:var(--neu-surface-3);border-color:var(--neu-border-hover)}.neu-chip--default.neu-chip--selected{background:var(--neu-primary-100);color:var(--neu-primary);border-color:var(--neu-primary)}.neu-chip--primary{background:var(--neu-primary-50);color:var(--neu-primary);border-color:var(--neu-primary-100)}.neu-chip--primary:hover:not(.neu-chip--disabled){background:var(--neu-primary-100)}.neu-chip--primary.neu-chip--selected{background:var(--neu-primary);color:var(--neu-primary-fg);border-color:var(--neu-primary)}.neu-chip--success{background:var(--neu-success-bg);color:var(--neu-success-text);border-color:transparent}.neu-chip--success.neu-chip--selected{background:var(--neu-success);color:var(--neu-primary-fg)}.neu-chip--warning{background:var(--neu-warning-bg);color:var(--neu-warning-text);border-color:transparent}.neu-chip--warning.neu-chip--selected{background:var(--neu-warning);color:var(--neu-primary-fg)}.neu-chip--danger{background:var(--neu-error-bg);color:var(--neu-error-text);border-color:transparent}.neu-chip--danger.neu-chip--selected{background:var(--neu-error);color:var(--neu-primary-fg)}.neu-chip--disabled{opacity:.45;cursor:not-allowed;pointer-events:none}.neu-chip__remove{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;margin-left:2px;border:none;border-radius:50%;background:transparent;cursor:pointer;color:currentColor;opacity:.6;padding:0;flex-shrink:0;transition:opacity var(--neu-transition),background var(--neu-transition);outline:none}.neu-chip__remove:hover{opacity:1;background:var(--neu-alert-dismiss-hover-bg)}.neu-chip__remove:focus-visible{outline:2px solid currentColor;outline-offset:1px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
87
|
+
}
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: NeuChipComponent, decorators: [{
|
|
89
|
+
type: Component,
|
|
90
|
+
args: [{ selector: 'neu-chip', imports: [], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
91
|
+
'[class]': 'hostClasses()',
|
|
92
|
+
'[attr.role]': '_hostRole()',
|
|
93
|
+
'[attr.aria-pressed]': '_hostAriaPressed()',
|
|
94
|
+
'[attr.tabindex]': '_hostTabindex()',
|
|
95
|
+
'(keydown.space)': 'onToggle()',
|
|
96
|
+
'(keydown.enter)': 'onToggle()',
|
|
97
|
+
}, template: `
|
|
98
|
+
<ng-content />
|
|
99
|
+
@if (removable()) {
|
|
100
|
+
<button
|
|
101
|
+
class="neu-chip__remove"
|
|
102
|
+
type="button"
|
|
103
|
+
[disabled]="disabled()"
|
|
104
|
+
(click)="$event.stopPropagation(); onRemove()"
|
|
105
|
+
[attr.aria-label]="removeAriaLabel()"
|
|
106
|
+
>
|
|
107
|
+
<svg
|
|
108
|
+
width="10"
|
|
109
|
+
height="10"
|
|
110
|
+
viewBox="0 0 24 24"
|
|
111
|
+
fill="none"
|
|
112
|
+
stroke="currentColor"
|
|
113
|
+
stroke-width="2.5"
|
|
114
|
+
stroke-linecap="round"
|
|
115
|
+
aria-hidden="true"
|
|
116
|
+
>
|
|
117
|
+
<line x1="18" y1="6" x2="6" y2="18" />
|
|
118
|
+
<line x1="6" y1="6" x2="18" y2="18" />
|
|
119
|
+
</svg>
|
|
120
|
+
</button>
|
|
121
|
+
}
|
|
122
|
+
`, styles: [".neu-chip{display:inline-flex;align-items:center;gap:6px;font-family:var(--neu-font-sans);font-weight:500;white-space:nowrap;cursor:pointer;border:1.5px solid transparent;transition:background var(--neu-transition),border-color var(--neu-transition),color var(--neu-transition),box-shadow var(--neu-transition);-webkit-user-select:none;user-select:none;outline:none}.neu-chip:focus-visible{outline:2px solid var(--neu-primary);outline-offset:2px}.neu-chip--sm{padding:3px 10px;font-size:var(--neu-text-xs);border-radius:var(--neu-radius-full)}.neu-chip--md{padding:5px 14px;font-size:var(--neu-text-sm);border-radius:var(--neu-radius-full)}.neu-chip--default{background:var(--neu-surface-2);color:var(--neu-text-muted);border-color:var(--neu-border)}.neu-chip--default:hover:not(.neu-chip--disabled){background:var(--neu-surface-3);border-color:var(--neu-border-hover)}.neu-chip--default.neu-chip--selected{background:var(--neu-primary-100);color:var(--neu-primary);border-color:var(--neu-primary)}.neu-chip--primary{background:var(--neu-primary-50);color:var(--neu-primary);border-color:var(--neu-primary-100)}.neu-chip--primary:hover:not(.neu-chip--disabled){background:var(--neu-primary-100)}.neu-chip--primary.neu-chip--selected{background:var(--neu-primary);color:var(--neu-primary-fg);border-color:var(--neu-primary)}.neu-chip--success{background:var(--neu-success-bg);color:var(--neu-success-text);border-color:transparent}.neu-chip--success.neu-chip--selected{background:var(--neu-success);color:var(--neu-primary-fg)}.neu-chip--warning{background:var(--neu-warning-bg);color:var(--neu-warning-text);border-color:transparent}.neu-chip--warning.neu-chip--selected{background:var(--neu-warning);color:var(--neu-primary-fg)}.neu-chip--danger{background:var(--neu-error-bg);color:var(--neu-error-text);border-color:transparent}.neu-chip--danger.neu-chip--selected{background:var(--neu-error);color:var(--neu-primary-fg)}.neu-chip--disabled{opacity:.45;cursor:not-allowed;pointer-events:none}.neu-chip__remove{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;margin-left:2px;border:none;border-radius:50%;background:transparent;cursor:pointer;color:currentColor;opacity:.6;padding:0;flex-shrink:0;transition:opacity var(--neu-transition),background var(--neu-transition);outline:none}.neu-chip__remove:hover{opacity:1;background:var(--neu-alert-dismiss-hover-bg)}.neu-chip__remove:focus-visible{outline:2px solid currentColor;outline-offset:1px}\n"] }]
|
|
123
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], removeAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeAriaLabel", required: false }] }], selectedChange: [{ type: i0.Output, args: ["selectedChange"] }], removed: [{ type: i0.Output, args: ["removed"] }] } });
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Generated bundle index. Do not edit.
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
export { NeuChipComponent };
|
|
130
|
+
//# sourceMappingURL=neural-ui-core-chip.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"neural-ui-core-chip.mjs","sources":["../../../../projects/ui-core/chip/neu-chip.component.ts","../../../../projects/ui-core/chip/neural-ui-core-chip.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n input,\n output,\n} from '@angular/core';\n\nexport type NeuChipVariant = 'default' | 'primary' | 'success' | 'warning' | 'danger';\nexport type NeuChipSize = 'sm' | 'md';\n\n/**\n * NeuralUI Chip Component\n *\n * Etiqueta compacta seleccionable y/o eliminable. Ideal para filtros,\n * listas de tags y multiselección visual.\n *\n * Uso:\n * <neu-chip>Angular</neu-chip>\n * <neu-chip [removable]=\"true\" (removed)=\"onRemove()\">CSS</neu-chip>\n * <neu-chip [selected]=\"true\" (selectedChange)=\"toggle()\">TypeScript</neu-chip>\n */\n@Component({\n selector: 'neu-chip',\n imports: [],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'hostClasses()',\n '[attr.role]': '_hostRole()',\n '[attr.aria-pressed]': '_hostAriaPressed()',\n '[attr.tabindex]': '_hostTabindex()',\n '(keydown.space)': 'onToggle()',\n '(keydown.enter)': 'onToggle()',\n },\n template: `\n <ng-content />\n @if (removable()) {\n <button\n class=\"neu-chip__remove\"\n type=\"button\"\n [disabled]=\"disabled()\"\n (click)=\"$event.stopPropagation(); onRemove()\"\n [attr.aria-label]=\"removeAriaLabel()\"\n >\n <svg\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n aria-hidden=\"true\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n </button>\n }\n `,\n styleUrl: './neu-chip.component.scss',\n})\nexport class NeuChipComponent {\n /** Variante de color / Color variant */\n variant = input<NeuChipVariant>('default');\n\n /** Tamaño / Size */\n size = input<NeuChipSize>('md');\n\n /** Estado seleccionado / Selected state */\n selected = input<boolean>(false);\n\n /** Muestra botón de cierre / Shows close button */\n removable = input<boolean>(false);\n\n /** Deshabilitado / Disabled */\n disabled = input<boolean>(false);\n\n /** Aria-label del botón de eliminar / Aria-label for the delete button */\n removeAriaLabel = input<string>('Eliminar');\n\n /** Emite al hacer clic o pulsar espacio/enter / Emits on click or space/enter press */\n selectedChange = output<boolean>();\n\n /** Emite al pulsar el botón de cierre / Emits when the close button is pressed */\n removed = output<void>();\n\n readonly hostClasses = computed(() => ({\n 'neu-chip': true,\n [`neu-chip--${this.variant()}`]: true,\n [`neu-chip--${this.size()}`]: true,\n 'neu-chip--selected': this.selected(),\n 'neu-chip--removable': this.removable(),\n 'neu-chip--disabled': this.disabled(),\n }));\n\n /** Rol ARIA del host: 'button' cuando seleccionable, 'group' cuando también eliminable / Host ARIA role: 'button' when selectable, 'group' when removable */\n readonly _hostRole = computed(() => (this.removable() ? 'group' : 'button'));\n\n /** aria-pressed solo cuando actúa como botón toggle / aria-pressed only when acting as toggle button */\n readonly _hostAriaPressed = computed<boolean | null>(() =>\n this.removable() ? null : this.selected(),\n );\n\n /** tabindex nulo en el host grupo para no saturar el orden de foco / null tabindex on group host to not saturate focus order */\n readonly _hostTabindex = computed<number | null>(() => {\n if (this.removable()) return null;\n return this.disabled() ? -1 : 0;\n });\n\n onToggle(): void {\n if (!this.disabled() && !this.removable()) {\n this.selectedChange.emit(!this.selected());\n }\n }\n\n onRemove(): void {\n if (!this.disabled()) {\n this.removed.emit();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;AAYA;;;;;;;;;;AAUG;MA0CU,gBAAgB,CAAA;;AAE3B,IAAA,OAAO,GAAG,KAAK,CAAiB,SAAS,8EAAC;;AAG1C,IAAA,IAAI,GAAG,KAAK,CAAc,IAAI,2EAAC;;AAG/B,IAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,+EAAC;;AAGhC,IAAA,SAAS,GAAG,KAAK,CAAU,KAAK,gFAAC;;AAGjC,IAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,+EAAC;;AAGhC,IAAA,eAAe,GAAG,KAAK,CAAS,UAAU,sFAAC;;IAG3C,cAAc,GAAG,MAAM,EAAW;;IAGlC,OAAO,GAAG,MAAM,EAAQ;AAEf,IAAA,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al, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import { DOCUMENT } from '@angular/common';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* NeuralUI Code Block
|
|
7
|
+
*
|
|
8
|
+
* Bloque de código con estilo editor oscuro (Tokyo Night).
|
|
9
|
+
* Incluye botón de copiar al portapapeles, badge del lenguaje
|
|
10
|
+
* y soporte para resaltado futuro con ngx-highlightjs.
|
|
11
|
+
*
|
|
12
|
+
* Uso:
|
|
13
|
+
* <neu-code-block [code]="snippet" lang="TypeScript" />
|
|
14
|
+
*
|
|
15
|
+
* Con ngx-highlightjs instalado, envuelve el <pre> con
|
|
16
|
+
* [highlight]="code" para resaltado automático.
|
|
17
|
+
*/
|
|
18
|
+
class NeuCodeBlockComponent {
|
|
19
|
+
doc = inject(DOCUMENT);
|
|
20
|
+
destroyRef = inject(DestroyRef);
|
|
21
|
+
/** Código fuente a mostrar / Source code to display */
|
|
22
|
+
code = input('', ...(ngDevMode ? [{ debugName: "code" }] : /* istanbul ignore next */ []));
|
|
23
|
+
/** Nombre del lenguaje (decorativo) / Language name (decorative) */
|
|
24
|
+
lang = input('', ...(ngDevMode ? [{ debugName: "lang" }] : /* istanbul ignore next */ []));
|
|
25
|
+
/**
|
|
26
|
+
* Identificador de lenguaje estándar (typescript, scss, html, bash…).
|
|
27
|
+
* Genera automáticamente el label legible para el badge.
|
|
28
|
+
* Language identifier — auto-generates a readable badge label.
|
|
29
|
+
*/
|
|
30
|
+
language = input('', ...(ngDevMode ? [{ debugName: "language" }] : /* istanbul ignore next */ []));
|
|
31
|
+
/** Label legible derivado de lang o language / Readable label derived from lang or language */
|
|
32
|
+
displayLang = computed(() => {
|
|
33
|
+
const explicit = this.lang();
|
|
34
|
+
if (explicit)
|
|
35
|
+
return explicit;
|
|
36
|
+
const id = this.language().toLowerCase().trim();
|
|
37
|
+
const map = {
|
|
38
|
+
typescript: 'TypeScript',
|
|
39
|
+
javascript: 'JavaScript',
|
|
40
|
+
ts: 'TypeScript',
|
|
41
|
+
js: 'JavaScript',
|
|
42
|
+
scss: 'SCSS',
|
|
43
|
+
css: 'CSS',
|
|
44
|
+
less: 'Less',
|
|
45
|
+
html: 'HTML',
|
|
46
|
+
xml: 'XML',
|
|
47
|
+
bash: 'Bash',
|
|
48
|
+
shell: 'Shell',
|
|
49
|
+
sh: 'Shell',
|
|
50
|
+
json: 'JSON',
|
|
51
|
+
yaml: 'YAML',
|
|
52
|
+
yml: 'YAML',
|
|
53
|
+
angular: 'Angular',
|
|
54
|
+
jsx: 'JSX',
|
|
55
|
+
tsx: 'TSX',
|
|
56
|
+
};
|
|
57
|
+
return map[id] ?? (id ? id.toUpperCase() : 'TypeScript');
|
|
58
|
+
}, ...(ngDevMode ? [{ debugName: "displayLang" }] : /* istanbul ignore next */ []));
|
|
59
|
+
/** Texto del botón cuando no se ha copiado / Button text when not yet copied */
|
|
60
|
+
copyLabel = input(undefined, ...(ngDevMode ? [{ debugName: "copyLabel" }] : /* istanbul ignore next */ []));
|
|
61
|
+
/** Texto del botón tras copiar / Button text after copying */
|
|
62
|
+
copiedLabel = input(undefined, ...(ngDevMode ? [{ debugName: "copiedLabel" }] : /* istanbul ignore next */ []));
|
|
63
|
+
/** Aria-label del botón copiar / Aria-label for the copy button */
|
|
64
|
+
copyAriaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "copyAriaLabel" }] : /* istanbul ignore next */ []));
|
|
65
|
+
/** Aria-label del botón tras copiar / Aria-label for the button after copying */
|
|
66
|
+
copiedAriaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "copiedAriaLabel" }] : /* istanbul ignore next */ []));
|
|
67
|
+
localeLabels = signal(this._getLocaleLabels(), ...(ngDevMode ? [{ debugName: "localeLabels" }] : /* istanbul ignore next */ []));
|
|
68
|
+
resolvedCopyLabel = computed(() => this._resolveInputLabel(this.copyLabel()) ?? this.localeLabels().copyLabel, ...(ngDevMode ? [{ debugName: "resolvedCopyLabel" }] : /* istanbul ignore next */ []));
|
|
69
|
+
resolvedCopiedLabel = computed(() => this._resolveInputLabel(this.copiedLabel()) ?? this.localeLabels().copiedLabel, ...(ngDevMode ? [{ debugName: "resolvedCopiedLabel" }] : /* istanbul ignore next */ []));
|
|
70
|
+
resolvedCopyAriaLabel = computed(() => this._resolveInputLabel(this.copyAriaLabel()) ?? this.localeLabels().copyAriaLabel, ...(ngDevMode ? [{ debugName: "resolvedCopyAriaLabel" }] : /* istanbul ignore next */ []));
|
|
71
|
+
resolvedCopiedAriaLabel = computed(() => this._resolveInputLabel(this.copiedAriaLabel()) ?? this.localeLabels().copiedAriaLabel, ...(ngDevMode ? [{ debugName: "resolvedCopiedAriaLabel" }] : /* istanbul ignore next */ []));
|
|
72
|
+
copied = signal(false, ...(ngDevMode ? [{ debugName: "copied" }] : /* istanbul ignore next */ []));
|
|
73
|
+
_copyTimer;
|
|
74
|
+
constructor() {
|
|
75
|
+
const root = this.doc.documentElement;
|
|
76
|
+
const win = this.doc.defaultView;
|
|
77
|
+
if (!root || !win?.MutationObserver)
|
|
78
|
+
return;
|
|
79
|
+
const observer = new win.MutationObserver(() => {
|
|
80
|
+
this.localeLabels.set(this._getLocaleLabels());
|
|
81
|
+
});
|
|
82
|
+
observer.observe(root, {
|
|
83
|
+
attributes: true,
|
|
84
|
+
attributeFilter: ['lang'],
|
|
85
|
+
});
|
|
86
|
+
this.destroyRef.onDestroy(() => observer.disconnect());
|
|
87
|
+
}
|
|
88
|
+
copy() {
|
|
89
|
+
const text = this.code();
|
|
90
|
+
const win = this.doc.defaultView;
|
|
91
|
+
if (win?.navigator?.clipboard) {
|
|
92
|
+
void win.navigator.clipboard.writeText(text).then(() => this._markCopied());
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
// Fallback para HTTP o navegadores sin Clipboard API
|
|
96
|
+
const ta = this.doc.createElement('textarea');
|
|
97
|
+
ta.value = text;
|
|
98
|
+
ta.style.cssText = 'position:fixed;top:0;left:0;opacity:0;pointer-events:none';
|
|
99
|
+
this.doc.body.appendChild(ta);
|
|
100
|
+
ta.focus();
|
|
101
|
+
ta.select();
|
|
102
|
+
try {
|
|
103
|
+
this.doc.execCommand('copy');
|
|
104
|
+
this._markCopied();
|
|
105
|
+
}
|
|
106
|
+
finally {
|
|
107
|
+
this.doc.body.removeChild(ta);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
_markCopied() {
|
|
112
|
+
this.copied.set(true);
|
|
113
|
+
clearTimeout(this._copyTimer);
|
|
114
|
+
this._copyTimer = setTimeout(() => this.copied.set(false), 2000);
|
|
115
|
+
}
|
|
116
|
+
_getLocaleLabels() {
|
|
117
|
+
const lang = this.doc.documentElement?.lang?.toLowerCase() ?? 'en';
|
|
118
|
+
if (lang.startsWith('es')) {
|
|
119
|
+
return {
|
|
120
|
+
copyLabel: 'Copiar',
|
|
121
|
+
copiedLabel: 'Copiado',
|
|
122
|
+
copyAriaLabel: 'Copiar código',
|
|
123
|
+
copiedAriaLabel: 'Código copiado',
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
copyLabel: 'Copy',
|
|
128
|
+
copiedLabel: 'Copied',
|
|
129
|
+
copyAriaLabel: 'Copy code',
|
|
130
|
+
copiedAriaLabel: 'Code copied',
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
_resolveInputLabel(value) {
|
|
134
|
+
const trimmed = value?.trim();
|
|
135
|
+
return trimmed ? value : undefined;
|
|
136
|
+
}
|
|
137
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: NeuCodeBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
138
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: NeuCodeBlockComponent, isStandalone: true, selector: "neu-code-block", inputs: { code: { classPropertyName: "code", publicName: "code", isSignal: true, isRequired: false, transformFunction: null }, lang: { classPropertyName: "lang", publicName: "lang", isSignal: true, isRequired: false, transformFunction: null }, language: { classPropertyName: "language", publicName: "language", isSignal: true, isRequired: false, transformFunction: null }, copyLabel: { classPropertyName: "copyLabel", publicName: "copyLabel", isSignal: true, isRequired: false, transformFunction: null }, copiedLabel: { classPropertyName: "copiedLabel", publicName: "copiedLabel", isSignal: true, isRequired: false, transformFunction: null }, copyAriaLabel: { classPropertyName: "copyAriaLabel", publicName: "copyAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, copiedAriaLabel: { classPropertyName: "copiedAriaLabel", publicName: "copiedAriaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.lang": "null" } }, ngImport: i0, template: `
|
|
139
|
+
<div class="neu-code-block">
|
|
140
|
+
<!-- Encabezado del editor -->
|
|
141
|
+
<div class="neu-code-block__header">
|
|
142
|
+
<!-- Traffic lights decorativos -->
|
|
143
|
+
<div class="neu-code-block__dots" aria-hidden="true">
|
|
144
|
+
<span></span><span></span><span></span>
|
|
145
|
+
</div>
|
|
146
|
+
<span class="neu-code-block__lang">{{ displayLang() }}</span>
|
|
147
|
+
<button
|
|
148
|
+
class="neu-code-block__copy"
|
|
149
|
+
type="button"
|
|
150
|
+
[attr.aria-label]="copied() ? resolvedCopiedAriaLabel() : resolvedCopyAriaLabel()"
|
|
151
|
+
(click)="copy()"
|
|
152
|
+
>
|
|
153
|
+
@if (copied()) {
|
|
154
|
+
<svg
|
|
155
|
+
viewBox="0 0 24 24"
|
|
156
|
+
fill="none"
|
|
157
|
+
stroke="currentColor"
|
|
158
|
+
stroke-width="2.5"
|
|
159
|
+
stroke-linecap="round"
|
|
160
|
+
stroke-linejoin="round"
|
|
161
|
+
>
|
|
162
|
+
<polyline points="20 6 9 17 4 12" />
|
|
163
|
+
</svg>
|
|
164
|
+
{{ resolvedCopiedLabel() }}
|
|
165
|
+
} @else {
|
|
166
|
+
<svg
|
|
167
|
+
viewBox="0 0 24 24"
|
|
168
|
+
fill="none"
|
|
169
|
+
stroke="currentColor"
|
|
170
|
+
stroke-width="2"
|
|
171
|
+
stroke-linecap="round"
|
|
172
|
+
stroke-linejoin="round"
|
|
173
|
+
>
|
|
174
|
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2" />
|
|
175
|
+
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" />
|
|
176
|
+
</svg>
|
|
177
|
+
{{ resolvedCopyLabel() }}
|
|
178
|
+
}
|
|
179
|
+
</button>
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
<!-- Bloque de código -->
|
|
183
|
+
<pre
|
|
184
|
+
class="neu-code-block__pre"
|
|
185
|
+
tabindex="0"
|
|
186
|
+
><code class="neu-code-block__code">{{ code() }}</code></pre>
|
|
187
|
+
</div>
|
|
188
|
+
`, isInline: true, styles: [".neu-code-block{border-radius:var(--neu-radius-lg);overflow:hidden;border:1px solid var(--neu-code-block-border);font-family:var(--neu-font-mono)}.neu-code-block__header{display:flex;align-items:center;gap:var(--neu-space-3);padding:10px 16px;background:var(--neu-code-block-bar-bg);border-bottom:1px solid var(--neu-code-block-border)}.neu-code-block__dots{display:flex;gap:6px;flex-shrink:0}.neu-code-block__dots span{display:block;width:12px;height:12px;border-radius:50%}.neu-code-block__dots span:nth-child(1){background:#ff5f57}.neu-code-block__dots span:nth-child(2){background:#febc2e}.neu-code-block__dots span:nth-child(3){background:#28c840}.neu-code-block__lang{flex:1;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--neu-code-block-accent);font-family:var(--neu-font-mono)}.neu-code-block__copy{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;background:var(--neu-code-block-border);border:1px solid var(--neu-code-block-copy-border);border-radius:6px;font-size:11px;font-weight:500;color:var(--neu-code-block-copy-text);cursor:pointer;font-family:var(--neu-font-sans);transition:all var(--neu-transition);flex-shrink:0}.neu-code-block__copy svg{width:12px;height:12px;flex-shrink:0}.neu-code-block__copy:hover{background:var(--neu-code-block-copy-hover-bg);color:var(--neu-code-block-copy-hover-text);border-color:var(--neu-code-block-copy-hover-border)}.neu-code-block__pre{margin:0;padding:20px 24px;background:var(--neu-code-block-bg);overflow-x:auto;scrollbar-width:thin;scrollbar-color:var(--neu-code-block-muted) transparent}.neu-code-block__pre::-webkit-scrollbar{height:4px}.neu-code-block__pre::-webkit-scrollbar-track{background:transparent}.neu-code-block__pre::-webkit-scrollbar-thumb{background:var(--neu-code-block-muted);border-radius:99px}.neu-code-block__code{display:block;font-size:13.5px;line-height:1.75;color:var(--neu-code-block-text);font-family:inherit;white-space:pre;tab-size:2}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
189
|
+
}
|
|
190
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: NeuCodeBlockComponent, decorators: [{
|
|
191
|
+
type: Component,
|
|
192
|
+
args: [{ selector: 'neu-code-block', imports: [], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
193
|
+
<div class="neu-code-block">
|
|
194
|
+
<!-- Encabezado del editor -->
|
|
195
|
+
<div class="neu-code-block__header">
|
|
196
|
+
<!-- Traffic lights decorativos -->
|
|
197
|
+
<div class="neu-code-block__dots" aria-hidden="true">
|
|
198
|
+
<span></span><span></span><span></span>
|
|
199
|
+
</div>
|
|
200
|
+
<span class="neu-code-block__lang">{{ displayLang() }}</span>
|
|
201
|
+
<button
|
|
202
|
+
class="neu-code-block__copy"
|
|
203
|
+
type="button"
|
|
204
|
+
[attr.aria-label]="copied() ? resolvedCopiedAriaLabel() : resolvedCopyAriaLabel()"
|
|
205
|
+
(click)="copy()"
|
|
206
|
+
>
|
|
207
|
+
@if (copied()) {
|
|
208
|
+
<svg
|
|
209
|
+
viewBox="0 0 24 24"
|
|
210
|
+
fill="none"
|
|
211
|
+
stroke="currentColor"
|
|
212
|
+
stroke-width="2.5"
|
|
213
|
+
stroke-linecap="round"
|
|
214
|
+
stroke-linejoin="round"
|
|
215
|
+
>
|
|
216
|
+
<polyline points="20 6 9 17 4 12" />
|
|
217
|
+
</svg>
|
|
218
|
+
{{ resolvedCopiedLabel() }}
|
|
219
|
+
} @else {
|
|
220
|
+
<svg
|
|
221
|
+
viewBox="0 0 24 24"
|
|
222
|
+
fill="none"
|
|
223
|
+
stroke="currentColor"
|
|
224
|
+
stroke-width="2"
|
|
225
|
+
stroke-linecap="round"
|
|
226
|
+
stroke-linejoin="round"
|
|
227
|
+
>
|
|
228
|
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2" />
|
|
229
|
+
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" />
|
|
230
|
+
</svg>
|
|
231
|
+
{{ resolvedCopyLabel() }}
|
|
232
|
+
}
|
|
233
|
+
</button>
|
|
234
|
+
</div>
|
|
235
|
+
|
|
236
|
+
<!-- Bloque de código -->
|
|
237
|
+
<pre
|
|
238
|
+
class="neu-code-block__pre"
|
|
239
|
+
tabindex="0"
|
|
240
|
+
><code class="neu-code-block__code">{{ code() }}</code></pre>
|
|
241
|
+
</div>
|
|
242
|
+
`, host: { '[attr.lang]': 'null' }, styles: [".neu-code-block{border-radius:var(--neu-radius-lg);overflow:hidden;border:1px solid var(--neu-code-block-border);font-family:var(--neu-font-mono)}.neu-code-block__header{display:flex;align-items:center;gap:var(--neu-space-3);padding:10px 16px;background:var(--neu-code-block-bar-bg);border-bottom:1px solid var(--neu-code-block-border)}.neu-code-block__dots{display:flex;gap:6px;flex-shrink:0}.neu-code-block__dots span{display:block;width:12px;height:12px;border-radius:50%}.neu-code-block__dots span:nth-child(1){background:#ff5f57}.neu-code-block__dots span:nth-child(2){background:#febc2e}.neu-code-block__dots span:nth-child(3){background:#28c840}.neu-code-block__lang{flex:1;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--neu-code-block-accent);font-family:var(--neu-font-mono)}.neu-code-block__copy{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;background:var(--neu-code-block-border);border:1px solid var(--neu-code-block-copy-border);border-radius:6px;font-size:11px;font-weight:500;color:var(--neu-code-block-copy-text);cursor:pointer;font-family:var(--neu-font-sans);transition:all var(--neu-transition);flex-shrink:0}.neu-code-block__copy svg{width:12px;height:12px;flex-shrink:0}.neu-code-block__copy:hover{background:var(--neu-code-block-copy-hover-bg);color:var(--neu-code-block-copy-hover-text);border-color:var(--neu-code-block-copy-hover-border)}.neu-code-block__pre{margin:0;padding:20px 24px;background:var(--neu-code-block-bg);overflow-x:auto;scrollbar-width:thin;scrollbar-color:var(--neu-code-block-muted) transparent}.neu-code-block__pre::-webkit-scrollbar{height:4px}.neu-code-block__pre::-webkit-scrollbar-track{background:transparent}.neu-code-block__pre::-webkit-scrollbar-thumb{background:var(--neu-code-block-muted);border-radius:99px}.neu-code-block__code{display:block;font-size:13.5px;line-height:1.75;color:var(--neu-code-block-text);font-family:inherit;white-space:pre;tab-size:2}\n"] }]
|
|
243
|
+
}], ctorParameters: () => [], propDecorators: { code: [{ type: i0.Input, args: [{ isSignal: true, alias: "code", required: false }] }], lang: [{ type: i0.Input, args: [{ isSignal: true, alias: "lang", required: false }] }], language: [{ type: i0.Input, args: [{ isSignal: true, alias: "language", required: false }] }], copyLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "copyLabel", required: false }] }], copiedLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "copiedLabel", required: false }] }], copyAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "copyAriaLabel", required: false }] }], copiedAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "copiedAriaLabel", required: false }] }] } });
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Generated bundle index. Do not edit.
|
|
247
|
+
*/
|
|
248
|
+
|
|
249
|
+
export { NeuCodeBlockComponent };
|
|
250
|
+
//# sourceMappingURL=neural-ui-core-code-block.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"neural-ui-core-code-block.mjs","sources":["../../../../projects/ui-core/code-block/neu-code-block.component.ts","../../../../projects/ui-core/code-block/neural-ui-core-code-block.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\n\n/**\n * NeuralUI Code Block\n *\n * Bloque de código con estilo editor oscuro (Tokyo Night).\n * Incluye botón de copiar al portapapeles, badge del lenguaje\n * y soporte para resaltado futuro con ngx-highlightjs.\n *\n * Uso:\n * <neu-code-block [code]=\"snippet\" lang=\"TypeScript\" />\n *\n * Con ngx-highlightjs instalado, envuelve el <pre> con\n * [highlight]=\"code\" para resaltado automático.\n */\n@Component({\n selector: 'neu-code-block',\n imports: [],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"neu-code-block\">\n <!-- Encabezado del editor -->\n <div class=\"neu-code-block__header\">\n <!-- Traffic lights decorativos -->\n <div class=\"neu-code-block__dots\" aria-hidden=\"true\">\n <span></span><span></span><span></span>\n </div>\n <span class=\"neu-code-block__lang\">{{ displayLang() }}</span>\n <button\n class=\"neu-code-block__copy\"\n type=\"button\"\n [attr.aria-label]=\"copied() ? resolvedCopiedAriaLabel() : resolvedCopyAriaLabel()\"\n (click)=\"copy()\"\n >\n @if (copied()) {\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n {{ resolvedCopiedLabel() }}\n } @else {\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\" />\n <path d=\"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1\" />\n </svg>\n {{ resolvedCopyLabel() }}\n }\n </button>\n </div>\n\n <!-- Bloque de código -->\n <pre\n class=\"neu-code-block__pre\"\n tabindex=\"0\"\n ><code class=\"neu-code-block__code\">{{ code() }}</code></pre>\n </div>\n `,\n host: { '[attr.lang]': 'null' },\n styleUrl: './neu-code-block.component.scss',\n})\nexport class NeuCodeBlockComponent {\n private readonly doc = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n\n /** Código fuente a mostrar / Source code to display */\n code = input<string>('');\n\n /** Nombre del lenguaje (decorativo) / Language name (decorative) */\n lang = input<string>('');\n\n /**\n * Identificador de lenguaje estándar (typescript, scss, html, bash…).\n * Genera automáticamente el label legible para el badge.\n * Language identifier — auto-generates a readable badge label.\n */\n language = input<string>('');\n\n /** Label legible derivado de lang o language / Readable label derived from lang or language */\n protected readonly displayLang = computed(() => {\n const explicit = this.lang();\n if (explicit) return explicit;\n const id = this.language().toLowerCase().trim();\n const map: Record<string, string> = {\n typescript: 'TypeScript',\n javascript: 'JavaScript',\n ts: 'TypeScript',\n js: 'JavaScript',\n scss: 'SCSS',\n css: 'CSS',\n less: 'Less',\n html: 'HTML',\n xml: 'XML',\n bash: 'Bash',\n shell: 'Shell',\n sh: 'Shell',\n json: 'JSON',\n yaml: 'YAML',\n yml: 'YAML',\n angular: 'Angular',\n jsx: 'JSX',\n tsx: 'TSX',\n };\n return map[id] ?? (id ? id.toUpperCase() : 'TypeScript');\n });\n\n /** Texto del botón cuando no se ha copiado / Button text when not yet copied */\n copyLabel = input<string | undefined>(undefined);\n\n /** Texto del botón tras copiar / Button text after copying */\n copiedLabel = input<string | undefined>(undefined);\n\n /** Aria-label del botón copiar / Aria-label for the copy button */\n copyAriaLabel = input<string | undefined>(undefined);\n\n /** Aria-label del botón tras copiar / Aria-label for the button after copying */\n copiedAriaLabel = input<string | undefined>(undefined);\n\n private readonly localeLabels = signal(this._getLocaleLabels());\n\n protected readonly resolvedCopyLabel = computed(\n () => this._resolveInputLabel(this.copyLabel()) ?? this.localeLabels().copyLabel,\n );\n\n protected readonly resolvedCopiedLabel = computed(\n () => this._resolveInputLabel(this.copiedLabel()) ?? this.localeLabels().copiedLabel,\n );\n\n protected readonly resolvedCopyAriaLabel = computed(\n () => this._resolveInputLabel(this.copyAriaLabel()) ?? this.localeLabels().copyAriaLabel,\n );\n\n protected readonly resolvedCopiedAriaLabel = computed(\n () => this._resolveInputLabel(this.copiedAriaLabel()) ?? this.localeLabels().copiedAriaLabel,\n );\n\n protected readonly copied = signal(false);\n private _copyTimer?: ReturnType<typeof setTimeout>;\n\n constructor() {\n const root = this.doc.documentElement;\n const win = this.doc.defaultView;\n\n if (!root || !win?.MutationObserver) return;\n\n const observer = new win.MutationObserver(() => {\n this.localeLabels.set(this._getLocaleLabels());\n });\n\n observer.observe(root, {\n attributes: true,\n attributeFilter: ['lang'],\n });\n\n this.destroyRef.onDestroy(() => observer.disconnect());\n }\n\n copy(): void {\n const text = this.code();\n const win = this.doc.defaultView;\n\n if (win?.navigator?.clipboard) {\n void win.navigator.clipboard.writeText(text).then(() => this._markCopied());\n } else {\n // Fallback para HTTP o navegadores sin Clipboard API\n const ta = this.doc.createElement('textarea');\n ta.value = text;\n ta.style.cssText = 'position:fixed;top:0;left:0;opacity:0;pointer-events:none';\n this.doc.body.appendChild(ta);\n ta.focus();\n ta.select();\n try {\n this.doc.execCommand('copy');\n this._markCopied();\n } finally {\n this.doc.body.removeChild(ta);\n }\n }\n }\n\n private _markCopied(): void {\n this.copied.set(true);\n clearTimeout(this._copyTimer);\n this._copyTimer = setTimeout(() => this.copied.set(false), 2000);\n }\n\n private _getLocaleLabels(): {\n copyLabel: string;\n copiedLabel: string;\n copyAriaLabel: string;\n copiedAriaLabel: string;\n } {\n const lang = this.doc.documentElement?.lang?.toLowerCase() ?? 'en';\n\n if (lang.startsWith('es')) {\n return {\n copyLabel: 'Copiar',\n copiedLabel: 'Copiado',\n copyAriaLabel: 'Copiar código',\n copiedAriaLabel: 'Código copiado',\n };\n }\n\n return {\n copyLabel: 'Copy',\n copiedLabel: 'Copied',\n copyAriaLabel: 'Copy code',\n copiedAriaLabel: 'Code copied',\n };\n }\n\n private _resolveInputLabel(value: string | undefined): string | undefined {\n const trimmed = value?.trim();\n return trimmed ? value : undefined;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;AAYA;;;;;;;;;;;;AAYG;MA4DU,qBAAqB,CAAA;AACf,IAAA,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;AACtB,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;;AAGhD,IAAA,IAAI,GAAG,KAAK,CAAS,EAAE,2EAAC;;AAGxB,IAAA,IAAI,GAAG,KAAK,CAAS,EAAE,2EAAC;AAExB;;;;AAIG;AACH,IAAA,QAAQ,GAAG,KAAK,CAAS,EAAE,+EAAC;;AAGT,IAAA,WAAW,GAAG,QAAQ,CAAC,MAAK;AAC7C,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE;AAC5B,QAAA,IAAI,QAAQ;AAAE,YAAA,OAAO,QAAQ;AAC7B,QAAA,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE;AAC/C,QAAA,MAAM,GAAG,GAA2B;AAClC,YAAA,UAAU,EAAE,YAAY;AACxB,YAAA,UAAU,EAAE,YAAY;AACxB,YAAA,EAAE,EAAE,YAAY;AAChB,YAAA,EAAE,EAAE,YAAY;AAChB,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,GAAG,EAAE,KAAK;AACV,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,GAAG,EAAE,KAAK;AACV,YAAA,IAAI,EAAE,M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