@ngbase/adk 0.1.2 → 0.1.4

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 (128) hide show
  1. package/a11y/accessibility-group.d.ts +2 -5
  2. package/accordion/accordion-item.d.ts +3 -1
  3. package/autocomplete/autocomplete-input.d.ts +2 -4
  4. package/autocomplete/autocomplete.d.ts +12 -3
  5. package/carousel/carousel.d.ts +2 -2
  6. package/checkbox/checkbox.d.ts +11 -3
  7. package/checkbox/public-api.d.ts +1 -1
  8. package/datepicker/datepicker-trigger.d.ts +22 -5
  9. package/datepicker/datepicker.d.ts +2 -1
  10. package/drag/drag.d.ts +1 -2
  11. package/fesm2022/ngbase-adk-a11y.mjs +29 -26
  12. package/fesm2022/ngbase-adk-a11y.mjs.map +1 -1
  13. package/fesm2022/ngbase-adk-accordion.mjs +12 -2
  14. package/fesm2022/ngbase-adk-accordion.mjs.map +1 -1
  15. package/fesm2022/ngbase-adk-autocomplete.mjs +18 -18
  16. package/fesm2022/ngbase-adk-autocomplete.mjs.map +1 -1
  17. package/fesm2022/ngbase-adk-carousel.mjs +5 -5
  18. package/fesm2022/ngbase-adk-carousel.mjs.map +1 -1
  19. package/fesm2022/ngbase-adk-checkbox.mjs +8 -6
  20. package/fesm2022/ngbase-adk-checkbox.mjs.map +1 -1
  21. package/fesm2022/ngbase-adk-datepicker.mjs +76 -25
  22. package/fesm2022/ngbase-adk-datepicker.mjs.map +1 -1
  23. package/fesm2022/ngbase-adk-dialog.mjs +3 -3
  24. package/fesm2022/ngbase-adk-dialog.mjs.map +1 -1
  25. package/fesm2022/ngbase-adk-drag.mjs +1 -2
  26. package/fesm2022/ngbase-adk-drag.mjs.map +1 -1
  27. package/fesm2022/ngbase-adk-list.mjs +2 -2
  28. package/fesm2022/ngbase-adk-list.mjs.map +1 -1
  29. package/fesm2022/ngbase-adk-mask.mjs +5 -3
  30. package/fesm2022/ngbase-adk-mask.mjs.map +1 -1
  31. package/fesm2022/ngbase-adk-menu.mjs +22 -7
  32. package/fesm2022/ngbase-adk-menu.mjs.map +1 -1
  33. package/fesm2022/ngbase-adk-pagination.mjs +3 -3
  34. package/fesm2022/ngbase-adk-pagination.mjs.map +1 -1
  35. package/fesm2022/ngbase-adk-popover.mjs +25 -22
  36. package/fesm2022/ngbase-adk-popover.mjs.map +1 -1
  37. package/fesm2022/ngbase-adk-portal.mjs +5 -9
  38. package/fesm2022/ngbase-adk-portal.mjs.map +1 -1
  39. package/fesm2022/ngbase-adk-radio.mjs +6 -3
  40. package/fesm2022/ngbase-adk-radio.mjs.map +1 -1
  41. package/fesm2022/ngbase-adk-resizable.mjs.map +1 -1
  42. package/fesm2022/ngbase-adk-select.mjs +21 -13
  43. package/fesm2022/ngbase-adk-select.mjs.map +1 -1
  44. package/fesm2022/ngbase-adk-slider.mjs +4 -1
  45. package/fesm2022/ngbase-adk-slider.mjs.map +1 -1
  46. package/fesm2022/ngbase-adk-stepper.mjs.map +1 -1
  47. package/fesm2022/ngbase-adk-table.mjs +8 -6
  48. package/fesm2022/ngbase-adk-table.mjs.map +1 -1
  49. package/fesm2022/ngbase-adk-tabs.mjs.map +1 -1
  50. package/fesm2022/ngbase-adk-test.mjs +11 -1
  51. package/fesm2022/ngbase-adk-test.mjs.map +1 -1
  52. package/fesm2022/ngbase-adk-tour.mjs +2 -2
  53. package/fesm2022/ngbase-adk-tour.mjs.map +1 -1
  54. package/fesm2022/ngbase-adk-utils.mjs +12 -9
  55. package/fesm2022/ngbase-adk-utils.mjs.map +1 -1
  56. package/mask/mask.d.ts +1 -2
  57. package/menu/menu-trigger.d.ts +1 -1
  58. package/menu/menu.d.ts +8 -2
  59. package/package.json +8 -8
  60. package/pagination/pagination.d.ts +3 -3
  61. package/popover/base-popover.service.d.ts +1 -1
  62. package/popover/popover.d.ts +5 -4
  63. package/portal/portal-base.service.d.ts +3 -3
  64. package/portal/portal-close.directive.d.ts +3 -2
  65. package/radio/radio.d.ts +5 -1
  66. package/schematics/components/files/accordion/accordion.ts.template +2 -2
  67. package/schematics/components/files/alert/alert.ts.template +1 -1
  68. package/schematics/components/files/autocomplete/autocomplete.ts.template +1 -1
  69. package/schematics/components/files/avatar/avatar.ts.template +1 -1
  70. package/schematics/components/files/badge/badge.ts.template +1 -1
  71. package/schematics/components/files/breadcrumb/breadcrumb.ts.template +6 -2
  72. package/schematics/components/files/button/button.ts.template +5 -5
  73. package/schematics/components/files/card/card.ts.template +1 -1
  74. package/schematics/components/files/checkbox/checkbox.ts.template +9 -19
  75. package/schematics/components/files/checkbox/focus-style.directive.ts.template +1 -1
  76. package/schematics/components/files/chip/chip.ts.template +4 -2
  77. package/schematics/components/files/color-picker/color-picker.ts.template +1 -1
  78. package/schematics/components/files/command/command.ts.template +1 -1
  79. package/schematics/components/files/datepicker/calendar.ts.template +10 -10
  80. package/schematics/components/files/datepicker/datepicker.ts.template +19 -18
  81. package/schematics/components/files/datepicker/time.ts.template +3 -3
  82. package/schematics/components/files/dialog/dialog.ts.template +1 -1
  83. package/schematics/components/files/drawer/drawer.ts.template +2 -2
  84. package/schematics/components/files/form-field/form-field.ts.template +8 -8
  85. package/schematics/components/files/form-field/input-style.directive.ts.template +1 -1
  86. package/schematics/components/files/keys/key.ts.template +1 -1
  87. package/schematics/components/files/list/list.ts.template +1 -1
  88. package/schematics/components/files/otp/otp.ts.template +1 -1
  89. package/schematics/components/files/pagination/pagination.ts.template +6 -2
  90. package/schematics/components/files/popover/popover.ts.template +2 -2
  91. package/schematics/components/files/progress/progress.ts.template +1 -1
  92. package/schematics/components/files/radio/radio.ts.template +7 -5
  93. package/schematics/components/files/resizable/resizable.ts.template +6 -3
  94. package/schematics/components/files/select/option.ts.template +2 -2
  95. package/schematics/components/files/select/select.ts.template +3 -3
  96. package/schematics/components/files/selectable/selectable.ts.template +5 -5
  97. package/schematics/components/files/sheet/sheet.ts.template +1 -1
  98. package/schematics/components/files/sidenav/sidenav.ts.template +1 -1
  99. package/schematics/components/files/skeleton/skeleton.ts.template +1 -1
  100. package/schematics/components/files/slider/slider.ts.template +3 -3
  101. package/schematics/components/files/sonner/sonner.ts.template +3 -3
  102. package/schematics/components/files/spinner/spinner.ts.template +1 -1
  103. package/schematics/components/files/stepper/stepper.ts.template +1 -1
  104. package/schematics/components/files/switch/switch.ts.template +2 -2
  105. package/schematics/components/files/table/index.ts.template +12 -11
  106. package/schematics/components/files/table/table.ts.template +107 -5
  107. package/schematics/components/files/tabs/tab.ts.template +4 -4
  108. package/schematics/components/files/toggle/toggle.ts.template +1 -1
  109. package/schematics/components/files/toggle-group/toggle-group.ts.template +1 -1
  110. package/schematics/components/files/tooltip/tooltip.ts.template +1 -1
  111. package/schematics/components/index.js +32 -8
  112. package/schematics/components/index.js.map +1 -1
  113. package/schematics/components/index.ts +41 -11
  114. package/schematics/components/schema.d.ts +1 -1
  115. package/schematics/components/schema.json +2 -2
  116. package/schematics/components/schema.ts +1 -1
  117. package/select/option.d.ts +1 -1
  118. package/select/select-base.d.ts +8 -6
  119. package/select/select.d.ts +5 -2
  120. package/slider/slider.d.ts +1 -0
  121. package/table/table.d.ts +2 -2
  122. package/test/utils.d.ts +19 -3
  123. package/utils/utils.d.ts +5 -4
  124. package/schematics/components/files/table/body-cell.ts.template +0 -19
  125. package/schematics/components/files/table/body-row.ts.template +0 -21
  126. package/schematics/components/files/table/column.ts.template +0 -8
  127. package/schematics/components/files/table/head-cell.ts.template +0 -19
  128. package/schematics/components/files/table/head-row.ts.template +0 -27
