@tolle_/tolle-ui 0.0.31-beta → 0.0.32-beta

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.
@@ -29,7 +29,7 @@ const buttonVariants = cva("tolle-button-base inline-flex items-center justify-c
29
29
  outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",
30
30
  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
31
31
  ghost: "hover:bg-accent hover:text-accent-foreground",
32
- link: "text-primary underline-offset-4 hover:underline",
32
+ link: "text-primary-foreground underline-offset-4 hover:underline",
33
33
  },
34
34
  size: {
35
35
  default: "h-10 px-4 py-2",
@@ -1135,7 +1135,7 @@ class BadgeComponent {
1135
1135
  get computedClass() {
1136
1136
  return cn(
1137
1137
  // Base styles - Pills are always rounded-full
1138
- 'inline-flex items-center justify-center rounded-md border px-2 py-0.5 font-medium transition-colors gap-1',
1138
+ 'flex items-center justify-center rounded-md border px-2 py-0.5 font-medium transition-colors gap-1',
1139
1139
  // Variants (Google Dark Mode theme)
1140
1140
  this.variant === 'default' && 'border-transparent bg-primary text-primary-foreground', this.variant === 'secondary' && 'border-transparent bg-secondary text-secondary-foreground', this.variant === 'outline' && 'text-foreground border-border bg-transparent', this.variant === 'destructive' && 'border-transparent bg-destructive text-destructive-foreground',
1141
1141
  // Sizing
@@ -1153,9 +1153,8 @@ class BadgeComponent {
1153
1153
  <button
1154
1154
  *ngIf="removable"
1155
1155
  (click)="onRemove.emit($event)"
1156
- class="ml-1 -mr-1 rounded-md p-0.5 hover:bg-foreground/20 transition-colors outline-none focus:ring-1 focus:ring-ring"
1157
- >
1158
- <i class="ri-close-line text-[1.1em]"></i>
1156
+ class="ml-1 -mr-1 rounded-md hover:bg-foreground/20 transition-colors outline-none">
1157
+ <i class="ri-close-line"></i>
1159
1158
  </button>
1160
1159
  </div>
1161
1160
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
@@ -1177,9 +1176,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
1177
1176
  <button
1178
1177
  *ngIf="removable"
1179
1178
  (click)="onRemove.emit($event)"
1180
- class="ml-1 -mr-1 rounded-md p-0.5 hover:bg-foreground/20 transition-colors outline-none focus:ring-1 focus:ring-ring"
1181
- >
1182
- <i class="ri-close-line text-[1.1em]"></i>
1179
+ class="ml-1 -mr-1 rounded-md hover:bg-foreground/20 transition-colors outline-none">
1180
+ <i class="ri-close-line"></i>
1183
1181
  </button>
1184
1182
  </div>
1185
1183
  `,
@@ -6588,7 +6586,7 @@ class SegmentedComponent {
6588
6586
  role="tablist"
6589
6587
  >
6590
6588
  <div
6591
- class="absolute top-1 bottom-1 bg-background shadow-sm rounded-md transition-all duration-300 ease-[cubic-bezier(0.2,0.0,0.2,1)]"
6589
+ class="absolute top-1 bottom-1 bg-primary shadow-sm rounded-md transition-all duration-300 ease-[cubic-bezier(0.2,0.0,0.2,1)]"
6592
6590
  [style.left.px]="gliderLeft"
6593
6591
  [style.width.px]="gliderWidth"
6594
6592
  [class.opacity-0]="!hasValue"
@@ -6606,7 +6604,7 @@ class SegmentedComponent {
6606
6604
  'relative z-10 flex-1 px-3 py-1.5 text-sm font-medium transition-colors duration-200 rounded-md text-center focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
6607
6605
  'flex items-center justify-center gap-2',
6608
6606
  value === item.value
6609
- ? 'text-foreground'
6607
+ ? 'text-primary-foreground'
6610
6608
  : 'text-muted-foreground hover:text-foreground/70',
6611
6609
  item.disabled && 'opacity-50 cursor-not-allowed',
6612
6610
  item.class
@@ -6643,7 +6641,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
6643
6641
  role="tablist"
6644
6642
  >
6645
6643
  <div
6646
- class="absolute top-1 bottom-1 bg-background shadow-sm rounded-md transition-all duration-300 ease-[cubic-bezier(0.2,0.0,0.2,1)]"
6644
+ class="absolute top-1 bottom-1 bg-primary shadow-sm rounded-md transition-all duration-300 ease-[cubic-bezier(0.2,0.0,0.2,1)]"
6647
6645
  [style.left.px]="gliderLeft"
6648
6646
  [style.width.px]="gliderWidth"
6649
6647
  [class.opacity-0]="!hasValue"
@@ -6661,7 +6659,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
6661
6659
  'relative z-10 flex-1 px-3 py-1.5 text-sm font-medium transition-colors duration-200 rounded-md text-center focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
6662
6660
  'flex items-center justify-center gap-2',
6663
6661
  value === item.value
6664
- ? 'text-foreground'
6662
+ ? 'text-primary-foreground'
6665
6663
  : 'text-muted-foreground hover:text-foreground/70',
6666
6664
  item.disabled && 'opacity-50 cursor-not-allowed',
6667
6665
  item.class
@@ -6696,9 +6694,28 @@ class SidebarComponent {
6696
6694
  items = [];
6697
6695
  collapsed = false;
6698
6696
  class = '';
6697
+ /**
6698
+ * Styling variant for active items.
6699
+ * - default: Solid primary background, light text (Matches Badge Default)
6700
+ * - secondary: Solid secondary background
6701
+ * - ghost: Transparent background, accent text (Shadcn standard)
6702
+ * - outline: Bordered
6703
+ */
6704
+ variant = 'default';
6699
6705
  expandedParents = new Set();
6700
6706
  expandedChildren = new Set();
6701
6707
  cn = cn;
6708
+ get activeClasses() {
6709
+ return cn('transition-colors',
6710
+ // Default: Solid Primary (Badge-like) with lighter opacity (80% instead of 90%)
6711
+ this.variant === 'default' && 'bg-primary/80 text-primary-foreground hover:bg-primary hover:text-primary-foreground',
6712
+ // Secondary: Solid Secondary
6713
+ this.variant === 'secondary' && 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
6714
+ // Ghost: Subtle background (Sidebar standard)
6715
+ this.variant === 'ghost' && 'bg-accent text-accent-foreground',
6716
+ // Outline: Bordered
6717
+ this.variant === 'outline' && 'border border-border bg-background text-foreground hover:bg-accent hover:text-accent-foreground');
6718
+ }
6702
6719
  ngOnChanges(changes) {
6703
6720
  if (changes['collapsed'] && this.collapsed) {
6704
6721
  this.collapseAll();
@@ -6731,7 +6748,7 @@ class SidebarComponent {
6731
6748
  });
6732
6749
  });
6733
6750
  }
6734
- // --- ID GENERATORS (Now using Group Index correctly) ---
6751
+ // --- ID GENERATORS ---
6735
6752
  getGroupId(group, index) {
6736
6753
  return group.id || group.title || `g-${index}`;
6737
6754
  }
@@ -6750,7 +6767,6 @@ class SidebarComponent {
6750
6767
  if (this.collapsed)
6751
6768
  return;
6752
6769
  const id = this.getParentId(group, item, gIndex, iIndex);
6753
- // Create new Set reference to ensure Change Detection triggers
6754
6770
  const newSet = new Set(this.expandedParents);
6755
6771
  if (newSet.has(id)) {
6756
6772
  newSet.delete(id);
@@ -6762,7 +6778,6 @@ class SidebarComponent {
6762
6778
  }
6763
6779
  toggleChild(group, parent, subItem, gIndex, iIndex, sIndex) {
6764
6780
  const id = this.getChildId(group, parent, subItem, gIndex, iIndex, sIndex);
6765
- // Create new Set reference
6766
6781
  const newSet = new Set(this.expandedChildren);
6767
6782
  if (newSet.has(id)) {
6768
6783
  newSet.delete(id);
@@ -6784,13 +6799,13 @@ class SidebarComponent {
6784
6799
  return this.expandedChildren.has(this.getChildId(group, parent, subItem, gIndex, iIndex, sIndex));
6785
6800
  }
6786
6801
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
6787
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SidebarComponent, isStandalone: true, selector: "tolle-sidebar", inputs: { items: "items", collapsed: "collapsed", class: "class" }, usesOnChanges: true, ngImport: i0, template: `
6802
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SidebarComponent, isStandalone: true, selector: "tolle-sidebar", inputs: { items: "items", collapsed: "collapsed", class: "class", variant: "variant" }, usesOnChanges: true, ngImport: i0, template: `
6788
6803
  <aside [class]="cn(
6789
- 'flex flex-col h-full border-r bg-background transition-[width] duration-300 ease-in-out shrink-0 overflow-hidden',
6804
+ 'flex flex-col h-full bg-background transition-[width] duration-300 ease-in-out shrink-0 overflow-hidden',
6790
6805
  collapsed ? 'w-16' : 'w-64',
6791
6806
  class
6792
6807
  )">
6793
- <div class="flex h-14 shrink-0 items-center border-b px-3 overflow-hidden whitespace-nowrap">
6808
+ <div class="flex h-14 shrink-0 items-center px-3 overflow-hidden whitespace-nowrap">
6794
6809
  <ng-content select="[header]"></ng-content>
6795
6810
  </div>
6796
6811
 
@@ -6810,6 +6825,7 @@ class SidebarComponent {
6810
6825
  @for (item of group.items; track item.id || item.title || $index; let i = $index) {
6811
6826
 
6812
6827
  @if (item.items && item.items.length) {
6828
+ <!-- Parent Item (Group) -->
6813
6829
  <div class="relative">
6814
6830
  <button
6815
6831
  type="button"
@@ -6844,6 +6860,7 @@ class SidebarComponent {
6844
6860
  }
6845
6861
  </button>
6846
6862
 
6863
+ <!-- Submenu Grid Transition -->
6847
6864
  <div [class]="cn(
6848
6865
  'grid transition-[grid-template-rows] duration-300 ease-in-out',
6849
6866
  isParentExpanded(group, item, gIndex, i) && !collapsed ? 'grid-rows-[1fr] opacity-100' : 'grid-rows-[0fr] opacity-0'
@@ -6852,8 +6869,8 @@ class SidebarComponent {
6852
6869
  <div class="flex flex-col gap-1 mt-1 ml-4 border-l border-border/50 pl-2">
6853
6870
 
6854
6871
  @for (subItem of item.items; track subItem.id || subItem.title || $index; let j = $index) {
6855
-
6856
6872
  @if (subItem.items && subItem.items.length) {
6873
+ <!-- Grandchild Item Group (Recursive-ish logic for depth 2) -->
6857
6874
  <div class="relative">
6858
6875
  <button
6859
6876
  type="button"
@@ -6881,7 +6898,7 @@ class SidebarComponent {
6881
6898
  @for (grandChild of subItem.items; track grandChild.title) {
6882
6899
  <a
6883
6900
  [routerLink]="grandChild.url"
6884
- routerLinkActive="bg-accent/50 text-accent-foreground"
6901
+ [routerLinkActive]="activeClasses"
6885
6902
  [routerLinkActiveOptions]="{ exact: true }"
6886
6903
  class="flex items-center gap-2 hover:no-underline rounded-md px-3 py-1.5 text-sm transition-colors hover:bg-accent hover:text-accent-foreground text-muted-foreground whitespace-nowrap"
6887
6904
  >
@@ -6895,9 +6912,10 @@ class SidebarComponent {
6895
6912
  </div>
6896
6913
  }
6897
6914
  @else {
6915
+ <!-- Standard Sub Item -->
6898
6916
  <a
6899
6917
  [routerLink]="subItem.url"
6900
- routerLinkActive="bg-accent/50 text-accent-foreground"
6918
+ [routerLinkActive]="activeClasses"
6901
6919
  [routerLinkActiveOptions]="{ exact: true }"
6902
6920
  class="flex items-center gap-2 hover:no-underline rounded-md px-3 py-1.5 text-sm transition-colors hover:bg-accent hover:text-accent-foreground text-muted-foreground whitespace-nowrap"
6903
6921
  >
@@ -6912,9 +6930,10 @@ class SidebarComponent {
6912
6930
  </div>
6913
6931
  }
6914
6932
  @else {
6933
+ <!-- Standard Top-Level Item -->
6915
6934
  <a
6916
6935
  [routerLink]="item.url"
6917
- routerLinkActive="bg-primary/10 text-primary"
6936
+ [routerLinkActive]="activeClasses"
6918
6937
  [routerLinkActiveOptions]="{ exact: true }"
6919
6938
  [class]="cn(
6920
6939
  'group relative hover:no-underline flex items-center rounded-md px-3 py-2 text-sm font-medium transition-colors',
@@ -6941,21 +6960,21 @@ class SidebarComponent {
6941
6960
  }
6942
6961
  </div>
6943
6962
 
6944
- <div class="border-t shrink-0 p-3 overflow-hidden whitespace-nowrap">
6963
+ <div class="shrink-0 p-3 overflow-hidden whitespace-nowrap">
6945
6964
  <ng-content select="[footer]"></ng-content>
6946
6965
  </div>
6947
6966
  </aside>
6948
- `, isInline: true, styles: [":host{display:block;height:100%}.custom-scrollbar{scrollbar-width:thin;scrollbar-color:rgba(156,163,175,.3) transparent}.custom-scrollbar::-webkit-scrollbar{width:4px}.custom-scrollbar::-webkit-scrollbar-track{background:transparent}.custom-scrollbar::-webkit-scrollbar-thumb{background-color:#9ca3af4d;border-radius:20px}button:disabled{cursor:not-allowed;opacity:.6}*{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ml-4{margin-left:1rem}.border-l{border-left-width:1px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1$2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }] });
6967
+ `, isInline: true, styles: [":host{display:block;height:100%}.custom-scrollbar{scrollbar-width:thin;scrollbar-color:rgba(156,163,175,.3) transparent}.custom-scrollbar::-webkit-scrollbar{width:4px}.custom-scrollbar::-webkit-scrollbar-track{background:transparent}.custom-scrollbar::-webkit-scrollbar-thumb{background-color:#9ca3af4d;border-radius:20px}button:disabled{cursor:not-allowed;opacity:.6}*{transition-timing-function:cubic-bezier(.4,0,.2,1)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1$2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }] });
6949
6968
  }
6950
6969
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SidebarComponent, decorators: [{
6951
6970
  type: Component,
6952
6971
  args: [{ selector: 'tolle-sidebar', standalone: true, imports: [CommonModule, RouterModule], template: `
6953
6972
  <aside [class]="cn(
6954
- 'flex flex-col h-full border-r bg-background transition-[width] duration-300 ease-in-out shrink-0 overflow-hidden',
6973
+ 'flex flex-col h-full bg-background transition-[width] duration-300 ease-in-out shrink-0 overflow-hidden',
6955
6974
  collapsed ? 'w-16' : 'w-64',
6956
6975
  class
6957
6976
  )">
6958
- <div class="flex h-14 shrink-0 items-center border-b px-3 overflow-hidden whitespace-nowrap">
6977
+ <div class="flex h-14 shrink-0 items-center px-3 overflow-hidden whitespace-nowrap">
6959
6978
  <ng-content select="[header]"></ng-content>
6960
6979
  </div>
6961
6980
 
@@ -6975,6 +6994,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
6975
6994
  @for (item of group.items; track item.id || item.title || $index; let i = $index) {
6976
6995
 
6977
6996
  @if (item.items && item.items.length) {
6997
+ <!-- Parent Item (Group) -->
6978
6998
  <div class="relative">
6979
6999
  <button
6980
7000
  type="button"
@@ -7009,6 +7029,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
7009
7029
  }
7010
7030
  </button>
7011
7031
 
7032
+ <!-- Submenu Grid Transition -->
7012
7033
  <div [class]="cn(
7013
7034
  'grid transition-[grid-template-rows] duration-300 ease-in-out',
7014
7035
  isParentExpanded(group, item, gIndex, i) && !collapsed ? 'grid-rows-[1fr] opacity-100' : 'grid-rows-[0fr] opacity-0'
@@ -7017,8 +7038,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
7017
7038
  <div class="flex flex-col gap-1 mt-1 ml-4 border-l border-border/50 pl-2">
7018
7039
 
7019
7040
  @for (subItem of item.items; track subItem.id || subItem.title || $index; let j = $index) {
7020
-
7021
7041
  @if (subItem.items && subItem.items.length) {
7042
+ <!-- Grandchild Item Group (Recursive-ish logic for depth 2) -->
7022
7043
  <div class="relative">
7023
7044
  <button
7024
7045
  type="button"
@@ -7046,7 +7067,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
7046
7067
  @for (grandChild of subItem.items; track grandChild.title) {
7047
7068
  <a
7048
7069
  [routerLink]="grandChild.url"
7049
- routerLinkActive="bg-accent/50 text-accent-foreground"
7070
+ [routerLinkActive]="activeClasses"
7050
7071
  [routerLinkActiveOptions]="{ exact: true }"
7051
7072
  class="flex items-center gap-2 hover:no-underline rounded-md px-3 py-1.5 text-sm transition-colors hover:bg-accent hover:text-accent-foreground text-muted-foreground whitespace-nowrap"
7052
7073
  >
@@ -7060,9 +7081,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
7060
7081
  </div>
7061
7082
  }
7062
7083
  @else {
7084
+ <!-- Standard Sub Item -->
7063
7085
  <a
7064
7086
  [routerLink]="subItem.url"
7065
- routerLinkActive="bg-accent/50 text-accent-foreground"
7087
+ [routerLinkActive]="activeClasses"
7066
7088
  [routerLinkActiveOptions]="{ exact: true }"
7067
7089
  class="flex items-center gap-2 hover:no-underline rounded-md px-3 py-1.5 text-sm transition-colors hover:bg-accent hover:text-accent-foreground text-muted-foreground whitespace-nowrap"
7068
7090
  >
@@ -7077,9 +7099,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
7077
7099
  </div>
7078
7100
  }
7079
7101
  @else {
7102
+ <!-- Standard Top-Level Item -->
7080
7103
  <a
7081
7104
  [routerLink]="item.url"
7082
- routerLinkActive="bg-primary/10 text-primary"
7105
+ [routerLinkActive]="activeClasses"
7083
7106
  [routerLinkActiveOptions]="{ exact: true }"
7084
7107
  [class]="cn(
7085
7108
  'group relative hover:no-underline flex items-center rounded-md px-3 py-2 text-sm font-medium transition-colors',
@@ -7106,17 +7129,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
7106
7129
  }
7107
7130
  </div>
7108
7131
 
7109
- <div class="border-t shrink-0 p-3 overflow-hidden whitespace-nowrap">
7132
+ <div class="shrink-0 p-3 overflow-hidden whitespace-nowrap">
7110
7133
  <ng-content select="[footer]"></ng-content>
7111
7134
  </div>
7112
7135
  </aside>
7113
- `, styles: [":host{display:block;height:100%}.custom-scrollbar{scrollbar-width:thin;scrollbar-color:rgba(156,163,175,.3) transparent}.custom-scrollbar::-webkit-scrollbar{width:4px}.custom-scrollbar::-webkit-scrollbar-track{background:transparent}.custom-scrollbar::-webkit-scrollbar-thumb{background-color:#9ca3af4d;border-radius:20px}button:disabled{cursor:not-allowed;opacity:.6}*{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ml-4{margin-left:1rem}.border-l{border-left-width:1px}\n"] }]
7136
+ `, styles: [":host{display:block;height:100%}.custom-scrollbar{scrollbar-width:thin;scrollbar-color:rgba(156,163,175,.3) transparent}.custom-scrollbar::-webkit-scrollbar{width:4px}.custom-scrollbar::-webkit-scrollbar-track{background:transparent}.custom-scrollbar::-webkit-scrollbar-thumb{background-color:#9ca3af4d;border-radius:20px}button:disabled{cursor:not-allowed;opacity:.6}*{transition-timing-function:cubic-bezier(.4,0,.2,1)}\n"] }]
7114
7137
  }], propDecorators: { items: [{
7115
7138
  type: Input
7116
7139
  }], collapsed: [{
7117
7140
  type: Input
7118
7141
  }], class: [{
7119
7142
  type: Input
7143
+ }], variant: [{
7144
+ type: Input
7120
7145
  }] } });
7121
7146
 
7122
7147
  /*