@semantic-components/ui 0.11.0 → 0.13.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.
Files changed (77) hide show
  1. package/fesm2022/semantic-components-ui.mjs +2515 -871
  2. package/fesm2022/semantic-components-ui.mjs.map +1 -1
  3. package/index.d.ts +9 -1
  4. package/lib/components/autocomplete/autocomplete-item.d.ts +2 -2
  5. package/lib/components/button/button.d.ts +6 -5
  6. package/lib/components/calendar/calendar.d.ts +14 -5
  7. package/lib/components/checkbox/checkbox.d.ts +1 -1
  8. package/lib/components/cookie-consent/cookie-consent.d.ts +10 -0
  9. package/lib/components/cookie-consent/index.d.ts +1 -0
  10. package/lib/components/date-picker/date-input.d.ts +9 -0
  11. package/lib/components/date-picker/date-picker.d.ts +3 -7
  12. package/lib/components/editor/actions/editor-redo.d.ts +12 -0
  13. package/lib/components/editor/actions/editor-text-align-center.d.ts +12 -0
  14. package/lib/components/editor/actions/editor-text-align-left.d.ts +12 -0
  15. package/lib/components/editor/actions/editor-text-align-right.d.ts +12 -0
  16. package/lib/components/editor/actions/editor-undo.d.ts +12 -0
  17. package/lib/components/editor/actions/editor-unset-link.d.ts +14 -0
  18. package/lib/components/editor/editor-group.d.ts +7 -0
  19. package/lib/components/editor/editor-toolbar.d.ts +7 -0
  20. package/lib/components/editor/extensions/extension-link.d.ts +0 -1
  21. package/lib/components/editor/extensions/extensions.d.ts +10 -3
  22. package/lib/components/file-upload/drop-zone.d.ts +11 -0
  23. package/lib/components/file-upload/file-card.d.ts +12 -0
  24. package/lib/components/file-upload/file-preview.d.ts +7 -0
  25. package/lib/components/file-upload/file-upload.d.ts +9 -0
  26. package/lib/components/file-upload/file-uploader.d.ts +16 -0
  27. package/lib/components/file-upload/file.d.ts +4 -0
  28. package/lib/components/file-upload/image.d.ts +7 -0
  29. package/lib/components/file-upload/index.d.ts +3 -0
  30. package/lib/components/file-upload/single-file-uploader.d.ts +18 -0
  31. package/lib/components/file-upload/utils.d.ts +4 -0
  32. package/lib/components/hover-card/hover-card-trigger-for.d.ts +5 -5
  33. package/lib/components/input/input.d.ts +4 -3
  34. package/lib/components/menu/menu-checkbox-item.d.ts +1 -1
  35. package/lib/components/menu/menu-group.d.ts +2 -2
  36. package/lib/components/page/index.d.ts +4 -0
  37. package/lib/components/page/page-description.d.ts +7 -0
  38. package/lib/components/page/page-subtitle.d.ts +7 -0
  39. package/lib/components/page/page-title.d.ts +7 -0
  40. package/lib/components/page/section.d.ts +5 -0
  41. package/lib/components/popover/popover-trigger-for.d.ts +3 -3
  42. package/lib/components/radio-group/radio-item.d.ts +15 -17
  43. package/lib/components/scroll-area/scroll-area.d.ts +4 -6
  44. package/lib/components/select/option.d.ts +23 -3
  45. package/lib/components/select/select-state.d.ts +7 -0
  46. package/lib/components/select/select.d.ts +22 -7
  47. package/lib/components/separator/index.d.ts +1 -0
  48. package/lib/components/separator/separator.d.ts +8 -0
  49. package/lib/components/sidebar/sidebar.d.ts +2 -3
  50. package/lib/components/slider/slider.d.ts +1 -1
  51. package/lib/components/tab-group/index.d.ts +4 -0
  52. package/lib/components/tab-group/tab-content.d.ts +7 -0
  53. package/lib/components/tab-group/tab-group.d.ts +11 -0
  54. package/lib/components/tab-group/tab-item.d.ts +5 -0
  55. package/lib/components/tab-group/tab-label.d.ts +7 -0
  56. package/lib/components/time-picker/index.d.ts +1 -0
  57. package/lib/components/time-picker/time-option.d.ts +28 -0
  58. package/lib/components/time-picker/time-picker-input.d.ts +7 -0
  59. package/lib/components/time-picker/time-picker.d.ts +101 -0
  60. package/lib/components/toggle-group/index.d.ts +2 -0
  61. package/lib/components/toggle-group/toggle-group-item.d.ts +5 -0
  62. package/lib/components/toggle-group/toggle-group.d.ts +8 -0
  63. package/lib/components/typography/blockquote.d.ts +5 -0
  64. package/lib/components/typography/heading.d.ts +4 -4
  65. package/lib/components/typography/index.d.ts +1 -0
  66. package/lib/utils/index.d.ts +1 -2
  67. package/lib/utils/settings.d.ts +10 -0
  68. package/package.json +5 -6
  69. package/lib/components/editor/extensions/extension-history.d.ts +0 -14
  70. package/lib/components/editor/extensions/extension-text-align.d.ts +0 -16
  71. package/lib/components/editor/toolbar/extensions-group.d.ts +0 -5
  72. package/lib/components/editor/toolbar/extensions-separator.d.ts +0 -7
  73. package/lib/components/select/listbox-option.d.ts +0 -8
  74. package/lib/components/select/listbox.d.ts +0 -7
  75. /package/lib/components/{menubar → menu-bar}/index.d.ts +0 -0
  76. /package/lib/components/{menubar → menu-bar}/menu-bar-item.d.ts +0 -0
  77. /package/lib/components/{menubar → menu-bar}/menu-bar.d.ts +0 -0
@@ -1,65 +1,115 @@
1
- import { clsx } from 'clsx';
2
- import { twMerge } from 'tailwind-merge';
3
1
  import * as i0 from '@angular/core';
4
- import { input, computed, Component, ViewEncapsulation, ChangeDetectionStrategy, signal, inject, ElementRef, Directive, HostListener, Injectable, ChangeDetectorRef, viewChild, afterNextRender, forwardRef, ViewContainerRef, contentChildren, model, output, effect, LOCALE_ID, Injector, booleanAttribute, untracked, viewChildren } from '@angular/core';
2
+ import { signal, inject, LOCALE_ID, Injectable, input, computed, Component, ViewEncapsulation, ChangeDetectionStrategy, ElementRef, Directive, HostListener, ChangeDetectorRef, viewChild, afterNextRender, forwardRef, booleanAttribute, ViewContainerRef, contentChildren, effect, Injector, model, untracked, output, linkedSignal, viewChildren } from '@angular/core';
5
3
  import * as i1 from '@angular/forms';
6
4
  import { FormGroup, FormControl, Validators, ReactiveFormsModule, NG_VALUE_ACCESSOR, FormArray, NgForm, FormGroupDirective, NgControl, FormBuilder, FormsModule } from '@angular/forms';
5
+ import { cn } from '@semantic-components/utils';
7
6
  import { Editor } from '@tiptap/core';
8
7
  import Document from '@tiptap/extension-document';
9
8
  import Heading from '@tiptap/extension-heading';
10
9
  import Paragraph from '@tiptap/extension-paragraph';
11
10
  import Text from '@tiptap/extension-text';
12
11
  import { cva } from 'class-variance-authority';
13
- import { SvgQuoteIcon, SvgBoldIcon, SvgListIcon, SvgCodeIcon, SvgPaletteIcon, SvgHighlighterIcon, SvgUndoIcon, SvgRedoIcon, SvgMinusIcon, SvgItalicIcon, SvgListOrderedIcon, SvgStrikethroughIcon, SvgAlignLeftIcon, SvgAlignRightIcon, SvgAlignCenterIcon, SvgUnderlineIcon, SvgCheckIcon, SvgChevronDownIcon, SvgEllipsisIcon, SvgChevronLeftIcon, SvgChevronsLeftIcon, SvgChevronRightIcon, SvgChevronsRightIcon, SvgCalendarIcon, SvgMoonIcon, SvgSunIcon, SvgXIcon, SvgChevronUpIcon, SvgCircleIcon, SvgDotIcon, SvgSearchIcon } from '@semantic-icons/lucide-icons';
14
- import { Overlay, OverlayModule, OverlayContainer, OverlayConfig } from '@angular/cdk/overlay';
12
+ import { SvgRedoIcon, SvgAlignCenterIcon, SvgAlignLeftIcon, SvgAlignRightIcon, SvgUndoIcon, SvgUnlinkIcon, SvgQuoteIcon, SvgBoldIcon, SvgListIcon, SvgCodeIcon, SvgPaletteIcon, SvgHighlighterIcon, SvgMinusIcon, SvgItalicIcon, SvgListOrderedIcon, SvgStrikethroughIcon, SvgUnderlineIcon, SvgCheckIcon, SvgChevronDownIcon, SvgEllipsisIcon, SvgChevronLeftIcon, SvgChevronsLeftIcon, SvgChevronRightIcon, SvgChevronsRightIcon, SvgCalendarIcon, SvgMoonIcon, SvgSunIcon, SvgXIcon, SvgChevronUpIcon, SvgCircleIcon, SvgDotIcon, SvgSearchIcon, SvgClockIcon, SvgFileTextIcon, SvgUploadIcon, SvgCookieIcon } from '@semantic-icons/lucide-icons';
13
+ import { Overlay, OverlayContainer, OverlayConfig } from '@angular/cdk/overlay';
15
14
  import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
16
- import * as i1$5 from '@angular/cdk/menu';
15
+ import { Dialog, DialogRef, DialogModule } from '@angular/cdk/dialog';
16
+ import * as i1$3 from '@angular/cdk/menu';
17
17
  import { CdkMenuTrigger, CdkMenu, CdkMenuItem, CdkContextMenuTrigger, CdkMenuItemCheckbox, CdkMenuGroup, CdkMenuItemRadio, CdkMenuBar } from '@angular/cdk/menu';
18
- import { DialogRef, Dialog, DialogModule } from '@angular/cdk/dialog';
19
- import * as i1$1 from '@angular/cdk/a11y';
20
- import { A11yModule, FocusMonitor, ActiveDescendantKeyManager } from '@angular/cdk/a11y';
18
+ import { _IdGenerator, ActiveDescendantKeyManager, FocusMonitor } from '@angular/cdk/a11y';
21
19
  import { Directionality } from '@angular/cdk/bidi';
22
- import { TAB, ESCAPE, hasModifierKey, ENTER } from '@angular/cdk/keycodes';
23
- import { CdkOption, CdkListbox } from '@angular/cdk/listbox';
20
+ import { hasModifierKey, ENTER, TAB, ESCAPE } from '@angular/cdk/keycodes';
24
21
  import { _getEventTarget } from '@angular/cdk/platform';
25
- import * as i1$3 from '@angular/common';
26
- import { NgClass, DOCUMENT, NgTemplateOutlet, CommonModule, AsyncPipe, JsonPipe, NgOptimizedImage } from '@angular/common';
27
- import * as i1$2 from 'ngx-scrollbar';
28
- import { NgScrollbarModule } from 'ngx-scrollbar';
22
+ import * as i1$1 from '@angular/common';
23
+ import { NgClass, DOCUMENT, NgTemplateOutlet, CommonModule, AsyncPipe, JsonPipe } from '@angular/common';
29
24
  import EmblaCarousel from 'embla-carousel';
30
25
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
31
- import * as i1$4 from '@angular/cdk/accordion';
26
+ import * as i1$2 from '@angular/cdk/accordion';
32
27
  import { CdkAccordionModule } from '@angular/cdk/accordion';
33
28
  import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
34
- import { Subject, debounceTime } from 'rxjs';
35
- import * as i1$6 from '@angular/cdk/layout';
36
- import { LayoutModule } from '@angular/cdk/layout';
29
+ import { Subject, debounceTime, catchError, throwError } from 'rxjs';
30
+ import { BreakpointObserver, LayoutModule } from '@angular/cdk/layout';
31
+ import { HttpEventType, HttpResponse } from '@angular/common/http';
32
+ import { DataService } from '@semantic-components/supabase';
37
33
 
38
- function cn(...inputs) {
39
- return twMerge(clsx(inputs));
34
+ class ScSettings {
35
+ clock = signal('am-pm');
36
+ dateFormatPattern = signal('');
37
+ localeId = inject(LOCALE_ID);
38
+ constructor() {
39
+ this.dateFormatPattern.set(this.getDateFormatPattern(this.localeId));
40
+ }
41
+ getDateFormatPattern(localeId) {
42
+ const getPatternForPart = (part) => {
43
+ switch (part.type) {
44
+ case 'day':
45
+ return 'd'.repeat(part.value.length);
46
+ case 'month':
47
+ return 'M'.repeat(part.value.length);
48
+ case 'year':
49
+ return 'y'.repeat(part.value.length);
50
+ case 'literal':
51
+ return part.value;
52
+ default:
53
+ throw new Error('no default');
54
+ }
55
+ };
56
+ return new Intl.DateTimeFormat(localeId)
57
+ .formatToParts(new Date('2022-01-01'))
58
+ .map(getPatternForPart)
59
+ .join('')
60
+ .toLowerCase();
61
+ }
62
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScSettings, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
63
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScSettings, providedIn: 'root' });
64
+ }
65
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScSettings, decorators: [{
66
+ type: Injectable,
67
+ args: [{
68
+ providedIn: 'root',
69
+ }]
70
+ }], ctorParameters: () => [] });
71
+
72
+ class ScSeparator {
73
+ orientation = input('horizontal');
74
+ class = input('');
75
+ _class = computed(() => cn('block shrink-0 bg-border', this.orientation() === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]', this.class()));
76
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScSeparator, deps: [], target: i0.ɵɵFactoryTarget.Component });
77
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScSeparator, isStandalone: true, selector: "sc-separator", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_class()" } }, ngImport: i0, template: `
78
+ <ng-content />
79
+ `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
40
80
  }
81
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScSeparator, decorators: [{
82
+ type: Component,
83
+ args: [{ selector: 'sc-separator', imports: [], template: `
84
+ <ng-content />
85
+ `, host: {
86
+ '[class]': '_class()',
87
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
88
+ }] });
41
89
 
42
90
  const scHeadingVariants = cva('', {
43
91
  variants: {
44
92
  level: {
45
- 1: 'text-4xl font-extrabold tracking-tight lg:text-5xl',
46
- 2: 'text-3xl font-semibold tracking-tight',
47
- 3: 'text-2xl font-semibold tracking-tight',
48
- 4: 'text-xl font-semibold tracking-tight',
49
- 5: '',
50
- 6: '',
93
+ '1': 'scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl',
94
+ '2': 'scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0',
95
+ '3': 'scroll-m-20 text-2xl font-semibold tracking-tight',
96
+ '4': 'scroll-m-20 text-xl font-semibold tracking-tight',
97
+ '5': '',
98
+ '6': '',
51
99
  },
52
100
  },
53
101
  defaultVariants: {
54
- level: 1,
102
+ level: '1',
55
103
  },
56
104
  });
57
105
  class ScHeading {
58
- level = input(1);
59
- class = input('');
60
- classes = computed(() => cn(scHeadingVariants({ level: this.level() }), this.class()));
106
+ level = input('1');
107
+ classInput = input('', {
108
+ alias: 'class',
109
+ });
110
+ class = computed(() => cn(scHeadingVariants({ level: this.level() }), this.classInput()));
61
111
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScHeading, deps: [], target: i0.ɵɵFactoryTarget.Component });
62
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScHeading, isStandalone: true, selector: "h1[sc-heading], h2[sc-heading], h3[sc-heading], h4[sc-heading], h5[sc-heading], h6[sc-heading]", inputs: { level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `
112
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScHeading, isStandalone: true, selector: "h1[sc-heading], h2[sc-heading], h3[sc-heading], h4[sc-heading], h5[sc-heading], h6[sc-heading]", inputs: { level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "class()" } }, ngImport: i0, template: `
63
113
  <ng-content />
64
114
  `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
65
115
  }
@@ -68,7 +118,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
68
118
  args: [{ selector: 'h1[sc-heading], h2[sc-heading], h3[sc-heading], h4[sc-heading], h5[sc-heading], h6[sc-heading]', imports: [], template: `
69
119
  <ng-content />
70
120
  `, host: {
71
- '[class]': 'classes()',
121
+ '[class]': 'class()',
72
122
  }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
73
123
  }] });
74
124
 
@@ -90,7 +140,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
90
140
  }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
91
141
  }] });
92
142
 
93
- const toggleVariants = cva('inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_.svg]:pointer-events-none [&_.svg]:size-4 [&_.svg]:shrink-0', {
143
+ class ScBlockquote {
144
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScBlockquote, deps: [], target: i0.ɵɵFactoryTarget.Component });
145
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScBlockquote, isStandalone: true, selector: "blockquote[sc-blockquote]", host: { properties: { "class": "classes()" } }, ngImport: i0, template: `
146
+ <ng-content />
147
+ `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
148
+ }
149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScBlockquote, decorators: [{
150
+ type: Component,
151
+ args: [{ selector: 'blockquote[sc-blockquote]', imports: [], template: `
152
+ <ng-content />
153
+ `, host: {
154
+ '[class]': 'classes()',
155
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
156
+ }] });
157
+
158
+ const toggleVariants = cva('inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', {
94
159
  variants: {
95
160
  variant: {
96
161
  default: 'bg-transparent',
@@ -262,11 +327,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
262
327
  }] } });
263
328
 
264
329
  class ScExtensions {
330
+ //history extension
331
+ undo = signal(false);
332
+ redo = signal(false);
333
+ history = computed(() => this.undo() || this.redo());
334
+ //link extension
335
+ setLink = signal(false);
336
+ unsetLink = signal(false);
337
+ link = computed(() => this.setLink() || this.unsetLink());
338
+ //text align extension
339
+ textAlignRight = signal(false);
340
+ textAlignLeft = signal(false);
341
+ textAlignCenter = signal(false);
342
+ textAlign = computed(() => this.textAlignRight() || this.textAlignLeft() || this.textAlignCenter());
343
+ //
265
344
  highlight = signal(false);
266
345
  color = signal(false);
267
346
  underline = signal(false);
268
- link = signal(false);
269
- textAlign = signal(false);
270
347
  fontFamily = signal(false);
271
348
  bold = signal(false);
272
349
  youtube = signal(false);
@@ -279,7 +356,6 @@ class ScExtensions {
279
356
  orderedList = signal(false);
280
357
  horizontalRule = signal(false);
281
358
  textStyle = signal(false);
282
- history = signal(false);
283
359
  table = signal(false);
284
360
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensions, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
285
361
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensions, providedIn: 'root' });
@@ -291,244 +367,551 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
291
367
  }]
292
368
  }] });
293
369
 
294
- class ScExtensionBlockquote {
295
- ariaLabel = 'Toggle blockquote';
370
+ class ScEditorRedo {
371
+ ariaLabel = 'Redo';
296
372
  parent = inject(ScEditor, { host: true });
297
373
  extensions = inject(ScExtensions);
298
374
  constructor() {
299
- this.extensions.blockquote.set(true);
375
+ this.extensions.redo.set(true);
300
376
  }
301
377
  get editor() {
302
378
  return this.parent.editor;
303
379
  }
304
- toggleBlockquote() {
305
- this.editor.chain().focus().toggleBlockquote().run();
380
+ redo() {
381
+ this.editor.chain().focus().redo().run();
306
382
  }
307
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionBlockquote, deps: [], target: i0.ɵɵFactoryTarget.Component });
308
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScExtensionBlockquote, isStandalone: true, selector: "sc-extension-blockquote", ngImport: i0, template: `
383
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScEditorRedo, deps: [], target: i0.ɵɵFactoryTarget.Component });
384
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScEditorRedo, isStandalone: true, selector: "sc-editor-redo", ngImport: i0, template: `
309
385
  <button
310
386
  [attr.aria-label]="ariaLabel"
311
387
  [scTooltip]="ariaLabel"
312
- (click)="toggleBlockquote()"
388
+ (click)="redo()"
313
389
  sc-toggle
314
390
  variant="outline"
315
391
  type="button"
316
392
  >
317
- <svg-quote-icon />
393
+ <svg-redo-icon />
318
394
  <span class="sr-only">{{ ariaLabel }}</span>
319
395
  </button>
320
- `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgQuoteIcon, selector: "svg-quote-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
396
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgRedoIcon, selector: "svg-redo-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
321
397
  }
322
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionBlockquote, decorators: [{
398
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScEditorRedo, decorators: [{
323
399
  type: Component,
324
- args: [{ selector: 'sc-extension-blockquote', imports: [ScTooltip, ScToggle, SvgQuoteIcon], template: `
400
+ args: [{ selector: 'sc-editor-redo', imports: [ScTooltip, ScToggle, SvgRedoIcon], template: `
325
401
  <button
326
402
  [attr.aria-label]="ariaLabel"
327
403
  [scTooltip]="ariaLabel"
328
- (click)="toggleBlockquote()"
404
+ (click)="redo()"
329
405
  sc-toggle
330
406
  variant="outline"
331
407
  type="button"
332
408
  >
333
- <svg-quote-icon />
409
+ <svg-redo-icon />
334
410
  <span class="sr-only">{{ ariaLabel }}</span>
335
411
  </button>
336
412
  `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
337
413
  }], ctorParameters: () => [] });
338
414
 
339
- class ScExtensionBold {
340
- ariaLabel = 'Toggle Bold';
415
+ class ScEditorTextAlignCenter {
416
+ ariaLabel = 'Align center';
341
417
  parent = inject(ScEditor, { host: true });
342
418
  extensions = inject(ScExtensions);
343
419
  constructor() {
344
- this.extensions.bold.set(true);
420
+ this.extensions.textAlignCenter.set(true);
345
421
  }
346
422
  get editor() {
347
423
  return this.parent.editor;
348
424
  }
349
- toggleBold() {
350
- this.editor.chain().focus().toggleBold().run();
425
+ setCenterAlign() {
426
+ this.editor.chain().focus().setTextAlign('center').run();
351
427
  }
352
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionBold, deps: [], target: i0.ɵɵFactoryTarget.Component });
353
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScExtensionBold, isStandalone: true, selector: "sc-extension-bold", ngImport: i0, template: `
428
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScEditorTextAlignCenter, deps: [], target: i0.ɵɵFactoryTarget.Component });
429
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScEditorTextAlignCenter, isStandalone: true, selector: "sc-editor-text-align-center", ngImport: i0, template: `
354
430
  <button
355
431
  [attr.aria-label]="ariaLabel"
356
432
  [scTooltip]="ariaLabel"
357
- (click)="toggleBold()"
433
+ (click)="setCenterAlign()"
434
+ type="button"
358
435
  sc-toggle
359
436
  variant="outline"
437
+ >
438
+ <svg-align-center-icon />
439
+ <span class="sr-only">{{ ariaLabel }}</span>
440
+ </button>
441
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: SvgAlignCenterIcon, selector: "svg-align-center-icon", inputs: ["class"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
442
+ }
443
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScEditorTextAlignCenter, decorators: [{
444
+ type: Component,
445
+ args: [{ selector: 'sc-editor-text-align-center', imports: [ScTooltip, SvgAlignCenterIcon, ScToggle], template: `
446
+ <button
447
+ [attr.aria-label]="ariaLabel"
448
+ [scTooltip]="ariaLabel"
449
+ (click)="setCenterAlign()"
360
450
  type="button"
451
+ sc-toggle
452
+ variant="outline"
361
453
  >
362
- <svg-bold-icon />
454
+ <svg-align-center-icon />
455
+ <span class="sr-only">{{ ariaLabel }}</span>
456
+ </button>
457
+ `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
458
+ }], ctorParameters: () => [] });
459
+
460
+ class ScEditorTextAlignLeft {
461
+ ariaLabel = 'Align left';
462
+ parent = inject(ScEditor, { host: true });
463
+ extensions = inject(ScExtensions);
464
+ constructor() {
465
+ this.extensions.textAlignLeft.set(true);
466
+ }
467
+ get editor() {
468
+ return this.parent.editor;
469
+ }
470
+ setLeftAlign() {
471
+ this.editor.chain().focus().setTextAlign('left').run();
472
+ }
473
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScEditorTextAlignLeft, deps: [], target: i0.ɵɵFactoryTarget.Component });
474
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScEditorTextAlignLeft, isStandalone: true, selector: "sc-editor-text-align-left", ngImport: i0, template: `
475
+ <button
476
+ [attr.aria-label]="ariaLabel"
477
+ [scTooltip]="ariaLabel"
478
+ (click)="setLeftAlign()"
479
+ type="button"
480
+ sc-toggle
481
+ variant="outline"
482
+ >
483
+ <svg-align-left-icon />
363
484
  <span class="sr-only">{{ ariaLabel }}</span>
364
485
  </button>
365
- `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgBoldIcon, selector: "svg-bold-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
486
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: SvgAlignLeftIcon, selector: "svg-align-left-icon", inputs: ["class"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
366
487
  }