@@ -4,7 +4,9 @@ import {
4
4
  DatepickerGroup,
5
5
  NgbDatePicker,
6
6
  NgbDatepickerTrigger,
7
+ NgbEndDate,
7
8
  aliasDatePicker,
9
+ aliasDatePickerTrigger,
8
10
  registerDatePicker,
9
11
  } from '@ngbase/adk/datepicker';
10
12
  import { RangePipe } from '@ngbase/adk/utils';
@@ -35,24 +37,23 @@ export class DatePicker<D> extends NgbDatePicker<D> {}
35
37
 
36
38
  @Directive({
37
39
  selector: '[<%= name %>DatepickerTrigger]',
38
- providers: [registerDatePicker(DatePicker)],
39
- hostDirectives: [
40
- {
41
- directive: NgbDatepickerTrigger,
42
- inputs: [
43
- 'noOfCalendars',
44
- 'range',
45
- 'time',
46
- 'format',
47
- 'fieldFormat',
48
- 'dateFilter',
49
- 'pickerType',
50
- 'pickerTemplate',
51
- ],
52
- },
53
- ],
40
+ exportAs: '<%= name %>DatepickerTrigger',
41
+ providers: [registerDatePicker(DatePicker), aliasDatePickerTrigger(DatepickerTrigger)],
54
42
  host: {
55
- class: 'cursor-pointer hover:bg-muted-background outline-none',
43
+ class: 'cursor-pointer hover:bg-muted outline-none w-full bg-transparent',
56
44
  },
57
45
  })
