@surfnet/curve-angular 0.2.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/.postcssrc.json +7 -0
- package/.storybook/main.ts +9 -0
- package/.storybook/manager.ts +3 -0
- package/.storybook/preview.ts +28 -0
- package/.storybook/tsconfig.json +8 -0
- package/.turbo/turbo-build.log +32 -0
- package/CHANGELOG.md +29 -0
- package/angular.json +52 -0
- package/components.json +5 -0
- package/dist/fesm2022/surfnet-curve-angular.mjs +4237 -0
- package/dist/fesm2022/surfnet-curve-angular.mjs.map +1 -0
- package/dist/files/geist-cyrillic-ext-wght-italic.woff2 +0 -0
- package/dist/files/geist-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/files/geist-cyrillic-wght-italic.woff2 +0 -0
- package/dist/files/geist-cyrillic-wght-normal.woff2 +0 -0
- package/dist/files/geist-latin-ext-wght-italic.woff2 +0 -0
- package/dist/files/geist-latin-ext-wght-normal.woff2 +0 -0
- package/dist/files/geist-latin-wght-italic.woff2 +0 -0
- package/dist/files/geist-latin-wght-normal.woff2 +0 -0
- package/dist/files/geist-vietnamese-wght-italic.woff2 +0 -0
- package/dist/files/geist-vietnamese-wght-normal.woff2 +0 -0
- package/dist/styles.css +2 -0
- package/dist/types/surfnet-curve-angular.d.ts +1017 -0
- package/ng-package.json +20 -0
- package/package.json +73 -0
- package/scripts/copy-font-files.ts +15 -0
- package/scripts/rewrite-helm-imports.ts +60 -0
- package/src/foundations/design-tokens.stories.ts +198 -0
- package/src/lib/ui/avatar/src/index.ts +22 -0
- package/src/lib/ui/avatar/src/lib/hlm-avatar-badge.ts +19 -0
- package/src/lib/ui/avatar/src/lib/hlm-avatar-fallback.ts +20 -0
- package/src/lib/ui/avatar/src/lib/hlm-avatar-group-count.ts +17 -0
- package/src/lib/ui/avatar/src/lib/hlm-avatar-group.ts +17 -0
- package/src/lib/ui/avatar/src/lib/hlm-avatar-image.ts +19 -0
- package/src/lib/ui/avatar/src/lib/hlm-avatar.stories.ts +107 -0
- package/src/lib/ui/avatar/src/lib/hlm-avatar.ts +32 -0
- package/src/lib/ui/breadcrumb/src/index.ts +30 -0
- package/src/lib/ui/breadcrumb/src/lib/hlm-breadcrumb-ellipsis.ts +36 -0
- package/src/lib/ui/breadcrumb/src/lib/hlm-breadcrumb-item.ts +14 -0
- package/src/lib/ui/breadcrumb/src/lib/hlm-breadcrumb-link.ts +36 -0
- package/src/lib/ui/breadcrumb/src/lib/hlm-breadcrumb-list.ts +17 -0
- package/src/lib/ui/breadcrumb/src/lib/hlm-breadcrumb-page.ts +17 -0
- package/src/lib/ui/breadcrumb/src/lib/hlm-breadcrumb-separator.ts +27 -0
- package/src/lib/ui/breadcrumb/src/lib/hlm-breadcrumb.stories.ts +81 -0
- package/src/lib/ui/breadcrumb/src/lib/hlm-breadcrumb.ts +13 -0
- package/src/lib/ui/button/src/index.ts +6 -0
- package/src/lib/ui/button/src/lib/hlm-button.stories.ts +170 -0
- package/src/lib/ui/button/src/lib/hlm-button.token.ts +22 -0
- package/src/lib/ui/button/src/lib/hlm-button.ts +76 -0
- package/src/lib/ui/card/src/index.ts +25 -0
- package/src/lib/ui/card/src/lib/hlm-card-action.ts +12 -0
- package/src/lib/ui/card/src/lib/hlm-card-content.ts +12 -0
- package/src/lib/ui/card/src/lib/hlm-card-description.ts +12 -0
- package/src/lib/ui/card/src/lib/hlm-card-footer.ts +14 -0
- package/src/lib/ui/card/src/lib/hlm-card-header.ts +15 -0
- package/src/lib/ui/card/src/lib/hlm-card-title.ts +12 -0
- package/src/lib/ui/card/src/lib/hlm-card.stories.ts +105 -0
- package/src/lib/ui/card/src/lib/hlm-card.token.ts +19 -0
- package/src/lib/ui/card/src/lib/hlm-card.ts +22 -0
- package/src/lib/ui/checkbox/src/index.ts +5 -0
- package/src/lib/ui/checkbox/src/lib/hlm-checkbox.stories.ts +78 -0
- package/src/lib/ui/checkbox/src/lib/hlm-checkbox.ts +160 -0
- package/src/lib/ui/data-table/src/index.ts +14 -0
- package/src/lib/ui/data-table/src/lib/hlm-data-table-content.ts +87 -0
- package/src/lib/ui/data-table/src/lib/hlm-data-table-pagination.ts +62 -0
- package/src/lib/ui/data-table/src/lib/hlm-data-table-toolbar.ts +16 -0
- package/src/lib/ui/data-table/src/lib/hlm-data-table.stories.ts +479 -0
- package/src/lib/ui/data-table/src/lib/inject-data-table.ts +86 -0
- package/src/lib/ui/dropdown-menu/src/index.ts +45 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-checkbox-indicator.ts +20 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-checkbox.ts +36 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-group.ts +16 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-item-sub-indicator.ts +17 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-item.ts +41 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-label.ts +20 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-radio-indicator.ts +20 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-radio.ts +36 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-separator.ts +14 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-shortcut.ts +14 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-sub.ts +58 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-token.ts +26 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu-trigger.ts +49 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu.stories.ts +125 -0
- package/src/lib/ui/dropdown-menu/src/lib/hlm-dropdown-menu.ts +62 -0
- package/src/lib/ui/field/src/index.ts +34 -0
- package/src/lib/ui/field/src/lib/hlm-field-content.ts +12 -0
- package/src/lib/ui/field/src/lib/hlm-field-description.ts +53 -0
- package/src/lib/ui/field/src/lib/hlm-field-error.ts +100 -0
- package/src/lib/ui/field/src/lib/hlm-field-group.ts +15 -0
- package/src/lib/ui/field/src/lib/hlm-field-label.ts +17 -0
- package/src/lib/ui/field/src/lib/hlm-field-legend.ts +17 -0
- package/src/lib/ui/field/src/lib/hlm-field-separator.ts +24 -0
- package/src/lib/ui/field/src/lib/hlm-field-set.ts +15 -0
- package/src/lib/ui/field/src/lib/hlm-field-title.ts +15 -0
- package/src/lib/ui/field/src/lib/hlm-field.stories.ts +117 -0
- package/src/lib/ui/field/src/lib/hlm-field.ts +49 -0
- package/src/lib/ui/icon/src/index.ts +7 -0
- package/src/lib/ui/icon/src/lib/hlm-icon.token.ts +20 -0
- package/src/lib/ui/icon/src/lib/hlm-icon.ts +42 -0
- package/src/lib/ui/input/src/index.ts +5 -0
- package/src/lib/ui/input/src/lib/hlm-input.stories.ts +94 -0
- package/src/lib/ui/input/src/lib/hlm-input.ts +20 -0
- package/src/lib/ui/input-group/src/index.ts +22 -0
- package/src/lib/ui/input-group/src/lib/hlm-input-group-addon.ts +40 -0
- package/src/lib/ui/input-group/src/lib/hlm-input-group-button.ts +47 -0
- package/src/lib/ui/input-group/src/lib/hlm-input-group-input.ts +17 -0
- package/src/lib/ui/input-group/src/lib/hlm-input-group-text.ts +14 -0
- package/src/lib/ui/input-group/src/lib/hlm-input-group-textarea.ts +17 -0
- package/src/lib/ui/input-group/src/lib/hlm-input-group.stories.ts +133 -0
- package/src/lib/ui/input-group/src/lib/hlm-input-group.ts +18 -0
- package/src/lib/ui/label/src/index.ts +5 -0
- package/src/lib/ui/label/src/lib/hlm-label.stories.ts +55 -0
- package/src/lib/ui/label/src/lib/hlm-label.ts +17 -0
- package/src/lib/ui/select/src/index.ts +52 -0
- package/src/lib/ui/select/src/lib/hlm-select-content.ts +44 -0
- package/src/lib/ui/select/src/lib/hlm-select-group.ts +14 -0
- package/src/lib/ui/select/src/lib/hlm-select-item.ts +36 -0
- package/src/lib/ui/select/src/lib/hlm-select-label.ts +14 -0
- package/src/lib/ui/select/src/lib/hlm-select-multiple.ts +45 -0
- package/src/lib/ui/select/src/lib/hlm-select-placeholder.ts +17 -0
- package/src/lib/ui/select/src/lib/hlm-select-portal.ts +8 -0
- package/src/lib/ui/select/src/lib/hlm-select-scroll-down.ts +22 -0
- package/src/lib/ui/select/src/lib/hlm-select-scroll-up.ts +22 -0
- package/src/lib/ui/select/src/lib/hlm-select-separator.ts +14 -0
- package/src/lib/ui/select/src/lib/hlm-select-trigger.ts +59 -0
- package/src/lib/ui/select/src/lib/hlm-select-value-template.ts +5 -0
- package/src/lib/ui/select/src/lib/hlm-select-value.ts +18 -0
- package/src/lib/ui/select/src/lib/hlm-select-values-content.ts +9 -0
- package/src/lib/ui/select/src/lib/hlm-select-values.ts +5 -0
- package/src/lib/ui/select/src/lib/hlm-select.stories.ts +105 -0
- package/src/lib/ui/select/src/lib/hlm-select.ts +45 -0
- package/src/lib/ui/separator/src/index.ts +5 -0
- package/src/lib/ui/separator/src/lib/hlm-separator.stories.ts +88 -0
- package/src/lib/ui/separator/src/lib/hlm-separator.ts +19 -0
- package/src/lib/ui/sheet/src/index.ts +34 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet-close.ts +9 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet-content.ts +66 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet-description.ts +14 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet-footer.ts +12 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet-header.ts +12 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet-overlay.ts +27 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet-portal.ts +8 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet-title.ts +14 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet-trigger.ts +9 -0
- package/src/lib/ui/sheet/src/lib/hlm-sheet.ts +29 -0
- package/src/lib/ui/sidebar/src/index.ts +75 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-content.ts +18 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-footer.ts +15 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-group-action.ts +18 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-group-content.ts +15 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-group-label.ts +18 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-group.ts +15 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-header.ts +15 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-input.ts +17 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-inset.ts +15 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-menu-action.ts +24 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-menu-badge.ts +18 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-menu-button.ts +97 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-menu-item.ts +15 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-menu-skeleton.ts +33 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-menu-sub-button.ts +41 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-menu-sub-item.ts +15 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-menu-sub.ts +18 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-menu.ts +15 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-rail.ts +34 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-separator.ts +17 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-trigger.ts +35 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar-wrapper.ts +24 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar.service.ts +136 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar.stories.ts +177 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar.token.ts +33 -0
- package/src/lib/ui/sidebar/src/lib/hlm-sidebar.ts +139 -0
- package/src/lib/ui/skeleton/src/index.ts +5 -0
- package/src/lib/ui/skeleton/src/lib/hlm-skeleton.ts +14 -0
- package/src/lib/ui/table/src/index.ts +25 -0
- package/src/lib/ui/table/src/lib/hlm-table.stories.ts +70 -0
- package/src/lib/ui/table/src/lib/hlm-table.ts +129 -0
- package/src/lib/ui/textarea/src/index.ts +5 -0
- package/src/lib/ui/textarea/src/lib/hlm-textarea.stories.ts +72 -0
- package/src/lib/ui/textarea/src/lib/hlm-textarea.ts +21 -0
- package/src/lib/ui/tooltip/src/index.ts +5 -0
- package/src/lib/ui/tooltip/src/lib/hlm-tooltip.ts +44 -0
- package/src/lib/ui/utils/src/index.ts +1 -0
- package/src/lib/ui/utils/src/lib/hlm.ts +313 -0
- package/src/public-api.ts +24 -0
- package/src/styles.css +43 -0
- package/tsconfig.json +45 -0
- package/tsconfig.lib.json +11 -0
- package/tsconfig.lib.prod.json +9 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { BooleanInput } from '@angular/cdk/coercion';
|
|
2
|
+
import {
|
|
3
|
+
booleanAttribute,
|
|
4
|
+
ChangeDetectionStrategy,
|
|
5
|
+
Component,
|
|
6
|
+
computed,
|
|
7
|
+
input,
|
|
8
|
+
} from '@angular/core';
|
|
9
|
+
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
10
|
+
import { phosphorCaretUpDown } from '@ng-icons/phosphor-icons/regular';
|
|
11
|
+
import { BrnFieldControlDescribedBy } from '@spartan-ng/brain/field';
|
|
12
|
+
import { BrnSelectTrigger } from '@spartan-ng/brain/select';
|
|
13
|
+
import { hlm } from '../../../utils/src';
|
|
14
|
+
import type { SelectTriggerSizeName } from '@surfnet/curve-contracts';
|
|
15
|
+
import type { ClassValue } from 'clsx';
|
|
16
|
+
|
|
17
|
+
@Component({
|
|
18
|
+
selector: 'hlm-select-trigger',
|
|
19
|
+
imports: [NgIcon, BrnSelectTrigger, BrnFieldControlDescribedBy],
|
|
20
|
+
providers: [provideIcons({ phosphorCaretUpDown })],
|
|
21
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
22
|
+
template: `
|
|
23
|
+
<button
|
|
24
|
+
brnSelectTrigger
|
|
25
|
+
brnFieldControlDescribedBy
|
|
26
|
+
[forceInvalid]="forceInvalid()"
|
|
27
|
+
[id]="buttonId()"
|
|
28
|
+
[class]="_computedClass()"
|
|
29
|
+
[attr.data-size]="size()"
|
|
30
|
+
data-slot="select-trigger"
|
|
31
|
+
>
|
|
32
|
+
<ng-content />
|
|
33
|
+
<ng-icon
|
|
34
|
+
name="phosphorCaretUpDown"
|
|
35
|
+
class="text-muted-foreground text-[calc(var(--spacing)*4)] ms-auto"
|
|
36
|
+
/>
|
|
37
|
+
</button>
|
|
38
|
+
`,
|
|
39
|
+
})
|
|
40
|
+
export class HlmSelectTrigger {
|
|
41
|
+
private static _id = 0;
|
|
42
|
+
|
|
43
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
44
|
+
protected readonly _computedClass = computed(() =>
|
|
45
|
+
hlm(
|
|
46
|
+
'border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 data-[matches-spartan-invalid=true]:ring-destructive/20 dark:data-[matches-spartan-invalid=true]:ring-destructive/40 data-[matches-spartan-invalid=true]:border-destructive dark:data-[matches-spartan-invalid=true]:border-destructive/50 gap-1.5 rounded-md border bg-transparent py-2 ps-2.5 pe-2 text-sm shadow-xs transition-[color,box-shadow] focus-visible:ring-3 data-[matches-spartan-invalid=true]:ring-3 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:gap-1.5 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_ng-icon]:pointer-events-none [&_ng-icon]:shrink-0',
|
|
47
|
+
this.userClass(),
|
|
48
|
+
),
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
public readonly buttonId = input<string>(`hlm-select-trigger-${HlmSelectTrigger._id++}`);
|
|
52
|
+
|
|
53
|
+
public readonly size = input<SelectTriggerSizeName>('default');
|
|
54
|
+
|
|
55
|
+
/** Whether to force the trigger into an invalid state. */
|
|
56
|
+
public readonly forceInvalid = input<boolean, BooleanInput>(false, {
|
|
57
|
+
transform: booleanAttribute,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Directive, inject } from '@angular/core';
|
|
2
|
+
import { BrnSelectValue } from '@spartan-ng/brain/select';
|
|
3
|
+
import { classes } from '../../../utils/src';
|
|
4
|
+
|
|
5
|
+
@Directive({
|
|
6
|
+
selector: '[hlmSelectValue],hlm-select-value',
|
|
7
|
+
hostDirectives: [{ directive: BrnSelectValue, inputs: ['placeholder'] }],
|
|
8
|
+
host: { '[attr.data-slot]': '!_hidden() ? "select-value" : null' },
|
|
9
|
+
})
|
|
10
|
+
export class HlmSelectValue {
|
|
11
|
+
private readonly _brnSelectValue = inject(BrnSelectValue);
|
|
12
|
+
|
|
13
|
+
protected readonly _hidden = this._brnSelectValue.hidden;
|
|
14
|
+
|
|
15
|
+
constructor() {
|
|
16
|
+
classes(() => 'data-hidden:hidden');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { classes } from '../../../utils/src';
|
|
3
|
+
|
|
4
|
+
@Directive({ selector: '[hlmSelectValuesContent],hlm-select-values-content' })
|
|
5
|
+
export class HlmSelectValuesContent {
|
|
6
|
+
constructor() {
|
|
7
|
+
classes(() => 'gap-2 flex');
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { moduleMetadata, type Meta, type StoryObj } from '@storybook/angular';
|
|
2
|
+
import { selectContract } from '@surfnet/curve-contracts';
|
|
3
|
+
import { HlmSelect } from './hlm-select';
|
|
4
|
+
import { HlmSelectImports } from '..';
|
|
5
|
+
|
|
6
|
+
const meta: Meta<HlmSelect> = {
|
|
7
|
+
title: 'Components/Select',
|
|
8
|
+
component: HlmSelect,
|
|
9
|
+
decorators: [
|
|
10
|
+
moduleMetadata({
|
|
11
|
+
imports: [HlmSelectImports],
|
|
12
|
+
}),
|
|
13
|
+
],
|
|
14
|
+
parameters: {
|
|
15
|
+
docs: {
|
|
16
|
+
description: {
|
|
17
|
+
component: selectContract.docs.description,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
type Story = StoryObj<HlmSelect>;
|
|
25
|
+
|
|
26
|
+
/** A select with a placeholder until a value is chosen. */
|
|
27
|
+
export const Default: Story = {
|
|
28
|
+
render: () => ({
|
|
29
|
+
template: `
|
|
30
|
+
<hlm-select>
|
|
31
|
+
<hlm-select-trigger class="w-56">
|
|
32
|
+
<hlm-select-value placeholder="Category: All" />
|
|
33
|
+
</hlm-select-trigger>
|
|
34
|
+
<hlm-select-content *hlmSelectPortal>
|
|
35
|
+
<hlm-select-item value="all">All</hlm-select-item>
|
|
36
|
+
<hlm-select-item value="identity">Identity</hlm-select-item>
|
|
37
|
+
<hlm-select-item value="storage">Storage</hlm-select-item>
|
|
38
|
+
<hlm-select-item value="marketplace">Marketplace</hlm-select-item>
|
|
39
|
+
</hlm-select-content>
|
|
40
|
+
</hlm-select>
|
|
41
|
+
`,
|
|
42
|
+
}),
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** A pre-selected value with grouped, labelled options. */
|
|
46
|
+
export const Grouped: Story = {
|
|
47
|
+
render: () => ({
|
|
48
|
+
template: `
|
|
49
|
+
<hlm-select value="identity">
|
|
50
|
+
<hlm-select-trigger class="w-56">
|
|
51
|
+
<hlm-select-value placeholder="Pick a category" />
|
|
52
|
+
</hlm-select-trigger>
|
|
53
|
+
<hlm-select-content *hlmSelectPortal>
|
|
54
|
+
<hlm-select-group>
|
|
55
|
+
<hlm-select-label>Categories</hlm-select-label>
|
|
56
|
+
<hlm-select-item value="identity">Identity</hlm-select-item>
|
|
57
|
+
<hlm-select-item value="storage">Storage</hlm-select-item>
|
|
58
|
+
<hlm-select-item value="marketplace">Marketplace</hlm-select-item>
|
|
59
|
+
</hlm-select-group>
|
|
60
|
+
</hlm-select-content>
|
|
61
|
+
</hlm-select>
|
|
62
|
+
`,
|
|
63
|
+
}),
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** Disabled trigger. */
|
|
67
|
+
export const Disabled: Story = {
|
|
68
|
+
render: () => ({
|
|
69
|
+
template: `
|
|
70
|
+
<hlm-select disabled>
|
|
71
|
+
<hlm-select-trigger class="w-56">
|
|
72
|
+
<hlm-select-value placeholder="Category: All" />
|
|
73
|
+
</hlm-select-trigger>
|
|
74
|
+
<hlm-select-content *hlmSelectPortal>
|
|
75
|
+
<hlm-select-item value="all">All</hlm-select-item>
|
|
76
|
+
</hlm-select-content>
|
|
77
|
+
</hlm-select>
|
|
78
|
+
`,
|
|
79
|
+
}),
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/** Every trigger size declared in the contract. */
|
|
83
|
+
export const Sizes: Story = {
|
|
84
|
+
render: () => ({
|
|
85
|
+
template: `
|
|
86
|
+
<div class="flex items-center gap-3">
|
|
87
|
+
${selectContract.props.sizes
|
|
88
|
+
.map(
|
|
89
|
+
(size) => `
|
|
90
|
+
<hlm-select key="${size}" value="all">
|
|
91
|
+
<hlm-select-trigger class="w-40" size="${size}">
|
|
92
|
+
<hlm-select-value />
|
|
93
|
+
</hlm-select-trigger>
|
|
94
|
+
<hlm-select-content *hlmSelectPortal>
|
|
95
|
+
<hlm-select-item value="all" selected>All</hlm-select-item>
|
|
96
|
+
<hlm-select-item value="identity">Identity</hlm-select-item>
|
|
97
|
+
</hlm-select-content>
|
|
98
|
+
</hlm-select>
|
|
99
|
+
`,
|
|
100
|
+
)
|
|
101
|
+
.join('')}
|
|
102
|
+
</div>
|
|
103
|
+
`,
|
|
104
|
+
}),
|
|
105
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { provideBrnDialogDefaultOptions } from '@spartan-ng/brain/dialog';
|
|
3
|
+
import { BrnPopover, provideBrnPopoverConfig } from '@spartan-ng/brain/popover';
|
|
4
|
+
import { BrnSelect } from '@spartan-ng/brain/select';
|
|
5
|
+
import { classes } from '../../../utils/src';
|
|
6
|
+
|
|
7
|
+
@Directive({
|
|
8
|
+
selector: '[hlmSelect],hlm-select',
|
|
9
|
+
providers: [
|
|
10
|
+
provideBrnPopoverConfig({
|
|
11
|
+
align: 'start',
|
|
12
|
+
sideOffset: 6,
|
|
13
|
+
}),
|
|
14
|
+
provideBrnDialogDefaultOptions({
|
|
15
|
+
autoFocus: 'first-heading',
|
|
16
|
+
}),
|
|
17
|
+
],
|
|
18
|
+
hostDirectives: [
|
|
19
|
+
{
|
|
20
|
+
directive: BrnSelect,
|
|
21
|
+
inputs: ['disabled', 'value', 'isItemEqualToValue', 'itemToString'],
|
|
22
|
+
outputs: ['valueChange'],
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
directive: BrnPopover,
|
|
26
|
+
inputs: [
|
|
27
|
+
'align',
|
|
28
|
+
'autoFocus',
|
|
29
|
+
'closeDelay',
|
|
30
|
+
'closeOnOutsidePointerEvents',
|
|
31
|
+
'sideOffset',
|
|
32
|
+
'state',
|
|
33
|
+
'offsetX',
|
|
34
|
+
'restoreFocus',
|
|
35
|
+
],
|
|
36
|
+
outputs: ['stateChanged', 'closed'],
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
host: { 'data-slot': 'select' },
|
|
40
|
+
})
|
|
41
|
+
export class HlmSelect {
|
|
42
|
+
constructor() {
|
|
43
|
+
classes(() => 'block');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { type Meta, type StoryObj, argsToTemplate, moduleMetadata } from '@storybook/angular';
|
|
2
|
+
import { separatorContract } from '@surfnet/curve-contracts';
|
|
3
|
+
import { HlmSeparator, HlmSeparatorImports } from '..';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<HlmSeparator> = {
|
|
6
|
+
title: 'Components/Separator',
|
|
7
|
+
component: HlmSeparator,
|
|
8
|
+
decorators: [
|
|
9
|
+
moduleMetadata({
|
|
10
|
+
imports: [HlmSeparatorImports],
|
|
11
|
+
}),
|
|
12
|
+
],
|
|
13
|
+
parameters: {
|
|
14
|
+
docs: {
|
|
15
|
+
description: {
|
|
16
|
+
component: separatorContract.docs.description,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
argTypes: {
|
|
21
|
+
orientation: {
|
|
22
|
+
control: 'inline-radio',
|
|
23
|
+
options: separatorContract.props.orientations,
|
|
24
|
+
description: separatorContract.props.orientations
|
|
25
|
+
.map(
|
|
26
|
+
(orientation) =>
|
|
27
|
+
`\`${orientation}\` — ${separatorContract.docs.orientations[orientation]}`,
|
|
28
|
+
)
|
|
29
|
+
.join('\n\n'),
|
|
30
|
+
table: {
|
|
31
|
+
defaultValue: { summary: separatorContract.defaults.orientations },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
args: {
|
|
36
|
+
orientation: separatorContract.defaults.orientations,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default meta;
|
|
41
|
+
type Story = StoryObj<HlmSeparator>;
|
|
42
|
+
|
|
43
|
+
/** Interactive playground — flip `orientation` in the controls to see both directions. */
|
|
44
|
+
export const Default: Story = {
|
|
45
|
+
render: ({ ...args }) => ({
|
|
46
|
+
props: args,
|
|
47
|
+
template: `
|
|
48
|
+
<div class="
|
|
49
|
+
{{orientation === 'vertical'
|
|
50
|
+
? 'flex h-5 items-center gap-3 text-sm'
|
|
51
|
+
: 'flex w-72 flex-col gap-3 text-sm'
|
|
52
|
+
}}"
|
|
53
|
+
>
|
|
54
|
+
<span>One</span>
|
|
55
|
+
<hlm-separator ${argsToTemplate(args)} />
|
|
56
|
+
<span>Two</span>
|
|
57
|
+
</div>
|
|
58
|
+
`,
|
|
59
|
+
}),
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** A horizontal divider between stacked blocks of text. */
|
|
63
|
+
export const Horizontal: Story = {
|
|
64
|
+
render: () => ({
|
|
65
|
+
template: `
|
|
66
|
+
<div class="w-72">
|
|
67
|
+
<p class="text-sm">Curve</p>
|
|
68
|
+
<hlm-separator orientation="horizontal" class="my-3" />
|
|
69
|
+
<p class="text-sm text-muted-foreground">Components for React and Angular.</p>
|
|
70
|
+
</div>
|
|
71
|
+
`,
|
|
72
|
+
}),
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/** A vertical divider between inline items. */
|
|
76
|
+
export const Vertical: Story = {
|
|
77
|
+
render: () => ({
|
|
78
|
+
template: `
|
|
79
|
+
<div class="flex h-5 items-center gap-3 text-sm">
|
|
80
|
+
<span>Docs</span>
|
|
81
|
+
<hlm-separator orientation="vertical" />
|
|
82
|
+
<span>Source</span>
|
|
83
|
+
<hlm-separator orientation="vertical" />
|
|
84
|
+
<span>Storybook</span>
|
|
85
|
+
</div>
|
|
86
|
+
`,
|
|
87
|
+
}),
|
|
88
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { BrnSeparator } from '@spartan-ng/brain/separator';
|
|
3
|
+
import { classes } from '../../../utils/src';
|
|
4
|
+
|
|
5
|
+
export const hlmSeparatorClass =
|
|
6
|
+
'inline-flex shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch';
|
|
7
|
+
|
|
8
|
+
@Directive({
|
|
9
|
+
selector: '[hlmSeparator],hlm-separator',
|
|
10
|
+
hostDirectives: [{ directive: BrnSeparator, inputs: ['orientation', 'decorative'] }],
|
|
11
|
+
host: {
|
|
12
|
+
'data-slot': 'separator',
|
|
13
|
+
},
|
|
14
|
+
})
|
|
15
|
+
export class HlmSeparator {
|
|
16
|
+
constructor() {
|
|
17
|
+
classes(() => hlmSeparatorClass);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { HlmSheet } from './lib/hlm-sheet';
|
|
2
|
+
import { HlmSheetClose } from './lib/hlm-sheet-close';
|
|
3
|
+
import { HlmSheetContent } from './lib/hlm-sheet-content';
|
|
4
|
+
import { HlmSheetDescription } from './lib/hlm-sheet-description';
|
|
5
|
+
import { HlmSheetFooter } from './lib/hlm-sheet-footer';
|
|
6
|
+
import { HlmSheetHeader } from './lib/hlm-sheet-header';
|
|
7
|
+
import { HlmSheetOverlay } from './lib/hlm-sheet-overlay';
|
|
8
|
+
import { HlmSheetPortal } from './lib/hlm-sheet-portal';
|
|
9
|
+
import { HlmSheetTitle } from './lib/hlm-sheet-title';
|
|
10
|
+
import { HlmSheetTrigger } from './lib/hlm-sheet-trigger';
|
|
11
|
+
|
|
12
|
+
export * from './lib/hlm-sheet';
|
|
13
|
+
export * from './lib/hlm-sheet-close';
|
|
14
|
+
export * from './lib/hlm-sheet-content';
|
|
15
|
+
export * from './lib/hlm-sheet-description';
|
|
16
|
+
export * from './lib/hlm-sheet-footer';
|
|
17
|
+
export * from './lib/hlm-sheet-header';
|
|
18
|
+
export * from './lib/hlm-sheet-overlay';
|
|
19
|
+
export * from './lib/hlm-sheet-portal';
|
|
20
|
+
export * from './lib/hlm-sheet-title';
|
|
21
|
+
export * from './lib/hlm-sheet-trigger';
|
|
22
|
+
|
|
23
|
+
export const HlmSheetImports = [
|
|
24
|
+
HlmSheet,
|
|
25
|
+
HlmSheetClose,
|
|
26
|
+
HlmSheetContent,
|
|
27
|
+
HlmSheetDescription,
|
|
28
|
+
HlmSheetFooter,
|
|
29
|
+
HlmSheetHeader,
|
|
30
|
+
HlmSheetOverlay,
|
|
31
|
+
HlmSheetPortal,
|
|
32
|
+
HlmSheetTitle,
|
|
33
|
+
HlmSheetTrigger,
|
|
34
|
+
] as const;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { BrnSheetClose } from '@spartan-ng/brain/sheet';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: 'button[hlmSheetClose]',
|
|
6
|
+
hostDirectives: [{ directive: BrnSheetClose, inputs: ['delay'] }],
|
|
7
|
+
host: { 'data-slot': 'sheet-close' },
|
|
8
|
+
})
|
|
9
|
+
export class HlmSheetClose {}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { BooleanInput } from '@angular/cdk/coercion';
|
|
2
|
+
import {
|
|
3
|
+
booleanAttribute,
|
|
4
|
+
ChangeDetectionStrategy,
|
|
5
|
+
Component,
|
|
6
|
+
effect,
|
|
7
|
+
ElementRef,
|
|
8
|
+
inject,
|
|
9
|
+
input,
|
|
10
|
+
Renderer2,
|
|
11
|
+
signal,
|
|
12
|
+
} from '@angular/core';
|
|
13
|
+
import { provideIcons } from '@ng-icons/core';
|
|
14
|
+
import { phosphorX } from '@ng-icons/phosphor-icons/regular';
|
|
15
|
+
import { injectExposedSideProvider, injectExposesStateProvider } from '@spartan-ng/brain/core';
|
|
16
|
+
import { HlmButton } from '../../../button/src';
|
|
17
|
+
import { HlmIconImports } from '../../../icon/src';
|
|
18
|
+
import { classes } from '../../../utils/src';
|
|
19
|
+
import { HlmSheetClose } from './hlm-sheet-close';
|
|
20
|
+
|
|
21
|
+
@Component({
|
|
22
|
+
selector: 'hlm-sheet-content',
|
|
23
|
+
imports: [HlmIconImports, HlmButton, HlmSheetClose],
|
|
24
|
+
providers: [provideIcons({ phosphorX })],
|
|
25
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
26
|
+
host: {
|
|
27
|
+
'data-slot': 'sheet-content',
|
|
28
|
+
'[attr.data-side]': '_sideProvider.side()',
|
|
29
|
+
'[attr.data-state]': 'state()',
|
|
30
|
+
},
|
|
31
|
+
template: `
|
|
32
|
+
<ng-content />
|
|
33
|
+
|
|
34
|
+
@if (showCloseButton()) {
|
|
35
|
+
<button hlmBtn variant="ghost" size="icon-sm" class="absolute end-4 top-4" hlmSheetClose>
|
|
36
|
+
<span class="sr-only">Close</span>
|
|
37
|
+
<ng-icon hlm size="sm" name="phosphorX" />
|
|
38
|
+
</button>
|
|
39
|
+
}
|
|
40
|
+
`,
|
|
41
|
+
})
|
|
42
|
+
export class HlmSheetContent {
|
|
43
|
+
private readonly _stateProvider = injectExposesStateProvider({ host: true });
|
|
44
|
+
protected readonly _sideProvider = injectExposedSideProvider({ host: true });
|
|
45
|
+
public readonly state = this._stateProvider.state ?? signal('closed');
|
|
46
|
+
private readonly _renderer = inject(Renderer2);
|
|
47
|
+
private readonly _element = inject(ElementRef);
|
|
48
|
+
|
|
49
|
+
public readonly showCloseButton = input<boolean, BooleanInput>(true, {
|
|
50
|
+
transform: booleanAttribute,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
constructor() {
|
|
54
|
+
classes(() => [
|
|
55
|
+
'bg-popover text-popover-foreground fixed flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm',
|
|
56
|
+
'data-open:animate-in data-closed:animate-out',
|
|
57
|
+
'data-[side=top]:data-closed:slide-out-to-top data-[side=top]:data-open:slide-in-from-top',
|
|
58
|
+
'data-[side=bottom]:data-closed:slide-out-to-bottom data-[side=bottom]:data-open:slide-in-from-bottom',
|
|
59
|
+
'data-[side=left]:data-closed:slide-out-to-left data-[side=left]:data-open:slide-in-from-left',
|
|
60
|
+
'data-[side=right]:data-closed:slide-out-to-right data-[side=right]:data-open:slide-in-from-right',
|
|
61
|
+
]);
|
|
62
|
+
effect(() => {
|
|
63
|
+
this._renderer.setAttribute(this._element.nativeElement, 'data-state', this.state());
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { BrnSheetDescription } from '@spartan-ng/brain/sheet';
|
|
3
|
+
import { classes } from '../../../utils/src';
|
|
4
|
+
|
|
5
|
+
@Directive({
|
|
6
|
+
selector: '[hlmSheetDescription]',
|
|
7
|
+
hostDirectives: [BrnSheetDescription],
|
|
8
|
+
host: { 'data-slot': 'sheet-description' },
|
|
9
|
+
})
|
|
10
|
+
export class HlmSheetDescription {
|
|
11
|
+
constructor() {
|
|
12
|
+
classes(() => 'text-muted-foreground text-sm');
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { classes } from '../../../utils/src';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[hlmSheetFooter],hlm-sheet-footer',
|
|
6
|
+
host: { 'data-slot': 'sheet-footer' },
|
|
7
|
+
})
|
|
8
|
+
export class HlmSheetFooter {
|
|
9
|
+
constructor() {
|
|
10
|
+
classes(() => 'gap-2 p-4 mt-auto flex flex-col');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { classes } from '../../../utils/src';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[hlmSheetHeader],hlm-sheet-header',
|
|
6
|
+
host: { 'data-slot': 'sheet-header' },
|
|
7
|
+
})
|
|
8
|
+
export class HlmSheetHeader {
|
|
9
|
+
constructor() {
|
|
10
|
+
classes(() => 'gap-1.5 p-4 flex flex-col');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Directive, computed, effect, input, untracked } from '@angular/core';
|
|
2
|
+
import { injectCustomClassSettable } from '@spartan-ng/brain/core';
|
|
3
|
+
import { BrnSheetOverlay } from '@spartan-ng/brain/sheet';
|
|
4
|
+
import { hlm } from '../../../utils/src';
|
|
5
|
+
import type { ClassValue } from 'clsx';
|
|
6
|
+
|
|
7
|
+
@Directive({
|
|
8
|
+
selector: '[hlmSheetOverlay],hlm-sheet-overlay',
|
|
9
|
+
hostDirectives: [BrnSheetOverlay],
|
|
10
|
+
})
|
|
11
|
+
export class HlmSheetOverlay {
|
|
12
|
+
private readonly _classSettable = injectCustomClassSettable({ optional: true, host: true });
|
|
13
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
14
|
+
protected readonly _computedClass = computed(() =>
|
|
15
|
+
hlm(
|
|
16
|
+
'bg-black/10 supports-backdrop-filter:backdrop-blur-xs transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0',
|
|
17
|
+
this.userClass(),
|
|
18
|
+
),
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
constructor() {
|
|
22
|
+
effect(() => {
|
|
23
|
+
const classValue = this._computedClass();
|
|
24
|
+
untracked(() => this._classSettable?.setClassToCustomElement(classValue));
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { BrnSheetContent } from '@spartan-ng/brain/sheet';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[hlmSheetPortal]',
|
|
6
|
+
hostDirectives: [{ directive: BrnSheetContent, inputs: ['context', 'class'] }],
|
|
7
|
+
})
|
|
8
|
+
export class HlmSheetPortal {}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { BrnSheetTitle } from '@spartan-ng/brain/sheet';
|
|
3
|
+
import { classes } from '../../../utils/src';
|
|
4
|
+
|
|
5
|
+
@Directive({
|
|
6
|
+
selector: '[hlmSheetTitle]',
|
|
7
|
+
hostDirectives: [BrnSheetTitle],
|
|
8
|
+
host: { 'data-slot': 'sheet-title' },
|
|
9
|
+
})
|
|
10
|
+
export class HlmSheetTitle {
|
|
11
|
+
constructor() {
|
|
12
|
+
classes(() => 'text-foreground font-medium');
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { BrnSheetTrigger } from '@spartan-ng/brain/sheet';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: 'button[hlmSheetTrigger]',
|
|
6
|
+
hostDirectives: [{ directive: BrnSheetTrigger, inputs: ['id', 'side', 'type'] }],
|
|
7
|
+
host: { 'data-slot': 'sheet-trigger' },
|
|
8
|
+
})
|
|
9
|
+
export class HlmSheetTrigger {}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, forwardRef } from '@angular/core';
|
|
2
|
+
import { BrnDialog, provideBrnDialogDefaultOptions } from '@spartan-ng/brain/dialog';
|
|
3
|
+
import { BrnSheet } from '@spartan-ng/brain/sheet';
|
|
4
|
+
import { HlmSheetOverlay } from './hlm-sheet-overlay';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'hlm-sheet',
|
|
8
|
+
exportAs: 'hlmSheet',
|
|
9
|
+
imports: [HlmSheetOverlay],
|
|
10
|
+
providers: [
|
|
11
|
+
{
|
|
12
|
+
provide: BrnDialog,
|
|
13
|
+
useExisting: forwardRef(() => BrnSheet),
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
provide: BrnSheet,
|
|
17
|
+
useExisting: forwardRef(() => HlmSheet),
|
|
18
|
+
},
|
|
19
|
+
provideBrnDialogDefaultOptions({
|
|
20
|
+
// add custom options here
|
|
21
|
+
}),
|
|
22
|
+
],
|
|
23
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
24
|
+
template: `
|
|
25
|
+
<hlm-sheet-overlay />
|
|
26
|
+
<ng-content />
|
|
27
|
+
`,
|
|
28
|
+
})
|
|
29
|
+
export class HlmSheet extends BrnSheet {}
|