367
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionBold, decorators: [{
488
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScEditorTextAlignLeft, decorators: [{
368
489
  type: Component,
369
- args: [{ selector: 'sc-extension-bold', imports: [ScTooltip, ScToggle, SvgBoldIcon], template: `
490
+ args: [{ selector: 'sc-editor-text-align-left', imports: [ScTooltip, SvgAlignLeftIcon, ScToggle], template: `
370
491
  <button
371
492
  [attr.aria-label]="ariaLabel"
372
493
  [scTooltip]="ariaLabel"
373
- (click)="toggleBold()"
494
+ (click)="setLeftAlign()"
495
+ type="button"
496
+ sc-toggle
497
+ variant="outline"
498
+ >
499
+ <svg-align-left-icon />
500
+ <span class="sr-only">{{ ariaLabel }}</span>
501
+ </button>
502
+ `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
503
+ }], ctorParameters: () => [] });
504
+
505
+ class ScEditorTextAlignRight {
506
+ ariaLabel = 'Align right';
507
+ parent = inject(ScEditor, { host: true });
508
+ extensions = inject(ScExtensions);
509
+ constructor() {
510
+ this.extensions.textAlignRight.set(true);
511
+ }
512
+ get editor() {
513
+ return this.parent.editor;
514
+ }
515
+ setRightAlign() {
516
+ this.editor.chain().focus().setTextAlign('right').run();
517
+ }
518
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScEditorTextAlignRight, deps: [], target: i0.ɵɵFactoryTarget.Component });
519
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScEditorTextAlignRight, isStandalone: true, selector: "sc-editor-text-align-right", ngImport: i0, template: `
520
+ <button
521
+ [attr.aria-label]="ariaLabel"
522
+ [scTooltip]="ariaLabel"
523
+ (click)="setRightAlign()"
524
+ type="button"
374
525
  sc-toggle
375
526
  variant="outline"
527
+ >
528
+ <svg-align-right-icon />
529
+ <span class="sr-only">{{ ariaLabel }}</span>
530
+ </button>
531
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: SvgAlignRightIcon, selector: "svg-align-right-icon", inputs: ["class"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
532
+ }
533
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScEditorTextAlignRight, decorators: [{
534
+ type: Component,
535
+ args: [{ selector: 'sc-editor-text-align-right', imports: [ScTooltip, SvgAlignRightIcon, ScToggle], template: `
536
+ <button
537
+ [attr.aria-label]="ariaLabel"
538
+ [scTooltip]="ariaLabel"
539
+ (click)="setRightAlign()"
376
540
  type="button"
541
+ sc-toggle
542
+ variant="outline"
377
543
  >
378
- <svg-bold-icon />
544
+ <svg-align-right-icon />
379
545
  <span class="sr-only">{{ ariaLabel }}</span>
380
546
  </button>
381
547
  `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
382
548
  }], ctorParameters: () => [] });
383
549
 
384
- class ScExtensionBulletList {
385
- ariaLabel = 'Toggle List';
550
+ class ScEditorUndo {
551
+ ariaLabel = 'Undo';
386
552
  parent = inject(ScEditor, { host: true });
387
553
  extensions = inject(ScExtensions);
388
554
  constructor() {
389
- this.extensions.bulletList.set(true);
555
+ this.extensions.undo.set(true);
390
556
  }
391
557
  get editor() {
392
558
  return this.parent.editor;
393
559
  }
394
- toggleBulletList() {
395
- this.editor.chain().focus().toggleBulletList().run();
560
+ undo() {
561
+ this.editor.chain().focus().undo().run();
396
562
  }
397
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionBulletList, deps: [], target: i0.ɵɵFactoryTarget.Component });
398
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScExtensionBulletList, isStandalone: true, selector: "sc-extension-bullet-list", ngImport: i0, template: `
563
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScEditorUndo, deps: [], target: i0.ɵɵFactoryTarget.Component });
564
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScEditorUndo, isStandalone: true, selector: "sc-editor-undo", ngImport: i0, template: `
399
565
  <button
400
566
  [attr.aria-label]="ariaLabel"
401
567
  [scTooltip]="ariaLabel"
402
- (click)="toggleBulletList()"
568
+ (click)="undo()"
403
569
  sc-toggle
404
570
  variant="outline"
405
571
  type="button"
406
572
  >
407
- <svg-list-icon />
573
+ <svg-undo-icon />
408
574
  <span class="sr-only">{{ ariaLabel }}</span>
409
575
  </button>
410
- `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgListIcon, selector: "svg-list-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
576
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgUndoIcon, selector: "svg-undo-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
411
577
  }
412
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionBulletList, decorators: [{
578
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScEditorUndo, decorators: [{
413
579
  type: Component,
414
- args: [{ selector: 'sc-extension-bullet-list', imports: [ScTooltip, ScToggle, SvgListIcon], template: `
580
+ args: [{ selector: 'sc-editor-undo', imports: [ScTooltip, ScToggle, SvgUndoIcon], template: `
415
581
  <button
416
582
  [attr.aria-label]="ariaLabel"
417
583
  [scTooltip]="ariaLabel"
418
- (click)="toggleBulletList()"
584
+ (click)="undo()"
419
585
  sc-toggle
420
586
  variant="outline"
421
587
  type="button"
422
588
  >
423
- <svg-list-icon />
589
+ <svg-undo-icon />
424
590
  <span class="sr-only">{{ ariaLabel }}</span>
425
591
  </button>
426
592
  `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
427
593
  }], ctorParameters: () => [] });
428
594
 
429
- class ScExtensionCode {
430
- ariaLabel = 'Format code';
595
+ class ScEditorUnsetLink {
596
+ ariaLabel = 'Unset Link';
431
597
  parent = inject(ScEditor, { host: true });
598
+ dialog = inject(Dialog);
432
599
  extensions = inject(ScExtensions);
433
600
  constructor() {
434
- this.extensions.code.set(true);
601
+ this.extensions.unsetLink.set(true);
435
602
  }
436
603
  get editor() {
437
604
  return this.parent.editor;
438
605
  }
439
- toggleCode() {
440
- this.editor.chain().focus().toggleCode().run();
606
+ unsetLink() {
607
+ this.editor.chain().focus().unsetLink().run();
441
608
  }
442
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionCode, deps: [], target: i0.ɵɵFactoryTarget.Component });
443
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScExtensionCode, isStandalone: true, selector: "sc-extension-code", ngImport: i0, template: `
609
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScEditorUnsetLink, deps: [], target: i0.ɵɵFactoryTarget.Component });
610
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScEditorUnsetLink, isStandalone: true, selector: "sc-editor-unset-link", ngImport: i0, template: `
444
611
  <button
445
612
  [attr.aria-label]="ariaLabel"
446
613
  [scTooltip]="ariaLabel"
447
- (click)="toggleCode()"
614
+ (click)="unsetLink()"
448
615
  sc-toggle
449
616
  variant="outline"
450
617
  type="button"
451
618
  >
452
- <svg-code-icon />
619
+ <svg-unlink-icon />
453
620
  <span class="sr-only">{{ ariaLabel }}</span>
454
621
  </button>
455
- `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: SvgCodeIcon, selector: "svg-code-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
622
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgUnlinkIcon, selector: "svg-unlink-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
456
623
  }
457
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionCode, decorators: [{
624
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScEditorUnsetLink, decorators: [{
458
625
  type: Component,
459
- args: [{ selector: 'sc-extension-code', imports: [ScTooltip, SvgCodeIcon, ScToggle], template: `
626
+ args: [{ selector: 'sc-editor-unset-link', imports: [ScTooltip, ScToggle, SvgUnlinkIcon], template: `
460
627
  <button
461
628
  [attr.aria-label]="ariaLabel"
462
629
  [scTooltip]="ariaLabel"
463
- (click)="toggleCode()"
630
+ (click)="unsetLink()"
464
631
  sc-toggle
465
632
  variant="outline"
466
633
  type="button"
467
634
  >
468
- <svg-code-icon />
635
+ <svg-unlink-icon />
469
636
  <span class="sr-only">{{ ariaLabel }}</span>
470
637
  </button>
471
638
  `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
472
639
  }], ctorParameters: () => [] });
473
640
 
474
- const allColors = {
475
- slate: {
476
- 50: '#f8fafc',
477
- 100: '#f1f5f9',
478
- 200: '#e2e8f0',
479
- 300: '#cbd5e1',
480
- 400: '#94a3b8',
481
- 500: '#64748b',
482
- 600: '#475569',
483
- 700: '#334155',
484
- 800: '#1e293b',
485
- 900: '#0f172a',
486
- 950: '#020617',
487
- },
488
- gray: {
489
- 50: '#f9fafb',
490
- 100: '#f3f4f6',
491
- 200: '#e5e7eb',
492
- 300: '#d1d5db',
493
- 400: '#9ca3af',
494
- 500: '#6b7280',
495
- 600: '#4b5563',
496
- 700: '#374151',
497
- 800: '#1f2937',
498
- 900: '#111827',
499
- 950: '#030712',
500
- },
501
- zinc: {
502
- 50: '#fafafa',
503
- 100: '#f4f4f5',
504
- 200: '#e4e4e7',
505
- 300: '#d4d4d8',
506
- 400: '#a1a1aa',
507
- 500: '#71717a',
508
- 600: '#52525b',
509
- 700: '#3f3f46',
510
- 800: '#27272a',
511
- 900: '#18181b',
512
- 950: '#09090b',
513
- },
514
- neutral: {
515
- 50: '#fafafa',
516
- 100: '#f5f5f5',
517
- 200: '#e5e5e5',
518
- 300: '#d4d4d4',
519
- 400: '#a3a3a3',
520
- 500: '#737373',
521
- 600: '#525252',
522
- 700: '#404040',
523
- 800: '#262626',
524
- 900: '#171717',
525
- 950: '#0a0a0a',
526
- },
527
- stone: {
528
- 50: '#fafaf9',
529
- 100: '#f5f5f4',
530
- 200: '#e7e5e4',
531
- 300: '#d6d3d1',
641
+ class ScEditorGroup {
642
+ class = input('');
643
+ //TODO change styles
644
+ _class = computed(() => cn('flex flex-wrap items-center gap-1 py-1', this.class()));
645
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScEditorGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
646
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScEditorGroup, isStandalone: true, selector: "sc-editor-group", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_class()" } }, ngImport: i0, template: `
647
+ <ng-content />
648
+ `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
649
+ }
650
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScEditorGroup, decorators: [{
651
+ type: Component,
652
+ args: [{ selector: 'sc-editor-group', imports: [], template: `
653
+ <ng-content />
654
+ `, host: {
655
+ '[class]': '_class()',
656
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
657
+ }] });
658
+
659
+ class ScEditorToolbar {
660
+ class = input('');
661
+ //TODO change styles to fit shadcn
662
+ _class = computed(() => cn('block border-b px-3 py-1 dark:border-gray-600', this.class()));
663
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScEditorToolbar, deps: [], target: i0.ɵɵFactoryTarget.Component });
664
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScEditorToolbar, isStandalone: true, selector: "sc-editor-toolbar", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_class()" } }, ngImport: i0, template: `
665
+ <ng-content />
666
+ `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
667
+ }
668
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScEditorToolbar, decorators: [{
669
+ type: Component,
670
+ args: [{ selector: 'sc-editor-toolbar', imports: [], template: `
671
+ <ng-content />
672
+ `, host: {
673
+ '[class]': '_class()',
674
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
675
+ }] });
676
+
677
+ class ScExtensionBlockquote {
678
+ ariaLabel = 'Toggle blockquote';
679
+ parent = inject(ScEditor, { host: true });
680
+ extensions = inject(ScExtensions);
681
+ constructor() {
682
+ this.extensions.blockquote.set(true);
683
+ }
684
+ get editor() {
685
+ return this.parent.editor;
686
+ }
687
+ toggleBlockquote() {
688
+ this.editor.chain().focus().toggleBlockquote().run();
689
+ }
690
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionBlockquote, deps: [], target: i0.ɵɵFactoryTarget.Component });
691
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScExtensionBlockquote, isStandalone: true, selector: "sc-extension-blockquote", ngImport: i0, template: `
692
+ <button
693
+ [attr.aria-label]="ariaLabel"
694
+ [scTooltip]="ariaLabel"
695
+ (click)="toggleBlockquote()"
696
+ sc-toggle
697
+ variant="outline"
698
+ type="button"
699
+ >
700
+ <svg-quote-icon />
701
+ <span class="sr-only">{{ ariaLabel }}</span>
702
+ </button>
703
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgQuoteIcon, selector: "svg-quote-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
704
+ }
705
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionBlockquote, decorators: [{
706
+ type: Component,
707
+ args: [{ selector: 'sc-extension-blockquote', imports: [ScTooltip, ScToggle, SvgQuoteIcon], template: `
708
+ <button
709
+ [attr.aria-label]="ariaLabel"
710
+ [scTooltip]="ariaLabel"
711
+ (click)="toggleBlockquote()"
712
+ sc-toggle
713
+ variant="outline"
714
+ type="button"
715
+ >
716
+ <svg-quote-icon />
717
+ <span class="sr-only">{{ ariaLabel }}</span>
718
+ </button>
719
+ `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
720
+ }], ctorParameters: () => [] });
721
+
722
+ class ScExtensionBold {
723
+ ariaLabel = 'Toggle Bold';
724
+ parent = inject(ScEditor, { host: true });
725
+ extensions = inject(ScExtensions);
726
+ constructor() {
727
+ this.extensions.bold.set(true);
728
+ }
729
+ get editor() {
730
+ return this.parent.editor;
731
+ }
732
+ toggleBold() {
733
+ this.editor.chain().focus().toggleBold().run();
734
+ }
735
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionBold, deps: [], target: i0.ɵɵFactoryTarget.Component });
736
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScExtensionBold, isStandalone: true, selector: "sc-extension-bold", ngImport: i0, template: `
737
+ <button
738
+ [attr.aria-label]="ariaLabel"
739
+ [scTooltip]="ariaLabel"
740
+ (click)="toggleBold()"
741
+ sc-toggle
742
+ variant="outline"
743
+ type="button"
744
+ >
745
+ <svg-bold-icon />
746
+ <span class="sr-only">{{ ariaLabel }}</span>
747
+ </button>
748
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgBoldIcon, selector: "svg-bold-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
749
+ }
750
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionBold, decorators: [{
751
+ type: Component,
752
+ args: [{ selector: 'sc-extension-bold', imports: [ScTooltip, ScToggle, SvgBoldIcon], template: `
753
+ <button
754
+ [attr.aria-label]="ariaLabel"
755
+ [scTooltip]="ariaLabel"
756
+ (click)="toggleBold()"
757
+ sc-toggle
758
+ variant="outline"
759
+ type="button"
760
+ >
761
+ <svg-bold-icon />
762
+ <span class="sr-only">{{ ariaLabel }}</span>
763
+ </button>
764
+ `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
765
+ }], ctorParameters: () => [] });
766
+
767
+ class ScExtensionBulletList {
768
+ ariaLabel = 'Toggle List';
769
+ parent = inject(ScEditor, { host: true });
770
+ extensions = inject(ScExtensions);
771
+ constructor() {
772
+ this.extensions.bulletList.set(true);
773
+ }
774
+ get editor() {
775
+ return this.parent.editor;
776
+ }
777
+ toggleBulletList() {
778
+ this.editor.chain().focus().toggleBulletList().run();
779
+ }
780
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionBulletList, deps: [], target: i0.ɵɵFactoryTarget.Component });
781
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScExtensionBulletList, isStandalone: true, selector: "sc-extension-bullet-list", ngImport: i0, template: `
782
+ <button
783
+ [attr.aria-label]="ariaLabel"
784
+ [scTooltip]="ariaLabel"
785
+ (click)="toggleBulletList()"
786
+ sc-toggle
787
+ variant="outline"
788
+ type="button"
789
+ >
790
+ <svg-list-icon />
791
+ <span class="sr-only">{{ ariaLabel }}</span>
792
+ </button>
793
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgListIcon, selector: "svg-list-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
794
+ }
795
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionBulletList, decorators: [{
796
+ type: Component,
797
+ args: [{ selector: 'sc-extension-bullet-list', imports: [ScTooltip, ScToggle, SvgListIcon], template: `
798
+ <button
799
+ [attr.aria-label]="ariaLabel"
800
+ [scTooltip]="ariaLabel"
801
+ (click)="toggleBulletList()"
802
+ sc-toggle
803
+ variant="outline"
804
+ type="button"
805
+ >
806
+ <svg-list-icon />
807
+ <span class="sr-only">{{ ariaLabel }}</span>
808
+ </button>
809
+ `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
810
+ }], ctorParameters: () => [] });
811
+
812
+ class ScExtensionCode {
813
+ ariaLabel = 'Format code';
814
+ parent = inject(ScEditor, { host: true });
815
+ extensions = inject(ScExtensions);
816
+ constructor() {
817
+ this.extensions.code.set(true);
818
+ }
819
+ get editor() {
820
+ return this.parent.editor;
821
+ }
822
+ toggleCode() {
823
+ this.editor.chain().focus().toggleCode().run();
824
+ }
825
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionCode, deps: [], target: i0.ɵɵFactoryTarget.Component });
826
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScExtensionCode, isStandalone: true, selector: "sc-extension-code", ngImport: i0, template: `
827
+ <button
828
+ [attr.aria-label]="ariaLabel"
829
+ [scTooltip]="ariaLabel"
830
+ (click)="toggleCode()"
831
+ sc-toggle
832
+ variant="outline"
833
+ type="button"
834
+ >
835
+ <svg-code-icon />
836
+ <span class="sr-only">{{ ariaLabel }}</span>
837
+ </button>
838
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: SvgCodeIcon, selector: "svg-code-icon", inputs: ["class"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
839
+ }
840
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionCode, decorators: [{
841
+ type: Component,
842
+ args: [{ selector: 'sc-extension-code', imports: [ScTooltip, SvgCodeIcon, ScToggle], template: `
843
+ <button
844
+ [attr.aria-label]="ariaLabel"
845
+ [scTooltip]="ariaLabel"
846
+ (click)="toggleCode()"
847
+ sc-toggle
848
+ variant="outline"
849
+ type="button"
850
+ >
851
+ <svg-code-icon />
852
+ <span class="sr-only">{{ ariaLabel }}</span>
853
+ </button>
854
+ `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
855
+ }], ctorParameters: () => [] });
856
+
857
+ const allColors = {
858
+ slate: {
859
+ 50: '#f8fafc',
860
+ 100: '#f1f5f9',
861
+ 200: '#e2e8f0',
862
+ 300: '#cbd5e1',
863
+ 400: '#94a3b8',
864
+ 500: '#64748b',
865
+ 600: '#475569',
866
+ 700: '#334155',
867
+ 800: '#1e293b',
868
+ 900: '#0f172a',
869
+ 950: '#020617',
870
+ },
871
+ gray: {
872
+ 50: '#f9fafb',
873
+ 100: '#f3f4f6',
874
+ 200: '#e5e7eb',
875
+ 300: '#d1d5db',
876
+ 400: '#9ca3af',
877
+ 500: '#6b7280',
878
+ 600: '#4b5563',
879
+ 700: '#374151',
880
+ 800: '#1f2937',
881
+ 900: '#111827',
882
+ 950: '#030712',
883
+ },
884
+ zinc: {
885
+ 50: '#fafafa',
886
+ 100: '#f4f4f5',
887
+ 200: '#e4e4e7',
888
+ 300: '#d4d4d8',
889
+ 400: '#a1a1aa',
890
+ 500: '#71717a',
891
+ 600: '#52525b',
892
+ 700: '#3f3f46',
893
+ 800: '#27272a',
894
+ 900: '#18181b',
895
+ 950: '#09090b',
896
+ },
897
+ neutral: {
898
+ 50: '#fafafa',
899
+ 100: '#f5f5f5',
900
+ 200: '#e5e5e5',
901
+ 300: '#d4d4d4',
902
+ 400: '#a3a3a3',
903
+ 500: '#737373',
904
+ 600: '#525252',
905
+ 700: '#404040',
906
+ 800: '#262626',
907
+ 900: '#171717',
908
+ 950: '#0a0a0a',
909
+ },
910
+ stone: {
911
+ 50: '#fafaf9',
912
+ 100: '#f5f5f4',
913
+ 200: '#e7e5e4',
914
+ 300: '#d6d3d1',
532
915
  400: '#a8a29e',
533
916
  500: '#78716c',
534
917
  600: '#57534e',
@@ -838,7 +1221,7 @@ class ScExtensionColor {
838
1221
  </button>
839
1222
  </div>
840
1223
  </ng-template>
841
- `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: CdkMenuTrigger, selector: "[cdkMenuTriggerFor]", inputs: ["cdkMenuTriggerFor", "cdkMenuPosition", "cdkMenuTriggerData"], outputs: ["cdkMenuOpened", "cdkMenuClosed"], exportAs: ["cdkMenuTriggerFor"] }, { kind: "directive", type: CdkMenu, selector: "[cdkMenu]", outputs: ["closed"], exportAs: ["cdkMenu"] }, { kind: "directive", type: CdkMenuItem, selector: "[cdkMenuItem]", inputs: ["cdkMenuItemDisabled", "cdkMenuitemTypeaheadLabel"], outputs: ["cdkMenuItemTriggered"], exportAs: ["cdkMenuItem"] }, { kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: SvgPaletteIcon, selector: "svg-palette-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1224
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: CdkMenuTrigger, selector: "[cdkMenuTriggerFor]", inputs: ["cdkMenuTriggerFor", "cdkMenuPosition", "cdkMenuTriggerData"], outputs: ["cdkMenuOpened", "cdkMenuClosed"], exportAs: ["cdkMenuTriggerFor"] }, { kind: "directive", type: CdkMenu, selector: "[cdkMenu]", outputs: ["closed"], exportAs: ["cdkMenu"] }, { kind: "directive", type: CdkMenuItem, selector: "[cdkMenuItem]", inputs: ["cdkMenuItemDisabled", "cdkMenuitemTypeaheadLabel"], outputs: ["cdkMenuItemTriggered"], exportAs: ["cdkMenuItem"] }, { kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: SvgPaletteIcon, selector: "svg-palette-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
842
1225
  }
843
1226
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionColor, decorators: [{
844
1227
  type: Component,
@@ -1655,7 +2038,7 @@ class ScExtensionHighlight {
1655
2038
  <svg-highlighter-icon />
1656
2039
  <span class="sr-only">{{ ariaLabel }}</span>
1657
2040
  </button>
1658
- `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgHighlighterIcon, selector: "svg-highlighter-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2041
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgHighlighterIcon, selector: "svg-highlighter-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1659
2042
  }
1660
2043
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionHighlight, decorators: [{
1661
2044
  type: Component,
@@ -1674,81 +2057,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
1674
2057
  `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
1675
2058
  }], ctorParameters: () => [] });
1676
2059
 
1677
- class ScExtensionHistory {
1678
- ariaLabel1 = 'Undo';
1679
- ariaLabel2 = 'Redo';
1680
- parent = inject(ScEditor, { host: true });
1681
- extensions = inject(ScExtensions);
1682
- constructor() {
1683
- this.extensions.history.set(true);
1684
- }
1685
- get editor() {
1686
- return this.parent.editor;
1687
- }
1688
- undo() {
1689
- this.editor.chain().focus().undo().run();
1690
- }
1691
- redo() {
1692
- this.editor.chain().focus().redo().run();
1693
- }
1694
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionHistory, deps: [], target: i0.ɵɵFactoryTarget.Component });
1695
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScExtensionHistory, isStandalone: true, selector: "sc-extension-history", ngImport: i0, template: `
1696
- <button
1697
- [attr.aria-label]="ariaLabel1"
1698
- [scTooltip]="ariaLabel1"
1699
- (click)="undo()"
1700
- sc-toggle
1701
- variant="outline"
1702
- type="button"
1703
- >
1704
- <svg-undo-icon />
1705
- <span class="sr-only">{{ ariaLabel1 }}</span>
1706
- </button>
1707
-
1708
- <button
1709
- [attr.aria-label]="ariaLabel2"
1710
- [scTooltip]="ariaLabel2"
1711
- (click)="redo()"
1712
- sc-toggle
1713
- variant="outline"
1714
- type="button"
1715
- >
1716
- <svg-redo-icon />
1717
- <span class="sr-only">{{ ariaLabel2 }}</span>
1718
- </button>
1719
- `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgUndoIcon, selector: "svg-undo-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: SvgRedoIcon, selector: "svg-redo-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1720
- }
1721
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionHistory, decorators: [{
1722
- type: Component,
1723
- args: [{ selector: 'sc-extension-history', imports: [ScTooltip, ScToggle, SvgUndoIcon, SvgRedoIcon], template: `
1724
- <button
1725
- [attr.aria-label]="ariaLabel1"
1726
- [scTooltip]="ariaLabel1"
1727
- (click)="undo()"
1728
- sc-toggle
1729
- variant="outline"
1730
- type="button"
1731
- >
1732
- <svg-undo-icon />
1733
- <span class="sr-only">{{ ariaLabel1 }}</span>
1734
- </button>
1735
-
1736
- <button
1737
- [attr.aria-label]="ariaLabel2"
1738
- [scTooltip]="ariaLabel2"
1739
- (click)="redo()"
1740
- sc-toggle
1741
- variant="outline"
1742
- type="button"
1743
- >
1744
- <svg-redo-icon />
1745
- <span class="sr-only">{{ ariaLabel2 }}</span>
1746
- </button>
1747
- `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
1748
- }], ctorParameters: () => [] });
1749
-
1750
- class ScExtensionHorizontalRule {
1751
- ariaLabel = 'Toggle Horizontal Rule';
2060
+ class ScExtensionHorizontalRule {
2061
+ ariaLabel = 'Toggle Horizontal Rule';
1752
2062
  parent = inject(ScEditor, { host: true });
1753
2063
  extensions = inject(ScExtensions);
1754
2064
  constructor() {
@@ -1773,7 +2083,7 @@ class ScExtensionHorizontalRule {
1773
2083
  <svg-minus-icon />
1774
2084
  <span class="sr-only">{{ ariaLabel }}</span>
1775
2085
  </button>
1776
- `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgMinusIcon, selector: "svg-minus-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2086
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgMinusIcon, selector: "svg-minus-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1777
2087
  }
1778
2088
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionHorizontalRule, decorators: [{
1779
2089
  type: Component,
@@ -2147,7 +2457,7 @@ class ScExtensionItalic {
2147
2457
  <svg-italic-icon />
2148
2458
  <span class="sr-only">{{ ariaLabel }}</span>
2149
2459
  </button>
2150
- `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgItalicIcon, selector: "svg-italic-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2460
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgItalicIcon, selector: "svg-italic-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2151
2461
  }
2152
2462
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionItalic, decorators: [{
2153
2463
  type: Component,
@@ -2327,7 +2637,7 @@ class ScExtensionLink {
2327
2637
  dialog = inject(Dialog);
2328
2638
  extensions = inject(ScExtensions);
2329
2639
  constructor() {
2330
- this.extensions.link.set(true);
2640
+ this.extensions.setLink.set(true);
2331
2641
  }
2332
2642
  get editor() {
2333
2643
  return this.parent.editor;
@@ -2344,9 +2654,6 @@ class ScExtensionLink {
2344
2654
  .run();
2345
2655
  });
2346
2656
  }
2347
- removeLink() {
2348
- this.editor.chain().focus().unsetLink().run();
2349
- }
2350
2657
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionLink, deps: [], target: i0.ɵɵFactoryTarget.Component });
2351
2658
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScExtensionLink, isStandalone: true, selector: "sc-extension-link", ngImport: i0, template: `
2352
2659
  <button
@@ -2374,31 +2681,6 @@ class ScExtensionLink {
2374
2681
  </svg>
2375
2682
  <span class="sr-only">Link</span>
2376
2683
  </button>
2377
-
2378
- <button
2379
- class="cursor-pointer rounded p-1.5 text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-600 dark:hover:text-white"
2380
- (click)="removeLink()"
2381
- type="button"
2382
- scTooltip="Remove link"
2383
- >
2384
- <svg
2385
- class="size-5"
2386
- aria-hidden="true"
2387
- xmlns="http://www.w3.org/2000/svg"
2388
- width="24"
2389
- height="24"
2390
- fill="none"
2391
- viewBox="0 0 24 24"
2392
- >
2393
- <path
2394
- stroke="currentColor"
2395
- stroke-linecap="round"
2396
- stroke-width="2"
2397
- d="M13.2 9.8a3.4 3.4 0 0 0-4.8 0L5 13.2A3.4 3.4 0 0 0 9.8 18l.3-.3m-.3-4.5a3.4 3.4 0 0 0 4.8 0L18 9.8A3.4 3.4 0 0 0 13.2 5l-1 1m7.4 14-1.8-1.8m0 0L16 16.4m1.8 1.8 1.8-1.8m-1.8 1.8L16 20"
2398
- />
2399
- </svg>
2400
- <span class="sr-only">Remove link</span>
2401
- </button>
2402
2684
  `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2403
2685
  }
2404
2686
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionLink, decorators: [{
@@ -2429,31 +2711,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
2429
2711
  </svg>
2430
2712
  <span class="sr-only">Link</span>
2431
2713
  </button>
2432
-
2433
- <button
2434
- class="cursor-pointer rounded p-1.5 text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-600 dark:hover:text-white"
2435
- (click)="removeLink()"
2436
- type="button"
2437
- scTooltip="Remove link"
2438
- >
2439
- <svg
2440
- class="size-5"
2441
- aria-hidden="true"
2442
- xmlns="http://www.w3.org/2000/svg"
2443
- width="24"
2444
- height="24"
2445
- fill="none"
2446
- viewBox="0 0 24 24"
2447
- >
2448
- <path
2449
- stroke="currentColor"
2450
- stroke-linecap="round"
2451
- stroke-width="2"
2452
- d="M13.2 9.8a3.4 3.4 0 0 0-4.8 0L5 13.2A3.4 3.4 0 0 0 9.8 18l.3-.3m-.3-4.5a3.4 3.4 0 0 0 4.8 0L18 9.8A3.4 3.4 0 0 0 13.2 5l-1 1m7.4 14-1.8-1.8m0 0L16 16.4m1.8 1.8 1.8-1.8m-1.8 1.8L16 20"
2453
- />
2454
- </svg>
2455
- <span class="sr-only">Remove link</span>
2456
- </button>
2457
2714
  `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
2458
2715
  }], ctorParameters: () => [] });
2459
2716
 
@@ -2483,7 +2740,7 @@ class ScExtensionOrderedList {
2483
2740
  <svg-list-ordered-icon />
2484
2741
  <span class="sr-only">{{ ariaLabel }}</span>
2485
2742
  </button>
2486
- `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgListOrderedIcon, selector: "svg-list-ordered-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2743
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgListOrderedIcon, selector: "svg-list-ordered-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2487
2744
  }
2488
2745
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionOrderedList, decorators: [{
2489
2746
  type: Component,
@@ -2660,7 +2917,7 @@ class ScExtensionStrike {
2660
2917
  <svg-strikethrough-icon />
2661
2918
  <span class="sr-only">{{ ariaLabel }}</span>
2662
2919
  </button>
2663
- `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: SvgStrikethroughIcon, selector: "svg-strikethrough-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2920
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: SvgStrikethroughIcon, selector: "svg-strikethrough-icon", inputs: ["class"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2664
2921
  }
2665
2922
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionStrike, decorators: [{
2666
2923
  type: Component,
@@ -2875,23 +3132,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
2875
3132
  `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
2876
3133
  }] });
2877
3134
 
2878
- class ScExtensionsSeparator {
2879
- class = input('');
2880
- classes = computed(() => cn('px-1', this.class()));
2881
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionsSeparator, deps: [], target: i0.ɵɵFactoryTarget.Component });
2882
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScExtensionsSeparator, isStandalone: true, selector: "sc-extensions-separator", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `
2883
- <span class="inline-block h-4 w-px bg-gray-300 dark:bg-gray-600"></span>
2884
- `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2885
- }
2886
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionsSeparator, decorators: [{
2887
- type: Component,
2888
- args: [{ selector: 'sc-extensions-separator', imports: [], template: `
2889
- <span class="inline-block h-4 w-px bg-gray-300 dark:bg-gray-600"></span>
2890
- `, host: {
2891
- '[class]': 'classes()',
2892
- }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
2893
- }] });
2894
-
2895
3135
  class ScExtensionTable {
2896
3136
  parent = inject(ScEditor, { host: true });
2897
3137
  dialog = inject(Dialog);
@@ -3014,7 +3254,7 @@ class ScExtensionTable {
3014
3254
  <span class="sr-only">Delete table</span>
3015
3255
  </button>
3016
3256
 
3017
- <sc-extensions-separator />
3257
+ <sc-separator class="h5" orientation="vertical" />
3018
3258
 
3019
3259
  <button
3020
3260
  class="cursor-pointer rounded p-1.5 text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-600 dark:hover:text-white"
@@ -3094,7 +3334,7 @@ class ScExtensionTable {
3094
3334
  <span class="sr-only">Remove column</span>
3095
3335
  </button>
3096
3336
 
3097
- <sc-extensions-separator />
3337
+ <sc-separator class="h5" orientation="vertical" />
3098
3338
 
3099
3339
  <button
3100
3340
  class="cursor-pointer rounded p-1.5 text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-600 dark:hover:text-white"
@@ -3252,7 +3492,7 @@ class ScExtensionTable {
3252
3492
  <span class="sr-only">Merge or split</span>
3253
3493
  </button>
3254
3494
 
3255
- <sc-extensions-separator />
3495
+ <sc-separator class="h5" orientation="vertical" />
3256
3496
 
3257
3497
  <button
3258
3498
  class="cursor-pointer rounded p-1.5 text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-600 dark:hover:text-white"
@@ -3357,7 +3597,7 @@ class ScExtensionTable {
3357
3597
  <span class="sr-only">Add cell attribute</span>
3358
3598
  </button>
3359
3599
 
3360
- <sc-extensions-separator />
3600
+ <sc-separator class="h5" orientation="vertical" />
3361
3601
 
3362
3602
  <button
3363
3603
  class="cursor-pointer rounded p-1.5 text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-600 dark:hover:text-white"
@@ -3435,11 +3675,11 @@ class ScExtensionTable {
3435
3675
  </svg>
3436
3676
  <span class="sr-only">Next cell</span>
3437
3677
  </button>
3438
- `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScExtensionsSeparator, selector: "sc-extensions-separator", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
3678
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScSeparator, selector: "sc-separator", inputs: ["orientation", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
3439
3679
  }
3440
3680
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionTable, decorators: [{
3441
3681
  type: Component,
3442
- args: [{ selector: 'sc-extension-table', imports: [ScTooltip, ScExtensionsSeparator], template: `
3682
+ args: [{ selector: 'sc-extension-table', imports: [ScTooltip, ScSeparator], template: `
3443
3683
  <button
3444
3684
  class="cursor-pointer rounded p-1.5 text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-600 dark:hover:text-white"
3445
3685
  (click)="insertTable()"
@@ -3491,7 +3731,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
3491
3731
  <span class="sr-only">Delete table</span>
3492
3732
  </button>
3493
3733
 
3494
- <sc-extensions-separator />
3734
+ <sc-separator class="h5" orientation="vertical" />
3495
3735
 
3496
3736
  <button
3497
3737
  class="cursor-pointer rounded p-1.5 text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-600 dark:hover:text-white"
@@ -3571,7 +3811,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
3571
3811
  <span class="sr-only">Remove column</span>
3572
3812
  </button>
3573
3813
 
3574
- <sc-extensions-separator />
3814
+ <sc-separator class="h5" orientation="vertical" />
3575
3815
 
3576
3816
  <button
3577
3817
  class="cursor-pointer rounded p-1.5 text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-600 dark:hover:text-white"
@@ -3729,7 +3969,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
3729
3969
  <span class="sr-only">Merge or split</span>
3730
3970
  </button>
3731
3971
 
3732
- <sc-extensions-separator />
3972
+ <sc-separator class="h5" orientation="vertical" />
3733
3973
 
3734
3974
  <button
3735
3975
  class="cursor-pointer rounded p-1.5 text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-600 dark:hover:text-white"
@@ -3834,7 +4074,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
3834
4074
  <span class="sr-only">Add cell attribute</span>
3835
4075
  </button>
3836
4076
 
3837
- <sc-extensions-separator />
4077
+ <sc-separator class="h5" orientation="vertical" />
3838
4078
 
3839
4079
  <button
3840
4080
  class="cursor-pointer rounded p-1.5 text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-600 dark:hover:text-white"
@@ -3915,107 +4155,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
3915
4155
  `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
3916
4156
  }], ctorParameters: () => [] });
3917
4157
 
3918
- class ScExtensionTextAlignAction {
3919
- ariaLabel1 = 'Align left';
3920
- ariaLabel2 = 'Align center';
3921
- ariaLabel3 = 'Align right';
3922
- parent = inject(ScEditor, { host: true });
3923
- extensions = inject(ScExtensions);
3924
- constructor() {
3925
- this.extensions.textAlign.set(true);
3926
- }
3927
- get editor() {
3928
- return this.parent.editor;
3929
- }
3930
- setLeftAlign() {
3931
- this.editor.chain().focus().setTextAlign('left').run();
3932
- }
3933
- setCenterAlign() {
3934
- this.editor.chain().focus().setTextAlign('center').run();
3935
- }
3936
- setRightAlign() {
3937
- this.editor.chain().focus().setTextAlign('right').run();
3938
- }
3939
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionTextAlignAction, deps: [], target: i0.ɵɵFactoryTarget.Component });
3940
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScExtensionTextAlignAction, isStandalone: true, selector: "sc-extension-text-align", ngImport: i0, template: `
3941
- <button
3942
- [attr.aria-label]="ariaLabel1"
3943
- [scTooltip]="ariaLabel1"
3944
- (click)="setLeftAlign()"
3945
- type="button"
3946
- sc-toggle
3947
- variant="outline"
3948
- >
3949
- <svg-align-left-icon />
3950
- <span class="sr-only">{{ ariaLabel1 }}</span>
3951
- </button>
3952
-
3953
- <button
3954
- [attr.aria-label]="ariaLabel2"
3955
- [scTooltip]="ariaLabel2"
3956
- (click)="setCenterAlign()"
3957
- type="button"
3958
- sc-toggle
3959
- variant="outline"
3960
- >
3961
- <svg-align-center-icon />
3962
- <span class="sr-only">{{ ariaLabel2 }}</span>
3963
- </button>
3964
-
3965
- <button
3966
- [attr.aria-label]="ariaLabel3"
3967
- [scTooltip]="ariaLabel3"
3968
- (click)="setRightAlign()"
3969
- type="button"
3970
- sc-toggle
3971
- variant="outline"
3972
- >
3973
- <svg-align-right-icon />
3974
- <span class="sr-only">{{ ariaLabel3 }}</span>
3975
- </button>
3976
- `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: SvgAlignLeftIcon, selector: "svg-align-left-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: SvgAlignRightIcon, selector: "svg-align-right-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: SvgAlignCenterIcon, selector: "svg-align-center-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
3977
- }
3978
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionTextAlignAction, decorators: [{
3979
- type: Component,
3980
- args: [{ selector: 'sc-extension-text-align', imports: [ScTooltip, SvgAlignLeftIcon, SvgAlignRightIcon, SvgAlignCenterIcon, ScToggle], template: `
3981
- <button
3982
- [attr.aria-label]="ariaLabel1"
3983
- [scTooltip]="ariaLabel1"
3984
- (click)="setLeftAlign()"
3985
- type="button"
3986
- sc-toggle
3987
- variant="outline"
3988
- >
3989
- <svg-align-left-icon />
3990
- <span class="sr-only">{{ ariaLabel1 }}</span>
3991
- </button>
3992
-
3993
- <button
3994
- [attr.aria-label]="ariaLabel2"
3995
- [scTooltip]="ariaLabel2"
3996
- (click)="setCenterAlign()"
3997
- type="button"
3998
- sc-toggle
3999
- variant="outline"
4000
- >
4001
- <svg-align-center-icon />
4002
- <span class="sr-only">{{ ariaLabel2 }}</span>
4003
- </button>
4004
-
4005
- <button
4006
- [attr.aria-label]="ariaLabel3"
4007
- [scTooltip]="ariaLabel3"
4008
- (click)="setRightAlign()"
4009
- type="button"
4010
- sc-toggle
4011
- variant="outline"
4012
- >
4013
- <svg-align-right-icon />
4014
- <span class="sr-only">{{ ariaLabel3 }}</span>
4015
- </button>
4016
- `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
4017
- }], ctorParameters: () => [] });
4018
-
4019
4158
  class ScExtensionTextStyle {
4020
4159
  parent = inject(ScEditor, { host: true });
4021
4160
  extensions = inject(ScExtensions);
@@ -4268,7 +4407,7 @@ class ScExtensionUnderline {
4268
4407
  <svg-underline-icon />
4269
4408
  <span class="sr-only">{{ ariaLabel }}</span>
4270
4409
  </button>
4271
- `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: SvgUnderlineIcon, selector: "svg-underline-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
4410
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: SvgUnderlineIcon, selector: "svg-underline-icon", inputs: ["class"] }, { kind: "component", type: ScToggle, selector: "button[sc-toggle]", inputs: ["variant", "size", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
4272
4411
  }
4273
4412
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionUnderline, decorators: [{
4274
4413
  type: Component,
@@ -4601,30 +4740,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
4601
4740
  `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
4602
4741
  }], ctorParameters: () => [] });