58
- export class DatepickerTrigger<D> {}
46
+ export class DatepickerTrigger<D> extends NgbDatepickerTrigger<D> {}
47
+
48
+ @Directive({
49
+ selector: '[<%= name %>EndDate]',
50
+ hostDirectives: [{ directive: NgbEndDate, inputs: ['ngbEndDate: <%= name %>EndDate'] }],
51
+ host: {
52
+ class: 'hidden',
53
+ },
54
+ })
55
+ export class EndDate {
56
+ constructor() {
57
+ inject(NgbEndDate).hidden = true;
58
+ }
59
+ }
@@ -12,21 +12,21 @@ import { Button } from '<%= basepath %>/button';
12
12
  ngbTimeInput="hours"
13
13
  [(value)]="hours"
14
14
  (valueChange)="updateValue()"
15
- class="w-7 px-1 text-center font-semibold focus:bg-muted-background"
15
+ class="w-7 px-1 text-center font-semibold focus:bg-muted"
16
16
  />
17
17
  <span>:</span>
18
18
  <input
19
19
  ngbTimeInput="minutes"
20
20
  [(value)]="minutes"
21
21
  (valueChange)="updateValue()"
22
- class="w-7 px-1 text-center font-semibold focus:bg-muted-background"
22
+ class="w-7 px-1 text-center font-semibold focus:bg-muted"
23
23
  />
24
24
  <span>:</span>
25
25
  <input
26
26
  ngbTimeInput="seconds"
27
27
  [(value)]="seconds"
28
28
  (valueChange)="updateValue()"
29
- class="w-7 px-1 text-center font-semibold focus:bg-muted-background"
29
+ class="w-7 px-1 text-center font-semibold focus:bg-muted"
30
30
  />
