@spartan-ng/cli 1.2.0-beta.2 → 1.2.0-beta.3

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.
Files changed (50) hide show
  1. package/package.json +1 -1
  2. package/src/generators/ui/libs/attachment/files/index.ts.template +31 -0
  3. package/src/generators/ui/libs/attachment/files/lib/hlm-attachment-action.ts.template +15 -0
  4. package/src/generators/ui/libs/attachment/files/lib/hlm-attachment-actions.ts.template +15 -0
  5. package/src/generators/ui/libs/attachment/files/lib/hlm-attachment-content.ts.template +12 -0
  6. package/src/generators/ui/libs/attachment/files/lib/hlm-attachment-description.ts.template +15 -0
  7. package/src/generators/ui/libs/attachment/files/lib/hlm-attachment-group.ts.template +15 -0
  8. package/src/generators/ui/libs/attachment/files/lib/hlm-attachment-media.ts.template +35 -0
  9. package/src/generators/ui/libs/attachment/files/lib/hlm-attachment-title.ts.template +15 -0
  10. package/src/generators/ui/libs/attachment/files/lib/hlm-attachment-trigger.ts.template +23 -0
  11. package/src/generators/ui/libs/attachment/files/lib/hlm-attachment.ts.template +47 -0
  12. package/src/generators/ui/libs/attachment/generator.d.ts +3 -0
  13. package/src/generators/ui/libs/attachment/generator.js +9 -0
  14. package/src/generators/ui/libs/attachment/generator.js.map +1 -0
  15. package/src/generators/ui/libs/bubble/files/index.ts.template +11 -0
  16. package/src/generators/ui/libs/bubble/files/lib/hlm-bubble-content.ts.template +15 -0
  17. package/src/generators/ui/libs/bubble/files/lib/hlm-bubble-group.ts.template +12 -0
  18. package/src/generators/ui/libs/bubble/files/lib/hlm-bubble-reactions.ts.template +43 -0
  19. package/src/generators/ui/libs/bubble/files/lib/hlm-bubble.ts.template +46 -0
  20. package/src/generators/ui/libs/bubble/generator.d.ts +3 -0
  21. package/src/generators/ui/libs/bubble/generator.js +9 -0
  22. package/src/generators/ui/libs/bubble/generator.js.map +1 -0
  23. package/src/generators/ui/libs/marker/files/index.ts.template +9 -0
  24. package/src/generators/ui/libs/marker/files/lib/hlm-marker-content.ts.template +15 -0
  25. package/src/generators/ui/libs/marker/files/lib/hlm-marker-icon.ts.template +15 -0
  26. package/src/generators/ui/libs/marker/files/lib/hlm-marker.ts.template +36 -0
  27. package/src/generators/ui/libs/marker/generator.d.ts +3 -0
  28. package/src/generators/ui/libs/marker/generator.js +9 -0
  29. package/src/generators/ui/libs/marker/generator.js.map +1 -0
  30. package/src/generators/ui/libs/message/files/index.ts.template +22 -0
  31. package/src/generators/ui/libs/message/files/lib/hlm-message-avatar.ts.template +15 -0
  32. package/src/generators/ui/libs/message/files/lib/hlm-message-content.ts.template +15 -0
  33. package/src/generators/ui/libs/message/files/lib/hlm-message-footer.ts.template +15 -0
  34. package/src/generators/ui/libs/message/files/lib/hlm-message-group.ts.template +12 -0
  35. package/src/generators/ui/libs/message/files/lib/hlm-message-header.ts.template +14 -0
  36. package/src/generators/ui/libs/message/files/lib/hlm-message.ts.template +21 -0
  37. package/src/generators/ui/libs/message/generator.d.ts +3 -0
  38. package/src/generators/ui/libs/message/generator.js +9 -0
  39. package/src/generators/ui/libs/message/generator.js.map +1 -0
  40. package/src/generators/ui/libs/spinner/files/lib/hlm-spinner.ts.template +1 -0
  41. package/src/generators/ui/primitive-deps.js +4 -0
  42. package/src/generators/ui/primitive-deps.js.map +1 -1
  43. package/src/generators/ui/primitives.d.ts +1 -1
  44. package/src/generators/ui/style-luma.css +152 -0
  45. package/src/generators/ui/style-lyra.css +152 -0
  46. package/src/generators/ui/style-maia.css +152 -0
  47. package/src/generators/ui/style-mira.css +152 -0
  48. package/src/generators/ui/style-nova.css +152 -0
  49. package/src/generators/ui/style-vega.css +152 -0
  50. package/src/generators/ui/supported-ui-libraries.json +68 -41
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spartan-ng/cli",
3
- "version": "1.2.0-beta.2",
3
+ "version": "1.2.0-beta.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/spartan-ng/spartan.git"
@@ -0,0 +1,31 @@
1
+ import { HlmAttachment } from './lib/hlm-attachment';
2
+ import { HlmAttachmentAction } from './lib/hlm-attachment-action';
3
+ import { HlmAttachmentActions } from './lib/hlm-attachment-actions';
4
+ import { HlmAttachmentContent } from './lib/hlm-attachment-content';
5
+ import { HlmAttachmentDescription } from './lib/hlm-attachment-description';
6
+ import { HlmAttachmentGroup } from './lib/hlm-attachment-group';
7
+ import { HlmAttachmentMedia } from './lib/hlm-attachment-media';
8
+ import { HlmAttachmentTitle } from './lib/hlm-attachment-title';
9
+ import { HlmAttachmentTrigger } from './lib/hlm-attachment-trigger';
10
+
11
+ export * from './lib/hlm-attachment';
12
+ export * from './lib/hlm-attachment-action';
13
+ export * from './lib/hlm-attachment-actions';
14
+ export * from './lib/hlm-attachment-content';
15
+ export * from './lib/hlm-attachment-description';
16
+ export * from './lib/hlm-attachment-group';
17
+ export * from './lib/hlm-attachment-media';
18
+ export * from './lib/hlm-attachment-title';
19
+ export * from './lib/hlm-attachment-trigger';
20
+
21
+ export const HlmAttachmentImports = [
22
+ HlmAttachment,
23
+ HlmAttachmentAction,
24
+ HlmAttachmentActions,
25
+ HlmAttachmentContent,
26
+ HlmAttachmentDescription,
27
+ HlmAttachmentGroup,
28
+ HlmAttachmentMedia,
29
+ HlmAttachmentTitle,
30
+ HlmAttachmentTrigger,
31
+ ] as const;
@@ -0,0 +1,15 @@
1
+ import { Directive, input } from '@angular/core';
2
+ import { HlmButton, provideBrnButtonConfig } from '<%- importAlias %>/button';
3
+
4
+ @Directive({
5
+ selector: 'button[hlmAttachmentAction]',
6
+ providers: [provideBrnButtonConfig({ variant: 'ghost', size: 'icon-xs' })],
7
+ hostDirectives: [{ directive: HlmButton, inputs: ['variant', 'size'] }],
8
+ host: {
9
+ 'data-slot': 'attachment-action',
10
+ '[type]': 'type()',
11
+ },
12
+ })
13
+ export class HlmAttachmentAction {
14
+ public readonly type = input<'button' | 'submit' | 'reset'>('button');
15
+ }
@@ -0,0 +1,15 @@
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+
4
+ @Directive({
5
+ selector: '[hlmAttachmentActions],hlm-attachment-actions',
6
+ host: { 'data-slot': 'attachment-actions' },
7
+ })
8
+ export class HlmAttachmentActions {
9
+ constructor() {
10
+ classes(
11
+ () =>
12
+ 'spartan-attachment-actions relative z-20 flex group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:end-3 group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:gap-1',
13
+ );
14
+ }
15
+ }
@@ -0,0 +1,12 @@
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+
4
+ @Directive({
5
+ selector: '[hlmAttachmentContent],hlm-attachment-content',
6
+ host: { 'data-slot': 'attachment-content' },
7
+ })
8
+ export class HlmAttachmentContent {
9
+ constructor() {
10
+ classes(() => 'spartan-attachment-content max-w-full group-data-[orientation=vertical]/attachment:px-1');
11
+ }
12
+ }
@@ -0,0 +1,15 @@
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+
4
+ @Directive({
5
+ selector: '[hlmAttachmentDescription],hlm-attachment-description',
6
+ host: { 'data-slot': 'attachment-description' },
7
+ })
8
+ export class HlmAttachmentDescription {
9
+ constructor() {
10
+ classes(
11
+ () =>
12
+ 'spartan-attachment-description group-data-[state=error]/attachment:text-destructive/80 block max-w-full min-w-0',
13
+ );
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+
4
+ @Directive({
5
+ selector: '[hlmAttachmentGroup],hlm-attachment-group',
6
+ host: { 'data-slot': 'attachment-group' },
7
+ })
8
+ export class HlmAttachmentGroup {
9
+ constructor() {
10
+ classes(
11
+ () =>
12
+ 'spartan-attachment-group scroll-fade-x no-scrollbar flex min-w-0 snap-x snap-mandatory scroll-px-1 gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start',
13
+ );
14
+ }
15
+ }
@@ -0,0 +1,35 @@
1
+ import { Directive, input } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+ import { cva, type VariantProps } from 'class-variance-authority';
4
+
5
+ const attachmentMediaVariants = cva(
6
+ "spartan-attachment-media group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive relative flex aspect-square shrink-0 items-center justify-center overflow-hidden group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 [&_ng-icon]:pointer-events-none [&_ng-icon:not([class*='text-'])]:text-[length:--spacing(4)] group-data-[orientation=vertical]/attachment:[&_ng-icon:not([class*='text-'])]:text-[length:--spacing(6)] group-data-[size=xs]/attachment:[&_ng-icon:not([class*='text-'])]:text-[length:--spacing(3.5)]",
7
+ {
8
+ variants: {
9
+ variant: {
10
+ icon: 'spartan-attachment-media-variant-icon',
11
+ image: 'spartan-attachment-media-variant-image *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover',
12
+ },
13
+ },
14
+ defaultVariants: {
15
+ variant: 'icon',
16
+ },
17
+ },
18
+ );
19
+
20
+ export type AttachmentMediaVariants = VariantProps<typeof attachmentMediaVariants>;
21
+
22
+ @Directive({
23
+ selector: '[hlmAttachmentMedia],hlm-attachment-media',
24
+ host: {
25
+ 'data-slot': 'attachment-media',
26
+ '[attr.data-variant]': 'variant()',
27
+ },
28
+ })
29
+ export class HlmAttachmentMedia {
30
+ public readonly variant = input<AttachmentMediaVariants['variant']>('icon');
31
+
32
+ constructor() {
33
+ classes(() => attachmentMediaVariants({ variant: this.variant() }));
34
+ }
35
+ }
@@ -0,0 +1,15 @@
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+
4
+ @Directive({
5
+ selector: '[hlmAttachmentTitle],hlm-attachment-title',
6
+ host: { 'data-slot': 'attachment-title' },
7
+ })
8
+ export class HlmAttachmentTitle {
9
+ constructor() {
10
+ classes(
11
+ () =>
12
+ 'spartan-attachment-title group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer block max-w-full min-w-0',
13
+ );
14
+ }
15
+ }
@@ -0,0 +1,23 @@
1
+ import { computed, Directive, ElementRef, inject, input } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+
4
+ @Directive({
5
+ selector: 'button[hlmAttachmentTrigger],a[hlmAttachmentTrigger]',
6
+ host: {
7
+ 'data-slot': 'attachment-trigger',
8
+ '[attr.type]': '_hostType()',
9
+ },
10
+ })
11
+ export class HlmAttachmentTrigger {
12
+ private readonly _elementRef = inject(ElementRef<HTMLElement>);
13
+
14
+ public readonly type = input<'button' | 'submit' | 'reset' | null>('button');
15
+
16
+ protected readonly _hostType = computed(() =>
17
+ this._elementRef.nativeElement.localName === 'button' ? this.type() : null,
18
+ );
19
+
20
+ constructor() {
21
+ classes(() => 'spartan-attachment-trigger');
22
+ }
23
+ }
@@ -0,0 +1,47 @@
1
+ import { Directive, input } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+ import { cva, type VariantProps } from 'class-variance-authority';
4
+
5
+ const attachmentVariants = cva(
6
+ 'spartan-attachment group/attachment focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap transition-colors focus-within:ring-1 data-[state=idle]:border-dashed',
7
+ {
8
+ variants: {
9
+ size: {
10
+ default:
11
+ 'spartan-attachment-size-default gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2',
12
+ sm: 'spartan-attachment-size-sm gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5',
13
+ xs: 'spartan-attachment-size-xs gap-1.5 text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1',
14
+ },
15
+ orientation: {
16
+ horizontal: 'spartan-attachment-orientation-horizontal min-w-40 items-center',
17
+ vertical: 'spartan-attachment-orientation-vertical w-24 flex-col has-data-[slot=attachment-content]:w-30',
18
+ },
19
+ },
20
+ defaultVariants: {
21
+ size: 'default',
22
+ orientation: 'horizontal',
23
+ },
24
+ },
25
+ );
26
+
27
+ export type AttachmentVariants = VariantProps<typeof attachmentVariants>;
28
+ export type AttachmentState = 'idle' | 'uploading' | 'processing' | 'error' | 'done';
29
+
30
+ @Directive({
31
+ selector: '[hlmAttachment],hlm-attachment',
32
+ host: {
33
+ 'data-slot': 'attachment',
34
+ '[attr.data-state]': 'state()',
35
+ '[attr.data-size]': 'size()',
36
+ '[attr.data-orientation]': 'orientation()',
37
+ },
38
+ })
39
+ export class HlmAttachment {
40
+ public readonly state = input<AttachmentState>('done');
41
+ public readonly size = input<AttachmentVariants['size']>('default');
42
+ public readonly orientation = input<AttachmentVariants['orientation']>('horizontal');
43
+
44
+ constructor() {
45
+ classes(() => attachmentVariants({ size: this.size(), orientation: this.orientation() }));
46
+ }
47
+ }
@@ -0,0 +1,3 @@
1
+ import type { Tree } from '@nx/devkit';
2
+ import type { HlmBaseGeneratorSchema } from '../../../base/schema';
3
+ export declare function generator(tree: Tree, options: HlmBaseGeneratorSchema): Promise<import("@nx/devkit").GeneratorCallback>;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generator = generator;
4
+ const tslib_1 = require("tslib");
5
+ const generator_1 = tslib_1.__importDefault(require("../../../base/generator"));
6
+ async function generator(tree, options) {
7
+ return await (0, generator_1.default)(tree, { ...options, name: 'attachment' });
8
+ }
9
+ //# sourceMappingURL=generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/attachment/generator.ts"],"names":[],"mappings":";;AAIA,8BAEC;;AALD,gFAAuD;AAGhD,KAAK,UAAU,SAAS,CAAC,IAAU,EAAE,OAA+B;IAC1E,OAAO,MAAM,IAAA,mBAAgB,EAAC,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;AACzE,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { HlmBubble } from './lib/hlm-bubble';
2
+ import { HlmBubbleContent } from './lib/hlm-bubble-content';
3
+ import { HlmBubbleGroup } from './lib/hlm-bubble-group';
4
+ import { HlmBubbleReactions } from './lib/hlm-bubble-reactions';
5
+
6
+ export * from './lib/hlm-bubble';
7
+ export * from './lib/hlm-bubble-content';
8
+ export * from './lib/hlm-bubble-group';
9
+ export * from './lib/hlm-bubble-reactions';
10
+
11
+ export const HlmBubbleImports = [HlmBubble, HlmBubbleContent, HlmBubbleGroup, HlmBubbleReactions] as const;
@@ -0,0 +1,15 @@
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+
4
+ @Directive({
5
+ selector: '[hlmBubbleContent],hlm-bubble-content',
6
+ host: { 'data-slot': 'bubble-content' },
7
+ })
8
+ export class HlmBubbleContent {
9
+ constructor() {
10
+ classes(
11
+ () =>
12
+ 'spartan-bubble-content [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-ring/50 w-fit max-w-full min-w-0 overflow-hidden border border-transparent wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-start [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:ring-3',
13
+ );
14
+ }
15
+ }
@@ -0,0 +1,12 @@
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+
4
+ @Directive({
5
+ selector: '[hlmBubbleGroup],hlm-bubble-group',
6
+ host: { 'data-slot': 'bubble-group' },
7
+ })
8
+ export class HlmBubbleGroup {
9
+ constructor() {
10
+ classes(() => 'spartan-bubble-group flex min-w-0 flex-col');
11
+ }
12
+ }
@@ -0,0 +1,43 @@
1
+ import { Directive, input } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+ import { cva, type VariantProps } from 'class-variance-authority';
4
+
5
+ const bubbleReactionsVariants = cva(
6
+ 'spartan-bubble-reactions absolute z-10 flex w-fit shrink-0 items-center justify-center has-[button]:p-0',
7
+ {
8
+ variants: {
9
+ side: {
10
+ top: 'top-0 -translate-y-3/4',
11
+ bottom: 'bottom-0 translate-y-3/4',
12
+ },
13
+ align: {
14
+ start: 'start-3',
15
+ end: 'end-3',
16
+ },
17
+ },
18
+ defaultVariants: {
19
+ side: 'bottom',
20
+ align: 'end',
21
+ },
22
+ },
23
+ );
24
+
25
+ export type BubbleReactionsVariants = VariantProps<typeof bubbleReactionsVariants>;
26
+
27
+ @Directive({
28
+ selector: '[hlmBubbleReactions],hlm-bubble-reactions',
29
+ host: {
30
+ 'data-slot': 'bubble-reactions',
31
+ '[attr.data-align]': 'align()',
32
+ '[attr.data-side]': 'side()',
33
+ '[attr.align]': 'null',
34
+ },
35
+ })
36
+ export class HlmBubbleReactions {
37
+ public readonly side = input<BubbleReactionsVariants['side']>('bottom');
38
+ public readonly align = input<BubbleReactionsVariants['align']>('end');
39
+
40
+ constructor() {
41
+ classes(() => bubbleReactionsVariants({ side: this.side(), align: this.align() }));
42
+ }
43
+ }
@@ -0,0 +1,46 @@
1
+ import { Directive, input } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+ import { cva, type VariantProps } from 'class-variance-authority';
4
+
5
+ const bubbleVariants = cva(
6
+ 'spartan-bubble group/bubble relative flex w-fit min-w-0 flex-col group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full',
7
+ {
8
+ variants: {
9
+ variant: {
10
+ default: 'spartan-bubble-variant-default',
11
+ secondary: 'spartan-bubble-variant-secondary',
12
+ muted: 'spartan-bubble-variant-muted',
13
+ tinted: 'spartan-bubble-variant-tinted',
14
+ outline: 'spartan-bubble-variant-outline',
15
+ ghost: 'spartan-bubble-variant-ghost',
16
+ destructive: 'spartan-bubble-variant-destructive',
17
+ },
18
+ },
19
+ defaultVariants: {
20
+ variant: 'default',
21
+ },
22
+ },
23
+ );
24
+
25
+ export type BubbleVariants = VariantProps<typeof bubbleVariants>;
26
+ export type BubbleAlign = 'start' | 'end';
27
+
28
+ @Directive({
29
+ selector: '[hlmBubble],hlm-bubble',
30
+ host: {
31
+ 'data-slot': 'bubble',
32
+ '[attr.data-variant]': 'variant()',
33
+ '[attr.data-align]': 'align()',
34
+ // Prevent the legacy HTML `align` attribute (from `align="end"` bindings) from
35
+ // forcing text-align on the bubble content.
36
+ '[attr.align]': 'null',
37
+ },
38
+ })
39
+ export class HlmBubble {
40
+ public readonly variant = input<BubbleVariants['variant']>('default');
41
+ public readonly align = input<BubbleAlign>('start');
42
+
43
+ constructor() {
44
+ classes(() => bubbleVariants({ variant: this.variant() }));
45
+ }
46
+ }
@@ -0,0 +1,3 @@
1
+ import type { Tree } from '@nx/devkit';
2
+ import type { HlmBaseGeneratorSchema } from '../../../base/schema';
3
+ export declare function generator(tree: Tree, options: HlmBaseGeneratorSchema): Promise<import("@nx/devkit").GeneratorCallback>;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generator = generator;
4
+ const tslib_1 = require("tslib");
5
+ const generator_1 = tslib_1.__importDefault(require("../../../base/generator"));
6
+ async function generator(tree, options) {
7
+ return await (0, generator_1.default)(tree, { ...options, name: 'bubble' });
8
+ }
9
+ //# sourceMappingURL=generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/bubble/generator.ts"],"names":[],"mappings":";;AAIA,8BAEC;;AALD,gFAAuD;AAGhD,KAAK,UAAU,SAAS,CAAC,IAAU,EAAE,OAA+B;IAC1E,OAAO,MAAM,IAAA,mBAAgB,EAAC,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;AACrE,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { HlmMarker } from './lib/hlm-marker';
2
+ import { HlmMarkerContent } from './lib/hlm-marker-content';
3
+ import { HlmMarkerIcon } from './lib/hlm-marker-icon';
4
+
5
+ export * from './lib/hlm-marker';
6
+ export * from './lib/hlm-marker-content';
7
+ export * from './lib/hlm-marker-icon';
8
+
9
+ export const HlmMarkerImports = [HlmMarker, HlmMarkerContent, HlmMarkerIcon] as const;
@@ -0,0 +1,15 @@
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+
4
+ @Directive({
5
+ selector: '[hlmMarkerContent],hlm-marker-content',
6
+ host: { 'data-slot': 'marker-content' },
7
+ })
8
+ export class HlmMarkerContent {
9
+ constructor() {
10
+ classes(
11
+ () =>
12
+ 'spartan-marker-content *:[a]:hover:text-foreground wrap-break-word group-data-[variant=separator]/marker:flex-none group-data-[variant=separator]/marker:text-center *:[a]:underline *:[a]:underline-offset-3',
13
+ );
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+
4
+ @Directive({
5
+ selector: '[hlmMarkerIcon],hlm-marker-icon',
6
+ host: {
7
+ 'data-slot': 'marker-icon',
8
+ 'aria-hidden': 'true',
9
+ },
10
+ })
11
+ export class HlmMarkerIcon {
12
+ constructor() {
13
+ classes(() => "spartan-marker-icon [&_ng-icon:not([class*='text-'])]:text-[length:--spacing(4)]");
14
+ }
15
+ }
@@ -0,0 +1,36 @@
1
+ import { Directive, input } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+ import { cva, type VariantProps } from 'class-variance-authority';
4
+
5
+ const markerVariants = cva(
6
+ "spartan-marker group/marker [a]:hover:text-foreground relative flex min-h-4 w-full items-center text-start text-sm [&_ng-icon:not([class*='text-'])]:text-[length:--spacing(4)] [a]:underline [a]:underline-offset-3",
7
+ {
8
+ variants: {
9
+ variant: {
10
+ default: 'spartan-marker-variant-default',
11
+ separator: 'spartan-marker-variant-separator',
12
+ border: 'spartan-marker-variant-border',
13
+ },
14
+ },
15
+ defaultVariants: {
16
+ variant: 'default',
17
+ },
18
+ },
19
+ );
20
+
21
+ export type MarkerVariants = VariantProps<typeof markerVariants>;
22
+
23
+ @Directive({
24
+ selector: '[hlmMarker],hlm-marker',
25
+ host: {
26
+ 'data-slot': 'marker',
27
+ '[attr.data-variant]': 'variant()',
28
+ },
29
+ })
30
+ export class HlmMarker {
31
+ public readonly variant = input<MarkerVariants['variant']>('default');
32
+
33
+ constructor() {
34
+ classes(() => markerVariants({ variant: this.variant() }));
35
+ }
36
+ }
@@ -0,0 +1,3 @@
1
+ import type { Tree } from '@nx/devkit';
2
+ import type { HlmBaseGeneratorSchema } from '../../../base/schema';
3
+ export declare function generator(tree: Tree, options: HlmBaseGeneratorSchema): Promise<import("@nx/devkit").GeneratorCallback>;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generator = generator;
4
+ const tslib_1 = require("tslib");
5
+ const generator_1 = tslib_1.__importDefault(require("../../../base/generator"));
6
+ async function generator(tree, options) {
7
+ return await (0, generator_1.default)(tree, { ...options, name: 'marker' });
8
+ }
9
+ //# sourceMappingURL=generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/marker/generator.ts"],"names":[],"mappings":";;AAIA,8BAEC;;AALD,gFAAuD;AAGhD,KAAK,UAAU,SAAS,CAAC,IAAU,EAAE,OAA+B;IAC1E,OAAO,MAAM,IAAA,mBAAgB,EAAC,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;AACrE,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { HlmMessage } from './lib/hlm-message';
2
+ import { HlmMessageAvatar } from './lib/hlm-message-avatar';
3
+ import { HlmMessageContent } from './lib/hlm-message-content';
4
+ import { HlmMessageFooter } from './lib/hlm-message-footer';
5
+ import { HlmMessageGroup } from './lib/hlm-message-group';
6
+ import { HlmMessageHeader } from './lib/hlm-message-header';
7
+
8
+ export * from './lib/hlm-message';
9
+ export * from './lib/hlm-message-avatar';
10
+ export * from './lib/hlm-message-content';
11
+ export * from './lib/hlm-message-footer';
12
+ export * from './lib/hlm-message-group';
13
+ export * from './lib/hlm-message-header';
14
+
15
+ export const HlmMessageImports = [
16
+ HlmMessage,
17
+ HlmMessageAvatar,
18
+ HlmMessageContent,
19
+ HlmMessageFooter,
20
+ HlmMessageGroup,
21
+ HlmMessageHeader,
22
+ ] as const;
@@ -0,0 +1,15 @@
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+
4
+ @Directive({
5
+ selector: '[hlmMessageAvatar],hlm-message-avatar',
6
+ host: { 'data-slot': 'message-avatar' },
7
+ })
8
+ export class HlmMessageAvatar {
9
+ constructor() {
10
+ classes(
11
+ () =>
12
+ 'spartan-message-avatar flex w-fit shrink-0 items-center justify-center self-end overflow-hidden group-has-data-[slot=message-footer]/message:-translate-y-8',
13
+ );
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+
4
+ @Directive({
5
+ selector: '[hlmMessageContent],hlm-message-content',
6
+ host: { 'data-slot': 'message-content' },
7
+ })
8
+ export class HlmMessageContent {
9
+ constructor() {
10
+ classes(
11
+ () =>
12
+ 'spartan-message-content flex w-full min-w-0 flex-col wrap-break-word group-data-[align=end]/message:*:data-slot:self-end',
13
+ );
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+
4
+ @Directive({
5
+ selector: '[hlmMessageFooter],hlm-message-footer',
6
+ host: { 'data-slot': 'message-footer' },
7
+ })
8
+ export class HlmMessageFooter {
9
+ constructor() {
10
+ classes(
11
+ () =>
12
+ 'spartan-message-footer flex max-w-full min-w-0 items-center group-has-data-[variant=ghost]/message:px-0 group-data-[align=end]/message:justify-end',
13
+ );
14
+ }
15
+ }
@@ -0,0 +1,12 @@
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+
4
+ @Directive({
5
+ selector: '[hlmMessageGroup],hlm-message-group',
6
+ host: { 'data-slot': 'message-group' },
7
+ })
8
+ export class HlmMessageGroup {
9
+ constructor() {
10
+ classes(() => 'spartan-message-group flex min-w-0 flex-col');
11
+ }
12
+ }
@@ -0,0 +1,14 @@
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+
4
+ @Directive({
5
+ selector: '[hlmMessageHeader],hlm-message-header',
6
+ host: { 'data-slot': 'message-header' },
7
+ })
8
+ export class HlmMessageHeader {
9
+ constructor() {
10
+ classes(
11
+ () => 'spartan-message-header flex max-w-full min-w-0 items-center group-has-data-[variant=ghost]/message:px-0',
12
+ );
13
+ }
14
+ }
@@ -0,0 +1,21 @@
1
+ import { Directive, input } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
+
4
+ export type MessageAlign = 'start' | 'end';
5
+
6
+ @Directive({
7
+ selector: '[hlmMessage],hlm-message',
8
+ host: {
9
+ 'data-slot': 'message',
10
+ '[attr.data-align]': 'align()',
11
+ // Prevent the legacy HTML `align` attribute from forcing text-align.
12
+ '[attr.align]': 'null',
13
+ },
14
+ })
15
+ export class HlmMessage {
16
+ public readonly align = input<MessageAlign>('start');
17
+
18
+ constructor() {
19
+ classes(() => 'spartan-message group/message relative flex w-full min-w-0 data-[align=end]:flex-row-reverse');
20
+ }
21
+ }