4603
4742
 
4604
- class ScExtensionsGroup {
4605
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionsGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
4606
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScExtensionsGroup, isStandalone: true, selector: "sc-extensions-group", ngImport: i0, template: `
4607
- <div class="flex flex-wrap items-center gap-1 py-1">
4608
- <ng-content />
4609
- </div>
4610
- `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
4611
- }
4612
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScExtensionsGroup, decorators: [{
4613
- type: Component,
4614
- args: [{ selector: 'sc-extensions-group', imports: [], template: `
4615
- <div class="flex flex-wrap items-center gap-1 py-1">
4616
- <ng-content />
4617
- </div>
4618
- `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
4619
- }] });
4620
-
4621
4743
  class ScEditor {
4622
4744
  _cdr = inject(ChangeDetectorRef);
4623
4745
  editorDiv = viewChild.required('editorDiv');
4624
4746
  _value = signal('');
4625
4747
  _isEditable = signal(true);
4626
4748
  class = input('');
4627
- classes = computed(() => cn('', this.class()));
4749
+ //TODO change styles
4750
+ classes = computed(() => cn('block w-full rounded-lg border border-gray-200 bg-gray-50 dark:border-gray-600 dark:bg-gray-700', this.class()));
4628
4751
  editorClass = input('');
4629
4752
  editorClasses = computed(() => cn('mx-auto focus:outline-none', scArticleClasses(), this.editorClass()));
4630
4753
  // eslint-disable-next-line @typescript-eslint/no-empty-function
@@ -4777,58 +4900,60 @@ class ScEditor {
4777
4900
  multi: true,
4778
4901
  },
4779
4902
  ], viewQueries: [{ propertyName: "editorDiv", first: true, predicate: ["editorDiv"], descendants: true, isSignal: true }], ngImport: i0, template: `
4780
- <div
4781
- class="w-full rounded-lg border border-gray-200 bg-gray-50 dark:border-gray-600 dark:bg-gray-700"
4782
- >
4783
- <div class="border-b px-3 py-1 dark:border-gray-600">
4784
- <sc-extensions-group>
4785
- <sc-extension-history />
4786
- <sc-extensions-separator />
4787
- <sc-extension-bold />
4788
- <sc-extension-italic />
4789
- <sc-extension-underline />
4790
- <sc-extension-highlight />
4791
- <sc-extension-link />
4792
- <sc-extension-text-style />
4793
- <sc-extension-color />
4794
- <sc-extension-font-family />
4795
- <sc-extensions-separator />
4796
- <sc-extension-text-align />
4797
- </sc-extensions-group>
4798
-
4799
- <sc-extensions-group>
4800
- <sc-extension-heading />
4801
- <sc-extension-paragraph />
4802
- <sc-extensions-separator />
4803
- <sc-extension-image />
4804
- <sc-extension-youtube />
4805
- <sc-extension-bullet-list />
4806
- <sc-extension-ordered-list />
4807
- <sc-extension-blockquote />
4808
- <sc-extensions-separator />
4809
- <sc-extension-strike />
4810
- <sc-extension-horizontal-rule />
4811
- <sc-extension-code />
4812
- </sc-extensions-group>
4813
-
4814
- <sc-extensions-group>
4815
- <sc-extension-table />
4816
- </sc-extensions-group>
4817
- </div>
4818
-
4819
- <div class="rounded-b-lg bg-white px-4 py-2 dark:bg-gray-800">
4820
- <label class="sr-only" for="wysiwyg-example">Publish post</label>
4821
- <div
4822
- class="block w-full border-0 bg-white px-0 text-sm text-gray-800 focus:ring-0 dark:bg-gray-800 dark:text-white dark:placeholder:text-gray-400"
4823
- #editorDiv
4824
- ></div>
4825
- </div>
4903
+ <sc-editor-toolbar>
4904
+ <sc-editor-group>
4905
+ <sc-editor-undo />
4906
+ <sc-editor-redo />
4907
+ <sc-separator class="h-5" orientation="vertical" />
4908
+ <sc-extension-bold />
4909
+ <sc-extension-italic />
4910
+ <sc-extension-underline />
4911
+ <sc-extension-highlight />
4912
+ <sc-extension-text-style />
4913
+ <sc-extension-color />
4914
+ <sc-extension-font-family />
4915
+ <sc-extension-link />
4916
+ <sc-editor-unset-link />
4917
+ <sc-separator class="h-5" orientation="vertical" />
4918
+ <sc-editor-text-align-left />
4919
+ <sc-editor-text-align-center />
4920
+ <sc-editor-text-align-right />
4921
+ </sc-editor-group>
4922
+
4923
+ <sc-editor-group>
4924
+ <sc-extension-heading />
4925
+ <sc-extension-paragraph />
4926
+ <sc-separator class="h-5" orientation="vertical" />
4927
+ <sc-extension-image />
4928
+ <sc-extension-youtube />
4929
+ <sc-extension-bullet-list />
4930
+ <sc-extension-ordered-list />
4931
+ <sc-extension-blockquote />
4932
+ <sc-separator class="h-5" orientation="vertical" />
4933
+ <sc-extension-strike />
4934
+ <sc-extension-horizontal-rule />
4935
+ <sc-extension-code />
4936
+ </sc-editor-group>
4937
+
4938
+ <sc-editor-group>
4939
+ <sc-extension-table />
4940
+ </sc-editor-group>
4941
+ </sc-editor-toolbar>
4942
+
4943
+ <div class="rounded-b-lg bg-white px-4 py-2 dark:bg-gray-800">
4944
+ <label class="sr-only" for="wysiwyg-example">Publish post</label>
4945
+ <div
4946
+ class="block w-full border-0 bg-white px-0 text-sm text-gray-800 focus:ring-0 dark:bg-gray-800 dark:text-white dark:placeholder:text-gray-400"
4947
+ #editorDiv
4948
+ ></div>
4826
4949
  </div>
4827
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScExtensionHighlight, selector: "sc-extension-highlight" }, { kind: "component", type: ScExtensionColor, selector: "sc-extension-color" }, { kind: "component", type: ScExtensionBold, selector: "sc-extension-bold" }, { kind: "component", type: ScExtensionUnderline, selector: "sc-extension-underline" }, { kind: "component", type: ScExtensionYoutube, selector: "sc-extension-youtube" }, { kind: "component", type: ScExtensionImage, selector: "sc-extension-image" }, { kind: "component", type: ScExtensionFontFamily, selector: "sc-extension-font-family" }, { kind: "component", type: ScExtensionLink, selector: "sc-extension-link" }, { kind: "component", type: ScExtensionItalic, selector: "sc-extension-italic" }, { kind: "component", type: ScExtensionBlockquote, selector: "sc-extension-blockquote" }, { kind: "component", type: ScExtensionBulletList, selector: "sc-extension-bullet-list" }, { kind: "component", type: ScExtensionOrderedList, selector: "sc-extension-ordered-list" }, { kind: "component", type: ScExtensionTextAlignAction, selector: "sc-extension-text-align" }, { kind: "component", type: ScExtensionTextStyle, selector: "sc-extension-text-style" }, { kind: "component", type: ScExtensionParagraph, selector: "sc-extension-paragraph" }, { kind: "component", type: ScExtensionHistory, selector: "sc-extension-history" }, { kind: "component", type: ScExtensionsSeparator, selector: "sc-extensions-separator", inputs: ["class"] }, { kind: "component", type: ScExtensionsGroup, selector: "sc-extensions-group" }, { kind: "component", type: ScExtensionStrike, selector: "sc-extension-strike" }, { kind: "component", type: ScExtensionHorizontalRule, selector: "sc-extension-horizontal-rule" }, { kind: "component", type: ScExtensionCode, selector: "sc-extension-code" }, { kind: "component", type: ScExtensionHeading, selector: "sc-extension-heading" }, { kind: "component", type: ScExtensionTable, selector: "sc-extension-table" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
4950
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScEditorUndo, selector: "sc-editor-undo" }, { kind: "component", type: ScEditorRedo, selector: "sc-editor-redo" }, { kind: "component", type: ScExtensionHighlight, selector: "sc-extension-highlight" }, { kind: "component", type: ScExtensionColor, selector: "sc-extension-color" }, { kind: "component", type: ScExtensionBold, selector: "sc-extension-bold" }, { kind: "component", type: ScExtensionUnderline, selector: "sc-extension-underline" }, { kind: "component", type: ScExtensionYoutube, selector: "sc-extension-youtube" }, { kind: "component", type: ScExtensionImage, selector: "sc-extension-image" }, { kind: "component", type: ScExtensionFontFamily, selector: "sc-extension-font-family" }, { kind: "component", type: ScExtensionLink, selector: "sc-extension-link" }, { kind: "component", type: ScExtensionItalic, selector: "sc-extension-italic" }, { kind: "component", type: ScExtensionBlockquote, selector: "sc-extension-blockquote" }, { kind: "component", type: ScExtensionBulletList, selector: "sc-extension-bullet-list" }, { kind: "component", type: ScExtensionOrderedList, selector: "sc-extension-ordered-list" }, { kind: "component", type: ScExtensionTextStyle, selector: "sc-extension-text-style" }, { kind: "component", type: ScExtensionParagraph, selector: "sc-extension-paragraph" }, { kind: "component", type: ScSeparator, selector: "sc-separator", inputs: ["orientation", "class"] }, { kind: "component", type: ScEditorGroup, selector: "sc-editor-group", inputs: ["class"] }, { kind: "component", type: ScExtensionStrike, selector: "sc-extension-strike" }, { kind: "component", type: ScExtensionHorizontalRule, selector: "sc-extension-horizontal-rule" }, { kind: "component", type: ScExtensionCode, selector: "sc-extension-code" }, { kind: "component", type: ScExtensionHeading, selector: "sc-extension-heading" }, { kind: "component", type: ScExtensionTable, selector: "sc-extension-table" }, { kind: "component", type: ScEditorToolbar, selector: "sc-editor-toolbar", inputs: ["class"] }, { kind: "component", type: ScEditorUnsetLink, selector: "sc-editor-unset-link" }, { kind: "component", type: ScEditorTextAlignRight, selector: "sc-editor-text-align-right" }, { kind: "component", type: ScEditorTextAlignLeft, selector: "sc-editor-text-align-left" }, { kind: "component", type: ScEditorTextAlignCenter, selector: "sc-editor-text-align-center" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
4828
4951
  }
4829
4952
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScEditor, decorators: [{
4830
4953
  type: Component,
4831
4954
  args: [{ selector: 'sc-editor', imports: [
4955
+ ScEditorUndo,
4956
+ ScEditorRedo,
4832
4957
  ScExtensionHighlight,
4833
4958
  ScExtensionColor,
4834
4959
  ScExtensionBold,
@@ -4841,64 +4966,67 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
4841
4966
  ScExtensionBlockquote,
4842
4967
  ScExtensionBulletList,
4843
4968
  ScExtensionOrderedList,
4844
- ScExtensionTextAlignAction,
4845
4969
  ScExtensionTextStyle,
4846
4970
  ScExtensionParagraph,
4847
- ScExtensionHistory,
4848
- ScExtensionsSeparator,
4849
- ScExtensionsGroup,
4971
+ ScSeparator,
4972
+ ScEditorGroup,
4850
4973
  ScExtensionStrike,
4851
4974
  ScExtensionHorizontalRule,
4852
4975
  ScExtensionCode,
4853
4976
  ScExtensionHeading,
4854
4977
  ScExtensionTable,
4978
+ ScEditorToolbar,
4979
+ ScEditorUnsetLink,
4980
+ ScEditorTextAlignRight,
4981
+ ScEditorTextAlignLeft,
4982
+ ScEditorTextAlignCenter,
4855
4983
  ], template: `
4856
- <div
4857
- class="w-full rounded-lg border border-gray-200 bg-gray-50 dark:border-gray-600 dark:bg-gray-700"
4858
- >
4859
- <div class="border-b px-3 py-1 dark:border-gray-600">
4860
- <sc-extensions-group>
4861
- <sc-extension-history />
4862
- <sc-extensions-separator />
4863
- <sc-extension-bold />
4864
- <sc-extension-italic />
4865
- <sc-extension-underline />
4866
- <sc-extension-highlight />
4867
- <sc-extension-link />
4868
- <sc-extension-text-style />
4869
- <sc-extension-color />
4870
- <sc-extension-font-family />
4871
- <sc-extensions-separator />
4872
- <sc-extension-text-align />
4873
- </sc-extensions-group>
4874
-
4875
- <sc-extensions-group>
4876
- <sc-extension-heading />
4877
- <sc-extension-paragraph />
4878
- <sc-extensions-separator />
4879
- <sc-extension-image />
4880
- <sc-extension-youtube />
4881
- <sc-extension-bullet-list />
4882
- <sc-extension-ordered-list />
4883
- <sc-extension-blockquote />
4884
- <sc-extensions-separator />
4885
- <sc-extension-strike />
4886
- <sc-extension-horizontal-rule />
4887
- <sc-extension-code />
4888
- </sc-extensions-group>
4889
-
4890
- <sc-extensions-group>
4891
- <sc-extension-table />
4892
- </sc-extensions-group>
4893
- </div>
4894
-
4895
- <div class="rounded-b-lg bg-white px-4 py-2 dark:bg-gray-800">
4896
- <label class="sr-only" for="wysiwyg-example">Publish post</label>
4897
- <div
4898
- class="block w-full border-0 bg-white px-0 text-sm text-gray-800 focus:ring-0 dark:bg-gray-800 dark:text-white dark:placeholder:text-gray-400"
4899
- #editorDiv
4900
- ></div>
4901
- </div>
4984
+ <sc-editor-toolbar>
4985
+ <sc-editor-group>
4986
+ <sc-editor-undo />
4987
+ <sc-editor-redo />
4988
+ <sc-separator class="h-5" orientation="vertical" />
4989
+ <sc-extension-bold />
4990
+ <sc-extension-italic />
4991
+ <sc-extension-underline />
4992
+ <sc-extension-highlight />
4993
+ <sc-extension-text-style />
4994
+ <sc-extension-color />
4995
+ <sc-extension-font-family />
4996
+ <sc-extension-link />
4997
+ <sc-editor-unset-link />
4998
+ <sc-separator class="h-5" orientation="vertical" />
4999
+ <sc-editor-text-align-left />
5000
+ <sc-editor-text-align-center />
5001
+ <sc-editor-text-align-right />
5002
+ </sc-editor-group>
5003
+
5004
+ <sc-editor-group>
5005
+ <sc-extension-heading />
5006
+ <sc-extension-paragraph />
5007
+ <sc-separator class="h-5" orientation="vertical" />
5008
+ <sc-extension-image />
5009
+ <sc-extension-youtube />
5010
+ <sc-extension-bullet-list />
5011
+ <sc-extension-ordered-list />
5012
+ <sc-extension-blockquote />
5013
+ <sc-separator class="h-5" orientation="vertical" />
5014
+ <sc-extension-strike />
5015
+ <sc-extension-horizontal-rule />
5016
+ <sc-extension-code />
5017
+ </sc-editor-group>
5018
+
5019
+ <sc-editor-group>
5020
+ <sc-extension-table />
5021
+ </sc-editor-group>
5022
+ </sc-editor-toolbar>
5023
+
5024
+ <div class="rounded-b-lg bg-white px-4 py-2 dark:bg-gray-800">
5025
+ <label class="sr-only" for="wysiwyg-example">Publish post</label>
5026
+ <div
5027
+ class="block w-full border-0 bg-white px-0 text-sm text-gray-800 focus:ring-0 dark:bg-gray-800 dark:text-white dark:placeholder:text-gray-400"
5028
+ #editorDiv
5029
+ ></div>
4902
5030
  </div>
4903
5031
  `, host: {
4904
5032
  '[class]': 'classes()',
@@ -4911,7 +5039,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
4911
5039
  ] }]
4912
5040
  }], ctorParameters: () => [] });
4913
5041
 
4914
- const buttonVariants = cva('inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_.svg]:pointer-events-none [&_.svg]:size-4 [&_.svg]:shrink-0', {
5042
+ const buttonVariants = cva('inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', {
4915
5043
  variants: {
4916
5044
  variant: {
4917
5045
  primary: 'bg-primary text-primary-foreground hover:bg-primary/90',
@@ -4936,10 +5064,15 @@ const buttonVariants = cva('inline-flex items-center justify-center gap-2 whites
4936
5064
  class ScButton {
4937
5065
  variant = input('primary');
4938
5066
  size = input('default');
4939
- class = input('');
4940
- classes = computed(() => cn(buttonVariants({ variant: this.variant(), size: this.size() }), this.class()));
5067
+ classInput = input('', {
5068
+ alias: 'class',
5069
+ });
5070
+ class = computed(() => cn(buttonVariants({ variant: this.variant(), size: this.size() }), this.classInput()));
5071
+ disabled = input(false, {
5072
+ transform: booleanAttribute,
5073
+ });
4941
5074
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
4942
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScButton, isStandalone: true, selector: "button[sc-button], a[sc-button]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `
5075
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScButton, isStandalone: true, selector: "button[sc-button], a[sc-button]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "class()", "attr.data-disabled": "disabled()" } }, ngImport: i0, template: `
4943
5076
  <ng-content />
4944
5077
  `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
4945
5078
  }
@@ -4948,81 +5081,114 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
4948
5081
  args: [{ selector: 'button[sc-button], a[sc-button]', imports: [], template: `
4949
5082
  <ng-content />
4950
5083
  `, host: {
4951
- '[class]': 'classes()',
4952
- }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
4953
- }] });
4954
-
4955
- class ScListbox {
4956
- class = input('');
4957
- classes = computed(() => cn('relative z-50 max-h-96 w-full min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', this.class()));
4958
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScListbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
4959
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScListbox, isStandalone: true, selector: "ul[sc-listbox]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `
4960
- <ng-content />
4961
- `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
4962
- }
4963
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScListbox, decorators: [{
4964
- type: Component,
4965
- args: [{ selector: 'ul[sc-listbox]', imports: [], template: `
4966
- <ng-content />
4967
- `, host: {
4968
- '[class]': 'classes()',
5084
+ '[class]': 'class()',
5085
+ '[attr.data-disabled]': 'disabled()',
4969
5086
  }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
4970
5087
  }] });
4971
5088
 
4972
- class ScListboxOption {
4973
- class = input('');
4974
- classes = computed(() => cn('relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', this.class()));
4975
- isSelected = input.required();
4976
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScListboxOption, deps: [], target: i0.ɵɵFactoryTarget.Component });
4977
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ScListboxOption, isStandalone: true, selector: "li[sc-listbox-option]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, isSelected: { classPropertyName: "isSelected", publicName: "isSelected", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `
4978
- @if (isSelected()) {
4979
- <svg-check-icon class="absolute left-2 flex size-4 items-center justify-center" />
4980
- }
4981
-
4982
- <ng-content />
4983
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgCheckIcon, selector: "svg-check-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
5089
+ class ScSelectState {
5090
+ //1 undefined for init
5091
+ //2 selected value
5092
+ //3 null nothing selected
5093
+ value = signal(undefined);
5094
+ disabled = signal(false);
5095
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScSelectState, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5096
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScSelectState });
4984
5097
  }