31
31
  @if (!is24()) {
32
32
  <div class="ml-1 flex gap-2">
@@ -27,7 +27,7 @@ import { DragMove } from '@ngbase/adk/drag';
27
27
  ngbDialogMain
28
28
  [@viewAnimation]
29
29
  class="{{
30
- 'pointer-events-auto relative flex max-w-[100vw] flex-col overflow-hidden border bg-foreground shadow-lg' +
30
+ 'pointer-events-auto relative flex max-w-[100vw] flex-col overflow-hidden border bg-background shadow-lg' +
31
31
  (options().fullWindow
32
32
  ? ' h-screen w-screen border-none'
33
33
  : ' max-w-[calc(100vw-30px)] rounded-lg')
@@ -15,10 +15,10 @@ import { createHostAnimation, fadeAnimation } from '@ngbase/adk/utils';
15
15
  template: `
16
16
  <div class="pointer-events-none flex h-full flex-col justify-end">
17
17
  <div
18
- class="pointer-events-auto flex max-h-[90vh] flex-col overflow-hidden rounded-tl-2xl rounded-tr-2xl border-t bg-foreground p-4 shadow-2xl"
18
+ class="pointer-events-auto flex max-h-[90vh] flex-col overflow-hidden rounded-tl-2xl rounded-tr-2xl border-t bg-background p-4 shadow-2xl"
19
19
  [@bottomAnimation]
20
20
  >
21
- <button class="mx-auto h-2 w-20 rounded-full bg-muted"></button>
21
+ <button class="bg-muted-foreground mx-auto h-2 w-20 rounded-full"></button>
22
22
  @if (!isHideHeader) {
23
23
  <div class="flex h-8 items-center">
24
24
  <h2 class="flex-1 font-bold">{{ options.title }}</h2>
@@ -26,9 +26,9 @@ import { NgbSelectTarget } from '@ngbase/adk/select';
26
26
  <ng-content select="[<%= name %>Label]" />
27
27
  <ng-content select="[<%= name %>Description]" />
28
28
  <div class="mt-1 flex items-center" #target <%= name %>InputStyle>
29
- <ng-content select="[<%= name %>InputPrefix]" />
29
+ <ng-content select="[<%= name %>Prefix]" />
30
30
  <ng-content />
31
- <ng-content select="[<%= name %>InputSuffix]" />
31
+ <ng-content select="[<%= name %>Suffix]" />
32
32
  </div>
33
33
  <ng-content select="[<%= name %>Error]" />
34
34
  `,
@@ -46,13 +46,13 @@ export class FormField {
46
46
 
47
47
  @Directive({
48
48
  selector: '[<%= name %>Input]',
49
- hostDirectives: [{ directive: InputBase, inputs: ['value'] }],
49
+ hostDirectives: [{ directive: InputBase, inputs: ['value'], outputs: ['valueChange'] }],
50
50
  host: {
51
- class: 'focus:outline-none',
51
+ class: 'outline-none w-full bg-transparent',
52
52
  '[class.border-red-500]': 'formField?.hasErrors()',
53
53
  },
54
54
  })
55
- export class Input<T = unknown> {
55
+ export class Input {
56
56
  readonly formField = inject(NgbFormField, { optional: true });
57
57
  }
58
58
 
@@ -70,13 +70,13 @@ export class Label {}
70
70
  @Directive({
71
71
  selector: '[<%= name %>Description]',
72
72
  host: {
73
- class: 'text-sm text-muted',
73
+ class: 'text-sm text-muted-foreground',
74
74
  },
75
75
  })
76
76
  export class Description {}
77
77
 
78
78
  @Directive({
79
- selector: '[<%= name %>InputPrefix]',
79
+ selector: '[<%= name %>Prefix]',
80
80
  host: {
81
81
  class: 'mr-2.5',
82
82
  },
@@ -84,7 +84,7 @@ export class Description {}
84
84
  export class InputPrefix {}
85
85
 
86
86
  @Directive({
87
- selector: '[<%= name %>InputSuffix]',
87
+ selector: '[<%= name %>Suffix]',
88
88
  host: {
89
89
  class: 'ml-2.5',
90
90
  },
@@ -5,7 +5,7 @@ import { ɵFocusStyle as FocusStyle } from '<%= basepath %>/checkbox';
5
5
  selector: '[<%= name %>InputStyle]',
6
6
  hostDirectives: [{ directive: FocusStyle, inputs: ['unfocus'] }],
7
7
  host: {
8
- class: 'inline-block rounded-lg bg-foreground px-2.5 py-2 border font-normal min-h-10',
8
+ class: 'inline-block rounded-lg bg-transparent px-2.5 py-2 border font-normal min-h-10',
9
9
  },
10
10
  })
11
11
  export class InputStyle {}
@@ -15,7 +15,7 @@ import { keyMap } from '@ngbase/adk/keys';
15
15
  changeDetection: ChangeDetectionStrategy.OnPush,
16
16
  template: `{{ content() }}`,
17
17
  host: {
18
- class: 'ml-auto text-xs tracking-widest opacity-60 text-muted',
18
+ class: 'ml-auto text-xs tracking-widest opacity-60 text-muted-foreground',
19
19
  },
20
20
  })
21
21
  export class Key {
@@ -5,7 +5,7 @@ import { NgbList, NgbListActionGroup, provideList } from '@ngbase/adk/list';
5
5
  selector: '[<%= name %>ListStyle]',
6
6
  host: {
7
7
  class:
8
- 'flex items-center gap-2 py-2 px-2 hover:bg-muted-background cursor-pointer rounded-md text-left data-[focus="true"]:bg-muted-background',
8
+ 'flex items-center gap-2 py-2 px-2 hover:bg-accent cursor-pointer rounded-md text-left data-[focus="true"]:bg-accent',
9
9
  },
10
10
  })
11
11
  export class ListStyle {}
@@ -16,7 +16,7 @@ import { InputStyle } from '<%= basepath %>/form-field';
16
16
  <%= name %>InputStyle
17
17
  ngbOtpValue
18
18
  class="{{
19
- 'mb-0 aspect-square w-10 rounded-none !px-0 text-center text-base font-semibold data-[disabled]:bg-muted-background/40 data-[disabled]:text-muted data-[focus]:relative' +
19
+ 'mb-0 aspect-square w-10 rounded-none !px-0 text-center text-base font-semibold data-[disabled]:bg-muted/40 data-[disabled]:text-muted-foreground data-[focus]:relative' +
20
20
  ((dir.isRtl() ? ll : i === 0) ? ' !rounded-l-lg' : '') +
21
21
  ((dir.isRtl() ? i === 0 : ll) ? ' !rounded-r-lg' : '')
22
22
  }}"
@@ -26,7 +26,11 @@ import {
26
26
  template: `
27
27
  <div class="flex items-center gap-2">
28
28
  <div>Rows per page</div>
29
- <<%= name %>-select [value]="size()" (valueChange)="sizeChanged($event)" class="w-20 !py-1.5">
29
+ <<%= name %>-select
30
+ [value]="size()"
31
+ (valueChange)="sizeChanged($event)"
32
+ class="h-8 !w-auto rounded-md border px-2"
33
+ >
30
34
  @for (size of sizeOptions(); track size) {
31
35
  <<%= name %>-option [value]="size">
32
36
  {{ size }}
@@ -48,7 +52,7 @@ import {
48
52
  ngbPaginationBtn="page"
49
53
  [jump]="snap"
50
54
  <%= name %>Button="ghost"
51
- class="min-w-9 !p-2 ring-offset-background aria-[current=page]:bg-muted-background aria-[current=page]:text-primary"
55
+ class="min-w-9 !p-2 ring-offset-foreground aria-[current=page]:bg-muted aria-[current=page]:text-primary"
52
56
  >
53
57
  {{ snap }}
54
58
  </button>
@@ -19,7 +19,7 @@ import {
19
19
  template: ` <div
20
20
  ngbPopoverMain
21
21
  [@slideInOutAnimation]
22
- class="menu-container pointer-events-auto fixed z-10 flex flex-col rounded-lg border bg-foreground shadow-md"
22
+ class="menu-container pointer-events-auto fixed z-10 flex flex-col rounded-lg border bg-popover text-popover-foreground shadow-md"
23
23
  >
24
24
  <div class="flex flex-1 flex-col overflow-auto" ngbPopoverArrow>
25
25
  <ng-container #myDialog />
@@ -59,6 +59,6 @@ export class PopoverTrigger {}
59
59
 
60
60
  @Directive({
61
61
  selector: '[<%= name %>PopoverClose]',
62
- hostDirectives: [NgbPopoverClose],
62
+ hostDirectives: [{ directive: NgbPopoverClose, inputs: ['ngbPopoverClose: <%= name %>PopoverClose'] }],
63
63
  })
64
64
  export class PopoverClose {}
@@ -8,7 +8,7 @@ import { NgbProgress, NgbProgressBar } from '@ngbase/adk/progress';
8
8
  imports: [NgbProgressBar],
9
9
  template: `<div class="h-full bg-primary transition" ngbProgressBar></div>`,
10
10
  host: {
11
- class: 'block h-2 my-1 bg-muted-background rounded-full',
11
+ class: 'block h-2 my-1 bg-muted rounded-full',
12
12
  },
13
13
  })
