@tolle_/tolle-ui 0.0.19-beta → 0.0.22-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.
@@ -1,7 +1,7 @@
1
1
  import { type VariantProps } from 'class-variance-authority';
2
2
  import * as i0 from "@angular/core";
3
3
  declare const buttonVariants: (props?: ({
4
- variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
4
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
5
5
  size?: "default" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon" | "icon-lg" | null | undefined;
6
6
  busy?: boolean | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -12,9 +12,8 @@ export declare class ButtonComponent {
12
12
  size: ButtonProps['size'];
13
13
  disabled: boolean;
14
14
  busy: boolean;
15
- readonly: boolean;
16
15
  get computedClass(): string;
17
16
  static ɵfac: i0.ɵɵFactoryDeclaration<ButtonComponent, never>;
18
- static ɵcmp: i0.ɵɵComponentDeclaration<ButtonComponent, "tolle-button", never, { "class": { "alias": "class"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "size": { "alias": "size"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "busy": { "alias": "busy"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; }, {}, never, ["*"], true, never>;
17
+ static ɵcmp: i0.ɵɵComponentDeclaration<ButtonComponent, "tolle-button", never, { "class": { "alias": "class"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "size": { "alias": "size"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "busy": { "alias": "busy"; "required": false; }; }, {}, never, ["*"], true, never>;
19
18
  }
20
19
  export {};
@@ -1,9 +1,10 @@
1
- import { ChangeDetectorRef } from '@angular/core';
1
+ import { ChangeDetectorRef, ElementRef, AfterViewInit } from '@angular/core';
2
2
  import { ControlValueAccessor } from '@angular/forms';
3
3
  import { cn } from './utils/cn';
4
4
  import * as i0 from "@angular/core";
5
- export declare class InputComponent implements ControlValueAccessor {
5
+ export declare class InputComponent implements ControlValueAccessor, AfterViewInit {
6
6
  private cdr;
7
+ inputElement: ElementRef<HTMLInputElement>;
7
8
  id: string;
8
9
  label: string;
9
10
  hint: string;
@@ -16,18 +17,25 @@ export declare class InputComponent implements ControlValueAccessor {
16
17
  disabled: boolean;
17
18
  readonly: boolean;
18
19
  error: boolean;
20
+ hideHintOnFocus: boolean;
19
21
  value: any;
20
22
  onChange: any;
21
23
  onTouched: any;
24
+ isFocused: boolean;
22
25
  constructor(cdr: ChangeDetectorRef);
26
+ ngAfterViewInit(): void;
23
27
  writeValue(value: any): void;
24
28
  registerOnChange(fn: any): void;
25
29
  registerOnTouched(fn: any): void;
26
30
  setDisabledState(isDisabled: boolean): void;
27
31
  onInputChange(event: Event): void;
32
+ onFocus(): void;
33
+ onBlur(): void;
34
+ focusInput(): void;
28
35
  protected readonly cn: typeof cn;
36
+ get computedLabelClass(): string;
29
37
  get computedContainerClass(): string;
30
38
  get computedInputClass(): string;
31
39
  static ɵfac: i0.ɵɵFactoryDeclaration<InputComponent, never>;
32
- static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent, "tolle-input", never, { "id": { "alias": "id"; "required": false; }; "label": { "alias": "label"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "type": { "alias": "type"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "size": { "alias": "size"; "required": false; }; "containerClass": { "alias": "containerClass"; "required": false; }; "class": { "alias": "class"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "error": { "alias": "error"; "required": false; }; }, {}, never, ["[prefix]", "[suffix]"], true, never>;
40
+ static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent, "tolle-input", never, { "id": { "alias": "id"; "required": false; }; "label": { "alias": "label"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "type": { "alias": "type"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "size": { "alias": "size"; "required": false; }; "containerClass": { "alias": "containerClass"; "required": false; }; "class": { "alias": "class"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "error": { "alias": "error"; "required": false; }; "hideHintOnFocus": { "alias": "hideHintOnFocus"; "required": false; }; }, {}, never, ["[prefix]", "[suffix]"], true, never>;
33
41
  }
@@ -19,17 +19,23 @@ export declare class MaskedInputComponent implements ControlValueAccessor, After
19
19
  error: boolean;
20
20
  size: 'xs' | 'sm' | 'default' | 'lg';
21
21
  returnRaw: boolean;
22
+ hideHintOnFocus: boolean;
22
23
  inputEl: ElementRef<HTMLInputElement>;
23
24
  hasPrefix: boolean;
24
25
  hasSuffix: boolean;
25
26
  displayValue: string;
27
+ isFocused: boolean;
26
28
  private tokens;
27
29
  onChange: any;
28
30
  onTouched: any;
29
31
  constructor(el: ElementRef, cdr: ChangeDetectorRef);
30
32
  ngAfterContentChecked(): void;
33
+ get computedLabelClass(): string;
31
34
  get computedContainerClass(): string;
32
35
  get computedInputClass(): string;
36
+ focusInput(): void;
37
+ onFocus(): void;
38
+ onBlur(): void;
33
39
  onInput(event: Event): void;
34
40
  private applyMask;
35
41
  private unmask;
@@ -39,5 +45,5 @@ export declare class MaskedInputComponent implements ControlValueAccessor, After
39
45
  setDisabledState(isDisabled: boolean): void;
40
46
  protected cn: typeof cn;
41
47
  static ɵfac: i0.ɵɵFactoryDeclaration<MaskedInputComponent, never>;
42
- static ɵcmp: i0.ɵɵComponentDeclaration<MaskedInputComponent, "tolle-masked-input", never, { "id": { "alias": "id"; "required": false; }; "label": { "alias": "label"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "mask": { "alias": "mask"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "type": { "alias": "type"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "class": { "alias": "class"; "required": false; }; "containerClass": { "alias": "containerClass"; "required": false; }; "error": { "alias": "error"; "required": false; }; "size": { "alias": "size"; "required": false; }; "returnRaw": { "alias": "returnRaw"; "required": false; }; }, {}, never, ["[prefix]", "[suffix]"], true, never>;
48
+ static ɵcmp: i0.ɵɵComponentDeclaration<MaskedInputComponent, "tolle-masked-input", never, { "id": { "alias": "id"; "required": false; }; "label": { "alias": "label"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "mask": { "alias": "mask"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "type": { "alias": "type"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "class": { "alias": "class"; "required": false; }; "containerClass": { "alias": "containerClass"; "required": false; }; "error": { "alias": "error"; "required": false; }; "size": { "alias": "size"; "required": false; }; "returnRaw": { "alias": "returnRaw"; "required": false; }; "hideHintOnFocus": { "alias": "hideHintOnFocus"; "required": false; }; }, {}, never, ["[prefix]", "[suffix]"], true, never>;
43
49
  }
@@ -7,6 +7,7 @@ export declare class OtpSlotComponent {
7
7
  isLast: boolean;
8
8
  class: string;
9
9
  protected cn: typeof cn;
10
+ get computedClass(): string;
10
11
  static ɵfac: i0.ɵɵFactoryDeclaration<OtpSlotComponent, never>;
11
12
  static ɵcmp: i0.ɵɵComponentDeclaration<OtpSlotComponent, "tolle-otp-slot", never, { "char": { "alias": "char"; "required": false; }; "isActive": { "alias": "isActive"; "required": false; }; "isFirst": { "alias": "isFirst"; "required": false; }; "isLast": { "alias": "isLast"; "required": false; }; "class": { "alias": "class"; "required": false; }; }, {}, never, never, true, never>;
12
13
  }
@@ -14,6 +14,7 @@ export declare class SelectComponent implements ControlValueAccessor, AfterConte
14
14
  readonly: boolean;
15
15
  trigger: ElementRef;
16
16
  popover: ElementRef;
17
+ container: ElementRef;
17
18
  items: QueryList<SelectItemComponent>;
18
19
  private sub;
19
20
  searchQuery: string;
@@ -7,25 +7,32 @@ export declare class TextareaComponent implements ControlValueAccessor, AfterVie
7
7
  label: string;
8
8
  placeholder: string;
9
9
  hint: string;
10
+ errorMessage: string;
10
11
  rows: number;
11
12
  maxLength?: number;
12
13
  showCharacterCount: boolean;
13
14
  autoGrow: boolean;
14
15
  error: boolean;
15
16
  className: string;
17
+ hideHintOnFocus: boolean;
18
+ hideCharacterCountOnFocus: boolean;
16
19
  disabled: boolean;
17
20
  readonly: boolean;
18
21
  value: string;
22
+ isFocused: boolean;
19
23
  onChange: any;
20
24
  onTouched: any;
21
25
  ngAfterViewInit(): void;
26
+ get computedLabelClass(): string;
22
27
  get textareaClasses(): string;
23
28
  handleInput(event: any): void;
29
+ onFocus(): void;
30
+ onBlur(): void;
24
31
  private resize;
25
32
  writeValue(value: any): void;
26
33
  registerOnChange(fn: any): void;
27
34
  registerOnTouched(fn: any): void;
28
35
  setDisabledState(isDisabled: boolean): void;
29
36
  static ɵfac: i0.ɵɵFactoryDeclaration<TextareaComponent, never>;
30
- static ɵcmp: i0.ɵɵComponentDeclaration<TextareaComponent, "tolle-textarea", never, { "id": { "alias": "id"; "required": false; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "showCharacterCount": { "alias": "showCharacterCount"; "required": false; }; "autoGrow": { "alias": "autoGrow"; "required": false; }; "error": { "alias": "error"; "required": false; }; "className": { "alias": "className"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; }, {}, never, never, true, never>;
37
+ static ɵcmp: i0.ɵɵComponentDeclaration<TextareaComponent, "tolle-textarea", never, { "id": { "alias": "id"; "required": false; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "showCharacterCount": { "alias": "showCharacterCount"; "required": false; }; "autoGrow": { "alias": "autoGrow"; "required": false; }; "error": { "alias": "error"; "required": false; }; "className": { "alias": "className"; "required": false; }; "hideHintOnFocus": { "alias": "hideHintOnFocus"; "required": false; }; "hideCharacterCountOnFocus": { "alias": "hideCharacterCountOnFocus"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; }, {}, never, never, true, never>;
31
38
  }
@@ -12,14 +12,41 @@ export declare class ThemeService {
12
12
  constructor(document: Document, platformId: Object, config: TolleConfig, rendererFactory: RendererFactory2);
13
13
  private initializeTheme;
14
14
  /**
15
- * Applies the brand identity variables with full shade palette
15
+ * Sets the border radius for all components
16
16
  */
17
- applyBrandConfig(config: TolleConfig): void;
17
+ setRadius(radius: string, persist?: boolean): void;
18
+ /**
19
+ * Updates the radius calculations in dynamic styles
20
+ */
21
+ private updateRadiusInDynamicStyles;
18
22
  /**
19
23
  * Generates full primary color palette (50-900) based on base color
20
- * Uses color-mix() for consistency with your existing approach
21
24
  */
22
25
  private generatePrimaryShades;
26
+ /**
27
+ * Convert hex color to RGB object
28
+ */
29
+ private hexToRgb;
30
+ /**
31
+ * Convert hex to RGB string format for CSS (space-separated)
32
+ */
33
+ private hexToRgbString;
34
+ /**
35
+ * Get contrast color in RGB format
36
+ */
37
+ private getContrastColorRgb;
38
+ /**
39
+ * Lighten a hex color by a percentage
40
+ */
41
+ private lightenColor;
42
+ /**
43
+ * Darken a hex color by a percentage
44
+ */
45
+ private darkenColor;
46
+ /**
47
+ * Calculate contrast color (black or white) based on background color
48
+ */
49
+ private getContrastColor;
23
50
  private injectDynamicStyles;
24
51
  toggleTheme(): void;
25
52
  private enableDarkMode;
@@ -27,6 +54,22 @@ export declare class ThemeService {
27
54
  setPrimaryColor(color: string, persist?: boolean): void;
28
55
  get currentTheme(): 'dark' | 'light';
29
56
  get primaryColor(): string | null;
57
+ /**
58
+ * Reset to config defaults (clears user preferences)
59
+ */
60
+ resetToConfigDefaults(): void;
61
+ /**
62
+ * Get current user preferences
63
+ */
64
+ getUserPreferences(): {
65
+ theme: string | null;
66
+ primaryColor: string | null;
67
+ radius: string | null;
68
+ } | null;
69
+ /**
70
+ * Clear all user preferences
71
+ */
72
+ clearUserPreferences(): void;
30
73
  static ɵfac: i0.ɵɵFactoryDeclaration<ThemeService, [null, null, { optional: true; }, null]>;
31
74
  static ɵprov: i0.ɵɵInjectableDeclaration<ThemeService>;
32
75
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tolle_/tolle-ui",
3
- "version": "0.0.19-beta",
3
+ "version": "0.0.22-beta",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/preset.js CHANGED
@@ -1,48 +1,56 @@
1
- /** @type {import('tailwindcss').Config} */
1
+ // tolle-preset.js
2
2
  module.exports = {
3
+ darkMode: 'class',
3
4
  theme: {
4
5
  extend: {
5
6
  colors: {
6
- // Primary with full palette
7
+ // CSS Variables with RGB values
8
+ border: 'rgb(var(--border) / <alpha-value>)',
9
+ input: 'rgb(var(--input) / <alpha-value>)',
10
+ ring: 'rgb(var(--ring) / <alpha-value>)',
11
+ background: 'rgb(var(--background) / <alpha-value>)',
12
+ foreground: 'rgb(var(--foreground) / <alpha-value>)',
13
+
14
+ // Primary colors with opacity support
7
15
  primary: {
8
- 50: 'var(--primary-50)',
9
- 100: 'var(--primary-100)',
10
- 200: 'var(--primary-200)',
11
- 300: 'var(--primary-300)',
12
- 400: 'var(--primary-400)',
13
- 500: 'var(--primary-500)',
14
- 600: 'var(--primary-600)',
15
- 700: 'var(--primary-700)',
16
- 800: 'var(--primary-800)',
17
- 900: 'var(--primary-900)',
18
- DEFAULT: 'var(--primary-500)',
19
- foreground: 'var(--primary-foreground)',
16
+ DEFAULT: 'rgb(var(--primary) / <alpha-value>)',
17
+ foreground: 'rgb(var(--primary-foreground) / <alpha-value>)',
18
+ 50: 'rgb(var(--primary-50) / <alpha-value>)',
19
+ 100: 'rgb(var(--primary-100) / <alpha-value>)',
20
+ 200: 'rgb(var(--primary-200) / <alpha-value>)',
21
+ 300: 'rgb(var(--primary-300) / <alpha-value>)',
22
+ 400: 'rgb(var(--primary-400) / <alpha-value>)',
23
+ 500: 'rgb(var(--primary-500) / <alpha-value>)',
24
+ 600: 'rgb(var(--primary-600) / <alpha-value>)',
25
+ 700: 'rgb(var(--primary-700) / <alpha-value>)',
26
+ 800: 'rgb(var(--primary-800) / <alpha-value>)',
27
+ 900: 'rgb(var(--primary-900) / <alpha-value>)',
20
28
  },
21
- // Other colors
29
+
30
+ // Semantic colors with opacity support
22
31
  secondary: {
23
- DEFAULT: 'var(--secondary)',
24
- foreground: 'var(--secondary-foreground)',
32
+ DEFAULT: 'rgb(var(--secondary) / <alpha-value>)',
33
+ foreground: 'rgb(var(--secondary-foreground) / <alpha-value>)',
34
+ },
35
+ destructive: {
36
+ DEFAULT: 'rgb(var(--destructive) / <alpha-value>)',
37
+ foreground: 'rgb(var(--destructive-foreground) / <alpha-value>)',
25
38
  },
26
39
  muted: {
27
- DEFAULT: 'var(--muted)',
28
- foreground: 'var(--muted-foreground)',
40
+ DEFAULT: 'rgb(var(--muted) / <alpha-value>)',
41
+ foreground: 'rgb(var(--muted-foreground) / <alpha-value>)',
29
42
  },
30
43
  accent: {
31
- DEFAULT: 'var(--accent)',
32
- foreground: 'var(--accent-foreground)',
33
- },
34
- destructive: {
35
- DEFAULT: 'var(--destructive)',
36
- foreground: 'var(--destructive-foreground)',
44
+ DEFAULT: 'rgb(var(--accent) / <alpha-value>)',
45
+ foreground: 'rgb(var(--accent-foreground) / <alpha-value>)',
37
46
  },
38
- border: 'var(--border)',
39
- input: 'var(--input)',
40
- ring: 'var(--ring)',
41
- background: 'var(--background)',
42
- foreground: 'var(--foreground)',
43
47
  popover: {
44
- DEFAULT: 'var(--popover)',
45
- foreground: 'var(--popover-foreground)',
48
+ DEFAULT: 'rgb(var(--popover) / <alpha-value>)',
49
+ foreground: 'rgb(var(--popover-foreground) / <alpha-value>)',
50
+ },
51
+ card: {
52
+ DEFAULT: 'rgb(var(--card) / <alpha-value>)',
53
+ foreground: 'rgb(var(--card-foreground) / <alpha-value>)',
46
54
  },
47
55
  },
48
56
  borderRadius: {
@@ -50,7 +58,13 @@ module.exports = {
50
58
  md: 'calc(var(--radius) - 2px)',
51
59
  sm: 'calc(var(--radius) - 4px)',
52
60
  },
61
+ boxShadow: {
62
+ sm: 'var(--shadow-sm)',
63
+ DEFAULT: 'var(--shadow)',
64
+ md: 'var(--shadow-md)',
65
+ lg: 'var(--shadow-lg)',
66
+ },
53
67
  },
54
68
  },
55
69
  plugins: [],
56
- };
70
+ }