4985
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScListboxOption, decorators: [{
4986
- type: Component,
4987
- args: [{ selector: 'li[sc-listbox-option]', imports: [SvgCheckIcon], template: `
4988
- @if (isSelected()) {
4989
- <svg-check-icon class="absolute left-2 flex size-4 items-center justify-center" />
4990
- }
4991
-
4992
- <ng-content />
4993
- `, host: {
4994
- '[class]': 'classes()',
4995
- }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
5098
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScSelectState, decorators: [{
5099
+ type: Injectable
4996
5100
  }] });
4997
5101
 
4998
5102
  class ScOption {
5103
+ state = inject(ScSelectState);
5104
+ /** The unique ID of the option. */
5105
+ id = signal(inject(_IdGenerator).getId('sc-option-'));
5106
+ classInput = input('', {
5107
+ alias: 'class',
5108
+ });
5109
+ class = computed(() => cn('relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[active=true]:bg-accent data-[active=true]:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50', this.classInput()));
5110
+ isSelected = computed(() => this.value() === this.state.value());
4999
5111
  value = input.required();
5000
5112
  labelEl = viewChild.required('label');
5001
5113
  label = computed(() => {
5002
- return this.labelEl().nativeElement.textContent?.trim();
5114
+ return this.labelEl().nativeElement.textContent?.trim() ?? '';
5003
5115
  });
5004
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScOption, deps: [], target: i0.ɵɵFactoryTarget.Component });
5005
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.0.5", type: ScOption, isStandalone: true, selector: "sc-option", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "labelEl", first: true, predicate: ["label"], descendants: true, isSignal: true }], ngImport: i0, template: `
5006
- <span #label>
5007
- <ng-content />
5008
- </span>
5009
- `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
5010
- }
5011
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScOption, decorators: [{
5012
- type: Component,
5013
- args: [{ selector: 'sc-option', imports: [], template: `
5014
- <span #label>
5015
- <ng-content />
5016
- </span>
5017
- `, host: {}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
5018
- }] });
5019
-
5020
- class ScSelect {
5021
- static nextId = 0;
5022
- id = 0;
5023
- _getPanelId() {
5024
- return `panel-${this.id}`;
5116
+ element = inject(ElementRef);
5117
+ /** Gets the host DOM element. */
5118
+ getHostElement() {
5119
+ return this.element.nativeElement;
5120
+ }
5121
+ active = signal(false);
5122
+ setActiveStyles() {
5123
+ this.active.set(true);
5124
+ }
5125
+ setInactiveStyles() {
5126
+ this.active.set(false);
5127
+ }
5128
+ disabled;
5129
+ getLabel() {
5130
+ return this.label();
5131
+ }
5132
+ disabledByInput = input(false, {
5133
+ alias: 'disabled',
5134
+ transform: booleanAttribute,
5135
+ });
5136
+ _disabled = computed(() => this.disabledByInput() || this.disabled || this.state.disabled());
5137
+ toggle() {
5138
+ if (this.isSelected()) {
5139
+ this.deselect();
5140
+ }
5141
+ else {
5142
+ this.select();
5143
+ }
5144
+ }
5145
+ select() {
5146
+ if (this._disabled()) {
5147
+ return;
5148
+ }
5149
+ this.state.value.set(this.value());
5150
+ }
5151
+ deselect() {
5152
+ if (this._disabled()) {
5153
+ return;
5154
+ }
5155
+ this.state.value.set(null);
5156
+ }
5157
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScOption, deps: [], target: i0.ɵɵFactoryTarget.Component });
5158
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ScOption, isStandalone: true, selector: "sc-option", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabledByInput: { classPropertyName: "disabledByInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseover": "setActiveStyles()", "mouseleave": "setInactiveStyles()", "click": "toggle()" }, properties: { "id": "id()", "class": "class()", "attr.data-disabled": "_disabled()", "attr.data-active": "active()" } }, viewQueries: [{ propertyName: "labelEl", first: true, predicate: ["label"], descendants: true, isSignal: true }], ngImport: i0, template: `
5159
+ @if (isSelected()) {
5160
+ <svg-check-icon class="absolute left-2 flex size-4 items-center justify-center" />
5161
+ }
5162
+
5163
+ <span #label>
5164
+ <ng-content />
5165
+ </span>
5166
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgCheckIcon, selector: "svg-check-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
5167
+ }
5168
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScOption, decorators: [{
5169
+ type: Component,
5170
+ args: [{ selector: 'sc-option', imports: [SvgCheckIcon], template: `
5171
+ @if (isSelected()) {
5172
+ <svg-check-icon class="absolute left-2 flex size-4 items-center justify-center" />
5025
5173
  }
5174
+
5175
+ <span #label>
5176
+ <ng-content />
5177
+ </span>
5178
+ `, host: {
5179
+ '[id]': 'id()',
5180
+ '[class]': 'class()',
5181
+ '[attr.data-disabled]': '_disabled()',
5182
+ '[attr.data-active]': 'active()',
5183
+ '(mouseover)': 'setActiveStyles()',
5184
+ '(mouseleave)': 'setInactiveStyles()',
5185
+ '(click)': 'toggle()',
5186
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
5187
+ }] });
5188
+
5189
+ class ScSelect {
5190
+ state = inject(ScSelectState);
5191
+ panelId = inject(_IdGenerator).getId('sc-select-panel-');
5026
5192
  _cdr = inject(ChangeDetectorRef);
5027
5193
  _overlay = inject(Overlay);
5028
5194
  _dir = inject(Directionality, { optional: true });
@@ -5032,23 +5198,48 @@ class ScSelect {
5032
5198
  _panelTemplate = viewChild.required('panelTemplate');
5033
5199
  placeholder = input('');
5034
5200
  isOpen = signal(false);
5035
- constructor() {
5036
- this.id = ++ScSelect.nextId;
5037
- }
5038
5201
  options = contentChildren(ScOption);
5202
+ activeDescendant = signal(null);
5203
+ constructor() {
5204
+ effect(() => {
5205
+ //init
5206
+ if (this.state.value() === undefined) {
5207
+ this.state.value.set(this.value());
5208
+ }
5209
+ });
5210
+ effect(() => {
5211
+ if (this.value() !== this.state.value()) {
5212
+ this.setValue(this.state.value());
5213
+ }
5214
+ });
5215
+ effect(() => {
5216
+ this.syncSelectedState(this.value(), this.options(), this.options()[0]);
5217
+ });
5218
+ this.keyManager.change.subscribe(() => this.activeDescendant.set(this.keyManager.activeItem?.id() ?? null));
5219
+ }
5220
+ /**
5221
+ * Scrolls an option into view.
5222
+ * @param option Option to be scrolled into view.
5223
+ * @param position Position to which to align the option relative to the scrollable container.
5224
+ */
5225
+ scrollOptionIntoView(option, position) {
5226
+ option.getHostElement().scrollIntoView({ block: position, inline: position });
5227
+ }
5228
+ injector = inject(Injector);
5229
+ keyManager = new ActiveDescendantKeyManager(this.options, this.injector)
5230
+ .withHomeAndEnd(true)
5231
+ .withPageUpDown(true)
5232
+ .withVerticalOrientation(true);
5039
5233
  value = model(undefined);
5040
5234
  isDisabled = signal(false);
5041
5235
  writeValue(value) {
5042
5236
  this.value.set(value);
5043
5237
  }
5044
- handleValueChange(v) {
5045
- this.setValue(v[0]);
5046
- this.close();
5047
- }
5048
5238
  setValue(value) {
5049
5239
  this.value.set(value);
5050
5240
  this._onChange(value);
5051
5241
  this._cdr.markForCheck();
5242
+ this.close();
5052
5243
  }
5053
5244
  // eslint-disable-next-line @typescript-eslint/no-empty-function
5054
5245
  _onChange = () => { };
@@ -5130,39 +5321,84 @@ class ScSelect {
5130
5321
  }
5131
5322
  close() {
5132
5323
  if (this.isOpen()) {
5324
+ this.focusOnTrigger();
5133
5325
  this.isOpen.set(false);
5134
5326
  this._overlayRef?.detach();
5135
5327
  }
5136
5328
  }
5329
+ focusOnTrigger() {
5330
+ this.scSelectTrigger().nativeElement.focus();
5331
+ }
5332
+ /**
5333
+ * Synchronizes the internal state of the component based on a specific selected date.
5334
+ * @param value Currently selected date.
5335
+ * @param options Options rendered out in the timepicker.
5336
+ * @param fallback Option to set as active if no option is selected.
5337
+ */
5338
+ syncSelectedState(value, options, fallback) {
5339
+ let hasSelected = false;
5340
+ for (const option of options) {
5341
+ if (value && option.value() === value) {
5342
+ this.scrollOptionIntoView(option, 'center');
5343
+ untracked(() => this.keyManager.setActiveItem(option));
5344
+ hasSelected = true;
5345
+ }
5346
+ }
5347
+ // If no option was selected, we need to reset the key manager since
5348
+ // it might be holding onto an option that no longer exists.
5349
+ if (!hasSelected) {
5350
+ if (fallback) {
5351
+ untracked(() => this.keyManager.setActiveItem(fallback));
5352
+ this.scrollOptionIntoView(fallback, 'center');
5353
+ }
5354
+ else {
5355
+ untracked(() => this.keyManager.setActiveItem(-1));
5356
+ }
5357
+ }
5358
+ }
5137
5359
  /** Handles keyboard events while the overlay is open. */
5138
5360
  _handleKeydown(event) {
5139
- const keyCode = event.keyCode;
5140
- if (keyCode === TAB) {
5361
+ const key = event.key;
5362
+ if (key === 'Tab') {
5141
5363
  this.close();
5142
5364
  }
5143
- else if (keyCode === ESCAPE && !hasModifierKey(event)) {
5365
+ else if (key === 'Escape' && !hasModifierKey(event)) {
5144
5366
  event.preventDefault();
5145
5367
  this.close();
5146
5368
  }
5147
- else if (keyCode === ENTER) {
5148
- //TODO for me it's mean it's was selected
5149
- this.close();
5369
+ else if (key === 'Enter') {
5370
+ event.preventDefault();
5371
+ if (this.keyManager.activeItem) {
5372
+ this.setValue(this.keyManager.activeItem.value() ?? '');
5373
+ }
5374
+ else {
5375
+ this.close();
5376
+ }
5377
+ }
5378
+ else {
5379
+ const previousActive = this.keyManager.activeItem;
5380
+ this.keyManager.onKeydown(event);
5381
+ const currentActive = this.keyManager.activeItem;
5382
+ if (currentActive && currentActive !== previousActive) {
5383
+ this.scrollOptionIntoView(currentActive, 'nearest');
5384
+ }
5150
5385
  }
5151
5386
  }
5152
5387
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
5153
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ScSelect, isStandalone: true, selector: "sc-select", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
5388
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.0.5", type: ScSelect, isStandalone: true, selector: "sc-select", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
5154
5389
  {
5155
5390
  provide: NG_VALUE_ACCESSOR,
5156
5391
  useExisting: forwardRef(() => ScSelect),
5157
5392
  multi: true,
5158
5393
  },
5394
+ ScSelectState,
5159
5395
  ], queries: [{ propertyName: "options", predicate: ScOption, isSignal: true }], viewQueries: [{ propertyName: "scSelectTrigger", first: true, predicate: ["scSelectTrigger"], descendants: true, isSignal: true }, { propertyName: "_panelTemplate", first: true, predicate: ["panelTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: `
5160
5396
  <button
5161
5397
  class="flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1"
5162
5398
  #scSelectTrigger
5163
5399
  [disabled]="isDisabled()"
5164
5400
  [attr.aria-expanded]="_isExpanded()"
5165
- [attr.aria-controls]="_getPanelId()"
5401
+ [attr.aria-controls]="panelId"
5166
5402
  (click)="open()"
5167
5403
  type="button"
5168
5404
  role="combobox"
@@ -5173,43 +5409,24 @@ class ScSelect {
5173
5409
 
5174
5410
  <ng-template #panelTemplate>
5175
5411
  <ul
5176
- [id]="_getPanelId()"
5177
- [cdkTrapFocusAutoCapture]="true"
5178
- (cdkListboxValueChange)="handleValueChange($event.value)"
5179
- sc-listbox
5180
- cdkListbox
5181
- cdkTrapFocus
5412
+ class="relative z-50 max-h-96 w-full min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"
5413
+ [id]="panelId"
5414
+ role="listbox"
5182
5415
  >
5183
- @for (option of options(); track $index) {
5184
- <li
5185
- [isSelected]="option.value() === this.value()"
5186
- [cdkOption]="option.value()"
5187
- sc-listbox-option
5188
- >
5189
- {{ option.label() }}
5190
- </li>
5191
- }
5416
+ <ng-content />
5192
5417
  </ul>
5193
5418
  </ng-template>
5194
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgChevronDownIcon, selector: "svg-chevron-down-icon", inputs: ["class", "svgClass"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "component", type: ScListbox, selector: "ul[sc-listbox]", inputs: ["class"] }, { kind: "component", type: ScListboxOption, selector: "li[sc-listbox-option]", inputs: ["class", "isSelected"] }, { kind: "directive", type: CdkOption, selector: "[cdkOption]", inputs: ["id", "cdkOption", "cdkOptionTypeaheadLabel", "cdkOptionDisabled", "tabindex"], exportAs: ["cdkOption"] }, { kind: "directive", type: CdkListbox, selector: "[cdkListbox]", inputs: ["id", "tabindex", "cdkListboxValue", "cdkListboxMultiple", "cdkListboxDisabled", "cdkListboxUseActiveDescendant", "cdkListboxOrientation", "cdkListboxCompareWith", "cdkListboxNavigationWrapDisabled", "cdkListboxNavigatesDisabledOptions"], outputs: ["cdkListboxValueChange"], exportAs: ["cdkListbox"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
5419
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgChevronDownIcon, selector: "svg-chevron-down-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
5195
5420
  }
5196
5421
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScSelect, decorators: [{
5197
5422
  type: Component,
5198
- args: [{ selector: 'sc-select', imports: [
5199
- SvgChevronDownIcon,
5200
- OverlayModule,
5201
- ScListbox,
5202
- ScListboxOption,
5203
- CdkOption,
5204
- CdkListbox,
5205
- A11yModule,
5206
- ], template: `
5423
+ args: [{ selector: 'sc-select', imports: [SvgChevronDownIcon], template: `
5207
5424
  <button
5208
5425
  class="flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1"
5209
5426
  #scSelectTrigger
5210
5427
  [disabled]="isDisabled()"
5211
5428
  [attr.aria-expanded]="_isExpanded()"
5212
- [attr.aria-controls]="_getPanelId()"
5429
+ [attr.aria-controls]="panelId"
5213
5430
  (click)="open()"
5214
5431
  type="button"
5215
5432
  role="combobox"
@@ -5220,22 +5437,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
5220
5437
 
5221
5438
  <ng-template #panelTemplate>
5222
5439
  <ul
5223
- [id]="_getPanelId()"
5224
- [cdkTrapFocusAutoCapture]="true"
5225
- (cdkListboxValueChange)="handleValueChange($event.value)"
5226
- sc-listbox
5227
- cdkListbox
5228
- cdkTrapFocus
5440
+ class="relative z-50 max-h-96 w-full min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"
5441
+ [id]="panelId"
5442
+ role="listbox"
5229
5443
  >
5230
- @for (option of options(); track $index) {
5231
- <li
5232
- [isSelected]="option.value() === this.value()"
5233
- [cdkOption]="option.value()"
5234
- sc-listbox-option
5235
- >
5236
- {{ option.label() }}
5237
- </li>
5238
- }
5444
+ <ng-content />
5239
5445
  </ul>
5240
5446
  </ng-template>
5241
5447
  `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
@@ -5244,6 +5450,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
5244
5450
  useExisting: forwardRef(() => ScSelect),
5245
5451
  multi: true,
5246
5452
  },
5453
+ ScSelectState,
5247
5454
  ] }]
5248
5455
  }], ctorParameters: () => [] });
5249
5456
 
@@ -5281,7 +5488,7 @@ class ScPageItem {
5281
5488
  </a>
5282
5489
  }
5283
5490
  </li>
5284
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgEllipsisIcon, selector: "svg-ellipsis-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
5491
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class", "disabled"] }, { kind: "component", type: SvgEllipsisIcon, selector: "svg-ellipsis-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
5285
5492
  }
5286
5493
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScPageItem, decorators: [{
5287
5494
  type: Component,
@@ -5522,7 +5729,7 @@ class ScPaginator {
5522
5729
  }
5523
5730
  </ul>
5524
5731
  </nav>
5525
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScPageItem, selector: "sc-page-item", inputs: ["currentPage", "page"], outputs: ["pageChanged"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: ScPagination, selector: "nav[sc-pagination]", inputs: ["class"] }, { kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class"] }, { kind: "component", type: SvgChevronLeftIcon, selector: "svg-chevron-left-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: SvgChevronsLeftIcon, selector: "svg-chevrons-left-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: SvgChevronRightIcon, selector: "svg-chevron-right-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: SvgChevronsRightIcon, selector: "svg-chevrons-right-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: ScSelect, selector: "sc-select", inputs: ["placeholder", "value"], outputs: ["valueChange"] }, { kind: "component", type: ScOption, selector: "sc-option", inputs: ["value"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
5732
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScPageItem, selector: "sc-page-item", inputs: ["currentPage", "page"], outputs: ["pageChanged"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: ScPagination, selector: "nav[sc-pagination]", inputs: ["class"] }, { kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class", "disabled"] }, { kind: "component", type: SvgChevronLeftIcon, selector: "svg-chevron-left-icon", inputs: ["class"] }, { kind: "component", type: SvgChevronsLeftIcon, selector: "svg-chevrons-left-icon", inputs: ["class"] }, { kind: "component", type: SvgChevronRightIcon, selector: "svg-chevron-right-icon", inputs: ["class"] }, { kind: "component", type: SvgChevronsRightIcon, selector: "svg-chevrons-right-icon", inputs: ["class"] }, { kind: "component", type: ScSelect, selector: "sc-select", inputs: ["placeholder", "value"], outputs: ["valueChange"] }, { kind: "component", type: ScOption, selector: "sc-option", inputs: ["class", "value", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
5526
5733
  }
5527
5734
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScPaginator, decorators: [{
5528
5735
  type: Component,
@@ -5782,7 +5989,7 @@ class ScMonthDays {
5782
5989
  {{ day.slice(-2) }}
5783
5990
  </button>
5784
5991
  }
5785
- `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
5992
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
5786
5993
  }
5787
5994
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScMonthDays, decorators: [{
5788
5995
  type: Component,
@@ -5855,7 +6062,7 @@ class ScMonthYearHeader {
5855
6062
  >
5856
6063
  <svg-chevron-right-icon />
5857
6064
  </button>
5858
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgChevronRightIcon, selector: "svg-chevron-right-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: SvgChevronLeftIcon, selector: "svg-chevron-left-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
6065
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgChevronRightIcon, selector: "svg-chevron-right-icon", inputs: ["class"] }, { kind: "component", type: SvgChevronLeftIcon, selector: "svg-chevron-left-icon", inputs: ["class"] }, { kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
5859
6066
  }
5860
6067
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScMonthYearHeader, decorators: [{
5861
6068
  type: Component,
@@ -5892,11 +6099,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
5892
6099
  }] });
5893
6100
 
5894
6101
  class ScCalendar {
6102
+ _cdr = inject(ChangeDetectorRef);
5895
6103
  class = input('');
5896
6104
  classes = computed(() => cn('', this.class()));
5897
6105
  localeId = inject(LOCALE_ID);
5898
- year = signal(0);
5899
- month = signal(0);
6106
+ date = computed(() => {
6107
+ if (this.value()) {
6108
+ return new Date(this.value());
6109
+ }
6110
+ return new Date();
6111
+ });
6112
+ year = linkedSignal(() => this.date().getFullYear());
6113
+ month = linkedSignal(() => this.date().getMonth());
5900
6114
  weekDaysNames = signal([]);
5901
6115
  monthYear = computed(() => {
5902
6116
  const options = {
@@ -5928,18 +6142,31 @@ class ScCalendar {
5928
6142
  .map((e) => e.long)
5929
6143
  .indexOf(dayName);
5930
6144
  });
5931
- selectedDay = signal('');
5932
- ngOnInit() {
5933
- this.init();
5934
- this.setLocaleDayNames();
6145
+ value = model('');
6146
+ setSelectedDay(day) {
6147
+ this.value.set(day);
6148
+ this._onChange(day);
6149
+ this._cdr.markForCheck();
5935
6150
  }
5936
- init() {
5937
- const today = new Date();
5938
- this.year.set(today.getFullYear());
5939
- this.month.set(today.getMonth());
6151
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
6152
+ _onChange = () => { };
6153
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
6154
+ _onTouched = () => { };
6155
+ writeValue(value) {
6156
+ this.value.set(value);
5940
6157
  }
5941
- setSelectedDay(day) {
5942
- this.selectedDay.set(day);
6158
+ registerOnChange(fn) {
6159
+ this._onChange = fn;
6160
+ }
6161
+ registerOnTouched(fn) {
6162
+ this._onTouched = fn;
6163
+ }
6164
+ _disabledByCva = signal(false);
6165
+ setDisabledState(isDisabled) {
6166
+ this._disabledByCva.set(isDisabled);
6167
+ }
6168
+ ngOnInit() {
6169
+ this.setLocaleDayNames();
5943
6170
  }
5944
6171
  //https://github.com/angular/angular/issues/57193
5945
6172
  setLocaleDayNames() {
@@ -5999,7 +6226,13 @@ class ScCalendar {
5999
6226
  });
6000
6227
  }
6001
6228
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScCalendar, deps: [], target: i0.ɵɵFactoryTarget.Component });
6002
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScCalendar, isStandalone: true, selector: "sc-calendar", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `
6229
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScCalendar, isStandalone: true, selector: "sc-calendar", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "classes()" } }, providers: [
6230
+ {
6231
+ provide: NG_VALUE_ACCESSOR,
6232
+ useExisting: forwardRef(() => ScCalendar),
6233
+ multi: true,
6234
+ },
6235
+ ], ngImport: i0, template: `
6003
6236
  <div sc-card>
6004
6237
  <div sc-card-header>
6005
6238
  <sc-month-year-header [monthYear]="monthYear()" (monthYearChange)="setMonthYear($event)" />
@@ -6010,7 +6243,7 @@ class ScCalendar {
6010
6243
  [weekDaysNames]="weekDaysNames()"
6011
6244
  [days]="monthDays()"
6012
6245
  [firstDayMonth]="firstDayMonth()"
6013
- [selectedDay]="selectedDay()"
6246
+ [selectedDay]="value()"
6014
6247
  (selectedDayChange)="setSelectedDay($event)"
6015
6248
  />
6016
6249
  </div>
@@ -6020,7 +6253,7 @@ class ScCalendar {
6020
6253
  <button sc-button type="button">Done</button>
6021
6254
  </div>
6022
6255
  </div>
6023
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScMonthYearHeader, selector: "sc-month-year-header", inputs: ["class", "monthYear"], outputs: ["monthYearChange"] }, { kind: "component", type: ScMonthDays, selector: "sc-month-days", inputs: ["class", "weekDaysNames", "days", "firstDayMonth", "selectedDay"], outputs: ["selectedDayChange"] }, { kind: "component", type: ScCard, selector: "div[sc-card]", inputs: ["class"] }, { kind: "component", type: ScCardHeader, selector: "div[sc-card-header]", inputs: ["class"] }, { kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class"] }, { kind: "component", type: ScCardFooter, selector: "div[sc-card-footer]", inputs: ["class"] }, { kind: "component", type: ScCardContent, selector: "div[sc-card-content]", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
6256
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScMonthYearHeader, selector: "sc-month-year-header", inputs: ["class", "monthYear"], outputs: ["monthYearChange"] }, { kind: "component", type: ScMonthDays, selector: "sc-month-days", inputs: ["class", "weekDaysNames", "days", "firstDayMonth", "selectedDay"], outputs: ["selectedDayChange"] }, { kind: "component", type: ScCard, selector: "div[sc-card]", inputs: ["class"] }, { kind: "component", type: ScCardHeader, selector: "div[sc-card-header]", inputs: ["class"] }, { kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class", "disabled"] }, { kind: "component", type: ScCardFooter, selector: "div[sc-card-footer]", inputs: ["class"] }, { kind: "component", type: ScCardContent, selector: "div[sc-card-content]", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
6024
6257
  }
6025
6258
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScCalendar, decorators: [{
6026
6259
  type: Component,
@@ -6043,7 +6276,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
6043
6276
  [weekDaysNames]="weekDaysNames()"
6044
6277
  [days]="monthDays()"
6045
6278
  [firstDayMonth]="firstDayMonth()"
6046
- [selectedDay]="selectedDay()"
6279
+ [selectedDay]="value()"
6047
6280
  (selectedDayChange)="setSelectedDay($event)"
6048
6281
  />
6049
6282
  </div>
@@ -6055,7 +6288,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
6055
6288
  </div>
6056
6289
  `, host: {
6057
6290
  '[class]': 'classes()',
6058
- }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
6291
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
6292
+ {
6293
+ provide: NG_VALUE_ACCESSOR,
6294
+ useExisting: forwardRef(() => ScCalendar),
6295
+ multi: true,
6296
+ },
6297
+ ] }]
6059
6298
  }] });
6060
6299
 
6061
6300
  class ScFullCalendar {
@@ -6075,11 +6314,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
6075
6314
  }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
6076
6315
  }] });
6077
6316
 
6317
+ const scInputStyles = signal('flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm');
6078
6318
  class ScInput {
6079
- class = input('');
6080
- classes = computed(() => cn('flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm', this.class()));
6319
+ classInput = input('', {
6320
+ alias: 'class',
6321
+ });
6322
+ class = computed(() => cn(scInputStyles(), this.classInput()));
6081
6323
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
6082
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScInput, isStandalone: true, selector: "input[sc-input]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `
6324
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScInput, isStandalone: true, selector: "input[sc-input]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "class()" } }, ngImport: i0, template: `
6083
6325
  <ng-content />
6084
6326
  `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
6085
6327
  }
@@ -6088,39 +6330,78 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
6088
6330
  args: [{ selector: 'input[sc-input]', imports: [], template: `
6089
6331
  <ng-content />
6090
6332
  `, host: {
6091
- '[class]': 'classes()',
6333
+ '[class]': 'class()',
6092
6334
  }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
6093
6335
  }] });
6094
6336
 
6337
+ class ScDateInput {
6338
+ el = inject(ElementRef);
6339
+ dateFormatRegExp = (current) => {
6340
+ switch (current.length) {
6341
+ case 0: {
6342
+ return new RegExp(/^\d$/g);
6343
+ }
6344
+ case 1: {
6345
+ return new RegExp(/^\d{1,2}\/?$/g);
6346
+ }
6347
+ case 2: {
6348
+ return new RegExp(/^\d{1,2}\/\d?$/g);
6349
+ }
6350
+ case 3: {
6351
+ return new RegExp(/^\d{1,2}\/\d{1,2}\/?$/g);
6352
+ }
6353
+ case 4: {
6354
+ return new RegExp(/^\d{1,2}\/\d{1,2}\/?\d?$/g);
6355
+ }
6356
+ case 5: {
6357
+ return new RegExp(/^\d{1,2}\/\d{1,2}\/\d{0,2}$/g);
6358
+ }
6359
+ case 6: {
6360
+ return new RegExp(/^\d{1,2}\/\d{1,2}\/\d{0,3}$/g);
6361
+ }
6362
+ default: {
6363
+ return new RegExp(/^\d{1,2}\/\d{1,2}\/\d{1,4}$/g);
6364
+ }
6365
+ }
6366
+ };
6367
+ previousKey = '';
6368
+ onKeyDown(event) {
6369
+ if (event.key === 'Backspace' ||
6370
+ event.key === 'Delete' ||
6371
+ event.key === 'ArrowLeft' ||
6372
+ event.key === 'ArrowRight' ||
6373
+ (this.previousKey === 'Control' && event.key === 'c') ||
6374
+ (this.previousKey === 'Control' && event.key === 'v') ||
6375
+ (this.previousKey === 'Control' && event.key === 'x')) {
6376
+ this.previousKey = event.key;
6377
+ return;
6378
+ }
6379
+ this.previousKey = event.key;
6380
+ const current = this.el.nativeElement.value;
6381
+ const start = this.el.nativeElement.selectionStart;
6382
+ const end = this.el.nativeElement.selectionEnd;
6383
+ const next = current.slice(0, start) + event.key + current.slice(end);
6384
+ if (this.dateFormatRegExp(current).exec(next) === null) {
6385
+ event.preventDefault();
6386
+ }
6387
+ }
6388
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScDateInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
6389
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.5", type: ScDateInput, isStandalone: true, selector: "[scDateInput]", host: { listeners: { "keydown": "onKeyDown($event)" } }, ngImport: i0 });
6390
+ }
6391
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScDateInput, decorators: [{
6392
+ type: Directive,
6393
+ args: [{
6394
+ selector: '[scDateInput]',
6395
+ host: {
6396
+ '(keydown)': 'onKeyDown($event)',
6397
+ },
6398
+ }]
6399
+ }] });
6400
+
6095
6401
  class ScDatePicker {
6096
6402
  class = input('');
6097
6403
  classes = computed(() => cn('flex relative', this.class()));
6098
6404
  host = inject(ElementRef);
6099
- localeId = inject(LOCALE_ID);
6100
- dateFormatPattern = signal('');
6101
- ngOnInit() {
6102
- this.dateFormatPattern.set(this.getDateFormatPattern(this.localeId));
6103
- }
6104
- getDateFormatPattern(localeId) {
6105
- const getPatternForPart = (part) => {
6106
- switch (part.type) {
6107
- case 'day':
6108
- return 'd'.repeat(part.value.length);
6109
- case 'month':
6110
- return 'M'.repeat(part.value.length);
6111
- case 'year':
6112
- return 'y'.repeat(part.value.length);
6113
- case 'literal':
6114
- return part.value;
6115
- default:
6116
- throw new Error('no default');
6117
- }
6118
- };
6119
- return new Intl.DateTimeFormat(localeId)
6120
- .formatToParts(new Date('2022-01-01'))
6121
- .map(getPatternForPart)
6122
- .join('');
6123
- }
6124
6405
  _injector = inject(Injector);
6125
6406
  _dir = inject(Directionality, { optional: true });
6126
6407
  _overlay = inject(Overlay);
@@ -6223,16 +6504,16 @@ class ScDatePicker {
6223
6504
  <button class="absolute inset-y-0 end-0 pe-4" (click)="open()" sc-button variant="ghost">
6224
6505
  <svg-calendar-icon />
6225
6506
  </button>
6226
- <input #input sc-input type="text" placeholder="Select date" />
6227
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScInput, selector: "input[sc-input]", inputs: ["class"] }, { kind: "component", type: SvgCalendarIcon, selector: "svg-calendar-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
6507
+ <input #input sc-input scDateInput type="text" placeholder="Select date" />
6508
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScInput, selector: "input[sc-input]", inputs: ["class"] }, { kind: "component", type: SvgCalendarIcon, selector: "svg-calendar-icon", inputs: ["class"] }, { kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class", "disabled"] }, { kind: "directive", type: ScDateInput, selector: "[scDateInput]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
6228
6509
  }
6229
6510
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScDatePicker, decorators: [{
6230
6511
  type: Component,
6231
- args: [{ selector: 'sc-date-picker', imports: [ScInput, SvgCalendarIcon, ScButton], template: `
6512
+ args: [{ selector: 'sc-date-picker', imports: [ScInput, SvgCalendarIcon, ScButton, ScDateInput], template: `
6232
6513
  <button class="absolute inset-y-0 end-0 pe-4" (click)="open()" sc-button variant="ghost">
6233
6514
  <svg-calendar-icon />
6234
6515
  </button>
6235
- <input #input sc-input type="text" placeholder="Select date" />
6516
+ <input #input sc-input scDateInput type="text" placeholder="Select date" />
6236
6517
  `, host: {
6237
6518
  '[class]': 'classes()',
6238
6519
  }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
@@ -6439,7 +6720,7 @@ class ScThemeToggler {
6439
6720
  <svg-sun-icon />
6440
6721
  }
6441
6722
  </button>
6442
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgMoonIcon, selector: "svg-moon-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: SvgSunIcon, selector: "svg-sun-icon", inputs: ["class", "svgClass"] }, { kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
6723
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgMoonIcon, selector: "svg-moon-icon", inputs: ["class"] }, { kind: "component", type: SvgSunIcon, selector: "svg-sun-icon", inputs: ["class"] }, { kind: "directive", type: ScTooltip, selector: "[scTooltip]", inputs: ["scTooltip", "position"] }, { kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
6443
6724
  }
6444
6725
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScThemeToggler, decorators: [{
6445
6726
  type: Component,
@@ -6800,7 +7081,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
6800
7081
 
6801
7082
  class ScBreadcrumbSeparator {
6802
7083
  class = input('');
6803
- classes = computed(() => cn('[&>.svg]:w-3.5 [&>.svg]:h-3.5', this.class()));
7084
+ classes = computed(() => cn('[&_svg]:w-3.5 [&_svg]:h-3.5', this.class()));
6804
7085
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScBreadcrumbSeparator, deps: [], target: i0.ɵɵFactoryTarget.Component });
6805
7086
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScBreadcrumbSeparator, isStandalone: true, selector: "li[sc-breadcrumb-separator]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "presentation" }, properties: { "attr.aria-hidden": "true", "class": "classes()" } }, ngImport: i0, template: `
6806
7087
  <ng-content />
@@ -6824,7 +7105,7 @@ class ScBreadcrumbEllipsis {
6824
7105
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScBreadcrumbEllipsis, isStandalone: true, selector: "span[sc-breadcrumb-ellipsis]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "presentation" }, properties: { "attr.aria-hidden": "true", "class": "classes()" } }, ngImport: i0, template: `
6825
7106
  <svg-ellipsis-icon class="size-4" />
6826
7107
  <span class="sr-only">More</span>
6827
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgEllipsisIcon, selector: "svg-ellipsis-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
7108
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgEllipsisIcon, selector: "svg-ellipsis-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
6828
7109
  }
6829
7110
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScBreadcrumbEllipsis, decorators: [{
6830
7111
  type: Component,
@@ -6838,6 +7119,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
6838
7119
  }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
6839
7120
  }] });
6840
7121
 
7122
+ class ScToggleGroup {
7123
+ type = input('single');
7124
+ class = input('');
7125
+ _class = computed(() => cn('flex items-center justify-center gap-1', this.class()));
7126
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScToggleGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
7127
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScToggleGroup, isStandalone: true, selector: "sc-toggle-group", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_class()" } }, ngImport: i0, template: `
7128
+ <ng-content />
7129
+ `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
7130
+ }
7131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScToggleGroup, decorators: [{
7132
+ type: Component,
7133
+ args: [{ selector: 'sc-toggle-group', imports: [], template: `
7134
+ <ng-content />
7135
+ `, host: {
7136
+ '[class]': '_class()',
7137
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
7138
+ }] });
7139
+
7140
+ class ScToggleGroupItem {
7141
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScToggleGroupItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
7142
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScToggleGroupItem, isStandalone: true, selector: "sc-toggle-group-item", ngImport: i0, template: `
7143
+ <p>toggle-group-item works!</p>
7144
+ `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
7145
+ }
7146
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScToggleGroupItem, decorators: [{
7147
+ type: Component,
7148
+ args: [{ selector: 'sc-toggle-group-item', imports: [], template: `
7149
+ <p>toggle-group-item works!</p>
7150
+ `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
7151
+ }] });
7152
+
6841
7153
  class ScDialogClose {
6842
7154
  class = input('');
6843
7155
  classes = computed(() => cn('absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground', this.class()));
@@ -6960,7 +7272,7 @@ class ScDialog {
6960
7272
  <button sc-button type="submit">Save changes</button>
6961
7273
  </div>
6962
7274
  </div>
6963
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScDialogHeader, selector: "div[sc-dialog-header]", inputs: ["class"] }, { kind: "component", type: ScDialogTitle, selector: "h2[sc-dialog-title]", inputs: ["class"] }, { kind: "component", type: ScDialogDescription, selector: "p[sc-dialog-description]", inputs: ["class"] }, { kind: "component", type: ScDialogFooter, selector: "div[sc-dialog-footer]", inputs: ["class"] }, { kind: "component", type: ScDialogClose, selector: "button[sc-dialog-close]", inputs: ["class"] }, { kind: "component", type: SvgXIcon, selector: "svg-x-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: ScDialogContent, selector: "div[sc-dialog-content]", inputs: ["class"] }, { kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
7275
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScDialogHeader, selector: "div[sc-dialog-header]", inputs: ["class"] }, { kind: "component", type: ScDialogTitle, selector: "h2[sc-dialog-title]", inputs: ["class"] }, { kind: "component", type: ScDialogDescription, selector: "p[sc-dialog-description]", inputs: ["class"] }, { kind: "component", type: ScDialogFooter, selector: "div[sc-dialog-footer]", inputs: ["class"] }, { kind: "component", type: ScDialogClose, selector: "button[sc-dialog-close]", inputs: ["class"] }, { kind: "component", type: SvgXIcon, selector: "svg-x-icon", inputs: ["class"] }, { kind: "component", type: ScDialogContent, selector: "div[sc-dialog-content]", inputs: ["class"] }, { kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
6964
7276
  }
6965
7277
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScDialog, decorators: [{
6966
7278
  type: Component,
@@ -6993,11 +7305,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
6993
7305
  `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
6994
7306
  }] });
6995
7307
 
6996
- const alertVariants = cva('relative w-full rounded-lg border p-4 [&>.svg+div]:translate-y-[-3px] [&>.svg]:absolute [&>.svg]:left-4 [&>.svg]:top-4 [&>.svg]:text-foreground [&>.svg~*]:pl-7', {
7308
+ const alertVariants = cva('relative w-full rounded-lg border p-4 [&_svg]:size-4 [&>.svg-host+p]:translate-y-[-3px] [&_svg]:absolute [&_svg]:left-4 [&_svg]:top-4 [&_svg]:text-foreground [&>.svg-host~*]:pl-7', {
6997
7309
  variants: {
6998
7310
  variant: {
6999
7311
  default: 'bg-background text-foreground',
7000
- destructive: 'border-destructive/50 text-destructive dark:border-destructive [&>.svg]:text-destructive',
7312
+ destructive: 'border-destructive/50 text-destructive dark:border-destructive [&_svg]:text-destructive',
7001
7313
  },
7002
7314
  },
7003
7315
  defaultVariants: {
@@ -7166,7 +7478,7 @@ class ScAlertDialog {
7166
7478
  <button sc-button>Continue</button>
7167
7479
  </div>
7168
7480
  </div>
7169
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class"] }, { kind: "component", type: ScAlertDialogFooter, selector: "div[sc-alert-dialog-footer]", inputs: ["class"] }, { kind: "component", type: ScAlertDialogHeader, selector: "div[sc-alert-dialog-header]", inputs: ["class"] }, { kind: "component", type: scAlertDialogDescription, selector: "p[sc-alert-dialog-description]", inputs: ["class"] }, { kind: "component", type: ScAlertDialogTitle, selector: "h2[sc-alert-dialog-title]", inputs: ["class"] }, { kind: "component", type: ScAlertDialogContent, selector: "div[sc-alert-dialog-content]", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
7481
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class", "disabled"] }, { kind: "component", type: ScAlertDialogFooter, selector: "div[sc-alert-dialog-footer]", inputs: ["class"] }, { kind: "component", type: ScAlertDialogHeader, selector: "div[sc-alert-dialog-header]", inputs: ["class"] }, { kind: "component", type: scAlertDialogDescription, selector: "p[sc-alert-dialog-description]", inputs: ["class"] }, { kind: "component", type: ScAlertDialogTitle, selector: "h2[sc-alert-dialog-title]", inputs: ["class"] }, { kind: "component", type: ScAlertDialogContent, selector: "div[sc-alert-dialog-content]", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
7170
7482
  }
7171
7483
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScAlertDialog, decorators: [{
7172
7484
  type: Component,
@@ -7231,47 +7543,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
7231
7543
 
7232
7544
  class ScScrollArea {
7233
7545
  host = inject(ElementRef);
7234
- class = input('');
7235
- classes = computed(() => cn('', this.class()));
7236
- visibility = input('native');
7237
- //TODO remove use of ngAfterViewInit
7546
+ classInput = input('', {
7547
+ alias: 'class',
7548
+ });
7549
+ class = computed(() => cn('', this.classInput()));
7238
7550
  ngAfterViewInit() {
7239
7551
  const height = this.host.nativeElement.scrollHeight;
7240
7552
  console.log(height);
7241
7553
  }
7242
7554
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScScrollArea, deps: [], target: i0.ɵɵFactoryTarget.Component });
7243
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScScrollArea, isStandalone: true, selector: "div[sc-scroll-area]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, visibility: { classPropertyName: "visibility", publicName: "visibility", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `
7244
- <ng-scrollbar
7245
- [visibility]="visibility()"
7246
- [style]="{
7247
- '--scrollbar-border-radius': '100px',
7248
- '--scrollbar-padding': '1px',
7249
- '--scrollbar-thumb-color': 'hsl(var(--border))',
7250
- '--scrollbar-thumb-hover-color': 'hsl(var(--border))',
7251
- '--scrollbar-size': '7px',
7252
- }"
7253
- >
7254
- <ng-content />
7255
- </ng-scrollbar>
7256
- `, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: NgScrollbarModule }, { kind: "component", type: i1$2.NgScrollbar, selector: "ng-scrollbar:not([externalViewport])", exportAs: ["ngScrollbar"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
7555
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScScrollArea, isStandalone: true, selector: "div[sc-scroll-area]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "class()" } }, ngImport: i0, template: `
7556
+ <ng-content />
7557
+ `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
7257
7558
  }
7258
7559
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScScrollArea, decorators: [{
7259
7560
  type: Component,
7260
- args: [{ selector: 'div[sc-scroll-area]', imports: [NgScrollbarModule], template: `
7261
- <ng-scrollbar
7262
- [visibility]="visibility()"
7263
- [style]="{
7264
- '--scrollbar-border-radius': '100px',
7265
- '--scrollbar-padding': '1px',
7266
- '--scrollbar-thumb-color': 'hsl(var(--border))',
7267
- '--scrollbar-thumb-hover-color': 'hsl(var(--border))',
7268
- '--scrollbar-size': '7px',
7269
- }"
7270
- >
7271
- <ng-content />
7272
- </ng-scrollbar>
7561
+ args: [{ selector: 'div[sc-scroll-area]', imports: [], template: `
7562
+ <ng-content />
7273
7563
  `, host: {
7274
- '[class]': 'classes()',
7564
+ '[class]': 'class()',
7275
7565
  }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
7276
7566
  }] });
7277
7567
 
@@ -7348,7 +7638,7 @@ class ScTabs {
7348
7638
  </div>
7349
7639
 
7350
7640
  <ng-content />
7351
- `, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
7641
+ `, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
7352
7642
  }
7353
7643
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScTabs, decorators: [{
7354
7644
  type: Component,
@@ -7407,48 +7697,205 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
7407
7697
  }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
7408
7698
  }] });
7409
7699
 
7410
- const toastVariants = cva('group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full', {
7411
- variants: {
7412
- variant: {
7413
- default: 'border bg-background text-foreground',
7414
- destructive: 'destructive group border-destructive bg-destructive text-destructive-foreground',
7415
- },
7416
- },
7417
- defaultVariants: {
7418
- variant: 'default',
7419
- },
7420
- });
7421
- class ScToast {
7422
- variant = input('default');
7423
- class = input('');
7424
- classes = computed(() => cn(toastVariants({ variant: this.variant() }), this.class()));
7425
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScToast, deps: [], target: i0.ɵɵFactoryTarget.Component });
7426
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScToast, isStandalone: true, selector: "li[sc-toast]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `
7427
- <ng-content />
7428
- `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
7700
+ class ScTabContent2 {
7701
+ template = viewChild.required('template');
7702
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScTabContent2, deps: [], target: i0.ɵɵFactoryTarget.Component });
7703
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.0.5", type: ScTabContent2, isStandalone: true, selector: "sc-tab-content2", viewQueries: [{ propertyName: "template", first: true, predicate: ["template"], descendants: true, isSignal: true }], ngImport: i0, template: `
7704
+ <ng-template #template>
7705
+ <ng-content />
7706
+ </ng-template>
7707
+ `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
7429
7708
  }
7430
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScToast, decorators: [{
7709
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScTabContent2, decorators: [{
7431
7710
  type: Component,
7432
- args: [{
7433
- selector: 'li[sc-toast]',
7434
- imports: [],
7435
- template: `
7436
- <ng-content />
7437
- `,
7438
- host: {
7439
- '[class]': 'classes()',
7440
- },
7441
- encapsulation: ViewEncapsulation.None,
7442
- changeDetection: ChangeDetectionStrategy.OnPush,
7443
- }]
7711
+ args: [{ selector: 'sc-tab-content2', imports: [], template: `
7712
+ <ng-template #template>
7713
+ <ng-content />
7714
+ </ng-template>
7715
+ `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
7444
7716
  }] });
7445
7717
 
7446
- class Toaster {
7447
- overlayRef;
7448
- overlay = inject(Overlay);
7449
- constructor() {
7450
- // Initialize an overlay and define a relative position
7451
- // Change this to control where your toaster should appear
7718
+ class ScTabLabel2 {
7719
+ template = viewChild.required('template');
7720
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScTabLabel2, deps: [], target: i0.ɵɵFactoryTarget.Component });
7721
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.0.5", type: ScTabLabel2, isStandalone: true, selector: "sc-tab-label2", viewQueries: [{ propertyName: "template", first: true, predicate: ["template"], descendants: true, isSignal: true }], ngImport: i0, template: `
7722
+ <ng-template #template>
7723
+ <ng-content />
7724
+ </ng-template>
7725
+ `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
7726
+ }
7727
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScTabLabel2, decorators: [{
7728
+ type: Component,
7729
+ args: [{ selector: 'sc-tab-label2', imports: [], template: `
7730
+ <ng-template #template>
7731
+ <ng-content />
7732
+ </ng-template>
7733
+ `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [] }]
7734
+ }] });
7735
+
7736
+ class ScTabGroup {
7737
+ tabLabels = contentChildren(ScTabLabel2, { descendants: true });
7738
+ tabContents = contentChildren(ScTabContent2, { descendants: true });
7739
+ ngAfterViewInit() {
7740
+ console.log(this.tabLabels());
7741
+ }
7742
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScTabGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
7743
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ScTabGroup, isStandalone: true, selector: "sc-tab-group", queries: [{ propertyName: "tabLabels", predicate: ScTabLabel2, descendants: true, isSignal: true }, { propertyName: "tabContents", predicate: ScTabContent2, descendants: true, isSignal: true }], ngImport: i0, template: `
7744
+ <div class="group relative my-4 flex flex-col space-y-2">
7745
+ <div class="relative mr-auto w-full" dir="ltr" data-orientation="horizontal">
7746
+ <div class="flex items-center justify-between pb-3">
7747
+ <div
7748
+ class="inline-flex h-9 w-full items-center justify-start rounded-none border-b bg-transparent p-0 text-muted-foreground"
7749
+ style="outline: none;"
7750
+ tabindex="0"
7751
+ data-orientation="horizontal"
7752
+ >
7753
+ @for (tab of tabLabels(); track tab) {
7754
+ <ng-container [ngTemplateOutlet]="tab.template()"></ng-container>
7755
+ }
7756
+ </div>
7757
+ </div>
7758
+ <div
7759
+ class="relative mt-2 rounded-md border ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
7760
+ id="radix-:r17g:-content-preview"
7761
+ style="animation-duration: 0s;"
7762
+ tabindex="0"
7763
+ data-state="active"
7764
+ data-orientation="horizontal"
7765
+ >
7766
+ <div class="theme-zinc w-full" style="--radius: 0.5rem;">
7767
+ <div class="preview flex min-h-[350px] w-full items-center justify-center p-10">
7768
+ <div
7769
+ class="relative h-72 w-48 overflow-hidden rounded-md border"
7770
+ dir="ltr"
7771
+ style="position: relative; --radix-scroll-area-corner-width: 0px; --radix-scroll-area-corner-height: 0px;"
7772
+ >
7773
+ <div
7774
+ class="size-full rounded-[inherit]"
7775
+ style="overflow: hidden scroll;"
7776
+ data-radix-scroll-area-viewport=""
7777
+ >
7778
+ @for (content of tabContents(); track content) {
7779
+ <ng-container [ngTemplateOutlet]="content.template()"></ng-container>
7780
+ }
7781
+ </div>
7782
+ </div>
7783
+ </div>
7784
+ </div>
7785
+ </div>
7786
+ </div>
7787
+ </div>
7788
+
7789
+ <ng-content />
7790
+ `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
7791
+ }
7792
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScTabGroup, decorators: [{
7793
+ type: Component,
7794
+ args: [{ selector: 'sc-tab-group', imports: [NgTemplateOutlet], template: `
7795
+ <div class="group relative my-4 flex flex-col space-y-2">
7796
+ <div class="relative mr-auto w-full" dir="ltr" data-orientation="horizontal">
7797
+ <div class="flex items-center justify-between pb-3">
7798
+ <div
7799
+ class="inline-flex h-9 w-full items-center justify-start rounded-none border-b bg-transparent p-0 text-muted-foreground"
7800
+ style="outline: none;"
7801
+ tabindex="0"
7802
+ data-orientation="horizontal"
7803
+ >
7804
+ @for (tab of tabLabels(); track tab) {
7805
+ <ng-container [ngTemplateOutlet]="tab.template()"></ng-container>
7806
+ }
7807
+ </div>
7808
+ </div>
7809
+ <div
7810
+ class="relative mt-2 rounded-md border ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
7811
+ id="radix-:r17g:-content-preview"
7812
+ style="animation-duration: 0s;"
7813
+ tabindex="0"
7814
+ data-state="active"
7815
+ data-orientation="horizontal"
7816
+ >
7817
+ <div class="theme-zinc w-full" style="--radius: 0.5rem;">
7818
+ <div class="preview flex min-h-[350px] w-full items-center justify-center p-10">
7819
+ <div
7820
+ class="relative h-72 w-48 overflow-hidden rounded-md border"
7821
+ dir="ltr"
7822
+ style="position: relative; --radix-scroll-area-corner-width: 0px; --radix-scroll-area-corner-height: 0px;"
7823
+ >
7824
+ <div
7825
+ class="size-full rounded-[inherit]"
7826
+ style="overflow: hidden scroll;"
7827
+ data-radix-scroll-area-viewport=""
7828
+ >
7829
+ @for (content of tabContents(); track content) {
7830
+ <ng-container [ngTemplateOutlet]="content.template()"></ng-container>
7831
+ }
7832
+ </div>
7833
+ </div>
7834
+ </div>
7835
+ </div>
7836
+ </div>
7837
+ </div>
7838
+ </div>
7839
+
7840
+ <ng-content />
7841
+ `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
7842
+ }] });
7843
+
7844
+ class ScTabItem {
7845
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScTabItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
7846
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScTabItem, isStandalone: true, selector: "sc-tab-item", ngImport: i0, template: `
7847
+ <ng-content />
7848
+ `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
7849
+ }
7850
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScTabItem, decorators: [{
7851
+ type: Component,
7852
+ args: [{ selector: 'sc-tab-item', imports: [], template: `
7853
+ <ng-content />
7854
+ `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
7855
+ }] });
7856
+
7857
+ const toastVariants = cva('group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full', {
7858
+ variants: {
7859
+ variant: {
7860
+ default: 'border bg-background text-foreground',
7861
+ destructive: 'destructive group border-destructive bg-destructive text-destructive-foreground',
7862
+ },
7863
+ },
7864
+ defaultVariants: {
7865
+ variant: 'default',
7866
+ },
7867
+ });
7868
+ class ScToast {
7869
+ variant = input('default');
7870
+ class = input('');
7871
+ classes = computed(() => cn(toastVariants({ variant: this.variant() }), this.class()));
7872
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScToast, deps: [], target: i0.ɵɵFactoryTarget.Component });
7873
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScToast, isStandalone: true, selector: "li[sc-toast]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `
7874
+ <ng-content />
7875
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
7876
+ }
7877
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScToast, decorators: [{
7878
+ type: Component,
7879
+ args: [{
7880
+ selector: 'li[sc-toast]',
7881
+ imports: [],
7882
+ template: `
7883
+ <ng-content />
7884
+ `,
7885
+ host: {
7886
+ '[class]': 'classes()',
7887
+ },
7888
+ encapsulation: ViewEncapsulation.None,
7889
+ changeDetection: ChangeDetectionStrategy.OnPush,
7890
+ }]
7891
+ }] });
7892
+
7893
+ class Toaster {
7894
+ overlayRef;
7895
+ overlay = inject(Overlay);
7896
+ constructor() {
7897
+ // Initialize an overlay and define a relative position
7898
+ // Change this to control where your toaster should appear
7452
7899
  this.overlayRef = this.overlay.create({
7453
7900
  hasBackdrop: false,
7454
7901
  positionStrategy: this.overlay.position().global().top('20px').right('20px'),
@@ -7599,7 +8046,7 @@ class ScToastExample {
7599
8046
  </ol>
7600
8047
 
7601
8048
  -->
7602
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScToastClose, selector: "button[sc-toast-close]", inputs: ["class"] }, { kind: "component", type: SvgXIcon, selector: "svg-x-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: ScToastAction, selector: "button[sc-toast-action]", inputs: ["class"] }, { kind: "component", type: ScToastDescription, selector: "p[sc-toast-description]", inputs: ["class"] }, { kind: "component", type: ScToastTitle, selector: "h2[sc-toast-title]", inputs: ["class"] }, { kind: "component", type: ScToast, selector: "li[sc-toast]", inputs: ["variant", "class"] }, { kind: "component", type: ScToastContent, selector: "div[sc-toast-content]", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
8049
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScToastClose, selector: "button[sc-toast-close]", inputs: ["class"] }, { kind: "component", type: SvgXIcon, selector: "svg-x-icon", inputs: ["class"] }, { kind: "component", type: ScToastAction, selector: "button[sc-toast-action]", inputs: ["class"] }, { kind: "component", type: ScToastDescription, selector: "p[sc-toast-description]", inputs: ["class"] }, { kind: "component", type: ScToastTitle, selector: "h2[sc-toast-title]", inputs: ["class"] }, { kind: "component", type: ScToast, selector: "li[sc-toast]", inputs: ["variant", "class"] }, { kind: "component", type: ScToastContent, selector: "div[sc-toast-content]", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
7603
8050
  }
7604
8051
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScToastExample, decorators: [{
7605
8052
  type: Component,
@@ -7962,7 +8409,7 @@ class ScCheckbox {
7962
8409
  } @else if (checked() === true) {
7963
8410
  <svg-check-icon [class]="svgClasses()" />
7964
8411
  }
7965
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgCheckIcon, selector: "svg-check-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: SvgMinusIcon, selector: "svg-minus-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
8412
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgCheckIcon, selector: "svg-check-icon", inputs: ["class"] }, { kind: "component", type: SvgMinusIcon, selector: "svg-minus-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
7966
8413
  }
7967
8414
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScCheckbox, decorators: [{
7968
8415
  type: Component,
@@ -8002,7 +8449,7 @@ class ScAccordion {
8002
8449
  <cdk-accordion>
8003
8450
  <ng-content />
8004
8451
  </cdk-accordion>
8005
- `, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: CdkAccordionModule }, { kind: "directive", type: i1$4.CdkAccordion, selector: "cdk-accordion, [cdkAccordion]", inputs: ["multi"], exportAs: ["cdkAccordion"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
8452
+ `, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: CdkAccordionModule }, { kind: "directive", type: i1$2.CdkAccordion, selector: "cdk-accordion, [cdkAccordion]", inputs: ["multi"], exportAs: ["cdkAccordion"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
8006
8453
  }
8007
8454
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScAccordion, decorators: [{
8008
8455
  type: Component,
@@ -8034,7 +8481,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
8034
8481
 
8035
8482
  class ScAccordionTrigger {
8036
8483
  class = input('');
8037
- classes = computed(() => cn('flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>.svg]:rotate-180', this.class()));
8484
+ classes = computed(() => cn('flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180', this.class()));
8038
8485
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScAccordionTrigger, deps: [], target: i0.ɵɵFactoryTarget.Component });
8039
8486
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScAccordionTrigger, isStandalone: true, selector: "button[sc-accordion-trigger]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `
8040
8487
  <ng-content />
@@ -8071,7 +8518,7 @@ class ScAccordionItem {
8071
8518
  <ng-content select="sc-accordion-content" />
8072
8519
  }
8073
8520
  </cdk-accordion-item>
8074
- `, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: CdkAccordionModule }, { kind: "directive", type: i1$4.CdkAccordionItem, selector: "cdk-accordion-item, [cdkAccordionItem]", inputs: ["expanded", "disabled"], outputs: ["closed", "opened", "destroyed", "expandedChange"], exportAs: ["cdkAccordionItem"] }, { kind: "component", type: SvgChevronDownIcon, selector: "svg-chevron-down-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: SvgChevronUpIcon, selector: "svg-chevron-up-icon", inputs: ["class", "svgClass"] }, { kind: "component", type: ScAccordionHeader, selector: "h3[sc-accordion-header]", inputs: ["class"] }, { kind: "component", type: ScAccordionTrigger, selector: "button[sc-accordion-trigger]", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
8521
+ `, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: CdkAccordionModule }, { kind: "directive", type: i1$2.CdkAccordionItem, selector: "cdk-accordion-item, [cdkAccordionItem]", inputs: ["expanded", "disabled"], outputs: ["closed", "opened", "destroyed", "expandedChange"], exportAs: ["cdkAccordionItem"] }, { kind: "component", type: SvgChevronDownIcon, selector: "svg-chevron-down-icon", inputs: ["class"] }, { kind: "component", type: SvgChevronUpIcon, selector: "svg-chevron-up-icon", inputs: ["class"] }, { kind: "component", type: ScAccordionHeader, selector: "h3[sc-accordion-header]", inputs: ["class"] }, { kind: "component", type: ScAccordionTrigger, selector: "button[sc-accordion-trigger]", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
8075
8522
  }
8076
8523
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScAccordionItem, decorators: [{
8077
8524
  type: Component,
@@ -8335,23 +8782,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
8335
8782
 
8336
8783
  class ScRadioItem {
8337
8784
  state = inject(ScRadioGroupState);
8338
- id = input.required();
8785
+ id = signal(inject(_IdGenerator).getId('sc-radio-item-'));
8786
+ name = computed(() => {
8787
+ return this.state.name();
8788
+ });
8339
8789
  value = input.required();
8340
8790
  checked = computed(() => {
8341
8791
  return this.value() === this.state.selectedValue();
8342
8792
  });
8343
- name = computed(() => {
8344
- return this.state.name();
8793
+ disabledByInput = input(false, {
8794
+ alias: 'disabled',
8795
+ transform: booleanAttribute,
8345
8796
  });
8346
- disabled = input(false);
8347
- class = input('row-start-1 col-start-1');
8348
- classes = computed(() => cn('appearance-none aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50', this.class()));
8349
- hostClass = input('');
8350
- hostClasses = computed(() => cn('flex items-center space-x-2', this.hostClass()));
8351
- circleHostClass = input('row-start-1 col-start-1 h-4 w-4 flex items-center justify-center');
8352
- circleClass = input('');
8353
- circleClasses = computed(() => cn('h-2.5 w-2.5 fill-primary text-primary', this.circleClass()));
8354
- radioChecked = output();
8797
+ disabled = computed(() => this.disabledByInput() || this.state.disabled());
8798
+ class = input('');
8799
+ _class = computed(() => cn('flex items-center space-x-2', this.class()));
8800
+ inputClass = input('');
8801
+ _inputClass = computed(() => cn('row-start-1 col-start-1', 'appearance-none aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50', this.inputClass()));
8802
+ svgWrapperClass = input('row-start-1 col-start-1 h-4 w-4 flex items-center justify-center');
8803
+ svgClass = input('');
8804
+ _svgClass = computed(() => cn('h-2.5 w-2.5 fill-primary text-primary', this.svgClass()));
8355
8805
  toggle() {
8356
8806
  if (this.disabled()) {
8357
8807
  return;
@@ -8359,32 +8809,48 @@ class ScRadioItem {
8359
8809
  this.state.selectedValue.set(this.value());
8360
8810
  }
8361
8811
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScRadioItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
8362
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ScRadioItem, isStandalone: true, selector: "sc-radio-item", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, hostClass: { classPropertyName: "hostClass", publicName: "hostClass", isSignal: true, isRequired: false, transformFunction: null }, circleHostClass: { classPropertyName: "circleHostClass", publicName: "circleHostClass", isSignal: true, isRequired: false, transformFunction: null }, circleClass: { classPropertyName: "circleClass", publicName: "circleClass", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { radioChecked: "radioChecked" }, host: { listeners: { "click": "toggle()" }, properties: { "class": "hostClasses()" } }, ngImport: i0, template: `
8812
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ScRadioItem, isStandalone: true, selector: "sc-radio-item", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabledByInput: { classPropertyName: "disabledByInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, inputClass: { classPropertyName: "inputClass", publicName: "inputClass", isSignal: true, isRequired: false, transformFunction: null }, svgWrapperClass: { classPropertyName: "svgWrapperClass", publicName: "svgWrapperClass", isSignal: true, isRequired: false, transformFunction: null }, svgClass: { classPropertyName: "svgClass", publicName: "svgClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "toggle()" }, properties: { "class": "_class()" } }, ngImport: i0, template: `
8363
8813
  <div class="grid grid-cols-[1fr]">
8364
- <input [id]="id()" [class]="classes()" [disabled]="disabled()" [name]="name()" type="radio" />
8814
+ <input
8815
+ [id]="id()"
8816
+ [class]="_inputClass()"
8817
+ [disabled]="disabled()"
8818
+ [name]="name()"
8819
+ type="radio"
8820
+ />
8365
8821
 
8366
8822
  @if (checked() === true) {
8367
- <svg-circle-icon [class]="circleHostClass()" [svgClass]="circleClasses()" />
8823
+ <span [class]="svgWrapperClass()">
8824
+ <svg-circle-icon [class]="_svgClass()" />
8825
+ </span>
8368
8826
  }
8369
8827
  </div>
8370
8828
 
8371
8829
  <label [for]="id()" sc-label><ng-content /></label>
8372
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgCircleIcon, selector: "svg-circle-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
8830
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgCircleIcon, selector: "svg-circle-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
8373
8831
  }
8374
8832
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScRadioItem, decorators: [{
8375
8833
  type: Component,
8376
8834
  args: [{ selector: 'sc-radio-item', imports: [SvgCircleIcon], template: `
8377
8835
  <div class="grid grid-cols-[1fr]">
8378
- <input [id]="id()" [class]="classes()" [disabled]="disabled()" [name]="name()" type="radio" />
8836
+ <input
8837
+ [id]="id()"
8838
+ [class]="_inputClass()"
8839
+ [disabled]="disabled()"
8840
+ [name]="name()"
8841
+ type="radio"
8842
+ />
8379
8843
 
8380
8844
  @if (checked() === true) {
8381
- <svg-circle-icon [class]="circleHostClass()" [svgClass]="circleClasses()" />
8845
+ <span [class]="svgWrapperClass()">
8846
+ <svg-circle-icon [class]="_svgClass()" />
8847
+ </span>
8382
8848
  }
8383
8849
  </div>
8384
8850
 
8385
8851
  <label [for]="id()" sc-label><ng-content /></label>
8386
8852
  `, host: {
8387
- '[class]': 'hostClasses()',
8853
+ '[class]': '_class()',
8388
8854
  '(click)': 'toggle()',
8389
8855
  }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
8390
8856
  }] });
@@ -8604,7 +9070,7 @@ class ScInputOTPSeparator {
8604
9070
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScInputOTPSeparator, deps: [], target: i0.ɵɵFactoryTarget.Component });
8605
9071
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScInputOTPSeparator, isStandalone: true, selector: "sc-input-otp-separator", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `
8606
9072
  <svg-dot-icon />
8607
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgDotIcon, selector: "svg-dot-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
9073
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgDotIcon, selector: "svg-dot-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
8608
9074
  }
8609
9075
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScInputOTPSeparator, decorators: [{
8610
9076
  type: Component,
@@ -8972,13 +9438,13 @@ class ScHoverCardTriggerFor {
8972
9438
  viewContainer = inject(ViewContainerRef);
8973
9439
  scHoverCardTriggerFor = input.required();
8974
9440
  overlayRef = null;
8975
- showTooltip() {
9441
+ showCard() {
8976
9442
  if (this.overlayRef?.hasAttached() === true) {
8977
9443
  return;
8978
9444
  }
8979
9445
  this.attachTooltip();
8980
9446
  }
8981
- hideTooltip() {
9447
+ hideCard() {
8982
9448
  if (this.overlayRef?.hasAttached() === true) {
8983
9449
  this.overlayRef?.detach();
8984
9450
  }
@@ -8991,14 +9457,6 @@ class ScHoverCardTriggerFor {
8991
9457
  const positionStrategy = this.getPositionStrategy();
8992
9458
  this.overlayRef = this.overlay.create({ positionStrategy });
8993
9459
  }
8994
- // const injector = Injector.create({
8995
- // providers: [
8996
- // {
8997
- // provide: TOOLTIP_DATA,
8998
- // useValue: this.appTooltip,
8999
- // },
9000
- // ],
9001
- // });
9002
9460
  const componentPortal = new ComponentPortal(ScHoverCard, this.viewContainer);
9003
9461
  // Attach tooltip portal to overlay
9004
9462
  const componentRef = this.overlayRef.attach(componentPortal);
@@ -9026,26 +9484,20 @@ class ScHoverCardTriggerFor {
9026
9484
  ]);
9027
9485
  }
9028
9486
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScHoverCardTriggerFor, deps: [], target: i0.ɵɵFactoryTarget.Directive });
9029
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.5", type: ScHoverCardTriggerFor, isStandalone: true, selector: "[scHoverCardTriggerFor]", inputs: { scHoverCardTriggerFor: { classPropertyName: "scHoverCardTriggerFor", publicName: "scHoverCardTriggerFor", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "mouseover": "showTooltip()", "focus": "showTooltip()", "mouseleave": "hideTooltip()", "blur": "hideTooltip()" } }, ngImport: i0 });
9487
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.5", type: ScHoverCardTriggerFor, isStandalone: true, selector: "[scHoverCardTriggerFor]", inputs: { scHoverCardTriggerFor: { classPropertyName: "scHoverCardTriggerFor", publicName: "scHoverCardTriggerFor", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "mouseover": "showCard()", "focus": "showCard()", "mouseleave": "hideCard()", "blur": "hideCard()" } }, ngImport: i0 });
9030
9488
  }
9031
9489
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScHoverCardTriggerFor, decorators: [{
9032
9490
  type: Directive,
9033
9491
  args: [{
9034
9492
  selector: '[scHoverCardTriggerFor]',
9493
+ host: {
9494
+ '(mouseover)': 'showCard()',
9495
+ '(focus)': 'showCard()',
9496
+ '(mouseleave)': 'hideCard()',
9497
+ '(blur)': 'hideCard()',
9498
+ },
9035
9499
  }]
9036
- }], propDecorators: { showTooltip: [{
9037
- type: HostListener,
9038
- args: ['mouseover']
9039
- }, {
9040
- type: HostListener,
9041
- args: ['focus']
9042
- }], hideTooltip: [{
9043
- type: HostListener,
9044
- args: ['mouseleave']
9045
- }, {
9046
- type: HostListener,
9047
- args: ['blur']
9048
- }] } });
9500
+ }] });
9049
9501
 
9050
9502
  class ScAvatarFallback {
9051
9503
  class = input('');
@@ -9137,33 +9589,33 @@ class ScAspectRatio {
9137
9589
  @if (priority()) {
9138
9590
  <img
9139
9591
  [class]="imageClasses()"
9140
- [ngSrc]="src()"
9592
+ [src]="src()"
9141
9593
  [alt]="alt()"
9142
9594
  [style]="imageStyle()"
9143
9595
  fill
9144
9596
  priority
9145
9597
  />
9146
9598
  } @else {
9147
- <img [class]="imageClasses()" [ngSrc]="src()" [alt]="alt()" [style]="imageStyle()" fill />
9599
+ <img [class]="imageClasses()" [src]="src()" [alt]="alt()" [style]="imageStyle()" fill />
9148
9600
  }
9149
9601
  </div>
9150
- `, isInline: true, styles: [""], dependencies: [{ kind: "directive", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "placeholder", "placeholderConfig", "src", "srcset"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
9602
+ `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
9151
9603
  }
9152
9604
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScAspectRatio, decorators: [{
9153
9605
  type: Component,
9154
- args: [{ selector: 'sc-aspect-ratio', imports: [NgOptimizedImage], template: `
9606
+ args: [{ selector: 'sc-aspect-ratio', imports: [], template: `
9155
9607
  <div [class]="wrapperClass()" [style]="wrapperStyle()">
9156
9608
  @if (priority()) {
9157
9609
  <img
9158
9610
  [class]="imageClasses()"
9159
- [ngSrc]="src()"
9611
+ [src]="src()"
9160
9612
  [alt]="alt()"
9161
9613
  [style]="imageStyle()"
9162
9614
  fill
9163
9615
  priority
9164
9616
  />
9165
9617
  } @else {
9166
- <img [class]="imageClasses()" [ngSrc]="src()" [alt]="alt()" [style]="imageStyle()" fill />
9618
+ <img [class]="imageClasses()" [src]="src()" [alt]="alt()" [style]="imageStyle()" fill />
9167
9619
  }
9168
9620
  </div>
9169
9621
  `, host: {
@@ -9456,7 +9908,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
9456
9908
  class ScContextMenuTriggerFor {
9457
9909
  scContextMenuTriggerFor = input.required();
9458
9910
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScContextMenuTriggerFor, deps: [], target: i0.ɵɵFactoryTarget.Directive });
9459
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.5", type: ScContextMenuTriggerFor, isStandalone: true, selector: "[scContextMenuTriggerFor]", inputs: { scContextMenuTriggerFor: { classPropertyName: "scContextMenuTriggerFor", publicName: "scContextMenuTriggerFor", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: i1$5.CdkContextMenuTrigger, inputs: ["cdkContextMenuTriggerFor", "scContextMenuTriggerFor"] }], ngImport: i0 });
9911
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.5", type: ScContextMenuTriggerFor, isStandalone: true, selector: "[scContextMenuTriggerFor]", inputs: { scContextMenuTriggerFor: { classPropertyName: "scContextMenuTriggerFor", publicName: "scContextMenuTriggerFor", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: i1$3.CdkContextMenuTrigger, inputs: ["cdkContextMenuTriggerFor", "scContextMenuTriggerFor"] }], ngImport: i0 });
9460
9912
  }
9461
9913
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScContextMenuTriggerFor, decorators: [{
9462
9914
  type: Directive,
@@ -9475,7 +9927,7 @@ class ScMenu {
9475
9927
  class = input('');
9476
9928
  classes = computed(() => cn('my-2 z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', this.class()));
9477
9929
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScMenu, deps: [], target: i0.ɵɵFactoryTarget.Component });
9478
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScMenu, isStandalone: true, selector: "div[sc-menu]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, hostDirectives: [{ directive: i1$5.CdkMenu }], ngImport: i0, template: `
9930
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScMenu, isStandalone: true, selector: "div[sc-menu]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, hostDirectives: [{ directive: i1$3.CdkMenu }], ngImport: i0, template: `
9479
9931
  <ng-content />
9480
9932
  `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
9481
9933
  }
@@ -9545,9 +9997,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
9545
9997
 
9546
9998
  class ScMenuGroup {
9547
9999
  class = input('');
9548
- classes = computed(() => cn('', this.class()));
10000
+ _class = computed(() => cn('', this.class()));
9549
10001
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScMenuGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
9550
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScMenuGroup, isStandalone: true, selector: "sc-menu-group", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `
10002
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScMenuGroup, isStandalone: true, selector: "sc-menu-group", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_class()" } }, ngImport: i0, template: `
9551
10003
  <ng-content />
9552
10004
  `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
9553
10005
  }
@@ -9556,19 +10008,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
9556
10008
  args: [{ selector: 'sc-menu-group', imports: [], template: `
9557
10009
  <ng-content />
9558
10010
  `, host: {
9559
- '[class]': 'classes()',
10011
+ '[class]': '_class()',
9560
10012
  }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
9561
10013
  }] });
9562
10014
 
9563
10015
  class ScMenuItem {
9564
10016
  class = input('');
9565
- classes = computed(() => cn('w-full flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_.svg]:pointer-events-none [&_.svg]:size-4 [&_.svg]:shrink-0', this._inset() && 'pl-8', this.class()));
10017
+ classes = computed(() => cn('w-full flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', this._inset() && 'pl-8', this.class()));
9566
10018
  _inset = input(false, {
9567
10019
  alias: 'inset',
9568
10020
  transform: booleanAttribute,
9569
10021
  });
9570
10022
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
9571
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScMenuItem, isStandalone: true, selector: "button[sc-menu-item]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, _inset: { classPropertyName: "_inset", publicName: "inset", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, hostDirectives: [{ directive: i1$5.CdkMenuItem }], ngImport: i0, template: `
10023
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScMenuItem, isStandalone: true, selector: "button[sc-menu-item]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, _inset: { classPropertyName: "_inset", publicName: "inset", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, hostDirectives: [{ directive: i1$3.CdkMenuItem }], ngImport: i0, template: `
9572
10024
  <ng-content />
9573
10025
  `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
9574
10026
  }
@@ -9584,7 +10036,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
9584
10036
  class ScMenuCheckboxItem {
9585
10037
  _cdkMenuItemCheckbox = inject(CdkMenuItemCheckbox, { host: true });
9586
10038
  class = input('');
9587
- classes = computed(() => cn('relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', this.class()));
10039
+ classes = computed(() => cn('relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50', this.class()));
9588
10040
  disabled = input(false, {
9589
10041
  transform: booleanAttribute,
9590
10042
  });
@@ -9598,14 +10050,14 @@ class ScMenuCheckboxItem {
9598
10050
  });
9599
10051
  scTriggered = output();
9600
10052
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScMenuCheckboxItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
9601
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ScMenuCheckboxItem, isStandalone: true, selector: "button[sc-menu-checkbox-item]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, scChecked: { classPropertyName: "scChecked", publicName: "scChecked", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { scTriggered: "scTriggered" }, host: { properties: { "class": "classes()" } }, hostDirectives: [{ directive: i1$5.CdkMenuItemCheckbox, inputs: ["cdkMenuItemChecked", "scChecked"], outputs: ["cdkMenuItemTriggered", "scTriggered"] }], ngImport: i0, template: `
10053
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ScMenuCheckboxItem, isStandalone: true, selector: "button[sc-menu-checkbox-item]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, scChecked: { classPropertyName: "scChecked", publicName: "scChecked", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { scTriggered: "scTriggered" }, host: { properties: { "class": "classes()" } }, hostDirectives: [{ directive: i1$3.CdkMenuItemCheckbox, inputs: ["cdkMenuItemChecked", "scChecked"], outputs: ["cdkMenuItemTriggered", "scTriggered"] }], ngImport: i0, template: `
9602
10054
  @if (scChecked()) {
9603
10055
  <span class="absolute left-2 flex size-3.5 items-center justify-center">
9604
10056
  <svg-check-icon class="size-4" />
9605
10057
  </span>
9606
10058
  }
9607
10059
  <ng-content />
9608
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgCheckIcon, selector: "svg-check-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
10060
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgCheckIcon, selector: "svg-check-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
9609
10061
  }
9610
10062
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScMenuCheckboxItem, decorators: [{
9611
10063
  type: Component,
@@ -9631,7 +10083,7 @@ class ScMenuRadioGroup {
9631
10083
  class = input('');
9632
10084
  classes = computed(() => cn('', this.class()));
9633
10085
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScMenuRadioGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
9634
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScMenuRadioGroup, isStandalone: true, selector: "div[sc-menu-radio-group]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, hostDirectives: [{ directive: i1$5.CdkMenuGroup }], ngImport: i0, template: `
10086
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScMenuRadioGroup, isStandalone: true, selector: "div[sc-menu-radio-group]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, hostDirectives: [{ directive: i1$3.CdkMenuGroup }], ngImport: i0, template: `
9635
10087
  <ng-content />
9636
10088
  `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
9637
10089
  }
@@ -9646,16 +10098,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
9646
10098
 
9647
10099
  class ScMenuRadioItem {
9648
10100
  class = input('');
9649
- classes = computed(() => cn('relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', this.class()));
10101
+ classes = computed(() => cn('relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50', this.class()));
9650
10102
  value = input('');
9651
10103
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScMenuRadioItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
9652
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScMenuRadioItem, isStandalone: true, selector: "button[sc-menu-radio-item]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, hostDirectives: [{ directive: i1$5.CdkMenuItemRadio }], ngImport: i0, template: `
10104
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScMenuRadioItem, isStandalone: true, selector: "button[sc-menu-radio-item]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, hostDirectives: [{ directive: i1$3.CdkMenuItemRadio }], ngImport: i0, template: `
9653
10105
  <span class="absolute left-2 flex size-3.5 items-center justify-center">
9654
10106
  <svg-circle-icon class="size-2 fill-current" />
9655
10107
  </span>
9656
10108
 
9657
10109
  <ng-content />
9658
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgCircleIcon, selector: "svg-circle-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
10110
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgCircleIcon, selector: "svg-circle-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
9659
10111
  }
9660
10112
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScMenuRadioItem, decorators: [{
9661
10113
  type: Component,
@@ -9673,7 +10125,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
9673
10125
  class ScMenuTriggerFor {
9674
10126
  scMenuTriggerFor = input.required();
9675
10127
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScMenuTriggerFor, deps: [], target: i0.ɵɵFactoryTarget.Directive });
9676
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.5", type: ScMenuTriggerFor, isStandalone: true, selector: "[scMenuTriggerFor]", inputs: { scMenuTriggerFor: { classPropertyName: "scMenuTriggerFor", publicName: "scMenuTriggerFor", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: i1$5.CdkMenuTrigger, inputs: ["cdkMenuTriggerFor", "scMenuTriggerFor"] }], ngImport: i0 });
10128
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.5", type: ScMenuTriggerFor, isStandalone: true, selector: "[scMenuTriggerFor]", inputs: { scMenuTriggerFor: { classPropertyName: "scMenuTriggerFor", publicName: "scMenuTriggerFor", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: i1$3.CdkMenuTrigger, inputs: ["cdkMenuTriggerFor", "scMenuTriggerFor"] }], ngImport: i0 });
9677
10129
  }
9678
10130
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScMenuTriggerFor, decorators: [{
9679
10131
  type: Directive,
@@ -9692,7 +10144,7 @@ class ScMenuCheckboxGroup {
9692
10144
  class = input('');
9693
10145
  classes = computed(() => cn('', this.class()));
9694
10146
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScMenuCheckboxGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
9695
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScMenuCheckboxGroup, isStandalone: true, selector: "div[sc-menu-checkbox-group]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, hostDirectives: [{ directive: i1$5.CdkMenuGroup }], ngImport: i0, template: `
10147
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScMenuCheckboxGroup, isStandalone: true, selector: "div[sc-menu-checkbox-group]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, hostDirectives: [{ directive: i1$3.CdkMenuGroup }], ngImport: i0, template: `
9696
10148
  <ng-content />
9697
10149
  `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
9698
10150
  }
@@ -9709,7 +10161,7 @@ class ScMenuBar {
9709
10161
  class = input('');
9710
10162
  classes = computed(() => cn('flex h-10 items-center space-x-1 rounded-md border bg-background p-1', this.class()));
9711
10163
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScMenuBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
9712
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScMenuBar, isStandalone: true, selector: "div[sc-menu-bar]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, hostDirectives: [{ directive: i1$5.CdkMenuBar }], ngImport: i0, template: `
10164
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScMenuBar, isStandalone: true, selector: "div[sc-menu-bar]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, hostDirectives: [{ directive: i1$3.CdkMenuBar }], ngImport: i0, template: `
9713
10165
  <ng-content />
9714
10166
  `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
9715
10167
  }
@@ -9726,7 +10178,7 @@ class ScMenuBarItem {
9726
10178
  class = input('');
9727
10179
  classes = computed(() => cn('flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground', this.class()));
9728
10180
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScMenuBarItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
9729
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScMenuBarItem, isStandalone: true, selector: "button[sc-menu-bar-item]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, hostDirectives: [{ directive: i1$5.CdkMenuItem }], ngImport: i0, template: `
10181
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScMenuBarItem, isStandalone: true, selector: "button[sc-menu-bar-item]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, hostDirectives: [{ directive: i1$3.CdkMenuItem }], ngImport: i0, template: `
9730
10182
  <ng-content />
9731
10183
  `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
9732
10184
  }
@@ -9767,7 +10219,7 @@ class ScCommandInput {
9767
10219
  class="flex h-12 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50"
9768
10220
  [placeholder]="placeholder()"
9769
10221
  />
9770
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgSearchIcon, selector: "svg-search-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
10222
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgSearchIcon, selector: "svg-search-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
9771
10223
  }
9772
10224
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScCommandInput, decorators: [{
9773
10225
  type: Component,
@@ -9855,7 +10307,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
9855
10307
 
9856
10308
  class ScCommandItem {
9857
10309
  class = input('');
9858
- classes = computed(() => cn("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_.svg]:pointer-events-none [&_.svg]:size-4 [&_.svg]:shrink-0", this.class()));
10310
+ classes = computed(() => cn("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", this.class()));
9859
10311
  disabled = input(false, {
9860
10312
  transform: booleanAttribute,
9861
10313
  });
@@ -9996,7 +10448,7 @@ class ScCollapsible {
9996
10448
  }
9997
10449
  </cdk-accordion-item>
9998
10450
  </cdk-accordion>
9999
- `, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: CdkAccordionModule }, { kind: "directive", type: i1$4.CdkAccordion, selector: "cdk-accordion, [cdkAccordion]", inputs: ["multi"], exportAs: ["cdkAccordion"] }, { kind: "directive", type: i1$4.CdkAccordionItem, selector: "cdk-accordion-item, [cdkAccordionItem]", inputs: ["expanded", "disabled"], outputs: ["closed", "opened", "destroyed", "expandedChange"], exportAs: ["cdkAccordionItem"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
10451
+ `, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: CdkAccordionModule }, { kind: "directive", type: i1$2.CdkAccordion, selector: "cdk-accordion, [cdkAccordion]", inputs: ["multi"], exportAs: ["cdkAccordion"] }, { kind: "directive", type: i1$2.CdkAccordionItem, selector: "cdk-accordion-item, [cdkAccordionItem]", inputs: ["expanded", "disabled"], outputs: ["closed", "opened", "destroyed", "expandedChange"], exportAs: ["cdkAccordionItem"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
10000
10452
  }
10001
10453
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScCollapsible, decorators: [{
10002
10454
  type: Component,
@@ -10094,7 +10546,7 @@ class ScSidebarToggler {
10094
10546
  <ng-content />
10095
10547
  <span class="sr-only">Toggle Sidebar</span>
10096
10548
  </button>
10097
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
10549
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
10098
10550
  }
10099
10551
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScSidebarToggler, decorators: [{
10100
10552
  type: Component,
@@ -10142,7 +10594,7 @@ class ScSidebarMobile {
10142
10594
 
10143
10595
  <ng-content />
10144
10596
  </div>
10145
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScSidebarToggler, selector: "sc-sidebar-toggler" }, { kind: "component", type: SvgXIcon, selector: "svg-x-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
10597
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScSidebarToggler, selector: "sc-sidebar-toggler" }, { kind: "component", type: SvgXIcon, selector: "svg-x-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
10146
10598
  }
10147
10599
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScSidebarMobile, decorators: [{
10148
10600
  type: Component,
@@ -10172,7 +10624,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
10172
10624
  }] });
10173
10625
 
10174
10626
  class ScSidebar {
10175
- observer;
10627
+ observer = inject(BreakpointObserver);
10176
10628
  sidebarState = inject(ScSidebarState);
10177
10629
  class = input('');
10178
10630
  classes = computed(() => cn('block relative', this.class()));
@@ -10194,8 +10646,7 @@ class ScSidebar {
10194
10646
  this.variant() === 'floating' || this.variant() === 'inset'
10195
10647
  ? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]'
10196
10648
  : 'group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l'));
10197
- constructor(observer) {
10198
- this.observer = observer;
10649
+ constructor() {
10199
10650
  this.observer.observe('(max-width: 768px)').subscribe((result) => {
10200
10651
  this.sidebarState.isMobile.set(result.matches);
10201
10652
  if (!result.matches && this.openMobile()) {
@@ -10203,7 +10654,7 @@ class ScSidebar {
10203
10654
  }
10204
10655
  });
10205
10656
  }
10206
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScSidebar, deps: [{ token: i1$6.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Component });
10657
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScSidebar, deps: [], target: i0.ɵɵFactoryTarget.Component });
10207
10658
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ScSidebar, isStandalone: true, selector: "sc-sidebar", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0, template: `
10208
10659
  <ng-template #sc_sidebar_content>
10209
10660
  <ng-content />
@@ -10277,7 +10728,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
10277
10728
  `, host: {
10278
10729
  '[class]': 'classes()',
10279
10730
  }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
10280
- }], ctorParameters: () => [{ type: i1$6.BreakpointObserver }] });
10731
+ }], ctorParameters: () => [] });
10281
10732
 
10282
10733
  class ScSidebarProvider {
10283
10734
  sidebarState = inject(ScSidebarState);
@@ -10305,7 +10756,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
10305
10756
 
10306
10757
  class ScAutocompleteItem {
10307
10758
  class = input('');
10308
- classes = computed(() => cn('relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none hover:bg-accent hover:text-accent-foreground data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_.svg]:pointer-events-none [&_.svg]:size-4 [&_.svg]:shrink-0', this.class()));
10759
+ classes = computed(() => cn('relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none hover:bg-accent hover:text-accent-foreground data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', this.class()));
10309
10760
  _disabled = input(false, {
10310
10761
  transform: booleanAttribute,
10311
10762
  });
@@ -10332,7 +10783,7 @@ class ScAutocompleteItem {
10332
10783
  @if (isSelected()) {
10333
10784
  <svg-check-icon class="ml-auto" />
10334
10785
  }
10335
- `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgCheckIcon, selector: "svg-check-icon", inputs: ["class", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
10786
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgCheckIcon, selector: "svg-check-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
10336
10787
  }
10337
10788
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScAutocompleteItem, decorators: [{
10338
10789
  type: Component,
@@ -10470,9 +10921,1202 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
10470
10921
  }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
10471
10922
  }] });
10472
10923
 
10924
+ class ScTimeOption {
10925
+ /** The unique ID of the option. */
10926
+ id = signal(inject(_IdGenerator).getId('sc-time-option-'));
10927
+ class = input('');
10928
+ _class = computed(() => cn('relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50', this._active() && 'bg-accent text-accent-foreground', this.class()));
10929
+ _active = signal(false);
10930
+ _selected = signal(false);
10931
+ _disabledByInput = input(false, {
10932
+ alias: 'disabled',
10933
+ transform: booleanAttribute,
10934
+ });
10935
+ _disabled = computed(() => this._disabledByInput() || booleanAttribute(this.disabled));
10936
+ value = input();
10937
+ setActiveStyles() {
10938
+ this._active.set(true);
10939
+ }
10940
+ setInactiveStyles() {
10941
+ this._active.set(false);
10942
+ }
10943
+ disabled;
10944
+ getLabel() {
10945
+ return this.value() ?? '';
10946
+ }
10947
+ _element = inject(ElementRef);
10948
+ /** Gets the host DOM element. */
10949
+ _getHostElement() {
10950
+ return this._element.nativeElement;
10951
+ }
10952
+ /** Selects the option. */
10953
+ select() {
10954
+ if (!this._selected()) {
10955
+ this._selected.set(true);
10956
+ }
10957
+ }
10958
+ /** Deselects the option. */
10959
+ deselect() {
10960
+ if (this._selected()) {
10961
+ this._selected.set(false);
10962
+ }
10963
+ }
10964
+ onClick() {
10965
+ if (this._selected()) {
10966
+ this._selected.set(false);
10967
+ }
10968
+ else {
10969
+ this.selected.emit(this.value());
10970
+ this._selected.set(true);
10971
+ }
10972
+ }
10973
+ selected = output();
10974
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScTimeOption, deps: [], target: i0.ɵɵFactoryTarget.Component });
10975
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ScTimeOption, isStandalone: true, selector: "sc-time-option", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, _disabledByInput: { classPropertyName: "_disabledByInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected" }, host: { listeners: { "mouseover": "setActiveStyles()", "mouseleave": "setInactiveStyles()", "click": "onClick()" }, properties: { "id": "id()", "class": "_class()", "attr.data-disabled": "_disabled()" } }, ngImport: i0, template: `
10976
+ @if (_selected()) {
10977
+ <svg-check-icon class="absolute left-2 flex size-4 items-center justify-center" />
10978
+ }
10979
+
10980
+ <ng-content />
10981
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgCheckIcon, selector: "svg-check-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
10982
+ }
10983
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScTimeOption, decorators: [{
10984
+ type: Component,
10985
+ args: [{ selector: 'sc-time-option', imports: [SvgCheckIcon], template: `
10986
+ @if (_selected()) {
10987
+ <svg-check-icon class="absolute left-2 flex size-4 items-center justify-center" />
10988
+ }
10989
+
10990
+ <ng-content />
10991
+ `, host: {
10992
+ '[id]': 'id()',
10993
+ '[class]': '_class()',
10994
+ '[attr.data-disabled]': '_disabled()',
10995
+ '(mouseover)': 'setActiveStyles()',
10996
+ '(mouseleave)': 'setInactiveStyles()',
10997
+ '(click)': 'onClick()',
10998
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
10999
+ }] });
11000
+
11001
+ class ScTimePickerInput {
11002
+ class = input('');
11003
+ classes = computed(() => cn(scInputStyles(), this.class()));
11004
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScTimePickerInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
11005
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.5", type: ScTimePickerInput, isStandalone: true, selector: "[scTimePickerInput]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0 });
11006
+ }
11007
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScTimePickerInput, decorators: [{
11008
+ type: Directive,
11009
+ args: [{
11010
+ selector: '[scTimePickerInput]',
11011
+ host: {
11012
+ '[class]': 'classes()',
11013
+ },
11014
+ }]
11015
+ }] });
11016
+
11017
+ class ScTimePicker {
11018
+ settings = inject(ScSettings);
11019
+ clock = input(undefined);
11020
+ _clock = computed(() => {
11021
+ if (this.clock() !== undefined) {
11022
+ return this.clock();
11023
+ }
11024
+ return this.settings.clock();
11025
+ });
11026
+ class = input('');
11027
+ classes = computed(() => cn('flex relative', this.class()));
11028
+ _overlay = inject(Overlay);
11029
+ _dir = inject(Directionality, { optional: true });
11030
+ _viewContainerRef = inject(ViewContainerRef);
11031
+ _injector = inject(Injector);
11032
+ // private _defaultConfig = inject(MAT_TIMEPICKER_CONFIG, { optional: true });
11033
+ // private _dateAdapter = inject<DateAdapter<D>>(DateAdapter, { optional: true })!;
11034
+ // private _dateFormats = inject(MAT_DATE_FORMATS, { optional: true })!;
11035
+ _isOpen = signal(false);
11036
+ _activeDescendant = signal(null);
11037
+ _input = viewChild.required('input');
11038
+ _overlayRef = null;
11039
+ _portal = null;
11040
+ _optionsCacheKey = null;
11041
+ _localeChanges;
11042
+ _onOpenRender = null;
11043
+ _panelTemplate = viewChild.required('panelTemplate');
11044
+ _timeOptions = [];
11045
+ _options = viewChildren(ScTimeOption);
11046
+ _keyManager = new ActiveDescendantKeyManager(this._options, this._injector)
11047
+ .withHomeAndEnd(true)
11048
+ .withPageUpDown(true)
11049
+ .withVerticalOrientation(true);
11050
+ /**
11051
+ * Interval between each option in the timepicker. The value can either be an amount of
11052
+ * seconds (e.g. 90) or a number with a unit (e.g. 45m). Supported units are `s` for seconds,
11053
+ * `m` for minutes or `h` for hours.
11054
+ */
11055
+ // readonly interval: InputSignalWithTransform<number | null, number | string | null> = input(
11056
+ // parseInterval(this._defaultConfig?.interval || null),
11057
+ // { transform: parseInterval },
11058
+ // );
11059
+ /**
11060
+ * Array of pre-defined options that the user can select from, as an alternative to using the
11061
+ * `interval` input. An error will be thrown if both `options` and `interval` are specified.
11062
+ */
11063
+ options = input(null);
11064
+ /** Whether the timepicker is open. */
11065
+ isOpen = this._isOpen.asReadonly();
11066
+ /** Emits when the user selects a time. */
11067
+ selected = output();
11068
+ /** Emits when the timepicker is opened. */
11069
+ opened = output();
11070
+ /** Emits when the timepicker is closed. */
11071
+ closed = output();
11072
+ /** ID of the active descendant option. */
11073
+ activeDescendant = this._activeDescendant.asReadonly();
11074
+ /** Unique ID of the timepicker's panel */
11075
+ panelId = inject(_IdGenerator).getId('sc-time-picker-panel-');
11076
+ /** Whether ripples within the timepicker should be disabled. */
11077
+ // readonly disableRipple: InputSignalWithTransform<boolean, unknown> = input(
11078
+ // this._defaultConfig?.disableRipple ?? false,
11079
+ // {
11080
+ // transform: booleanAttribute,
11081
+ // },
11082
+ // );
11083
+ /** ARIA label for the timepicker panel. */
11084
+ ariaLabel = input(null, {
11085
+ alias: 'aria-label',
11086
+ });
11087
+ /** ID of the label element for the timepicker panel. */
11088
+ ariaLabelledby = input(null, {
11089
+ alias: 'aria-labelledby',
11090
+ });
11091
+ /** Whether the timepicker is currently disabled. */
11092
+ disabled = computed(() => !!this._input().nativeElement?.disabled);
11093
+ constructor() {
11094
+ // if (typeof ngDevMode === 'undefined' || ngDevMode) {
11095
+ // validateAdapter(this._dateAdapter, this._dateFormats);
11096
+ effect(() => {
11097
+ const options = this.options();
11098
+ // const interval = this.interval();
11099
+ // if (options !== null && interval !== null) {
11100
+ // throw new Error(
11101
+ // 'Cannot specify both the `options` and `interval` inputs at the same time',
11102
+ // );
11103
+ // } else if (options?.length === 0) {
11104
+ // throw new Error('Value of `options` input cannot be an empty array');
11105
+ // }
11106
+ });
11107
+ // }
11108
+ // Since the panel ID is static, we can set it once without having to maintain a host binding.
11109
+ const element = inject(ElementRef);
11110
+ element.nativeElement.setAttribute('sc-time-picker-panel-id', this.panelId);
11111
+ this._handleLocaleChanges();
11112
+ this._handleInputStateChanges();
11113
+ this._keyManager.change.subscribe(() => this._activeDescendant.set(this._keyManager.activeItem?.id() || null));
11114
+ }
11115
+ /** Opens the timepicker. */
11116
+ open() {
11117
+ const input = this._input();
11118
+ if (!input) {
11119
+ return;
11120
+ }
11121
+ // Focus should already be on the input, but this call is in case the timepicker is opened
11122
+ // programmatically. We need to call this even if the timepicker is already open, because
11123
+ // the user might be clicking the toggle.
11124
+ input.nativeElement.focus();
11125
+ if (this._isOpen()) {
11126
+ return;
11127
+ }
11128
+ this._isOpen.set(true);
11129
+ this._generateOptions();
11130
+ const overlayRef = this._getOverlayRef();
11131
+ overlayRef.updateSize({ width: input.nativeElement.offsetWidth });
11132
+ this._portal ??= new TemplatePortal(this._panelTemplate(), this._viewContainerRef);
11133
+ overlayRef.attach(this._portal);
11134
+ this._onOpenRender?.destroy();
11135
+ this._onOpenRender = afterNextRender(() => {
11136
+ const options = this._options();
11137
+ this._syncSelectedState(input.nativeElement?.value, options, options[0]);
11138
+ this._onOpenRender = null;
11139
+ }, { injector: this._injector });
11140
+ this.opened.emit();
11141
+ }
11142
+ /** Closes the timepicker. */
11143
+ close() {
11144
+ if (this._isOpen()) {
11145
+ this._isOpen.set(false);
11146
+ this._overlayRef?.detach();
11147
+ this.closed.emit();
11148
+ }
11149
+ }
11150
+ /** Registers an input with the timepicker. */
11151
+ // registerInput(input: MatTimepickerInput<D>): void {
11152
+ // const currentInput = this._input();
11153
+ // if (currentInput && input !== currentInput && (typeof ngDevMode === 'undefined' || ngDevMode)) {
11154
+ // throw new Error('MatTimepicker can only be registered with one input at a time');
11155
+ // }
11156
+ // this._input.set(input);
11157
+ // }
11158
+ ngOnDestroy() {
11159
+ this._keyManager.destroy();
11160
+ this._localeChanges.unsubscribe();
11161
+ this._onOpenRender?.destroy();
11162
+ this._overlayRef?.dispose();
11163
+ }
11164
+ /** Selects a specific time value. */
11165
+ _selectValue(value) {
11166
+ //TODO
11167
+ this._input().nativeElement.value = value;
11168
+ this.close();
11169
+ this.selected.emit({ value });
11170
+ this._input().nativeElement?.focus();
11171
+ }
11172
+ /** Gets the value of the `aria-labelledby` attribute. */
11173
+ _getAriaLabelledby() {
11174
+ if (this.ariaLabel()) {
11175
+ return null;
11176
+ }
11177
+ return this.ariaLabelledby() || null;
11178
+ }
11179
+ /** Creates an overlay reference for the timepicker panel. */
11180
+ _getOverlayRef() {
11181
+ if (this._overlayRef) {
11182
+ return this._overlayRef;
11183
+ }
11184
+ const positionStrategy = this._overlay
11185
+ .position()
11186
+ .flexibleConnectedTo(this._input())
11187
+ .withFlexibleDimensions(false)
11188
+ .withPush(false)
11189
+ // .withTransformOriginOn('.mat-timepicker-panel')
11190
+ .withPositions([
11191
+ {
11192
+ originX: 'start',
11193
+ originY: 'bottom',
11194
+ overlayX: 'start',
11195
+ overlayY: 'top',
11196
+ },
11197
+ {
11198
+ originX: 'start',
11199
+ originY: 'top',
11200
+ overlayX: 'start',
11201
+ overlayY: 'bottom',
11202
+ // panelClass: 'mat-timepicker-above',
11203
+ },
11204
+ ]);
11205
+ this._overlayRef = this._overlay.create({
11206
+ positionStrategy,
11207
+ scrollStrategy: this._overlay.scrollStrategies.reposition(),
11208
+ direction: this._dir || 'ltr',
11209
+ hasBackdrop: false,
11210
+ });
11211
+ this._overlayRef.keydownEvents().subscribe((event) => {
11212
+ this._handleKeydown(event);
11213
+ });
11214
+ this._overlayRef.outsidePointerEvents().subscribe((event) => {
11215
+ const target = _getEventTarget(event);
11216
+ const origin = this._input().nativeElement;
11217
+ if (target && origin && target !== origin && !origin.contains(target)) {
11218
+ this.close();
11219
+ }
11220
+ });
11221
+ return this._overlayRef;
11222
+ }
11223
+ /** Generates the list of options from which the user can select.. */
11224
+ _generateOptions() {
11225
+ // Default the interval to 30 minutes.
11226
+ this._timeOptions = [
11227
+ { value: '1', label: '1' },
11228
+ { value: '2', label: '2' },
11229
+ { value: '3', label: '3' },
11230
+ { value: '4', label: '4' },
11231
+ { value: '5', label: '5' },
11232
+ { value: '6', label: '6' },
11233
+ ];
11234
+ }
11235
+ /**
11236
+ * Synchronizes the internal state of the component based on a specific selected date.
11237
+ * @param value Currently selected date.
11238
+ * @param options Options rendered out in the timepicker.
11239
+ * @param fallback Option to set as active if no option is selected.
11240
+ */
11241
+ _syncSelectedState(value, options, fallback) {
11242
+ let hasSelected = false;
11243
+ for (const option of options) {
11244
+ if (value && option.value() === value) {
11245
+ option.select();
11246
+ scrollOptionIntoView(option, 'center');
11247
+ untracked(() => this._keyManager.setActiveItem(option));
11248
+ hasSelected = true;
11249
+ }
11250
+ else {
11251
+ option.deselect();
11252
+ }
11253
+ }
11254
+ // If no option was selected, we need to reset the key manager since
11255
+ // it might be holding onto an option that no longer exists.
11256
+ if (!hasSelected) {
11257
+ if (fallback) {
11258
+ untracked(() => this._keyManager.setActiveItem(fallback));
11259
+ scrollOptionIntoView(fallback, 'center');
11260
+ }
11261
+ else {
11262
+ untracked(() => this._keyManager.setActiveItem(-1));
11263
+ }
11264
+ }
11265
+ }
11266
+ /** Handles keyboard events while the overlay is open. */
11267
+ _handleKeydown(event) {
11268
+ const keyCode = event.keyCode;
11269
+ if (keyCode === TAB) {
11270
+ this.close();
11271
+ }
11272
+ else if (keyCode === ESCAPE && !hasModifierKey(event)) {
11273
+ event.preventDefault();
11274
+ this.close();
11275
+ }
11276
+ else if (keyCode === ENTER) {
11277
+ event.preventDefault();
11278
+ if (this._keyManager.activeItem) {
11279
+ this._selectValue(this._keyManager.activeItem.value() ?? '');
11280
+ }
11281
+ else {
11282
+ this.close();
11283
+ }
11284
+ }
11285
+ else {
11286
+ const previousActive = this._keyManager.activeItem;
11287
+ this._keyManager.onKeydown(event);
11288
+ const currentActive = this._keyManager.activeItem;
11289
+ if (currentActive && currentActive !== previousActive) {
11290
+ scrollOptionIntoView(currentActive, 'nearest');
11291
+ }
11292
+ }
11293
+ }
11294
+ /** Sets up the logic that updates the timepicker when the locale changes. */
11295
+ _handleLocaleChanges() {
11296
+ // Re-generate the options list if the locale changes.
11297
+ // this._localeChanges = this._dateAdapter.localeChanges.subscribe(() => {
11298
+ // this._optionsCacheKey = null;
11299
+ // if (this.isOpen()) {
11300
+ // this._generateOptions();
11301
+ // }
11302
+ // });
11303
+ }
11304
+ /**
11305
+ * Sets up the logic that updates the timepicker when the state of the connected input changes.
11306
+ */
11307
+ _handleInputStateChanges() {
11308
+ effect(() => {
11309
+ const input = this._input();
11310
+ const options = this._options();
11311
+ if (this._isOpen() && input) {
11312
+ this._syncSelectedState(input.nativeElement.value, options, null);
11313
+ }
11314
+ });
11315
+ }
11316
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScTimePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
11317
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ScTimePicker, isStandalone: true, selector: "sc-time-picker", inputs: { clock: { classPropertyName: "clock", publicName: "clock", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected", opened: "opened", closed: "closed" }, host: { properties: { "class": "classes()" } }, viewQueries: [{ propertyName: "_input", first: true, predicate: ["input"], descendants: true, isSignal: true }, { propertyName: "_panelTemplate", first: true, predicate: ["panelTemplate"], descendants: true, isSignal: true }, { propertyName: "_options", predicate: ScTimeOption, descendants: true, isSignal: true }], ngImport: i0, template: `
11318
+ <button class="absolute inset-y-0 end-0 pe-4" (click)="open()" sc-button variant="ghost">
11319
+ <svg-clock-icon />
11320
+ </button>
11321
+ <input #input scTimePickerInput type="text" placeholder="hh:mm" />
11322
+
11323
+ <ng-template #panelTemplate>
11324
+ <div
11325
+ class="relative z-50 max-h-96 w-full min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"
11326
+ [attr.aria-label]="ariaLabel() || null"
11327
+ [attr.aria-labelledby]="_getAriaLabelledby()"
11328
+ [id]="panelId"
11329
+ role="listbox"
11330
+ >
11331
+ @for (option of _timeOptions; track option.value) {
11332
+ <sc-time-option [value]="option.value" (selected)="_selectValue(option.value)">
11333
+ {{ option.label }}
11334
+ </sc-time-option>
11335
+ }
11336
+ </div>
11337
+ </ng-template>
11338
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgClockIcon, selector: "svg-clock-icon", inputs: ["class"] }, { kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class", "disabled"] }, { kind: "component", type: ScTimeOption, selector: "sc-time-option", inputs: ["class", "disabled", "value"], outputs: ["selected"] }, { kind: "directive", type: ScTimePickerInput, selector: "[scTimePickerInput]", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
11339
+ }
11340
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScTimePicker, decorators: [{
11341
+ type: Component,
11342
+ args: [{ selector: 'sc-time-picker', imports: [SvgClockIcon, ScButton, ScTimeOption, ScTimePickerInput], template: `
11343
+ <button class="absolute inset-y-0 end-0 pe-4" (click)="open()" sc-button variant="ghost">
11344
+ <svg-clock-icon />
11345
+ </button>
11346
+ <input #input scTimePickerInput type="text" placeholder="hh:mm" />
11347
+
11348
+ <ng-template #panelTemplate>
11349
+ <div
11350
+ class="relative z-50 max-h-96 w-full min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"
11351
+ [attr.aria-label]="ariaLabel() || null"
11352
+ [attr.aria-labelledby]="_getAriaLabelledby()"
11353
+ [id]="panelId"
11354
+ role="listbox"
11355
+ >
11356
+ @for (option of _timeOptions; track option.value) {
11357
+ <sc-time-option [value]="option.value" (selected)="_selectValue(option.value)">
11358
+ {{ option.label }}
11359
+ </sc-time-option>
11360
+ }
11361
+ </div>
11362
+ </ng-template>
11363
+ `, host: {
11364
+ '[class]': 'classes()',
11365
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
11366
+ }], ctorParameters: () => [] });
11367
+ /**
11368
+ * Scrolls an option into view.
11369
+ * @param option Option to be scrolled into view.
11370
+ * @param position Position to which to align the option relative to the scrollable container.
11371
+ */
11372
+ function scrollOptionIntoView(option, position) {
11373
+ option._getHostElement().scrollIntoView({ block: position, inline: position });
11374
+ }
11375
+
11376
+ class ScImage {
11377
+ class = input('');
11378
+ _class = computed(() => cn('', this.class()));
11379
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScImage, deps: [], target: i0.ɵɵFactoryTarget.Component });
11380
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScImage, isStandalone: true, selector: "img[sc-image]", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_class()" } }, ngImport: i0, template: `
11381
+ <ng-content />
11382
+ `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
11383
+ }
11384
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScImage, decorators: [{
11385
+ type: Component,
11386
+ args: [{ selector: 'img[sc-image]', imports: [], template: `
11387
+ <ng-content />
11388
+ `, host: {
11389
+ '[class]': '_class()',
11390
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
11391
+ }] });
11392
+
11393
+ class ScFileUpload {
11394
+ class = input('');
11395
+ _class = computed(() => cn('', this.class()));
11396
+ selectedFile = signal(undefined);
11397
+ handleFileChange(event) {
11398
+ const target = event.target;
11399
+ const files = target.files;
11400
+ console.log(files);
11401
+ const file = files[0];
11402
+ if (file) {
11403
+ const reader = new FileReader();
11404
+ reader.onloadend = () => {
11405
+ this.selectedFile.set(reader.result);
11406
+ };
11407
+ reader.readAsDataURL(file);
11408
+ }
11409
+ }
11410
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScFileUpload, deps: [], target: i0.ɵɵFactoryTarget.Component });
11411
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ScFileUpload, isStandalone: true, selector: "sc-file-upload", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_class()" } }, ngImport: i0, template: `
11412
+ <div class="grid w-full max-w-sm items-center gap-1.5">
11413
+ <label sc-label for="picture">Picture</label>
11414
+ <input id="picture" (change)="handleFileChange($event)" sc-input type="file" />
11415
+ @if (selectedFile()) {
11416
+ <div class="mt-2">
11417
+ <img
11418
+ class="rounded-md"
11419
+ [src]="selectedFile()"
11420
+ sc-image
11421
+ alt="Preview"
11422
+ width="500"
11423
+ height="500"
11424
+ />
11425
+ </div>
11426
+ }
11427
+ </div>
11428
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScLabel, selector: "label[sc-label]", inputs: ["class"] }, { kind: "component", type: ScInput, selector: "input[sc-input]", inputs: ["class"] }, { kind: "component", type: ScImage, selector: "img[sc-image]", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
11429
+ }
11430
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScFileUpload, decorators: [{
11431
+ type: Component,
11432
+ args: [{ selector: 'sc-file-upload', imports: [ScLabel, ScInput, ScImage], template: `
11433
+ <div class="grid w-full max-w-sm items-center gap-1.5">
11434
+ <label sc-label for="picture">Picture</label>
11435
+ <input id="picture" (change)="handleFileChange($event)" sc-input type="file" />
11436
+ @if (selectedFile()) {
11437
+ <div class="mt-2">
11438
+ <img
11439
+ class="rounded-md"
11440
+ [src]="selectedFile()"
11441
+ sc-image
11442
+ alt="Preview"
11443
+ width="500"
11444
+ height="500"
11445
+ />
11446
+ </div>
11447
+ }
11448
+ </div>
11449
+ `, host: {
11450
+ '[class]': '_class()',
11451
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
11452
+ }] });
11453
+
11454
+ class ScDropZone {
11455
+ isDragActive = signal(false);
11456
+ isDisabled = input(false);
11457
+ class = input('');
11458
+ _class = computed(() => cn('group relative grid h-52 w-full cursor-pointer place-items-center rounded-lg border-2 border-dashed border-muted-foreground/25 px-5 py-2.5 text-center transition hover:bg-muted/25', 'ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2', this.isDragActive() && 'border-muted-foreground/50', this.isDisabled() && 'pointer-events-none opacity-60', this.class()));
11459
+ handleDragOver(event) {
11460
+ if (this.isDisabled()) {
11461
+ event.preventDefault();
11462
+ event.stopPropagation();
11463
+ }
11464
+ else {
11465
+ this.isDragActive.set(true);
11466
+ }
11467
+ }
11468
+ handleDragLeave(event) {
11469
+ if (this.isDisabled()) {
11470
+ event.preventDefault();
11471
+ event.stopPropagation();
11472
+ }
11473
+ else {
11474
+ this.isDragActive.set(false);
11475
+ }
11476
+ }
11477
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScDropZone, deps: [], target: i0.ɵɵFactoryTarget.Directive });
11478
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.5", type: ScDropZone, isStandalone: true, selector: "[scDropZone]", inputs: { isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "dragover": "handleDragOver($event)", "dragleave": "handleDragLeave($event)" }, properties: { "class": "_class()" } }, exportAs: ["scDropZone"], ngImport: i0 });
11479
+ }
11480
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScDropZone, decorators: [{
11481
+ type: Directive,
11482
+ args: [{
11483
+ selector: '[scDropZone]',
11484
+ exportAs: 'scDropZone',
11485
+ host: {
11486
+ '[class]': '_class()',
11487
+ '(dragover)': 'handleDragOver($event)',
11488
+ '(dragleave)': 'handleDragLeave($event)',
11489
+ },
11490
+ }]
11491
+ }] });
11492
+
11493
+ class ScFilePreview {
11494
+ file = input.required();
11495
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScFilePreview, deps: [], target: i0.ɵɵFactoryTarget.Component });
11496
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ScFilePreview, isStandalone: true, selector: "sc-file-preview", inputs: { file: { classPropertyName: "file", publicName: "file", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
11497
+ @if (file().file.type.startsWith('image/')) {
11498
+ <img
11499
+ class="aspect-square shrink-0 rounded-md object-cover"
11500
+ [src]="file().preview"
11501
+ [alt]="file().file.name"
11502
+ width="48"
11503
+ height="48"
11504
+ loading="lazy"
11505
+ />
11506
+ } @else {
11507
+ <svg-file-text-icon class="size-10 text-muted-foreground" aria-hidden="true" />
11508
+ }
11509
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgFileTextIcon, selector: "svg-file-text-icon", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
11510
+ }
11511
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScFilePreview, decorators: [{
11512
+ type: Component,
11513
+ args: [{ selector: 'sc-file-preview', imports: [SvgFileTextIcon], template: `
11514
+ @if (file().file.type.startsWith('image/')) {
11515
+ <img
11516
+ class="aspect-square shrink-0 rounded-md object-cover"
11517
+ [src]="file().preview"
11518
+ [alt]="file().file.name"
11519
+ width="48"
11520
+ height="48"
11521
+ loading="lazy"
11522
+ />
11523
+ } @else {
11524
+ <svg-file-text-icon class="size-10 text-muted-foreground" aria-hidden="true" />
11525
+ }
11526
+ `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
11527
+ }] });
11528
+
11529
+ function formatBytes(bytes, opts = {}) {
11530
+ const { decimals = 0, sizeType = 'normal' } = opts;
11531
+ const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
11532
+ const accurateSizes = ['Bytes', 'KiB', 'MiB', 'GiB', 'TiB'];
11533
+ if (bytes === 0)
11534
+ return '0 Byte';
11535
+ const i = Math.floor(Math.log(bytes) / Math.log(1024));
11536
+ return `${(bytes / Math.pow(1024, i)).toFixed(decimals)} ${sizeType === 'accurate' ? (accurateSizes[i] ?? 'Bytes') : (sizes[i] ?? 'Bytes')}`;
11537
+ }
11538
+
11539
+ class ScFileCard {
11540
+ index = input.required();
11541
+ file = input.required();
11542
+ progress = input(undefined);
11543
+ removed = output();
11544
+ formatedSize = computed(() => formatBytes(this.file().file.size));
11545
+ remove() {
11546
+ this.removed.emit(this.index());
11547
+ }
11548
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScFileCard, deps: [], target: i0.ɵɵFactoryTarget.Component });
11549
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ScFileCard, isStandalone: true, selector: "sc-file-card", inputs: { index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: true, transformFunction: null }, file: { classPropertyName: "file", publicName: "file", isSignal: true, isRequired: true, transformFunction: null }, progress: { classPropertyName: "progress", publicName: "progress", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { removed: "removed" }, ngImport: i0, template: `
11550
+ <div class="relative flex items-center gap-2.5">
11551
+ <div class="flex flex-1 gap-2.5">
11552
+ @if (file().preview) {
11553
+ <sc-file-preview [file]="file()" />
11554
+ }
11555
+
11556
+ <div class="flex w-full flex-col gap-2">
11557
+ <div class="flex flex-col gap-px">
11558
+ <p class="line-clamp-1 text-sm font-medium text-foreground/80">
11559
+ {{ file().file.name }}
11560
+ </p>
11561
+ <p class="text-xs text-muted-foreground">
11562
+ {{ formatedSize() }}
11563
+ </p>
11564
+ </div>
11565
+
11566
+ @let p = progress();
11567
+ @if (p) {
11568
+ <sc-progress [value]="p" />
11569
+ }
11570
+ </div>
11571
+ </div>
11572
+ <div class="flex items-center gap-2">
11573
+ <button
11574
+ class="size-7"
11575
+ (click)="remove()"
11576
+ sc-button
11577
+ type="button"
11578
+ variant="outline"
11579
+ size="icon"
11580
+ >
11581
+ <svg-x-icon class="size-4" aria-hidden="true" />
11582
+ <span class="sr-only">Remove file</span>
11583
+ </button>
11584
+ </div>
11585
+ </div>
11586
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgXIcon, selector: "svg-x-icon", inputs: ["class"] }, { kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class", "disabled"] }, { kind: "component", type: ScFilePreview, selector: "sc-file-preview", inputs: ["file"] }, { kind: "component", type: ScProgress, selector: "sc-progress", inputs: ["class", "value"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
11587
+ }
11588
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScFileCard, decorators: [{
11589
+ type: Component,
11590
+ args: [{ selector: 'sc-file-card', imports: [SvgXIcon, ScButton, ScFilePreview, ScProgress], template: `
11591
+ <div class="relative flex items-center gap-2.5">
11592
+ <div class="flex flex-1 gap-2.5">
11593
+ @if (file().preview) {
11594
+ <sc-file-preview [file]="file()" />
11595
+ }
11596
+
11597
+ <div class="flex w-full flex-col gap-2">
11598
+ <div class="flex flex-col gap-px">
11599
+ <p class="line-clamp-1 text-sm font-medium text-foreground/80">
11600
+ {{ file().file.name }}
11601
+ </p>
11602
+ <p class="text-xs text-muted-foreground">
11603
+ {{ formatedSize() }}
11604
+ </p>
11605
+ </div>
11606
+
11607
+ @let p = progress();
11608
+ @if (p) {
11609
+ <sc-progress [value]="p" />
11610
+ }
11611
+ </div>
11612
+ </div>
11613
+ <div class="flex items-center gap-2">
11614
+ <button
11615
+ class="size-7"
11616
+ (click)="remove()"
11617
+ sc-button
11618
+ type="button"
11619
+ variant="outline"
11620
+ size="icon"
11621
+ >
11622
+ <svg-x-icon class="size-4" aria-hidden="true" />
11623
+ <span class="sr-only">Remove file</span>
11624
+ </button>
11625
+ </div>
11626
+ </div>
11627
+ `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
11628
+ }] });
11629
+
11630
+ class ScFileUploader {
11631
+ class = input('');
11632
+ _class = computed(() => cn('relative flex flex-col gap-6 overflow-hidden', this.class()));
11633
+ maxSize = input(1024 * 1024 * 2);
11634
+ maxFiles = input(1);
11635
+ files = signal([]);
11636
+ multiple = computed(() => this.maxFiles() > 1);
11637
+ progresses = input();
11638
+ uploadInfo() {
11639
+ return this.maxFiles() > 1
11640
+ ? ` ${this.maxFiles()} files (up to ${formatBytes(this.maxSize())} each)`
11641
+ : ` a file with ${formatBytes(this.maxSize())}`;
11642
+ }
11643
+ onRemove(index) {
11644
+ if (!this.files)
11645
+ return;
11646
+ this.files.update((files) => files.filter((_, i) => i !== index));
11647
+ }
11648
+ handleFileChange(event) {
11649
+ const target = event.target;
11650
+ const files = target.files;
11651
+ const acceptedFiles = Array.from(files);
11652
+ acceptedFiles.forEach((file) => {
11653
+ const reader = new FileReader();
11654
+ reader.onloadend = () => {
11655
+ const scFile = { file: file, preview: reader.result };
11656
+ this.files.update((files) => [...files, scFile]);
11657
+ };
11658
+ reader.readAsDataURL(file);
11659
+ });
11660
+ }
11661
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScFileUploader, deps: [], target: i0.ɵɵFactoryTarget.Component });
11662
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ScFileUploader, isStandalone: true, selector: "sc-file-uploader", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, maxSize: { classPropertyName: "maxSize", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null }, maxFiles: { classPropertyName: "maxFiles", publicName: "maxFiles", isSignal: true, isRequired: false, transformFunction: null }, progresses: { classPropertyName: "progresses", publicName: "progresses", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_class()" } }, ngImport: i0, template: `
11663
+ <!-- Dropzone -->
11664
+ <div #scDropZone="scDropZone" scDropZone>
11665
+ <input
11666
+ class="absolute left-0 top-0 size-full cursor-pointer opacity-0"
11667
+ [multiple]="multiple()"
11668
+ (change)="handleFileChange($event)"
11669
+ accept="image/*"
11670
+ tabindex="-1"
11671
+ type="file"
11672
+ />
11673
+
11674
+ @if (scDropZone.isDragActive()) {
11675
+ <div class="flex flex-col items-center justify-center gap-4 sm:px-5">
11676
+ <div class="rounded-full border border-dashed p-3">
11677
+ <svg-upload-icon class="size-7 text-muted-foreground" aria-hidden="true" />
11678
+ </div>
11679
+ <p class="font-medium text-muted-foreground">Drop the files here</p>
11680
+ </div>
11681
+ } @else {
11682
+ <div class="flex flex-col items-center justify-center gap-4 sm:px-5">
11683
+ <div class="rounded-full border border-dashed p-3">
11684
+ <svg-upload-icon class="size-7 text-muted-foreground" aria-hidden="true" />
11685
+ </div>
11686
+ <div class="flex flex-col gap-px">
11687
+ <p class="font-medium text-muted-foreground">
11688
+ Drag 'n' drop your files here, or click to select files
11689
+ </p>
11690
+ <p class="text-sm text-muted-foreground/70">You can upload {{ uploadInfo() }}</p>
11691
+ </div>
11692
+ </div>
11693
+ }
11694
+ </div>
11695
+ <!-- fin Dropzone -->
11696
+
11697
+ <div class="h-fit w-full px-3">
11698
+ <div class="flex max-h-48 flex-col gap-4">
11699
+ @for (file of files(); track $index; let index = $index) {
11700
+ <sc-file-card
11701
+ [file]="file"
11702
+ [index]="index"
11703
+ [progress]="progresses()?.[file.file.name]"
11704
+ (removed)="onRemove($event)"
11705
+ />
11706
+ }
11707
+ </div>
11708
+ </div>
11709
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgUploadIcon, selector: "svg-upload-icon", inputs: ["class"] }, { kind: "component", type: ScFileCard, selector: "sc-file-card", inputs: ["index", "file", "progress"], outputs: ["removed"] }, { kind: "directive", type: ScDropZone, selector: "[scDropZone]", inputs: ["isDisabled", "class"], exportAs: ["scDropZone"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
11710
+ }
11711
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScFileUploader, decorators: [{
11712
+ type: Component,
11713
+ args: [{ selector: 'sc-file-uploader', imports: [SvgUploadIcon, ScFileCard, ScDropZone], template: `
11714
+ <!-- Dropzone -->
11715
+ <div #scDropZone="scDropZone" scDropZone>
11716
+ <input
11717
+ class="absolute left-0 top-0 size-full cursor-pointer opacity-0"
11718
+ [multiple]="multiple()"
11719
+ (change)="handleFileChange($event)"
11720
+ accept="image/*"
11721
+ tabindex="-1"
11722
+ type="file"
11723
+ />
11724
+
11725
+ @if (scDropZone.isDragActive()) {
11726
+ <div class="flex flex-col items-center justify-center gap-4 sm:px-5">
11727
+ <div class="rounded-full border border-dashed p-3">
11728
+ <svg-upload-icon class="size-7 text-muted-foreground" aria-hidden="true" />
11729
+ </div>
11730
+ <p class="font-medium text-muted-foreground">Drop the files here</p>
11731
+ </div>
11732
+ } @else {
11733
+ <div class="flex flex-col items-center justify-center gap-4 sm:px-5">
11734
+ <div class="rounded-full border border-dashed p-3">
11735
+ <svg-upload-icon class="size-7 text-muted-foreground" aria-hidden="true" />
11736
+ </div>
11737
+ <div class="flex flex-col gap-px">
11738
+ <p class="font-medium text-muted-foreground">
11739
+ Drag 'n' drop your files here, or click to select files
11740
+ </p>
11741
+ <p class="text-sm text-muted-foreground/70">You can upload {{ uploadInfo() }}</p>
11742
+ </div>
11743
+ </div>
11744
+ }
11745
+ </div>
11746
+ <!-- fin Dropzone -->
11747
+
11748
+ <div class="h-fit w-full px-3">
11749
+ <div class="flex max-h-48 flex-col gap-4">
11750
+ @for (file of files(); track $index; let index = $index) {
11751
+ <sc-file-card
11752
+ [file]="file"
11753
+ [index]="index"
11754
+ [progress]="progresses()?.[file.file.name]"
11755
+ (removed)="onRemove($event)"
11756
+ />
11757
+ }
11758
+ </div>
11759
+ </div>
11760
+ `, host: {
11761
+ '[class]': '_class()',
11762
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
11763
+ }] });
11764
+
11765
+ class ScSingleFileUploader {
11766
+ dataService = inject(DataService);
11767
+ class = input('');
11768
+ _class = computed(() => cn('relative flex flex-col gap-6 overflow-hidden', this.class()));
11769
+ file = signal(undefined);
11770
+ fileUrl = computed(() => {
11771
+ const file = this.file();
11772
+ if (file) {
11773
+ return URL.createObjectURL(file);
11774
+ }
11775
+ // return null or undefined
11776
+ return file;
11777
+ });
11778
+ status = linkedSignal({
11779
+ source: this.file,
11780
+ computation: () => {
11781
+ return 'init';
11782
+ },
11783
+ });
11784
+ uploadProgress = signal(0);
11785
+ maxSize = input(1024 * 1024 * 2);
11786
+ uploadInfo() {
11787
+ return ` a file with ${formatBytes(this.maxSize())}`;
11788
+ }
11789
+ handleFileChange(event) {
11790
+ const target = event.target;
11791
+ const files = target.files;
11792
+ const file = files[0];
11793
+ this.file.set(file);
11794
+ }
11795
+ removeFile() {
11796
+ this.file.set(null);
11797
+ }
11798
+ uploadFile() {
11799
+ const file = this.file();
11800
+ if (!file) {
11801
+ //TODO add message error
11802
+ return;
11803
+ }
11804
+ this.status.set('uploading');
11805
+ this.dataService
11806
+ .uploadFile(file)
11807
+ .pipe(catchError((error) => {
11808
+ this.status.set('error');
11809
+ // Quality control catches the problem
11810
+ console.error('Delivery problem:', error);
11811
+ // Send an apology note or fix the issue
11812
+ return throwError(() => new Error('Oops! Something went wrong. Please try again later.'));
11813
+ }))
11814
+ .subscribe((event) => {
11815
+ if (event.type === HttpEventType.UploadProgress) {
11816
+ if (event.total) {
11817
+ this.uploadProgress.set(Math.round((100 * event.loaded) / event.total));
11818
+ }
11819
+ else {
11820
+ console.warn('event.total is undefined');
11821
+ }
11822
+ }
11823
+ else if (event instanceof HttpResponse) {
11824
+ this.uploadProgress.set(100);
11825
+ this.status.set('success');
11826
+ }
11827
+ });
11828
+ }
11829
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScSingleFileUploader, deps: [], target: i0.ɵɵFactoryTarget.Component });
11830
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ScSingleFileUploader, isStandalone: true, selector: "sc-single-file-uploader", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, maxSize: { classPropertyName: "maxSize", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_class()" } }, ngImport: i0, template: `
11831
+ @if (!fileUrl()) {
11832
+ <!-- Dropzone -->
11833
+ <div #scDropZone="scDropZone" scDropZone>
11834
+ <input
11835
+ class="absolute left-0 top-0 size-full cursor-pointer opacity-0"
11836
+ (change)="handleFileChange($event)"
11837
+ accept="image/*"
11838
+ tabindex="-1"
11839
+ type="file"
11840
+ />
11841
+
11842
+ @if (scDropZone.isDragActive()) {
11843
+ <div class="flex flex-col items-center justify-center gap-4 sm:px-5">
11844
+ <div class="rounded-full border border-dashed p-3">
11845
+ <svg-upload-icon class="size-7 text-muted-foreground" aria-hidden="true" />
11846
+ </div>
11847
+ <p class="font-medium text-muted-foreground">Drop the files here</p>
11848
+ </div>
11849
+ } @else {
11850
+ <div class="flex flex-col items-center justify-center gap-4 sm:px-5">
11851
+ <div class="rounded-full border border-dashed p-3">
11852
+ <svg-upload-icon class="size-7 text-muted-foreground" aria-hidden="true" />
11853
+ </div>
11854
+ <div class="flex flex-col gap-px">
11855
+ <p class="font-medium text-muted-foreground">
11856
+ Drag 'n' drop your files here, or click to select files
11857
+ </p>
11858
+ <p class="text-sm text-muted-foreground/70">You can upload {{ uploadInfo() }}</p>
11859
+ </div>
11860
+ </div>
11861
+ }
11862
+ </div>
11863
+ <!-- fin Dropzone -->
11864
+ }
11865
+
11866
+ <!-- Start Preview Image -->
11867
+ @if (fileUrl()) {
11868
+ <sc-aspect-ratio [src]="fileUrl() ?? ''" ratio="16 / 9" alt="" />
11869
+
11870
+ <p>{{ file()?.name }}</p>
11871
+
11872
+ <sc-progress [value]="uploadProgress()" />
11873
+
11874
+ <div class="flex justify-start gap-3">
11875
+ <button
11876
+ [disabled]="status() === 'uploading'"
11877
+ (click)="removeFile()"
11878
+ sc-button
11879
+ variant="destructive"
11880
+ type="button"
11881
+ >
11882
+ Remove
11883
+ </button>
11884
+
11885
+ @if (status() === 'init' || status() === 'error') {
11886
+ <button
11887
+ [disabled]="status() === 'uploading'"
11888
+ (click)="uploadFile()"
11889
+ sc-button
11890
+ variant="primary"
11891
+ type="button"
11892
+ >
11893
+ Upload
11894
+ </button>
11895
+ }
11896
+
11897
+ @if (status() === 'uploading') {
11898
+ <button sc-button variant="secondary" type="button">Cancel</button>
11899
+ }
11900
+ </div>
11901
+ }
11902
+ <!-- End Preview Image -->
11903
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: ScProgress, selector: "sc-progress", inputs: ["class", "value"] }, { kind: "component", type: SvgUploadIcon, selector: "svg-upload-icon", inputs: ["class"] }, { kind: "directive", type: ScDropZone, selector: "[scDropZone]", inputs: ["isDisabled", "class"], exportAs: ["scDropZone"] }, { kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class", "disabled"] }, { kind: "component", type: ScAspectRatio, selector: "sc-aspect-ratio", inputs: ["imageClass", "hostClass", "wrapperClass", "ratio", "src", "alt", "priority"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
11904
+ }
11905
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScSingleFileUploader, decorators: [{
11906
+ type: Component,
11907
+ args: [{ selector: 'sc-single-file-uploader', imports: [ScProgress, SvgUploadIcon, ScDropZone, ScButton, ScAspectRatio], template: `
11908
+ @if (!fileUrl()) {
11909
+ <!-- Dropzone -->
11910
+ <div #scDropZone="scDropZone" scDropZone>
11911
+ <input
11912
+ class="absolute left-0 top-0 size-full cursor-pointer opacity-0"
11913
+ (change)="handleFileChange($event)"
11914
+ accept="image/*"
11915
+ tabindex="-1"
11916
+ type="file"
11917
+ />
11918
+
11919
+ @if (scDropZone.isDragActive()) {
11920
+ <div class="flex flex-col items-center justify-center gap-4 sm:px-5">
11921
+ <div class="rounded-full border border-dashed p-3">
11922
+ <svg-upload-icon class="size-7 text-muted-foreground" aria-hidden="true" />
11923
+ </div>
11924
+ <p class="font-medium text-muted-foreground">Drop the files here</p>
11925
+ </div>
11926
+ } @else {
11927
+ <div class="flex flex-col items-center justify-center gap-4 sm:px-5">
11928
+ <div class="rounded-full border border-dashed p-3">
11929
+ <svg-upload-icon class="size-7 text-muted-foreground" aria-hidden="true" />
11930
+ </div>
11931
+ <div class="flex flex-col gap-px">
11932
+ <p class="font-medium text-muted-foreground">
11933
+ Drag 'n' drop your files here, or click to select files
11934
+ </p>
11935
+ <p class="text-sm text-muted-foreground/70">You can upload {{ uploadInfo() }}</p>
11936
+ </div>
11937
+ </div>
11938
+ }
11939
+ </div>
11940
+ <!-- fin Dropzone -->
11941
+ }
11942
+
11943
+ <!-- Start Preview Image -->
11944
+ @if (fileUrl()) {
11945
+ <sc-aspect-ratio [src]="fileUrl() ?? ''" ratio="16 / 9" alt="" />
11946
+
11947
+ <p>{{ file()?.name }}</p>
11948
+
11949
+ <sc-progress [value]="uploadProgress()" />
11950
+
11951
+ <div class="flex justify-start gap-3">
11952
+ <button
11953
+ [disabled]="status() === 'uploading'"
11954
+ (click)="removeFile()"
11955
+ sc-button
11956
+ variant="destructive"
11957
+ type="button"
11958
+ >
11959
+ Remove
11960
+ </button>
11961
+
11962
+ @if (status() === 'init' || status() === 'error') {
11963
+ <button
11964
+ [disabled]="status() === 'uploading'"
11965
+ (click)="uploadFile()"
11966
+ sc-button
11967
+ variant="primary"
11968
+ type="button"
11969
+ >
11970
+ Upload
11971
+ </button>
11972
+ }
11973
+
11974
+ @if (status() === 'uploading') {
11975
+ <button sc-button variant="secondary" type="button">Cancel</button>
11976
+ }
11977
+ </div>
11978
+ }
11979
+ <!-- End Preview Image -->
11980
+ `, host: {
11981
+ '[class]': '_class()',
11982
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
11983
+ }] });
11984
+
11985
+ class ScPageTitle {
11986
+ classInput = input('', {
11987
+ alias: 'class',
11988
+ });
11989
+ class = computed(() => cn('scroll-m-20 text-3xl font-bold tracking-tight', this.classInput()));
11990
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScPageTitle, deps: [], target: i0.ɵɵFactoryTarget.Component });
11991
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScPageTitle, isStandalone: true, selector: "h1[sc-page-title]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "class()" } }, ngImport: i0, template: `
11992
+ <ng-content />
11993
+ `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
11994
+ }
11995
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScPageTitle, decorators: [{
11996
+ type: Component,
11997
+ args: [{ selector: 'h1[sc-page-title]', imports: [], template: `
11998
+ <ng-content />
11999
+ `, host: {
12000
+ '[class]': 'class()',
12001
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
12002
+ }] });
12003
+
12004
+ class ScPageSubtitle {
12005
+ classInput = input('', {
12006
+ alias: 'class',
12007
+ });
12008
+ class = computed(() => cn('font-heading mt-12 scroll-m-20 border-b pb-2 text-2xl font-semibold tracking-tight first:mt-0', this.classInput()));
12009
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScPageSubtitle, deps: [], target: i0.ɵɵFactoryTarget.Component });
12010
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScPageSubtitle, isStandalone: true, selector: "h2[sc-page-subtitle]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "class()" } }, ngImport: i0, template: `
12011
+ <ng-content />
12012
+ `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
12013
+ }
12014
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScPageSubtitle, decorators: [{
12015
+ type: Component,
12016
+ args: [{ selector: 'h2[sc-page-subtitle]', imports: [], template: `
12017
+ <ng-content />
12018
+ `, host: {
12019
+ '[class]': 'class()',
12020
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
12021
+ }] });
12022
+
12023
+ class ScPageDescription {
12024
+ classInput = input('', {
12025
+ alias: 'class',
12026
+ });
12027
+ class = computed(() => cn('text-base text-muted-foreground', this.classInput()));
12028
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScPageDescription, deps: [], target: i0.ɵɵFactoryTarget.Component });
12029
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: ScPageDescription, isStandalone: true, selector: "p[sc-page-description]", inputs: { classInput: { classPropertyName: "classInput", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "class()" } }, ngImport: i0, template: `
12030
+ <ng-content />
12031
+ `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
12032
+ }
12033
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScPageDescription, decorators: [{
12034
+ type: Component,
12035
+ args: [{ selector: 'p[sc-page-description]', imports: [], template: `
12036
+ <ng-content />
12037
+ `, host: {
12038
+ '[class]': 'class()',
12039
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
12040
+ }] });
12041
+
12042
+ class Section {
12043
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: Section, deps: [], target: i0.ɵɵFactoryTarget.Component });
12044
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: Section, isStandalone: true, selector: "sc-section", ngImport: i0, template: `
12045
+ <p>section works!</p>
12046
+ `, isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
12047
+ }
12048
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: Section, decorators: [{
12049
+ type: Component,
12050
+ args: [{ selector: 'sc-section', imports: [], template: `
12051
+ <p>section works!</p>
12052
+ `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
12053
+ }] });
12054
+
12055
+ class ScCookieConsent {
12056
+ open = signal(true);
12057
+ hidden = signal(false);
12058
+ class = signal(cn('fixed z-[200] bottom-0 left-0 right-0 sm:left-4 sm:bottom-4 w-full sm:max-w-md duration-700', !this.open()
12059
+ ? 'transition-[opacity,transform] translate-y-8 opacity-0'
12060
+ : 'transition-[opacity,transform] translate-y-0 opacity-100', this.hidden() && 'hidden'));
12061
+ accept() {
12062
+ console.log('accept');
12063
+ }
12064
+ decline() {
12065
+ console.log('decline');
12066
+ }
12067
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScCookieConsent, deps: [], target: i0.ɵɵFactoryTarget.Component });
12068
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: ScCookieConsent, isStandalone: true, selector: "sc-cookie-consent", ngImport: i0, template: `
12069
+ <div [class]="class()">
12070
+ <div class="m-3 dark:bg-card bg-background border border-border rounded-lg">
12071
+ <div class="flex items-center justify-between p-3">
12072
+ <h1 class="text-lg font-medium">We use cookies</h1>
12073
+ <svg-cookie-icon class="h-[1.2rem] w-[1.2rem]" />
12074
+ </div>
12075
+ <div class="p-3 -mt-2">
12076
+ <p class="text-sm text-left text-muted-foreground">
12077
+ We use cookies to ensure you get the best experience on our website. For more
12078
+ information on how we use cookies, please see our cookie policy.
12079
+ </p>
12080
+ </div>
12081
+ <div class="p-3 flex items-center gap-2 mt-2 border-t">
12082
+ <button class="w-full h-9 rounded-full" (click)="accept()" sc-button>accept</button>
12083
+ <button class="w-full h-9 rounded-full" (click)="decline()" sc-button variant="outline">
12084
+ decline
12085
+ </button>
12086
+ </div>
12087
+ </div>
12088
+ </div>
12089
+ `, isInline: true, styles: [""], dependencies: [{ kind: "component", type: SvgCookieIcon, selector: "svg-cookie-icon", inputs: ["class"] }, { kind: "component", type: ScButton, selector: "button[sc-button], a[sc-button]", inputs: ["variant", "size", "class", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
12090
+ }
12091
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ScCookieConsent, decorators: [{
12092
+ type: Component,
12093
+ args: [{ selector: 'sc-cookie-consent', imports: [SvgCookieIcon, ScButton], template: `
12094
+ <div [class]="class()">
12095
+ <div class="m-3 dark:bg-card bg-background border border-border rounded-lg">
12096
+ <div class="flex items-center justify-between p-3">
12097
+ <h1 class="text-lg font-medium">We use cookies</h1>
12098
+ <svg-cookie-icon class="h-[1.2rem] w-[1.2rem]" />
12099
+ </div>
12100
+ <div class="p-3 -mt-2">
12101
+ <p class="text-sm text-left text-muted-foreground">
12102
+ We use cookies to ensure you get the best experience on our website. For more
12103
+ information on how we use cookies, please see our cookie policy.
12104
+ </p>
12105
+ </div>
12106
+ <div class="p-3 flex items-center gap-2 mt-2 border-t">
12107
+ <button class="w-full h-9 rounded-full" (click)="accept()" sc-button>accept</button>
12108
+ <button class="w-full h-9 rounded-full" (click)="decline()" sc-button variant="outline">
12109
+ decline
12110
+ </button>
12111
+ </div>
12112
+ </div>
12113
+ </div>
12114
+ `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }]
12115
+ }] });
12116
+
10473
12117
  /**
10474
12118
  * Generated bundle index. Do not edit.
10475
12119
  */
10476
12120
 
10477
- export { FormFieldCustomControlComponent, ScAccordion, ScAccordionContent, ScAccordionHeader, ScAccordionItem, ScAccordionItemDescription, ScAccordionTrigger, ScAlert, ScAlertDescription, ScAlertDialog, ScAlertTitle, ScAspectRatio, ScAutocomplete, ScAvatar, ScBadge, ScBreadcrumb, ScBreadcrumbEllipsis, ScBreadcrumbItem, ScBreadcrumbLink, ScBreadcrumbList, ScBreadcrumbPage, ScBreadcrumbSeparator, ScButton, ScCalendar, ScCard, ScCardContent, ScCardDescription, ScCardFooter, ScCardHeader, ScCardTitle, ScCarousel, ScCarouselContainer, ScCarouselItem, ScCarouselItems, ScCarouselNext, ScCarouselPrevious, ScCheckbox, ScCollapsible, ScCollapsibleContent, ScCollapsibleTrigger, ScCommand, ScCommandDialog, ScCommandEmpty, ScCommandError, ScCommandGroup, ScCommandInput, ScCommandItem, ScCommandList, ScCommandLoading, ScCommandSeparator, ScCommandShortcut, ScContextMenuTriggerFor, ScDataTable, ScDatePicker, ScDialog, ScDialogClose, ScDialogContent, ScDialogDescription, ScDialogFooter, ScDialogHeader, ScDialogTitle, ScEditor, ScFullCalendar, ScHoverCard, ScHoverCardTriggerFor, ScInput, ScInputOTPGroup, ScInputOTPSeparator, ScInputOTPSlot, ScInputOtp, ScLabel, ScMenu, ScMenuBar, ScMenuBarItem, ScMenuCheckboxGroup, ScMenuCheckboxItem, ScMenuGroup, ScMenuItem, ScMenuLabel, ScMenuRadioGroup, ScMenuRadioItem, ScMenuSeparator, ScMenuShortcut, ScMenuTriggerFor, ScNav, ScNavItem, ScNavItemDropdown, ScNavLink, ScNavList, ScOption, ScPaginator, ScPopoverTriggerFor, ScProgress, ScRadioGroup, ScRadioItem, ScScrollArea, ScSelect, ScSheet, ScSheetClose, ScSheetConfig, ScSheetTrigger, ScSidebar, ScSidebarProvider, ScSidebarState, ScSidebarToggler, ScSkeleton, ScSlider, ScSwitch, ScTab, ScTabContent, ScTabLabel, ScTable, ScTableBody, ScTableCaption, ScTableCell, ScTableContainer, ScTableFooter, ScTableHead, ScTableHeader, ScTableRow, ScTabs, ScTextarea, ScThemeToggler, ScToast, ScToastExample, ScToggle, ScTooltip, TelInputComponent, TelModel, Toaster, buttonVariants, cn, scThemeProvider };
12121
+ export { FormFieldCustomControlComponent, ScAccordion, ScAccordionContent, ScAccordionHeader, ScAccordionItem, ScAccordionItemDescription, ScAccordionTrigger, ScAlert, ScAlertDescription, ScAlertDialog, ScAlertTitle, ScArticle, ScAspectRatio, ScAutocomplete, ScAvatar, ScBadge, ScBlockquote, ScBreadcrumb, ScBreadcrumbEllipsis, ScBreadcrumbItem, ScBreadcrumbLink, ScBreadcrumbList, ScBreadcrumbPage, ScBreadcrumbSeparator, ScButton, ScCalendar, ScCard, ScCardContent, ScCardDescription, ScCardFooter, ScCardHeader, ScCardTitle, ScCarousel, ScCarouselContainer, ScCarouselItem, ScCarouselItems, ScCarouselNext, ScCarouselPrevious, ScCheckbox, ScCollapsible, ScCollapsibleContent, ScCollapsibleTrigger, ScCommand, ScCommandDialog, ScCommandEmpty, ScCommandError, ScCommandGroup, ScCommandInput, ScCommandItem, ScCommandList, ScCommandLoading, ScCommandSeparator, ScCommandShortcut, ScContextMenuTriggerFor, ScCookieConsent, ScDataTable, ScDatePicker, ScDialog, ScDialogClose, ScDialogContent, ScDialogDescription, ScDialogFooter, ScDialogHeader, ScDialogTitle, ScEditor, ScFileUpload, ScFileUploader, ScFullCalendar, ScHeading, ScHoverCard, ScHoverCardTriggerFor, ScInput, ScInputOTPGroup, ScInputOTPSeparator, ScInputOTPSlot, ScInputOtp, ScLabel, ScMenu, ScMenuBar, ScMenuBarItem, ScMenuCheckboxGroup, ScMenuCheckboxItem, ScMenuGroup, ScMenuItem, ScMenuLabel, ScMenuRadioGroup, ScMenuRadioItem, ScMenuSeparator, ScMenuShortcut, ScMenuTriggerFor, ScNav, ScNavItem, ScNavItemDropdown, ScNavLink, ScNavList, ScOption, ScPageDescription, ScPageSubtitle, ScPageTitle, ScPaginator, ScPopoverTriggerFor, ScProgress, ScRadioGroup, ScRadioItem, ScScrollArea, ScSelect, ScSeparator, ScSettings, ScSheet, ScSheetClose, ScSheetConfig, ScSheetTrigger, ScSidebar, ScSidebarProvider, ScSidebarState, ScSidebarToggler, ScSingleFileUploader, ScSkeleton, ScSlider, ScSwitch, ScTab, ScTabContent, ScTabContent2, ScTabGroup, ScTabItem, ScTabLabel, ScTabLabel2, ScTable, ScTableBody, ScTableCaption, ScTableCell, ScTableContainer, ScTableFooter, ScTableHead, ScTableHeader, ScTableRow, ScTabs, ScTextarea, ScThemeToggler, ScTimePicker, ScToast, ScToastExample, ScToggle, ScToggleGroup, ScToggleGroupItem, ScTooltip, Section, TelInputComponent, TelModel, Toaster, buttonVariants, scArticleClasses, scInputStyles, scThemeProvider };
10478
12122
  //# sourceMappingURL=semantic-components-ui.mjs.map