14
14
  export class Progress {}
@@ -1,5 +1,5 @@
1
1
  import { ChangeDetectionStrategy, Component } from '@angular/core';
2
- import { NgbRadio, NgbRadioGroup, NgbRadioIndicator } from '@ngbase/adk/radio';
2
+ import { aliasRadio, NgbRadio, NgbRadioGroup, NgbRadioIndicator } from '@ngbase/adk/radio';
3
3
  import { ɵFocusStyle as FocusStyle } from '<%= basepath %>/checkbox';
4
4
 
5
5
  @Component({
@@ -15,15 +15,17 @@ export class RadioGroup {}
15
15
  @Component({
16
16
  selector: '<%= name %>-radio, [<%= name %>Radio]',
17
17
  changeDetection: ChangeDetectionStrategy.OnPush,
18
- hostDirectives: [{ directive: NgbRadio, inputs: ['value', 'disabled'] }],
18
+ providers: [aliasRadio(Radio)],
19
19
  imports: [FocusStyle, NgbRadioIndicator],
20
20
  template: `
21
21
  <button
22
22
  <%= name %>FocusStyle
23
23
  ngbRadioIndicator
24
- class="custom-radio relative flex h-4 w-4 flex-none items-center justify-center rounded-full border border-primary group-aria-[disabled='true']:border-muted"
24
+ class="custom-radio relative flex h-4 w-4 flex-none items-center justify-center rounded-full border border-primary group-aria-[disabled='true']:border-muted-foreground"
25
25
  >
26
- <div class="h-2 w-2 rounded-full bg-primary group-aria-[disabled='true']:bg-muted"></div>
26
+ <div
27
+ class="h-2 w-2 rounded-full bg-primary group-aria-[disabled='true']:bg-muted-foreground"
28
+ ></div>
27
29
  </button>
28
30
  <ng-content />
29
31
  `,
@@ -32,4 +34,4 @@ export class RadioGroup {}
32
34
  'flex items-center gap-2 py-1 cursor-pointer aria-[disabled="true"]:opacity-40 aria-[disabled="true"]:cursor-not-allowed group',
33
35
  },
34
36
  })
35
- export class Radio {}
37
+ export class Radio extends NgbRadio {}
@@ -43,9 +43,12 @@ export class ResizableGroup extends NgbResizableGroup {}
43
43
  : ' right-0 top-0 w-0 cursor-ew-resize border-l after:h-full after:w-2')
44
44
  }}"
45
45
  >
46
- <<%= name %>-icon name="lucideGripVertical" class="z-30 rounded-lg border
47
- bg-muted-background py-0.5" size=".75rem" [class]="resizable.direction() === 'vertical' ?
48
- 'rotate-90' : ''" />
46
+ <<%= name %>-icon
47
+ name="lucideGripVertical"
48
+ class="z-30 rounded-lg border bg-muted py-0.5"
49
+ size=".75rem"
50
+ [class]="resizable.direction() === 'vertical' ? 'rotate-90' : ''"
51
+ />
49
52
  </div>
50
53
  }
51
54
  </ng-template>`,
@@ -14,7 +14,7 @@ import { ListStyle } from '<%= basepath %>/list';
14
14
  <ng-content />`,
15
15
  host: {
16
16
  class: 'outline-none',
17
- '[class.bg-muted-background]': 'option.active() || option.checked()',
17
+ '[class.bg-muted]': 'option.active() || option.checked()',
18
18
  },
19
19
  })
