@ojiepermana/angular-component 22.0.36 → 22.0.41
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 +3 -3
- package/alert-dialog/README.md +14 -14
- package/checkbox/README.md +16 -15
- package/command/README.md +4 -4
- package/dialog/README.md +12 -12
- package/drawer/README.md +1 -1
- package/fesm2022/ojiepermana-angular-component-accordion.mjs +16 -4
- package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs +11 -3
- package/fesm2022/ojiepermana-angular-component-alert.mjs +13 -3
- package/fesm2022/ojiepermana-angular-component-avatar.mjs +13 -3
- package/fesm2022/ojiepermana-angular-component-badge.mjs +16 -4
- package/fesm2022/ojiepermana-angular-component-button.mjs +13 -3
- package/fesm2022/ojiepermana-angular-component-calendar.mjs +2 -2
- package/fesm2022/ojiepermana-angular-component-card.mjs +13 -3
- package/fesm2022/ojiepermana-angular-component-dialog.mjs +18 -6
- package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs +13 -3
- package/fesm2022/ojiepermana-angular-component-input.mjs +16 -4
- package/fesm2022/ojiepermana-angular-component-item.mjs +14 -4
- package/fesm2022/ojiepermana-angular-component-kanban.mjs +1 -1
- package/fesm2022/ojiepermana-angular-component-popover.mjs +16 -4
- package/fesm2022/ojiepermana-angular-component-select.mjs +22 -5
- package/fesm2022/ojiepermana-angular-component-sheet.mjs +18 -6
- package/fesm2022/ojiepermana-angular-component-table.mjs +16 -4
- package/fesm2022/ojiepermana-angular-component-tabs.mjs +13 -3
- package/fesm2022/ojiepermana-angular-component-textarea.mjs +16 -4
- package/fesm2022/ojiepermana-angular-component-timeline.mjs +2 -2
- package/fesm2022/ojiepermana-angular-component-tooltip.mjs +44 -4
- package/fesm2022/ojiepermana-angular-component-utils.mjs +51 -1
- package/form/README.md +13 -13
- package/hover-card/README.md +1 -1
- package/package.json +1 -1
- package/radio/README.md +11 -11
- package/scroll-area/README.md +4 -2
- package/sheet/README.md +11 -11
- package/slider/README.md +2 -2
- package/switch/README.md +10 -10
- package/toast/README.md +59 -210
- package/tooltip/README.md +13 -8
- package/types/ojiepermana-angular-component-accordion.d.ts +5 -1
- package/types/ojiepermana-angular-component-alert-dialog.d.ts +3 -1
- package/types/ojiepermana-angular-component-alert.d.ts +5 -1
- package/types/ojiepermana-angular-component-avatar.d.ts +5 -1
- package/types/ojiepermana-angular-component-badge.d.ts +5 -1
- package/types/ojiepermana-angular-component-button.d.ts +5 -1
- package/types/ojiepermana-angular-component-card.d.ts +5 -1
- package/types/ojiepermana-angular-component-dialog.d.ts +5 -1
- package/types/ojiepermana-angular-component-dropdown-menu.d.ts +5 -1
- package/types/ojiepermana-angular-component-input.d.ts +5 -1
- package/types/ojiepermana-angular-component-item.d.ts +5 -1
- package/types/ojiepermana-angular-component-popover.d.ts +5 -1
- package/types/ojiepermana-angular-component-select.d.ts +11 -5
- package/types/ojiepermana-angular-component-sheet.d.ts +5 -1
- package/types/ojiepermana-angular-component-table.d.ts +5 -1
- package/types/ojiepermana-angular-component-tabs.d.ts +5 -1
- package/types/ojiepermana-angular-component-textarea.d.ts +5 -1
- package/types/ojiepermana-angular-component-tooltip.d.ts +13 -1
- package/types/ojiepermana-angular-component-utils.d.ts +34 -2
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { cn } from '@ojiepermana/angular-component/utils';
|
|
3
|
+
import { cn, radiusBaseValue, densityBaseValue } from '@ojiepermana/angular-component/utils';
|
|
4
4
|
|
|
5
5
|
class TableComponent {
|
|
6
6
|
class = input('', /* @ts-ignore */
|
|
7
7
|
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
8
|
+
radius = input('inherit', /* @ts-ignore */
|
|
9
|
+
...(ngDevMode ? [{ debugName: "radius" }] : /* istanbul ignore next */ []));
|
|
10
|
+
density = input('inherit', /* @ts-ignore */
|
|
11
|
+
...(ngDevMode ? [{ debugName: "density" }] : /* istanbul ignore next */ []));
|
|
8
12
|
classes = computed(() => cn('w-full caption-bottom text-sm', this.class()), /* @ts-ignore */
|
|
9
13
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
14
|
+
radiusBase = computed(() => radiusBaseValue(this.radius()), /* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [{ debugName: "radiusBase" }] : /* istanbul ignore next */ []));
|
|
16
|
+
densityBase = computed(() => densityBaseValue(this.density()), /* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [{ debugName: "densityBase" }] : /* istanbul ignore next */ []));
|
|
10
18
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.3", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.3", type: TableComponent, isStandalone: true, selector: "Table", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "relative block w-full overflow-x-auto" }, ngImport: i0, template: `
|
|
19
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.3", type: TableComponent, isStandalone: true, selector: "Table", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.--radius-base": "radiusBase()", "style.--spacing-base": "densityBase()" }, classAttribute: "relative block w-full overflow-x-auto" }, ngImport: i0, template: `
|
|
12
20
|
<table [class]="classes()">
|
|
13
21
|
<ng-content />
|
|
14
22
|
</table>
|
|
@@ -19,14 +27,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.3", ngImpor
|
|
|
19
27
|
args: [{
|
|
20
28
|
selector: 'Table',
|
|
21
29
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
22
|
-
host: {
|
|
30
|
+
host: {
|
|
31
|
+
class: 'relative block w-full overflow-x-auto',
|
|
32
|
+
'[style.--radius-base]': 'radiusBase()',
|
|
33
|
+
'[style.--spacing-base]': 'densityBase()',
|
|
34
|
+
},
|
|
23
35
|
template: `
|
|
24
36
|
<table [class]="classes()">
|
|
25
37
|
<ng-content />
|
|
26
38
|
</table>
|
|
27
39
|
`,
|
|
28
40
|
}]
|
|
29
|
-
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
41
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }] } });
|
|
30
42
|
class TableHeaderComponent {
|
|
31
43
|
class = input('', /* @ts-ignore */
|
|
32
44
|
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Directive, model, input, computed, forwardRef, ChangeDetectionStrategy, Component, inject, ElementRef } from '@angular/core';
|
|
3
|
-
import { uniqueId, cn } from '@ojiepermana/angular-component/utils';
|
|
3
|
+
import { uniqueId, radiusBaseValue, densityBaseValue, cn } from '@ojiepermana/angular-component/utils';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Shared state for a tabs group. Children read the active value and register
|
|
@@ -25,10 +25,18 @@ class TabsComponent extends TabsContextBase {
|
|
|
25
25
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
26
26
|
orientation = input('horizontal', /* @ts-ignore */
|
|
27
27
|
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
28
|
+
radius = input('inherit', /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "radius" }] : /* istanbul ignore next */ []));
|
|
30
|
+
density = input('inherit', /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "density" }] : /* istanbul ignore next */ []));
|
|
28
32
|
class = input('', /* @ts-ignore */
|
|
29
33
|
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
30
34
|
idPrefix = uniqueId('Tabs');
|
|
31
35
|
triggers = new Map();
|
|
36
|
+
radiusBase = computed(() => radiusBaseValue(this.radius()), /* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [{ debugName: "radiusBase" }] : /* istanbul ignore next */ []));
|
|
38
|
+
densityBase = computed(() => densityBaseValue(this.density()), /* @ts-ignore */
|
|
39
|
+
...(ngDevMode ? [{ debugName: "densityBase" }] : /* istanbul ignore next */ []));
|
|
32
40
|
classes = computed(() => cn(this.orientation() === 'vertical' ? 'flex items-start gap-4' : 'block', this.class()), /* @ts-ignore */
|
|
33
41
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
34
42
|
register(element, value, disabled) {
|
|
@@ -88,7 +96,7 @@ class TabsComponent extends TabsContextBase {
|
|
|
88
96
|
return normalized || 'tab';
|
|
89
97
|
}
|
|
90
98
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.3", ngImport: i0, type: TabsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
91
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.3", type: TabsComponent, isStandalone: true, selector: "Tabs", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "classes()", "attr.data-orientation": "orientation()" } }, providers: [{ provide: TabsContextBase, useExisting: forwardRef(() => TabsComponent) }], usesInheritance: true, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
99
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.3", type: TabsComponent, isStandalone: true, selector: "Tabs", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "classes()", "attr.data-orientation": "orientation()", "style.--radius-base": "radiusBase()", "style.--spacing-base": "densityBase()" } }, providers: [{ provide: TabsContextBase, useExisting: forwardRef(() => TabsComponent) }], usesInheritance: true, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
92
100
|
}
|
|
93
101
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.3", ngImport: i0, type: TabsComponent, decorators: [{
|
|
94
102
|
type: Component,
|
|
@@ -99,10 +107,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.3", ngImpor
|
|
|
99
107
|
host: {
|
|
100
108
|
'[class]': 'classes()',
|
|
101
109
|
'[attr.data-orientation]': 'orientation()',
|
|
110
|
+
'[style.--radius-base]': 'radiusBase()',
|
|
111
|
+
'[style.--spacing-base]': 'densityBase()',
|
|
102
112
|
},
|
|
103
113
|
template: `<ng-content />`,
|
|
104
114
|
}]
|
|
105
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
115
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
106
116
|
class TabsListComponent extends TabsListContextBase {
|
|
107
117
|
ctx = inject(TabsComponent);
|
|
108
118
|
variant = input('default', /* @ts-ignore */
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, ElementRef, input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { cn } from '@ojiepermana/angular-component/utils';
|
|
3
|
+
import { radiusBaseValue, densityBaseValue, cn } from '@ojiepermana/angular-component/utils';
|
|
4
4
|
|
|
5
5
|
class TextareaComponent {
|
|
6
6
|
el = inject(ElementRef);
|
|
7
7
|
class = input('', /* @ts-ignore */
|
|
8
8
|
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
9
|
+
radius = input('inherit', /* @ts-ignore */
|
|
10
|
+
...(ngDevMode ? [{ debugName: "radius" }] : /* istanbul ignore next */ []));
|
|
11
|
+
density = input('inherit', /* @ts-ignore */
|
|
12
|
+
...(ngDevMode ? [{ debugName: "density" }] : /* istanbul ignore next */ []));
|
|
13
|
+
radiusBase = computed(() => radiusBaseValue(this.radius()), /* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [{ debugName: "radiusBase" }] : /* istanbul ignore next */ []));
|
|
15
|
+
densityBase = computed(() => densityBaseValue(this.density()), /* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [{ debugName: "densityBase" }] : /* istanbul ignore next */ []));
|
|
9
17
|
classes = computed(() => cn([
|
|
10
18
|
'flex min-h-[60px] w-full resize-y rounded-md border border-input bg-transparent px-3 py-2',
|
|
11
19
|
'text-sm shadow-sm transition-colors',
|
|
@@ -19,17 +27,21 @@ class TextareaComponent {
|
|
|
19
27
|
this.el.nativeElement.focus();
|
|
20
28
|
}
|
|
21
29
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.3", ngImport: i0, type: TextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
22
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.3", type: TextareaComponent, isStandalone: true, selector: "textarea[Textarea]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
30
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.3", type: TextareaComponent, isStandalone: true, selector: "textarea[Textarea]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "style.--radius-base": "radiusBase()", "style.--spacing-base": "densityBase()" } }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
23
31
|
}
|
|
24
32
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.3", ngImport: i0, type: TextareaComponent, decorators: [{
|
|
25
33
|
type: Component,
|
|
26
34
|
args: [{
|
|
27
35
|
selector: 'textarea[Textarea]',
|
|
28
36
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
29
|
-
host: {
|
|
37
|
+
host: {
|
|
38
|
+
'[class]': 'classes()',
|
|
39
|
+
'[style.--radius-base]': 'radiusBase()',
|
|
40
|
+
'[style.--spacing-base]': 'densityBase()',
|
|
41
|
+
},
|
|
30
42
|
template: '',
|
|
31
43
|
}]
|
|
32
|
-
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
44
|
+
}], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }] } });
|
|
33
45
|
|
|
34
46
|
/**
|
|
35
47
|
* Generated bundle index. Do not edit.
|
|
@@ -4,11 +4,11 @@ import { cn } from '@ojiepermana/angular-component/utils';
|
|
|
4
4
|
|
|
5
5
|
const TIMELINE_BASE = [
|
|
6
6
|
'w-full min-w-0 text-sm text-foreground',
|
|
7
|
-
'[--timeline-content-gap:
|
|
7
|
+
'[--timeline-content-gap:calc(var(--spacing)*3)] [--timeline-indicator-size:1.5rem] [--timeline-item-gap:calc(var(--spacing)*6)]',
|
|
8
8
|
].join(' ');
|
|
9
9
|
const timelineSizeClasses = {
|
|
10
10
|
default: '[--timeline-indicator-size:1.5rem]',
|
|
11
|
-
lg: '[--timeline-indicator-size:2.5rem] [--timeline-content-gap:
|
|
11
|
+
lg: '[--timeline-indicator-size:2.5rem] [--timeline-content-gap:calc(var(--spacing)*4)]',
|
|
12
12
|
};
|
|
13
13
|
const timelineAlignClasses = {
|
|
14
14
|
start: 'items-start',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, input, forwardRef, ChangeDetectionStrategy, Component, inject, TemplateRef, Directive, ViewContainerRef, ElementRef, DestroyRef, output, signal,
|
|
2
|
+
import { InjectionToken, input, forwardRef, ChangeDetectionStrategy, Component, inject, TemplateRef, computed, Directive, ViewContainerRef, ElementRef, DestroyRef, output, signal, effect } from '@angular/core';
|
|
3
|
+
import { radiusBaseValue, densityBaseValue, connectedPositionFor, oppositeSide, uniqueId, overlayDismissals } from '@ojiepermana/angular-component/utils';
|
|
3
4
|
import { Overlay } from '@angular/cdk/overlay';
|
|
4
5
|
import { TemplatePortal, ComponentPortal } from '@angular/cdk/portal';
|
|
5
6
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
-
import { connectedPositionFor, oppositeSide, uniqueId, overlayDismissals } from '@ojiepermana/angular-component/utils';
|
|
7
7
|
|
|
8
8
|
const TOOLTIP_DEFAULTS = new InjectionToken('TOOLTIP_DEFAULTS');
|
|
9
9
|
class TooltipComponent {
|
|
@@ -35,16 +35,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.3", ngImpor
|
|
|
35
35
|
|
|
36
36
|
class TooltipContentDirective {
|
|
37
37
|
template = inject(TemplateRef);
|
|
38
|
+
radius = input('inherit', /* @ts-ignore */
|
|
39
|
+
...(ngDevMode ? [{ debugName: "radius" }] : /* istanbul ignore next */ []));
|
|
40
|
+
density = input('inherit', /* @ts-ignore */
|
|
41
|
+
...(ngDevMode ? [{ debugName: "density" }] : /* istanbul ignore next */ []));
|
|
42
|
+
/**
|
|
43
|
+
* Resolved `--radius-base` / `--spacing-base` knob values (or `null` to
|
|
44
|
+
* inherit the global axis). Public so {@link TooltipTriggerDirective} can mirror
|
|
45
|
+
* them onto the CDK overlay panel — the element that actually paints the rounded
|
|
46
|
+
* background + padding — since this directive sits on an `<ng-template>` whose
|
|
47
|
+
* host bindings never reach the imperatively-created overlay subtree.
|
|
48
|
+
*/
|
|
49
|
+
radiusBase = computed(() => radiusBaseValue(this.radius()), /* @ts-ignore */
|
|
50
|
+
...(ngDevMode ? [{ debugName: "radiusBase" }] : /* istanbul ignore next */ []));
|
|
51
|
+
densityBase = computed(() => densityBaseValue(this.density()), /* @ts-ignore */
|
|
52
|
+
...(ngDevMode ? [{ debugName: "densityBase" }] : /* istanbul ignore next */ []));
|
|
38
53
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.3", ngImport: i0, type: TooltipContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
39
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
54
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.3", type: TooltipContentDirective, isStandalone: true, selector: "ng-template[TooltipContent]", inputs: { radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.--radius-base": "radiusBase()", "style.--spacing-base": "densityBase()" } }, exportAs: ["TooltipContent"], ngImport: i0 });
|
|
40
55
|
}
|
|
41
56
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.3", ngImport: i0, type: TooltipContentDirective, decorators: [{
|
|
42
57
|
type: Directive,
|
|
43
58
|
args: [{
|
|
44
59
|
selector: 'ng-template[TooltipContent]',
|
|
45
60
|
exportAs: 'TooltipContent',
|
|
61
|
+
host: {
|
|
62
|
+
'[style.--radius-base]': 'radiusBase()',
|
|
63
|
+
'[style.--spacing-base]': 'densityBase()',
|
|
64
|
+
},
|
|
46
65
|
}]
|
|
47
|
-
}] });
|
|
66
|
+
}], propDecorators: { radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }] } });
|
|
48
67
|
|
|
49
68
|
const TOOLTIP_PANEL_CLASSES = [
|
|
50
69
|
'tooltip-panel',
|
|
@@ -161,6 +180,11 @@ class TooltipTriggerDirective {
|
|
|
161
180
|
const tooltipId = uniqueId('Tooltip');
|
|
162
181
|
this.overlayRef.overlayElement.id = tooltipId;
|
|
163
182
|
this.overlayRef.overlayElement.setAttribute('role', 'tooltip');
|
|
183
|
+
// The painted surface is this overlay panel (rounded-md / px-3 / py-1.5), not
|
|
184
|
+
// the content directive's <ng-template>. Mirror the content directive's
|
|
185
|
+
// radius/density override onto it so the per-component knob actually rescales
|
|
186
|
+
// the tooltip; `null` removes the property and keeps following the global axis.
|
|
187
|
+
this.applySurfaceVars(this.overlayRef.overlayElement, this.TooltipTrigger());
|
|
164
188
|
const portal = new TemplatePortal(this.TooltipTrigger().template, this.vcr);
|
|
165
189
|
this.overlayRef.attach(portal);
|
|
166
190
|
this.bindOverlayLifecycle();
|
|
@@ -184,6 +208,22 @@ class TooltipTriggerDirective {
|
|
|
184
208
|
this.openedChange.emit(false);
|
|
185
209
|
}
|
|
186
210
|
}
|
|
211
|
+
applySurfaceVars(panel, content) {
|
|
212
|
+
const radiusBase = content.radiusBase();
|
|
213
|
+
const spacingBase = content.densityBase();
|
|
214
|
+
if (radiusBase === null) {
|
|
215
|
+
panel.style.removeProperty('--radius-base');
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
panel.style.setProperty('--radius-base', radiusBase);
|
|
219
|
+
}
|
|
220
|
+
if (spacingBase === null) {
|
|
221
|
+
panel.style.removeProperty('--spacing-base');
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
panel.style.setProperty('--spacing-base', spacingBase);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
187
227
|
bindOverlayLifecycle() {
|
|
188
228
|
if (!this.overlayRef) {
|
|
189
229
|
return;
|
|
@@ -63,6 +63,56 @@ function overlayDismissals(overlayRef, origin) {
|
|
|
63
63
|
return merge(overlayRef.outsidePointerEvents().pipe(filter((event) => !origin || !origin.contains(event.target))), overlayRef.keydownEvents().pipe(filter((event) => event.key === 'Escape')), overlayRef.detachments());
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Per-component corner-radius / spacing-density override helpers.
|
|
68
|
+
*
|
|
69
|
+
* These mirror the global `theme-radius` / `theme-space` preset values from
|
|
70
|
+
* `@ojiepermana/angular-theme` — kept as a local copy so this package stays
|
|
71
|
+
* decoupled from the theme package (see its empty peer/deps on -theme).
|
|
72
|
+
*
|
|
73
|
+
* A component that accepts a `radius` / `density` input binds the resolved value
|
|
74
|
+
* onto its surface element via `[style.--radius-base]` / `[style.--spacing-base]`.
|
|
75
|
+
* Tailwind's `rounded-*` utilities resolve `calc(var(--radius-base) * n)` and the
|
|
76
|
+
* spacing utilities resolve `calc(var(--spacing-base) * n)` (see the theme's
|
|
77
|
+
* `base/tailwind.css` `@theme inline` mapping), so the override rescales that
|
|
78
|
+
* subtree and shadows the global `<html theme-radius|theme-space>` axis. The
|
|
79
|
+
* `'inherit'` preset binds nothing, so the component keeps following the axis.
|
|
80
|
+
*/
|
|
81
|
+
/** Corner-radius presets for a per-component `radius` input. */
|
|
82
|
+
const COMPONENT_RADII = ['inherit', 'none', 'sm', 'md', 'lg', 'xl', 'full'];
|
|
83
|
+
/** Spacing-density presets for a per-component `density` input. */
|
|
84
|
+
const COMPONENT_DENSITIES = ['inherit', 'compact', 'normal', 'relaxed', 'spacious'];
|
|
85
|
+
/** `--radius-base` knob value per preset; mirrors theme `radius/index.css`. */
|
|
86
|
+
const RADIUS_BASE_VALUES = {
|
|
87
|
+
none: '0px',
|
|
88
|
+
sm: '0.375rem',
|
|
89
|
+
md: '0.625rem',
|
|
90
|
+
lg: '0.875rem',
|
|
91
|
+
xl: '1.25rem',
|
|
92
|
+
full: '9999px',
|
|
93
|
+
};
|
|
94
|
+
/** `--spacing-base` knob value per preset; mirrors theme `space/index.css`. */
|
|
95
|
+
const DENSITY_BASE_VALUES = {
|
|
96
|
+
compact: '0.2rem',
|
|
97
|
+
normal: '0.25rem',
|
|
98
|
+
relaxed: '0.28rem',
|
|
99
|
+
spacious: '0.32rem',
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Resolves a `radius` input to a `--radius-base` value, or `null` to inherit the
|
|
103
|
+
* global axis. Bind the result to the surface host: `[style.--radius-base]`.
|
|
104
|
+
*/
|
|
105
|
+
function radiusBaseValue(radius) {
|
|
106
|
+
return radius === 'inherit' ? null : RADIUS_BASE_VALUES[radius];
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Resolves a `density` input to a `--spacing-base` value, or `null` to inherit
|
|
110
|
+
* the global axis. Bind the result to the surface host: `[style.--spacing-base]`.
|
|
111
|
+
*/
|
|
112
|
+
function densityBaseValue(density) {
|
|
113
|
+
return density === 'inherit' ? null : DENSITY_BASE_VALUES[density];
|
|
114
|
+
}
|
|
115
|
+
|
|
66
116
|
let counter = 0;
|
|
67
117
|
/**
|
|
68
118
|
* Returns a document-unique id with the given prefix, e.g. `uniqueId('Checkbox')`
|
|
@@ -77,4 +127,4 @@ function uniqueId(prefix) {
|
|
|
77
127
|
* Generated bundle index. Do not edit.
|
|
78
128
|
*/
|
|
79
129
|
|
|
80
|
-
export { cn, connectedPositionFor, oppositeSide, overlayDismissals, uniqueId };
|
|
130
|
+
export { COMPONENT_DENSITIES, COMPONENT_RADII, cn, connectedPositionFor, densityBaseValue, oppositeSide, overlayDismissals, radiusBaseValue, uniqueId };
|
package/form/README.md
CHANGED
|
@@ -153,19 +153,19 @@ validation flows or static examples, use the `invalid` input on
|
|
|
153
153
|
|
|
154
154
|
## API Reference
|
|
155
155
|
|
|
156
|
-
| Primitive | Selector
|
|
157
|
-
| -------------------------- |
|
|
158
|
-
| `FormFieldComponent` | `FormField`
|
|
159
|
-
| `FormFieldsetComponent` | `fieldset[FormFieldset]`
|
|
160
|
-
| `FormLegendComponent` | `legend[FormLegend]`
|
|
161
|
-
| `FormGroupComponent` | `FormGroup`
|
|
162
|
-
| `FormContentComponent` | `FormContent`
|
|
163
|
-
| `FormLabelComponent` | `FormLabel, label[FormLabel]`
|
|
164
|
-
| `FormTitleComponent` | `FormTitle`
|
|
165
|
-
| `FormDescriptionComponent` | `FormDescription, p[FormDescription]`
|
|
166
|
-
| `FormSeparatorComponent` | `FormSeparator`
|
|
167
|
-
| `FormMessageComponent` | `FormMessage, p[FormMessage]`
|
|
168
|
-
| `FormControlDirective` | `[FormControl]`
|
|
156
|
+
| Primitive | Selector | Inputs | Notes |
|
|
157
|
+
| -------------------------- | -------------------------------------- | --------------------------------- | -------------------------------------------------------------------------------------- |
|
|
158
|
+
| `FormFieldComponent` | `FormField` | `class`, `orientation`, `invalid` | Core field wrapper. `orientation` supports `vertical`, `horizontal`, and `responsive`. |
|
|
159
|
+
| `FormFieldsetComponent` | `FormFieldset, fieldset[FormFieldset]` | `class` | Semantic fieldset reset with spacing presets. |
|
|
160
|
+
| `FormLegendComponent` | `FormLegend, legend[FormLegend]` | `class`, `variant` | Uses either standard legend sizing or label-sized copy. |
|
|
161
|
+
| `FormGroupComponent` | `FormGroup` | `class` | Stacks related fields and separators. |
|
|
162
|
+
| `FormContentComponent` | `FormContent` | `class` | Secondary text column for horizontal fields and card layouts. |
|
|
163
|
+
| `FormLabelComponent` | `FormLabel, label[FormLabel]` | `class` | Visible label tied to the generated control id inside a field. |
|
|
164
|
+
| `FormTitleComponent` | `FormTitle` | `class` | Non-label heading for grouped controls. |
|
|
165
|
+
| `FormDescriptionComponent` | `FormDescription, p[FormDescription]` | `class` | Helper text inside a field or at the fieldset level. |
|
|
166
|
+
| `FormSeparatorComponent` | `FormSeparator` | `class` | Divider between stacked sections. |
|
|
167
|
+
| `FormMessageComponent` | `FormMessage, p[FormMessage]` | `class` | Error text shown when the field is invalid. |
|
|
168
|
+
| `FormControlDirective` | `[FormControl]` | none | Auto-wires `id`, `aria-describedby`, and invalid state for native controls. |
|
|
169
169
|
|
|
170
170
|
## Styling and Theming
|
|
171
171
|
|
package/hover-card/README.md
CHANGED
|
@@ -104,7 +104,7 @@ The overlay remains open while either the trigger or the rendered content is hov
|
|
|
104
104
|
| `closeDelay` | `number` | Inherited from root |
|
|
105
105
|
| `disabled` | `boolean` | `false` |
|
|
106
106
|
|
|
107
|
-
Exposes `isOpen()` and `openedChange`. The host reflects `
|
|
107
|
+
Exposes `isOpen()` and `openedChange`. The host reflects `data-state` (`"open"` or `"closed"`).
|
|
108
108
|
|
|
109
109
|
### `HoverCardContentDirective`
|
|
110
110
|
|
package/package.json
CHANGED
package/radio/README.md
CHANGED
|
@@ -152,15 +152,15 @@ Forward helper and error relationships from the group when the descriptive copy
|
|
|
152
152
|
|
|
153
153
|
### `RadioGroupComponent`
|
|
154
154
|
|
|
155
|
-
| Input | Type
|
|
156
|
-
| ------------------ |
|
|
157
|
-
| `name` | `string`
|
|
158
|
-
| `orientation` | `'horizontal' \| 'vertical'`
|
|
159
|
-
| `aria-label` | `string \| null`
|
|
160
|
-
| `aria-labelledby` | `string \| null`
|
|
161
|
-
| `aria-describedby` | `string \| null`
|
|
162
|
-
| `aria-invalid` | `boolean \|
|
|
163
|
-
| `class` | `string`
|
|
155
|
+
| Input | Type | Default | Notes |
|
|
156
|
+
| ------------------ | -------------------------------------- | ------------ | ------------------------------------------------------------ |
|
|
157
|
+
| `name` | `string` | `''` | Shared native `name` so the browser groups the radios. |
|
|
158
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `'vertical'` | Switches between stacked rows and inline columns. |
|
|
159
|
+
| `aria-label` | `string \| null` | `null` | Use when the group needs an explicit accessible name. |
|
|
160
|
+
| `aria-labelledby` | `string \| null` | `null` | Alternative to `aria-label` for external group headings. |
|
|
161
|
+
| `aria-describedby` | `string \| null` | `null` | Connects helper or error text outside the group. |
|
|
162
|
+
| `aria-invalid` | `boolean \| 'true' \| 'false' \| null` | `null` | Marks the group invalid for validation-driven presentations. |
|
|
163
|
+
| `class` | `string` | `''` | Adds utility classes to the wrapped group host. |
|
|
164
164
|
|
|
165
165
|
| Output | Payload |
|
|
166
166
|
| ------------- | -------- |
|
|
@@ -178,7 +178,7 @@ Public method: `focus()`.
|
|
|
178
178
|
|
|
179
179
|
## Styling and Theming
|
|
180
180
|
|
|
181
|
-
The radio primitives
|
|
181
|
+
The radio primitives render native radio inputs (no Material dependency) and restyle them through the shared theme tokens.
|
|
182
182
|
|
|
183
183
|
- The selected dot uses the `primary` token.
|
|
184
184
|
- Unselected outlines use the `input` token rather than current text color.
|
|
@@ -195,7 +195,7 @@ The radio primitives wrap Angular Material's structural radio markup and restyle
|
|
|
195
195
|
## Keyboard Interactions
|
|
196
196
|
|
|
197
197
|
- `Tab` moves focus to the selected item or first enabled item in the group.
|
|
198
|
-
- Arrow keys move between options using
|
|
198
|
+
- Arrow keys move between options using native radio-group behavior.
|
|
199
199
|
- `Space` selects the focused option.
|
|
200
200
|
|
|
201
201
|
## Angular Notes
|
package/scroll-area/README.md
CHANGED
|
@@ -98,8 +98,10 @@ WebKit scrollbar pseudo-elements for Chromium/Safari.
|
|
|
98
98
|
|
|
99
99
|
Tokens consumed:
|
|
100
100
|
|
|
101
|
-
- `--
|
|
102
|
-
- `--
|
|
101
|
+
- `--scrollbar-thumb` for the default scrollbar thumb (overridable via `--tw-scrollbar-thumb`).
|
|
102
|
+
- `--scrollbar-track` for the scrollbar track (overridable via `--tw-scrollbar-track`).
|
|
103
|
+
- `--scrollbar-thumb-hover` for the hover thumb fallback.
|
|
104
|
+
- `--scrollbar-size` (default `0.5rem`) and `--scrollbar-radius` (default `9999px`) size the WebKit scrollbar.
|
|
103
105
|
- `--ring` for keyboard focus indication.
|
|
104
106
|
|
|
105
107
|
Pass `class` for host sizing and borders, and `viewportClass` when the viewport
|
package/sheet/README.md
CHANGED
|
@@ -129,17 +129,17 @@ Because the overlay surface renders through CDK Overlay, set `dir="rtl"` on proj
|
|
|
129
129
|
|
|
130
130
|
## API Reference
|
|
131
131
|
|
|
132
|
-
| Input | Type
|
|
133
|
-
| ---------------------- |
|
|
134
|
-
| `open` | `boolean` model
|
|
135
|
-
| `side` | `'top'
|
|
136
|
-
| `closeOnEscape` | `boolean`
|
|
137
|
-
| `closeOnBackdropClick` | `boolean`
|
|
138
|
-
| `showCloseButton` | `boolean`
|
|
139
|
-
| `closeButtonLabel` | `string`
|
|
140
|
-
| `aria-labelledby` | `string
|
|
141
|
-
| `aria-describedby` | `string
|
|
142
|
-
| `class` | `string`
|
|
132
|
+
| Input | Type | Default |
|
|
133
|
+
| ---------------------- | ---------------------------------------- | ---------------------------------------------- |
|
|
134
|
+
| `open` | `boolean` model | `false` |
|
|
135
|
+
| `side` | `'top' \| 'right' \| 'bottom' \| 'left'` | `'right'` for `Sheet`, `'bottom'` for `Drawer` |
|
|
136
|
+
| `closeOnEscape` | `boolean` | `true` |
|
|
137
|
+
| `closeOnBackdropClick` | `boolean` | `true` |
|
|
138
|
+
| `showCloseButton` | `boolean` | `true` |
|
|
139
|
+
| `closeButtonLabel` | `string` | `'Close'` |
|
|
140
|
+
| `aria-labelledby` | `string \| null` | `null` |
|
|
141
|
+
| `aria-describedby` | `string \| null` | `null` |
|
|
142
|
+
| `class` | `string` | `''` |
|
|
143
143
|
|
|
144
144
|
| Part | Purpose |
|
|
145
145
|
| -------------------- | -------------------------------------------------------------- |
|
package/slider/README.md
CHANGED
|
@@ -6,7 +6,7 @@ This entrypoint now exports two related Angular surfaces:
|
|
|
6
6
|
|
|
7
7
|
- `Slider` via `SliderRootComponent` for shadcn-style single-thumb, range,
|
|
8
8
|
multiple-thumb, vertical, disabled, and RTL examples.
|
|
9
|
-
- `input[Slider]` via `SliderInputDirective` for browser-native range inputs
|
|
9
|
+
- `input[type=range][Slider]` via `SliderInputDirective` for browser-native range inputs
|
|
10
10
|
when labels and forms should stay on the native path.
|
|
11
11
|
|
|
12
12
|
## Import
|
|
@@ -23,7 +23,7 @@ Use `Slider` when you want the richer shadcn-style component.
|
|
|
23
23
|
<Slider [value]="[75]" />
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
Keep `input[Slider]` when a plain native range input is still the best fit.
|
|
26
|
+
Keep `input[type=range][Slider]` when a plain native range input is still the best fit.
|
|
27
27
|
|
|
28
28
|
```html
|
|
29
29
|
<input type="range" Slider />
|
package/switch/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Switch
|
|
2
2
|
|
|
3
|
-
A shadcn-style switch primitive built on
|
|
3
|
+
A shadcn-style switch primitive built on a native `<input type="checkbox" role="switch">`, with `ControlValueAccessor` support for `ngModel` and reactive forms.
|
|
4
4
|
|
|
5
5
|
## Import
|
|
6
6
|
|
|
@@ -115,16 +115,16 @@ Use `size="sm"` for denser settings lists and compact preference panes.
|
|
|
115
115
|
|
|
116
116
|
| Input | Type | Default | Notes |
|
|
117
117
|
| ------------------ | --------------------------- | -------------- | ------------------------------------------------------------------------- |
|
|
118
|
-
| `id` | `string` | auto-generated |
|
|
119
|
-
| `name` | `string \| null` | `null` | Forwarded to the underlying
|
|
118
|
+
| `id` | `string` | auto-generated | Applied directly to the native checkbox input. |
|
|
119
|
+
| `name` | `string \| null` | `null` | Forwarded to the underlying checkbox input. |
|
|
120
120
|
| `disabled` | `boolean` | `false` | Merges with form-driven disabled state. |
|
|
121
|
-
| `required` | `boolean` | `false` | Forwarded to the underlying
|
|
121
|
+
| `required` | `boolean` | `false` | Forwarded to the underlying checkbox input. |
|
|
122
122
|
| `aria-label` | `string \| null` | `null` | Use for compact or text-free switch controls. |
|
|
123
123
|
| `aria-describedby` | `string \| null` | `null` | Links helper or error text outside the control. |
|
|
124
124
|
| `aria-labelledby` | `string \| null` | `null` | Best choice for descriptive rows and card layouts. |
|
|
125
125
|
| `aria-invalid` | `boolean \| string \| null` | `null` | Switches the control into the destructive invalid treatment. |
|
|
126
126
|
| `size` | `'default' \| 'sm'` | `'default'` | Smaller track for dense settings lists. |
|
|
127
|
-
| `class` | `string` | `''` | Adds utility classes to the
|
|
127
|
+
| `class` | `string` | `''` | Adds utility classes to the switch host element. |
|
|
128
128
|
|
|
129
129
|
| Output | Payload |
|
|
130
130
|
| --------------- | --------- |
|
|
@@ -134,21 +134,21 @@ Public method: `focus()`.
|
|
|
134
134
|
|
|
135
135
|
## Styling and theming
|
|
136
136
|
|
|
137
|
-
The component
|
|
137
|
+
The component renders a native checkbox with `role="switch"`, styled with the library theme tokens.
|
|
138
138
|
|
|
139
139
|
- Default track and handle colors use the shared `primary`, `input`, and `background` tokens.
|
|
140
140
|
- `aria-invalid="true"` switches the switch into the destructive token set.
|
|
141
141
|
- `size="sm"` tightens the track and handle sizing without creating a second entrypoint.
|
|
142
142
|
- Pass spacing or alignment utilities through `class` when the switch needs to line up with multi-line content.
|
|
143
143
|
|
|
144
|
-
Additional visual adjustments belong in
|
|
144
|
+
Additional visual adjustments belong in the component's inline utility classes inside the library.
|
|
145
145
|
|
|
146
146
|
## Accessibility
|
|
147
147
|
|
|
148
148
|
- Give the switch an accessible name through projected content, `aria-label`, or `aria-labelledby`.
|
|
149
149
|
- Use `aria-describedby` for helper or error text rendered outside the control.
|
|
150
|
-
- Prefer `aria-labelledby` over `label[for]` when the visible label is external
|
|
151
|
-
- `aria-invalid` is forwarded to the underlying
|
|
150
|
+
- Prefer `aria-labelledby` over `label[for]` when the visible label is external.
|
|
151
|
+
- `aria-invalid` is forwarded to the underlying checkbox input for validation styling and assistive technology cues.
|
|
152
152
|
|
|
153
153
|
## Keyboard interactions
|
|
154
154
|
|
|
@@ -158,7 +158,7 @@ Additional visual adjustments belong in `switch.component.css` inside the librar
|
|
|
158
158
|
## Angular notes
|
|
159
159
|
|
|
160
160
|
- `ngModel`, reactive forms, and `checkedChange` all work with the same primitive.
|
|
161
|
-
- Passing `id`
|
|
161
|
+
- Passing `id` applies a stable id directly to the native checkbox input.
|
|
162
162
|
- The direct `disabled` input and `setDisabledState()` from forms are merged, so either source can disable the control.
|
|
163
163
|
|
|
164
164
|
## Source parity
|