ng-blatui 1.1.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/fesm2022/ng-blatui.mjs +433 -2
- package/fesm2022/ng-blatui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ng-blatui.d.ts +130 -1
package/fesm2022/ng-blatui.mjs
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import { twMerge } from 'tailwind-merge';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { input, computed, Directive, Component, signal, model, inject, PLATFORM_ID, effect, Injectable } from '@angular/core';
|
|
4
|
+
import { input, computed, Directive, Component, signal, model, inject, PLATFORM_ID, effect, Injectable, ElementRef } from '@angular/core';
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
6
6
|
export { AccordionContent, AccordionGroup, AccordionPanel, AccordionTrigger, ɵɵDeferredContent, ɵɵDeferredContentAware } from '@angular/aria/accordion';
|
|
7
7
|
export { Tab, TabContent, TabList, TabPanel, Tabs } from '@angular/aria/tabs';
|
|
8
8
|
export { DIALOG_DATA, Dialog, DialogModule, DialogRef } from '@angular/cdk/dialog';
|
|
9
9
|
import { isPlatformBrowser } from '@angular/common';
|
|
10
|
+
import { _IdGenerator } from '@angular/cdk/a11y';
|
|
11
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
12
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
|
10
13
|
|
|
11
14
|
/**
|
|
12
15
|
* Merge class names with `clsx` semantics and resolve Tailwind conflicts with
|
|
@@ -1819,6 +1822,434 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
1819
1822
|
}]
|
|
1820
1823
|
}] });
|
|
1821
1824
|
|
|
1825
|
+
/**
|
|
1826
|
+
* BlatUI radio group. `role="radiogroup"` with arrow-key roving focus across the
|
|
1827
|
+
* `buiRadioItem` buttons; `[(value)]` two-way binds the selected value.
|
|
1828
|
+
*/
|
|
1829
|
+
class BuiRadioGroup {
|
|
1830
|
+
value = model(null, /* @ts-ignore */
|
|
1831
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1832
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
1833
|
+
host = inject(ElementRef);
|
|
1834
|
+
computedClass = computed(() => cn('grid gap-3', this.userClass()), /* @ts-ignore */
|
|
1835
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
1836
|
+
select(next) {
|
|
1837
|
+
this.value.set(next);
|
|
1838
|
+
}
|
|
1839
|
+
onKeydown(event) {
|
|
1840
|
+
if (!['ArrowDown', 'ArrowRight', 'ArrowUp', 'ArrowLeft'].includes(event.key)) {
|
|
1841
|
+
return;
|
|
1842
|
+
}
|
|
1843
|
+
event.preventDefault();
|
|
1844
|
+
const items = [
|
|
1845
|
+
...this.host.nativeElement.querySelectorAll('[role="radio"]:not([disabled])'),
|
|
1846
|
+
];
|
|
1847
|
+
if (items.length === 0) {
|
|
1848
|
+
return;
|
|
1849
|
+
}
|
|
1850
|
+
const current = items.indexOf(document.activeElement);
|
|
1851
|
+
const isForward = event.key === 'ArrowDown' || event.key === 'ArrowRight';
|
|
1852
|
+
const next = items[(current + (isForward ? 1 : -1) + items.length) % items.length];
|
|
1853
|
+
next.focus();
|
|
1854
|
+
next.click();
|
|
1855
|
+
}
|
|
1856
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiRadioGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1857
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiRadioGroup, isStandalone: true, selector: "[buiRadioGroup]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { attributes: { "role": "radiogroup", "data-slot": "radio-group" }, listeners: { "keydown": "onKeydown($event)" }, properties: { "class": "computedClass()" } }, exportAs: ["buiRadioGroup"], ngImport: i0 });
|
|
1858
|
+
}
|
|
1859
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiRadioGroup, decorators: [{
|
|
1860
|
+
type: Directive,
|
|
1861
|
+
args: [{
|
|
1862
|
+
selector: '[buiRadioGroup]',
|
|
1863
|
+
exportAs: 'buiRadioGroup',
|
|
1864
|
+
host: {
|
|
1865
|
+
role: 'radiogroup',
|
|
1866
|
+
'data-slot': 'radio-group',
|
|
1867
|
+
'[class]': 'computedClass()',
|
|
1868
|
+
'(keydown)': 'onKeydown($event)',
|
|
1869
|
+
},
|
|
1870
|
+
}]
|
|
1871
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
1872
|
+
const ITEM = 'border-input text-primary dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex aspect-square size-4 shrink-0 items-center justify-center rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50';
|
|
1873
|
+
class BuiRadioGroupItem {
|
|
1874
|
+
value = input.required(/* @ts-ignore */
|
|
1875
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1876
|
+
disabled = input(false, /* @ts-ignore */
|
|
1877
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1878
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
1879
|
+
group = inject(BuiRadioGroup);
|
|
1880
|
+
checked = computed(() => this.group.value() === this.value(), /* @ts-ignore */
|
|
1881
|
+
...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
1882
|
+
tabIndex = computed(() => this.checked() || this.group.value() === null ? 0 : -1, /* @ts-ignore */
|
|
1883
|
+
...(ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []));
|
|
1884
|
+
computedClass = computed(() => cn(ITEM, this.userClass()), /* @ts-ignore */
|
|
1885
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
1886
|
+
select() {
|
|
1887
|
+
if (!this.disabled()) {
|
|
1888
|
+
this.group.select(this.value());
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiRadioGroupItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1892
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiRadioGroupItem, isStandalone: true, selector: "button[buiRadioItem]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button", "role": "radio", "data-slot": "radio-group-item" }, listeners: { "click": "select()" }, properties: { "attr.aria-checked": "checked()", "attr.data-state": "checked() ? 'checked' : 'unchecked'", "attr.tabindex": "tabIndex()", "disabled": "disabled()", "class": "computedClass()" } }, ngImport: i0, template: `
|
|
1893
|
+
@if (checked()) {
|
|
1894
|
+
<span data-slot="radio-group-indicator" class="flex items-center justify-center">
|
|
1895
|
+
<svg viewBox="0 0 24 24" fill="currentColor" class="size-2" aria-hidden="true">
|
|
1896
|
+
<circle cx="12" cy="12" r="10" />
|
|
1897
|
+
</svg>
|
|
1898
|
+
</span>
|
|
1899
|
+
}
|
|
1900
|
+
`, isInline: true });
|
|
1901
|
+
}
|
|
1902
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiRadioGroupItem, decorators: [{
|
|
1903
|
+
type: Component,
|
|
1904
|
+
args: [{
|
|
1905
|
+
selector: 'button[buiRadioItem]',
|
|
1906
|
+
host: {
|
|
1907
|
+
type: 'button',
|
|
1908
|
+
role: 'radio',
|
|
1909
|
+
'data-slot': 'radio-group-item',
|
|
1910
|
+
'[attr.aria-checked]': 'checked()',
|
|
1911
|
+
'[attr.data-state]': "checked() ? 'checked' : 'unchecked'",
|
|
1912
|
+
'[attr.tabindex]': 'tabIndex()',
|
|
1913
|
+
'[disabled]': 'disabled()',
|
|
1914
|
+
'[class]': 'computedClass()',
|
|
1915
|
+
'(click)': 'select()',
|
|
1916
|
+
},
|
|
1917
|
+
template: `
|
|
1918
|
+
@if (checked()) {
|
|
1919
|
+
<span data-slot="radio-group-indicator" class="flex items-center justify-center">
|
|
1920
|
+
<svg viewBox="0 0 24 24" fill="currentColor" class="size-2" aria-hidden="true">
|
|
1921
|
+
<circle cx="12" cy="12" r="10" />
|
|
1922
|
+
</svg>
|
|
1923
|
+
</span>
|
|
1924
|
+
}
|
|
1925
|
+
`,
|
|
1926
|
+
}]
|
|
1927
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
1928
|
+
|
|
1929
|
+
/** Floating tooltip bubble rendered into a CDK overlay. */
|
|
1930
|
+
class BuiTooltipContent {
|
|
1931
|
+
text = input('', /* @ts-ignore */
|
|
1932
|
+
...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
1933
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiTooltipContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1934
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: BuiTooltipContent, isStandalone: true, selector: "bui-tooltip-content", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "tooltip" }, classAttribute: "bg-primary text-primary-foreground z-50 w-fit max-w-xs rounded-md px-3 py-1.5 text-xs shadow-md" }, ngImport: i0, template: `{{ text() }}`, isInline: true });
|
|
1935
|
+
}
|
|
1936
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiTooltipContent, decorators: [{
|
|
1937
|
+
type: Component,
|
|
1938
|
+
args: [{
|
|
1939
|
+
selector: 'bui-tooltip-content',
|
|
1940
|
+
host: {
|
|
1941
|
+
role: 'tooltip',
|
|
1942
|
+
class: 'bg-primary text-primary-foreground z-50 w-fit max-w-xs rounded-md px-3 py-1.5 text-xs shadow-md',
|
|
1943
|
+
},
|
|
1944
|
+
template: `{{ text() }}`,
|
|
1945
|
+
}]
|
|
1946
|
+
}], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }] } });
|
|
1947
|
+
/**
|
|
1948
|
+
* BlatUI tooltip. Shows an accessible `role="tooltip"` bubble on hover/focus via the
|
|
1949
|
+
* Angular CDK overlay and wires `aria-describedby` on the host. SSR-safe (the overlay
|
|
1950
|
+
* is only created in the browser, on interaction).
|
|
1951
|
+
*/
|
|
1952
|
+
class BuiTooltip {
|
|
1953
|
+
text = input.required({ ...(ngDevMode ? { debugName: "text" } : /* istanbul ignore next */ {}), alias: 'buiTooltip' });
|
|
1954
|
+
overlay = inject(Overlay);
|
|
1955
|
+
idGenerator = inject(_IdGenerator);
|
|
1956
|
+
host = inject(ElementRef);
|
|
1957
|
+
overlayRef = null;
|
|
1958
|
+
describedBy = signal(null, /* @ts-ignore */
|
|
1959
|
+
...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
|
|
1960
|
+
show() {
|
|
1961
|
+
if (this.overlayRef || !this.text()) {
|
|
1962
|
+
return;
|
|
1963
|
+
}
|
|
1964
|
+
const positionStrategy = this.overlay
|
|
1965
|
+
.position()
|
|
1966
|
+
.flexibleConnectedTo(this.host)
|
|
1967
|
+
.withPositions([
|
|
1968
|
+
{ originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', offsetY: -6 },
|
|
1969
|
+
{ originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top', offsetY: 6 },
|
|
1970
|
+
]);
|
|
1971
|
+
this.overlayRef = this.overlay.create({ positionStrategy });
|
|
1972
|
+
const reference = this.overlayRef.attach(new ComponentPortal(BuiTooltipContent));
|
|
1973
|
+
reference.setInput('text', this.text());
|
|
1974
|
+
const id = this.idGenerator.getId('bui-tooltip-');
|
|
1975
|
+
reference.location.nativeElement.id = id;
|
|
1976
|
+
this.describedBy.set(id);
|
|
1977
|
+
}
|
|
1978
|
+
hide() {
|
|
1979
|
+
this.overlayRef?.dispose();
|
|
1980
|
+
this.overlayRef = null;
|
|
1981
|
+
this.describedBy.set(null);
|
|
1982
|
+
}
|
|
1983
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiTooltip, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1984
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiTooltip, isStandalone: true, selector: "[buiTooltip]", inputs: { text: { classPropertyName: "text", publicName: "buiTooltip", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "mouseenter": "show()", "mouseleave": "hide()", "focusin": "show()", "focusout": "hide()" }, properties: { "attr.aria-describedby": "describedBy()" } }, ngImport: i0 });
|
|
1985
|
+
}
|
|
1986
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiTooltip, decorators: [{
|
|
1987
|
+
type: Directive,
|
|
1988
|
+
args: [{
|
|
1989
|
+
selector: '[buiTooltip]',
|
|
1990
|
+
host: {
|
|
1991
|
+
'[attr.aria-describedby]': 'describedBy()',
|
|
1992
|
+
'(mouseenter)': 'show()',
|
|
1993
|
+
'(mouseleave)': 'hide()',
|
|
1994
|
+
'(focusin)': 'show()',
|
|
1995
|
+
'(focusout)': 'hide()',
|
|
1996
|
+
},
|
|
1997
|
+
}]
|
|
1998
|
+
}], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "buiTooltip", required: true }] }] } });
|
|
1999
|
+
|
|
2000
|
+
/** Breadcrumb navigation landmark (`<nav aria-label="breadcrumb">`). */
|
|
2001
|
+
class BuiBreadcrumb {
|
|
2002
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiBreadcrumb, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2003
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: BuiBreadcrumb, isStandalone: true, selector: "nav[buiBreadcrumb]", host: { attributes: { "aria-label": "breadcrumb", "data-slot": "breadcrumb" } }, ngImport: i0 });
|
|
2004
|
+
}
|
|
2005
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiBreadcrumb, decorators: [{
|
|
2006
|
+
type: Directive,
|
|
2007
|
+
args: [{
|
|
2008
|
+
selector: 'nav[buiBreadcrumb]',
|
|
2009
|
+
host: { 'aria-label': 'breadcrumb', 'data-slot': 'breadcrumb' },
|
|
2010
|
+
}]
|
|
2011
|
+
}] });
|
|
2012
|
+
class BuiBreadcrumbList {
|
|
2013
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2014
|
+
computedClass = computed(() => cn('flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5', this.userClass()), /* @ts-ignore */
|
|
2015
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
2016
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiBreadcrumbList, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2017
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiBreadcrumbList, isStandalone: true, selector: "ol[buiBreadcrumbList]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "breadcrumb-list" }, properties: { "class": "computedClass()" } }, ngImport: i0 });
|
|
2018
|
+
}
|
|
2019
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiBreadcrumbList, decorators: [{
|
|
2020
|
+
type: Directive,
|
|
2021
|
+
args: [{
|
|
2022
|
+
selector: 'ol[buiBreadcrumbList]',
|
|
2023
|
+
host: { 'data-slot': 'breadcrumb-list', '[class]': 'computedClass()' },
|
|
2024
|
+
}]
|
|
2025
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
2026
|
+
class BuiBreadcrumbItem {
|
|
2027
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2028
|
+
computedClass = computed(() => cn('inline-flex items-center gap-1.5', this.userClass()), /* @ts-ignore */
|
|
2029
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
2030
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiBreadcrumbItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2031
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiBreadcrumbItem, isStandalone: true, selector: "li[buiBreadcrumbItem]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "breadcrumb-item" }, properties: { "class": "computedClass()" } }, ngImport: i0 });
|
|
2032
|
+
}
|
|
2033
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiBreadcrumbItem, decorators: [{
|
|
2034
|
+
type: Directive,
|
|
2035
|
+
args: [{
|
|
2036
|
+
selector: 'li[buiBreadcrumbItem]',
|
|
2037
|
+
host: { 'data-slot': 'breadcrumb-item', '[class]': 'computedClass()' },
|
|
2038
|
+
}]
|
|
2039
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
2040
|
+
class BuiBreadcrumbLink {
|
|
2041
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2042
|
+
computedClass = computed(() => cn('transition-colors hover:text-foreground', this.userClass()), /* @ts-ignore */
|
|
2043
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
2044
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiBreadcrumbLink, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2045
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiBreadcrumbLink, isStandalone: true, selector: "a[buiBreadcrumbLink]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "breadcrumb-link" }, properties: { "class": "computedClass()" } }, ngImport: i0 });
|
|
2046
|
+
}
|
|
2047
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiBreadcrumbLink, decorators: [{
|
|
2048
|
+
type: Directive,
|
|
2049
|
+
args: [{
|
|
2050
|
+
selector: 'a[buiBreadcrumbLink]',
|
|
2051
|
+
host: { 'data-slot': 'breadcrumb-link', '[class]': 'computedClass()' },
|
|
2052
|
+
}]
|
|
2053
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
2054
|
+
/** The current page in a breadcrumb — non-interactive, `aria-current="page"`. */
|
|
2055
|
+
class BuiBreadcrumbPage {
|
|
2056
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2057
|
+
computedClass = computed(() => cn('font-normal text-foreground', this.userClass()), /* @ts-ignore */
|
|
2058
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
2059
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiBreadcrumbPage, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2060
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiBreadcrumbPage, isStandalone: true, selector: "[buiBreadcrumbPage]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "breadcrumb-page", "role": "link", "aria-disabled": "true", "aria-current": "page" }, properties: { "class": "computedClass()" } }, ngImport: i0 });
|
|
2061
|
+
}
|
|
2062
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiBreadcrumbPage, decorators: [{
|
|
2063
|
+
type: Directive,
|
|
2064
|
+
args: [{
|
|
2065
|
+
selector: '[buiBreadcrumbPage]',
|
|
2066
|
+
host: {
|
|
2067
|
+
'data-slot': 'breadcrumb-page',
|
|
2068
|
+
role: 'link',
|
|
2069
|
+
'aria-disabled': 'true',
|
|
2070
|
+
'aria-current': 'page',
|
|
2071
|
+
'[class]': 'computedClass()',
|
|
2072
|
+
},
|
|
2073
|
+
}]
|
|
2074
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
2075
|
+
/** Separator between breadcrumb items (defaults to a chevron). */
|
|
2076
|
+
class BuiBreadcrumbSeparator {
|
|
2077
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2078
|
+
computedClass = computed(() => cn('[&>svg]:size-3.5', this.userClass()), /* @ts-ignore */
|
|
2079
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
2080
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiBreadcrumbSeparator, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2081
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: BuiBreadcrumbSeparator, isStandalone: true, selector: "li[buiBreadcrumbSeparator]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "breadcrumb-separator", "role": "presentation", "aria-hidden": "true" }, properties: { "class": "computedClass()" } }, ngImport: i0, template: `
|
|
2082
|
+
<ng-content>
|
|
2083
|
+
<svg
|
|
2084
|
+
viewBox="0 0 24 24"
|
|
2085
|
+
fill="none"
|
|
2086
|
+
stroke="currentColor"
|
|
2087
|
+
stroke-width="2"
|
|
2088
|
+
stroke-linecap="round"
|
|
2089
|
+
stroke-linejoin="round"
|
|
2090
|
+
class="size-3.5"
|
|
2091
|
+
>
|
|
2092
|
+
<path d="m9 18 6-6-6-6" />
|
|
2093
|
+
</svg>
|
|
2094
|
+
</ng-content>
|
|
2095
|
+
`, isInline: true });
|
|
2096
|
+
}
|
|
2097
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiBreadcrumbSeparator, decorators: [{
|
|
2098
|
+
type: Component,
|
|
2099
|
+
args: [{
|
|
2100
|
+
selector: 'li[buiBreadcrumbSeparator]',
|
|
2101
|
+
host: {
|
|
2102
|
+
'data-slot': 'breadcrumb-separator',
|
|
2103
|
+
role: 'presentation',
|
|
2104
|
+
'aria-hidden': 'true',
|
|
2105
|
+
'[class]': 'computedClass()',
|
|
2106
|
+
},
|
|
2107
|
+
template: `
|
|
2108
|
+
<ng-content>
|
|
2109
|
+
<svg
|
|
2110
|
+
viewBox="0 0 24 24"
|
|
2111
|
+
fill="none"
|
|
2112
|
+
stroke="currentColor"
|
|
2113
|
+
stroke-width="2"
|
|
2114
|
+
stroke-linecap="round"
|
|
2115
|
+
stroke-linejoin="round"
|
|
2116
|
+
class="size-3.5"
|
|
2117
|
+
>
|
|
2118
|
+
<path d="m9 18 6-6-6-6" />
|
|
2119
|
+
</svg>
|
|
2120
|
+
</ng-content>
|
|
2121
|
+
`,
|
|
2122
|
+
}]
|
|
2123
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
2124
|
+
/** Collapsed breadcrumb indicator (ellipsis). */
|
|
2125
|
+
class BuiBreadcrumbEllipsis {
|
|
2126
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2127
|
+
computedClass = computed(() => cn('flex size-9 items-center justify-center', this.userClass()), /* @ts-ignore */
|
|
2128
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
2129
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiBreadcrumbEllipsis, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2130
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: BuiBreadcrumbEllipsis, isStandalone: true, selector: "li[buiBreadcrumbEllipsis]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "breadcrumb-ellipsis", "role": "presentation", "aria-hidden": "true" }, properties: { "class": "computedClass()" } }, ngImport: i0, template: `
|
|
2131
|
+
<svg
|
|
2132
|
+
viewBox="0 0 24 24"
|
|
2133
|
+
fill="none"
|
|
2134
|
+
stroke="currentColor"
|
|
2135
|
+
stroke-width="2"
|
|
2136
|
+
stroke-linecap="round"
|
|
2137
|
+
stroke-linejoin="round"
|
|
2138
|
+
class="size-4"
|
|
2139
|
+
>
|
|
2140
|
+
<circle cx="12" cy="12" r="1" />
|
|
2141
|
+
<circle cx="19" cy="12" r="1" />
|
|
2142
|
+
<circle cx="5" cy="12" r="1" />
|
|
2143
|
+
</svg>
|
|
2144
|
+
<span class="sr-only">More</span>
|
|
2145
|
+
`, isInline: true });
|
|
2146
|
+
}
|
|
2147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiBreadcrumbEllipsis, decorators: [{
|
|
2148
|
+
type: Component,
|
|
2149
|
+
args: [{
|
|
2150
|
+
selector: 'li[buiBreadcrumbEllipsis]',
|
|
2151
|
+
host: {
|
|
2152
|
+
'data-slot': 'breadcrumb-ellipsis',
|
|
2153
|
+
role: 'presentation',
|
|
2154
|
+
'aria-hidden': 'true',
|
|
2155
|
+
'[class]': 'computedClass()',
|
|
2156
|
+
},
|
|
2157
|
+
template: `
|
|
2158
|
+
<svg
|
|
2159
|
+
viewBox="0 0 24 24"
|
|
2160
|
+
fill="none"
|
|
2161
|
+
stroke="currentColor"
|
|
2162
|
+
stroke-width="2"
|
|
2163
|
+
stroke-linecap="round"
|
|
2164
|
+
stroke-linejoin="round"
|
|
2165
|
+
class="size-4"
|
|
2166
|
+
>
|
|
2167
|
+
<circle cx="12" cy="12" r="1" />
|
|
2168
|
+
<circle cx="19" cy="12" r="1" />
|
|
2169
|
+
<circle cx="5" cy="12" r="1" />
|
|
2170
|
+
</svg>
|
|
2171
|
+
<span class="sr-only">More</span>
|
|
2172
|
+
`,
|
|
2173
|
+
}]
|
|
2174
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
2175
|
+
|
|
2176
|
+
/** Keyboard key styling, applied to a native `<kbd>` element. */
|
|
2177
|
+
class BuiKbd {
|
|
2178
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2179
|
+
computedClass = computed(() => cn('pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none', this.userClass()), /* @ts-ignore */
|
|
2180
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
2181
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiKbd, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2182
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiKbd, isStandalone: true, selector: "kbd[buiKbd]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "kbd" }, properties: { "class": "computedClass()" } }, ngImport: i0 });
|
|
2183
|
+
}
|
|
2184
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiKbd, decorators: [{
|
|
2185
|
+
type: Directive,
|
|
2186
|
+
args: [{
|
|
2187
|
+
selector: 'kbd[buiKbd]',
|
|
2188
|
+
host: { 'data-slot': 'kbd', '[class]': 'computedClass()' },
|
|
2189
|
+
}]
|
|
2190
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
2191
|
+
|
|
2192
|
+
/** Constrains projected content to a given aspect ratio (e.g. `16 / 9`). */
|
|
2193
|
+
class BuiAspectRatio {
|
|
2194
|
+
ratio = input('1 / 1', /* @ts-ignore */
|
|
2195
|
+
...(ngDevMode ? [{ debugName: "ratio" }] : /* istanbul ignore next */ []));
|
|
2196
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2197
|
+
computedClass = computed(() => cn('relative block', this.userClass()), /* @ts-ignore */
|
|
2198
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
2199
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAspectRatio, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2200
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: BuiAspectRatio, isStandalone: true, selector: "bui-aspect-ratio", inputs: { ratio: { classPropertyName: "ratio", publicName: "ratio", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "aspect-ratio" }, properties: { "style.aspect-ratio": "ratio()", "class": "computedClass()" } }, ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
2201
|
+
}
|
|
2202
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAspectRatio, decorators: [{
|
|
2203
|
+
type: Component,
|
|
2204
|
+
args: [{
|
|
2205
|
+
selector: 'bui-aspect-ratio',
|
|
2206
|
+
host: {
|
|
2207
|
+
'data-slot': 'aspect-ratio',
|
|
2208
|
+
'[style.aspect-ratio]': 'ratio()',
|
|
2209
|
+
'[class]': 'computedClass()',
|
|
2210
|
+
},
|
|
2211
|
+
template: `<ng-content />`,
|
|
2212
|
+
}]
|
|
2213
|
+
}], propDecorators: { ratio: [{ type: i0.Input, args: [{ isSignal: true, alias: "ratio", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
2214
|
+
|
|
2215
|
+
/** Groups buttons (and inputs) into a single segmented control. */
|
|
2216
|
+
class BuiButtonGroup {
|
|
2217
|
+
orientation = input('horizontal', /* @ts-ignore */
|
|
2218
|
+
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
2219
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2220
|
+
computedClass = computed(() => cn('flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 data-[orientation=vertical]:flex-col [&>*]:focus-within:z-10 [&>*]:focus-visible:z-10 data-[orientation=horizontal]:[&>*:not(:first-child)]:rounded-l-none data-[orientation=horizontal]:[&>*:not(:first-child)]:border-l-0 data-[orientation=vertical]:[&>*:not(:first-child)]:rounded-t-none data-[orientation=vertical]:[&>*:not(:first-child)]:border-t-0 data-[orientation=horizontal]:[&>*:not(:last-child)]:rounded-r-none data-[orientation=vertical]:[&>*:not(:last-child)]:rounded-b-none', this.userClass()), /* @ts-ignore */
|
|
2221
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
2222
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiButtonGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2223
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiButtonGroup, isStandalone: true, selector: "[buiButtonGroup]", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group", "data-slot": "button-group" }, properties: { "attr.data-orientation": "orientation()", "class": "computedClass()" } }, ngImport: i0 });
|
|
2224
|
+
}
|
|
2225
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiButtonGroup, decorators: [{
|
|
2226
|
+
type: Directive,
|
|
2227
|
+
args: [{
|
|
2228
|
+
selector: '[buiButtonGroup]',
|
|
2229
|
+
host: {
|
|
2230
|
+
role: 'group',
|
|
2231
|
+
'data-slot': 'button-group',
|
|
2232
|
+
'[attr.data-orientation]': 'orientation()',
|
|
2233
|
+
'[class]': 'computedClass()',
|
|
2234
|
+
},
|
|
2235
|
+
}]
|
|
2236
|
+
}], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
2237
|
+
/** A non-button text segment inside a button group. */
|
|
2238
|
+
class BuiButtonGroupText {
|
|
2239
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2240
|
+
computedClass = computed(() => cn('flex items-center gap-2 rounded-md border bg-muted px-4 text-sm font-medium shadow-xs', this.userClass()), /* @ts-ignore */
|
|
2241
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
2242
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiButtonGroupText, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2243
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiButtonGroupText, isStandalone: true, selector: "[buiButtonGroupText]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "button-group-text" }, properties: { "class": "computedClass()" } }, ngImport: i0 });
|
|
2244
|
+
}
|
|
2245
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiButtonGroupText, decorators: [{
|
|
2246
|
+
type: Directive,
|
|
2247
|
+
args: [{
|
|
2248
|
+
selector: '[buiButtonGroupText]',
|
|
2249
|
+
host: { 'data-slot': 'button-group-text', '[class]': 'computedClass()' },
|
|
2250
|
+
}]
|
|
2251
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
2252
|
+
|
|
1822
2253
|
/*
|
|
1823
2254
|
* Public API Surface of ng-blatui
|
|
1824
2255
|
*/
|
|
@@ -1827,5 +2258,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
1827
2258
|
* Generated bundle index. Do not edit.
|
|
1828
2259
|
*/
|
|
1829
2260
|
|
|
1830
|
-
export { BuiAccordion, BuiAccordionContent, BuiAccordionItem, BuiAccordionTrigger, BuiAlert, BuiAlertDescription, BuiAlertTitle, BuiAvatar, BuiBadge, BuiButton, BuiCard, BuiCardAction, BuiCardContent, BuiCardDescription, BuiCardFooter, BuiCardHeader, BuiCardTitle, BuiCheckbox, BuiDialogContent, BuiDialogDescription, BuiDialogFooter, BuiDialogHeader, BuiDialogTitle, BuiInput, BuiLabel, BuiProgress, BuiSeparator, BuiSkeleton, BuiSwitch, BuiTabList, BuiTabPanel, BuiTabTrigger, BuiTabs, BuiTextarea, BuiThemeCustomizer, THEME_TOKENS, ThemeStore, buttonVariants, cn };
|
|
2261
|
+
export { BuiAccordion, BuiAccordionContent, BuiAccordionItem, BuiAccordionTrigger, BuiAlert, BuiAlertDescription, BuiAlertTitle, BuiAspectRatio, BuiAvatar, BuiBadge, BuiBreadcrumb, BuiBreadcrumbEllipsis, BuiBreadcrumbItem, BuiBreadcrumbLink, BuiBreadcrumbList, BuiBreadcrumbPage, BuiBreadcrumbSeparator, BuiButton, BuiButtonGroup, BuiButtonGroupText, BuiCard, BuiCardAction, BuiCardContent, BuiCardDescription, BuiCardFooter, BuiCardHeader, BuiCardTitle, BuiCheckbox, BuiDialogContent, BuiDialogDescription, BuiDialogFooter, BuiDialogHeader, BuiDialogTitle, BuiInput, BuiKbd, BuiLabel, BuiProgress, BuiRadioGroup, BuiRadioGroupItem, BuiSeparator, BuiSkeleton, BuiSwitch, BuiTabList, BuiTabPanel, BuiTabTrigger, BuiTabs, BuiTextarea, BuiThemeCustomizer, BuiTooltip, BuiTooltipContent, THEME_TOKENS, ThemeStore, buttonVariants, cn };
|
|
1831
2262
|
//# sourceMappingURL=ng-blatui.mjs.map
|