20
20
  export class Option<T> {
@@ -24,7 +24,7 @@ export class Option<T> {
24
24
  @Component({
25
25
  selector: '<%= name %>-option-group, [<%= name %>OptionGroup]',
26
26
  changeDetection: ChangeDetectionStrategy.OnPush,
27
- template: `<div class="sticky -top-1 z-10 bg-foreground px-2 py-1.5 text-sm text-muted">
27
+ template: `<div class="text-muted-foreground bg-popover sticky -top-1 z-10 px-2 py-1.5 text-sm">
28
28
  {{ label() }}
29
29
  </div>
30
30
  <ng-content />`,
@@ -43,12 +43,12 @@ export class SelectOption<T> {}
43
43
  <!-- Prefix template -->
44
44
  <ng-content select=".select-prefix" />
45
45
 
46
- <span class="flex-1 truncate" [class.text-muted]="!cValue()">
46
+ <span class="flex-1 truncate" [class.text-muted-foreground]="!cValue()">
47
47
  <ng-content select="[<%= name %>SelectTrigger]">
48
48
  {{ cValue() || placeholder() }}
49
49
  </ng-content>
50
50
  </span>
51
- <<%= name %>-icon name="lucideChevronsUpDown" class="ml-0.5 text-muted" />
51
+ <<%= name %>-icon name="lucideChevronsUpDown" class="ml-0.5 text-muted-foreground" />
52
52
  </button>
53
53
 
54
54
  <!-- Options template -->
@@ -87,7 +87,7 @@ export class SelectOption<T> {}
87
87
  </ng-template>
88
88
  `,
89
89
  host: {
90
- class: 'flex cursor-pointer font-medium outline-none',
90
+ class: 'flex cursor-pointer font-medium outline-none w-full',
91
91
  '[class.pointer-events-none]': 'disabled()',
92
92
  },
93
93
  })
@@ -9,7 +9,7 @@ import { NgbSelectable, NgbSelectableItem } from '@ngbase/adk/selectable';
9
9
  host: {
10
10
  class:
11
11
  'flex-1 flex items-center font-medium justify-center px-3 py-1.5 cursor-pointer transition-colors rounded-md whitespace-nowrap focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary',
12
- '[class]': `selectable.selected() ? 'bg-foreground shadow-md ring-1 ring-border' : 'opacity-60'`,
12
+ '[class]': `selectable.selected() ? 'bg-background text-primary shadow-md ring-1 ring-border' : 'opacity-60'`,
13
13
  },
14
14
  })
15
15
  export class SelectableItem<T> {
@@ -19,10 +19,6 @@ export class SelectableItem<T> {
19
19
  @Component({
20
20
  selector: '<%= name %>-selectable',
21
21
  changeDetection: ChangeDetectionStrategy.OnPush,
22
- template: `<ng-content />`,
23
- host: {
24
- class: 'inline-flex relative bg-muted-background rounded-md p-0.5',
25
- },
26
22
  hostDirectives: [
27
23
  {
28
24
  directive: NgbSelectable,
@@ -30,5 +26,9 @@ export class SelectableItem<T> {
30
26
  outputs: ['activeIndexChange', 'valueChanged'],
31
27
  },
32
28
  ],
29
+ template: `<ng-content />`,
30
+ host: {
31
+ class: 'inline-flex relative bg-muted text-muted-foreground rounded-md p-0.5',
32
+ },
33
33
  })
34
34
  export class Selectable<T> {}
@@ -21,7 +21,7 @@ import { createHostAnimation, fadeAnimation } from '@ngbase/adk/utils';
21
21
  [class]="options.position === 'left' ? 'justify-start' : 'justify-end'"
22
22
  >
23
23
  <div
24
- class="pointer-events-auto m-2 flex flex-col overflow-hidden rounded-lg border-l bg-foreground shadow-2xl will-change-transform"
24
+ class="pointer-events-auto m-2 flex flex-col overflow-hidden rounded-lg border-l bg-background shadow-2xl will-change-transform"
25
25
  [@sideAnimation]="position()"
26
26
  [ngStyle]="{
27
27
  width: options.width,
@@ -41,7 +41,7 @@ export class Sidenav extends NgbSidenav {}
41
41
  </div>
42
42
  `,
43
43
  host: {
44
- class: 'block h-full bg-foreground z-p transition-[width] duration-500',
44
+ class: 'block h-full bg-background z-p transition-[width] duration-500',
45
45
  },
46
46
  animations: [slideAnimation('500ms cubic-bezier(0.4, 0, 0.2, 1)')],
47
47
  })
@@ -4,7 +4,7 @@ import { Component, input } from '@angular/core';
4
4
  selector: '<%= name %>-skeleton',
5
5
  template: ``,
6
6
  host: {
7
- class: 'block animate-pulse bg-muted-background',
7
+ class: 'block animate-pulse bg-muted',
8
8
  '[class]': `shape() === 'circle' ? 'rounded-full' : 'rounded-md'`,
9
9
  },
10
10
  })
@@ -11,16 +11,16 @@ import { ɵFocusStyle as FocusStyle } from '<%= basepath %>/checkbox';
11
11
  template: `
12
12
  <div
13
13
  ngbSliderTrack
14
- class="h-full overflow-hidden rounded-full bg-muted-background aria-[disabled=true]:bg-opacity-30"
14
+ class="h-full overflow-hidden rounded-full bg-muted aria-[disabled=true]:bg-opacity-30"
15
15
  >
16
- <div ngbSliderRange class="bg-primary aria-[disabled=true]:bg-muted-background"></div>
16
+ <div ngbSliderRange class="bg-primary aria-[disabled=true]:bg-muted"></div>
17
17
  </div>
18
18
  @for (thumb of noOfThumbs(); track thumb) {
19
19
  <button
20
20
  ngbSliderThumb
21
21
  <%= name %>FocusStyle
22
22
  class="{{
23
- 'inline-block h-5 w-5 rounded-full border-2 bg-foreground shadow-md aria-[disabled=false]:border-primary aria-[disabled=true]:bg-muted-background ' +
23
+ 'inline-block h-5 w-5 rounded-full border-2 bg-background shadow-md aria-[disabled=false]:border-primary aria-[disabled=true]:bg-muted ' +
24
24
  (orientation() === 'vertical'
25
25
  ? '-left-1.5 -translate-y-1/2'
26
26
  : '-top-1.5 -translate-x-1/2')
@@ -17,12 +17,12 @@ import {
17
17
  ],
18
18
  imports: [Icon, SonnerBase],
19
19
  template: `
20
- <ul class="fixed bottom-0 right-0 flex flex-col gap-1">
20
+ <ul class="fixed bottom-0 right-0 z-p flex flex-col gap-1">
21
21
  @for (msg of messages(); track msg.id) {
22
22
  <li
23
23
  [ngbSonnerBase]="$index"
24
24
  class="{{
25
- 'm-4 w-96 rounded-lg border bg-foreground p-4 shadow-lg transition-all duration-300' +
25
+ 'm-4 w-96 rounded-lg border bg-background p-4 shadow-lg transition-all duration-300' +
26
26
  (msg.type === 'success' ? ' bg-green-50 text-green-600' : '') +
27
27
  (msg.type === 'error' ? ' bg-red-50 text-red-600' : '') +
28
28
  (msg.type === 'warning' ? ' bg-yellow-50 text-yellow-600' : '')
@@ -35,7 +35,7 @@ import {
35
35
  {{ msg.message }}
36
36
  </h4>
37
37
  @if (msg.data?.description) {
38
- <p class="text-muted">{{ msg.data?.description }}</p>
38
+ <p class="text-muted-foreground">{{ msg.data?.description }}</p>
39
39
  }
40
40
  </li>
41
41
  }
@@ -64,7 +64,7 @@ const spinnerAnimation = trigger('enterLeave', [
64
64
  `,
65
65
  host: {
66
66
  class: 'inline-flex items-center justify-center transition-all duration-300 text-primary',
67
- '[class]': `root() ? 'fixed inset-0 z-p bg-foreground bg-opacity-60 backdrop-blur-sm' : 'relative'`,
67
+ '[class]': `root() ? 'fixed inset-0 z-p bg-background bg-opacity-60 backdrop-blur-sm' : 'relative'`,
68
68
  },
69
69
  animations: [
70
70
  // animation for entering and exiting, with a bouncy effect
@@ -22,7 +22,7 @@ import {
22
22
  <div
23
23
  [ngbStepperStep]="$index"
24
24
  class="{{
25
- 'relative flex pb-4 data-[index]:flex-1 data-[index]:after:mx-2 data-[index]:after:block data-[index]:after:flex-1 data-[index]:after:bg-background data-[index]:after:transition-colors' +
25
+ 'relative flex pb-4 data-[index]:flex-1 data-[index]:after:mx-2 data-[index]:after:block data-[index]:after:flex-1 data-[index]:after:bg-foreground data-[index]:after:transition-colors' +
26
26
  (activeIndex() > $index ? ' data-[index]:after:bg-primary' : '') +
27
27
  (direction() === 'vertical'
28
28
  ? ' flex-col data-[index]:after:absolute data-[index]:after:bottom-0 data-[index]:after:left-3 data-[index]:after:top-10 data-[index]:after:w-0.5'
@@ -11,13 +11,13 @@ import { NgbSwitch, NgbSwitchLabel, NgbSwitchThumb, NgbSwitchTrack } from '@ngba
11
11
  template: `
12
12
  <button
13
13
  ngbSwitchTrack
14
- class="relative w-9 rounded-full border-2 border-transparent bg-muted-background transition-colors aria-[checked=true]:bg-primary"
14
+ class="relative w-9 rounded-full border-2 border-transparent bg-muted transition-colors aria-[checked=true]:bg-primary"
15
15
  >
16
16
  <span
17
17
  #thumb="ngbSwitchThumb"
18
18
  ngbSwitchThumb
19
19
  [class]="thumb.checked() ? (thumb.rtl() ? '-translate-x-full' : 'translate-x-full') : ''"
20
- class="block h-4 w-4 rounded-full bg-foreground shadow-sm transition-transform"
20
+ class="block h-4 w-4 rounded-full bg-background shadow-sm transition-transform"
21
21
  ></span>
22
22
  </button>
23
23
  <label ngbSwitchLabel><ng-content /></label>
@@ -1,16 +1,17 @@
1
- import { Cell, CellDef } from './body-cell';
2
- import { BodyRow, BodyRowDef } from './body-row';
3
- import { Column } from './column';
4
- import { Head, HeadDef } from './head-cell';
5
- import { HeadRow, HeadRowDef } from './head-row';
6
- import { Table } from './table';
1
+ import {
2
+ BodyRow,
3
+ BodyRowDef,
4
+ Cell,
5
+ CellDef,
6
+ Column,
7
+ HeadDef,
8
+ Head,
9
+ Table,
10
+ HeadRow,
11
+ HeadRowDef,
12
+ } from './table';
7
13
 
8
14
  export * from './table';
9
- export * from './column';
10
- export * from './body-cell';
11
- export * from './head-cell';
12
- export * from './body-row';
13
- export * from './head-row';
14
15
 
15
16
  export const TableComponents = [
16
17
  BodyRow,
@@ -1,12 +1,20 @@
1
- import { ChangeDetectionStrategy, Component } from '@angular/core';
2
- import { NgbTable } from '@ngbase/adk/table';
1
+ import { ChangeDetectionStrategy, Component, Directive } from '@angular/core';
2
+ import {
3
+ NgbBodyRow,
4
+ NgbBodyRowDef,
5
+ NgbCell,
6
+ NgbCellDef,
7
+ NgbColumn,
8
+ NgbHead,
9
+ NgbHeadDef,
10
+ NgbHeadRow,
11
+ NgbHeadRowDef,
12
+ NgbTable,
13
+ } from '@ngbase/adk/table';
3
14
 
4
15
  @Component({
5
16
  selector: 'table[<%= name %>Table]',
6
17
  changeDetection: ChangeDetectionStrategy.OnPush,
7
- host: {
8
- class: 'w-full text-sm',
9
- },
10
18
  providers: [{ provide: NgbTable, useExisting: Table }],
11
19
  template: `
12
20
  <thead>
@@ -16,5 +24,99 @@ import { NgbTable } from '@ngbase/adk/table';
16
24
  <ng-container #tbody />
17
25
  </tbody>
18
26
  `,
27
+ host: {
28
+ class: 'w-full text-sm',
29
+ },
19
30
  })
20
31
  export class Table<T> extends NgbTable<T> {}
32
+
33
+ // Cell
34
+ @Component({
35
+ selector: '[<%= name %>Cell]',
36
+ changeDetection: ChangeDetectionStrategy.OnPush,
37
+ hostDirectives: [NgbCell],
38
+ template: `<ng-content />`,
39
+ host: {
40
+ class: 'px-4 py-2 align-middle bg-background',
41
+ },
42
+ })
43
+ export class Cell {}
44
+
45
+ @Directive({
46
+ selector: '[<%= name %>CellDef]',
47
+ hostDirectives: [NgbCellDef],
48
+ })
49
+ export class CellDef {}
50
+
51
+ // Body
52
+
53
+ @Directive({
54
+ selector: '[<%= name %>BodyRowDef]',
55
+ hostDirectives: [
56
+ { directive: NgbBodyRowDef, inputs: ['ngbBodyRowDefColumns: <%= name %>BodyRowDefColumns'] },
57
+ ],
58
+ })
59
+ export class BodyRowDef {}
60
+
61
+ @Component({
62
+ selector: '[<%= name %>BodyRow]',
63
+ changeDetection: ChangeDetectionStrategy.OnPush,
64
+ providers: [{ provide: NgbBodyRow, useExisting: BodyRow }],
65
+ template: `<ng-container #container />`,
66
+ host: {
67
+ class: '[&:not(:last-child)]:border-b hover:bg-muted h-12',
68
+ },
69
+ })
70
+ export class BodyRow extends NgbBodyRow {}
71
+
72
+ // Column
73
+
74
+ @Directive({
75
+ selector: '[<%= name %>Column]',
76
+ hostDirectives: [{ directive: NgbColumn, inputs: ['ngbColumn: <%= name %>Column', 'sticky'] }],
77
+ })
78
+ export class Column {}
79
+
80
+ // Head Cell
81
+
82
+ @Component({
83
+ selector: '[<%= name %>Head]',
84
+ changeDetection: ChangeDetectionStrategy.OnPush,
85
+ hostDirectives: [NgbHead],
86
+ template: `<ng-content />`,
87
+ host: {
88
+ class:
89
+ 'px-4 py-2 text-left align-middle font-medium text-muted-foreground border-b bg-background',
90
+ },
91
+ })
92
+ export class Head {}
93
+
94
+ @Directive({
95
+ selector: '[<%= name %>HeadDef]',
96
+ hostDirectives: [NgbHeadDef],
97
+ })
98
+ export class HeadDef {}
99
+
100
+ // Head Row
101
+
102
+ @Component({
103
+ selector: '[<%= name %>HeadRow]',
104
+ changeDetection: ChangeDetectionStrategy.OnPush,
105
+ providers: [{ provide: NgbHeadRow, useExisting: HeadRow }],
106
+ template: `<ng-container #container />`,
107
+ host: {
108
+ class: `h-10 [&[data-sticky=true]]:sticky [&[data-sticky=true]]:top-0 [&[data-sticky=true]]:bg-background`,
109
+ },
110
+ })
111
+ export class HeadRow extends NgbHeadRow {}
112
+
113
+ @Directive({
114
+ selector: '[<%= name %>HeadRowDef]',
115
+ hostDirectives: [
116
+ {
117
+ directive: NgbHeadRowDef,
118
+ inputs: ['ngbHeadRowDef: <%= name %>HeadRowDef', 'ngbHeadRowDefSticky: <%= name %>HeadRowDefSticky'],
119
+ },
120
+ ],
121
+ })
122
+ export class HeadRowDef {}