shirkasoft-ui-components 1.3.15 → 1.4.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 (90) hide show
  1. package/README.md +447 -71
  2. package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs +7 -7
  3. package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs.map +1 -1
  4. package/fesm2022/shirkasoft-ui-components-button.mjs +11 -11
  5. package/fesm2022/shirkasoft-ui-components-button.mjs.map +1 -1
  6. package/fesm2022/shirkasoft-ui-components-chart.mjs +6 -6
  7. package/fesm2022/shirkasoft-ui-components-chart.mjs.map +1 -1
  8. package/fesm2022/shirkasoft-ui-components-config.mjs +914 -0
  9. package/fesm2022/shirkasoft-ui-components-config.mjs.map +1 -0
  10. package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs +8 -8
  11. package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs.map +1 -1
  12. package/fesm2022/shirkasoft-ui-components-date-picker.mjs +901 -753
  13. package/fesm2022/shirkasoft-ui-components-date-picker.mjs.map +1 -1
  14. package/fesm2022/shirkasoft-ui-components-fieldset.mjs +5 -5
  15. package/fesm2022/shirkasoft-ui-components-fieldset.mjs.map +1 -1
  16. package/fesm2022/shirkasoft-ui-components-file-upload.mjs +16 -9
  17. package/fesm2022/shirkasoft-ui-components-file-upload.mjs.map +1 -1
  18. package/fesm2022/shirkasoft-ui-components-icons.mjs +646 -0
  19. package/fesm2022/shirkasoft-ui-components-icons.mjs.map +1 -0
  20. package/fesm2022/shirkasoft-ui-components-knob.mjs +44 -17
  21. package/fesm2022/shirkasoft-ui-components-knob.mjs.map +1 -1
  22. package/fesm2022/shirkasoft-ui-components-loading.mjs +16 -16
  23. package/fesm2022/shirkasoft-ui-components-loading.mjs.map +1 -1
  24. package/fesm2022/shirkasoft-ui-components-modal.mjs +42 -31
  25. package/fesm2022/shirkasoft-ui-components-modal.mjs.map +1 -1
  26. package/fesm2022/shirkasoft-ui-components-notification.mjs +8 -8
  27. package/fesm2022/shirkasoft-ui-components-notification.mjs.map +1 -1
  28. package/fesm2022/shirkasoft-ui-components-price-input.mjs +79 -29
  29. package/fesm2022/shirkasoft-ui-components-price-input.mjs.map +1 -1
  30. package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs +7 -7
  31. package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs.map +1 -1
  32. package/fesm2022/shirkasoft-ui-components-select.mjs +50 -23
  33. package/fesm2022/shirkasoft-ui-components-select.mjs.map +1 -1
  34. package/fesm2022/shirkasoft-ui-components-sidebar.mjs +6 -6
  35. package/fesm2022/shirkasoft-ui-components-sidebar.mjs.map +1 -1
  36. package/fesm2022/shirkasoft-ui-components-skeleton.mjs +4 -4
  37. package/fesm2022/shirkasoft-ui-components-skeleton.mjs.map +1 -1
  38. package/fesm2022/shirkasoft-ui-components-table.mjs +163 -102
  39. package/fesm2022/shirkasoft-ui-components-table.mjs.map +1 -1
  40. package/fesm2022/shirkasoft-ui-components-tabs.mjs +21 -23
  41. package/fesm2022/shirkasoft-ui-components-tabs.mjs.map +1 -1
  42. package/fesm2022/shirkasoft-ui-components-tag.mjs +9 -9
  43. package/fesm2022/shirkasoft-ui-components-tag.mjs.map +1 -1
  44. package/fesm2022/shirkasoft-ui-components-text-field.mjs +63 -30
  45. package/fesm2022/shirkasoft-ui-components-text-field.mjs.map +1 -1
  46. package/fesm2022/shirkasoft-ui-components-theme-picker.mjs +280 -0
  47. package/fesm2022/shirkasoft-ui-components-theme-picker.mjs.map +1 -0
  48. package/fesm2022/shirkasoft-ui-components-theme.mjs +180 -0
  49. package/fesm2022/shirkasoft-ui-components-theme.mjs.map +1 -0
  50. package/fesm2022/shirkasoft-ui-components-timeline.mjs +10 -22
  51. package/fesm2022/shirkasoft-ui-components-timeline.mjs.map +1 -1
  52. package/fesm2022/shirkasoft-ui-components-toggle.mjs +60 -53
  53. package/fesm2022/shirkasoft-ui-components-toggle.mjs.map +1 -1
  54. package/fesm2022/shirkasoft-ui-components-tooltip.mjs +29 -11
  55. package/fesm2022/shirkasoft-ui-components-tooltip.mjs.map +1 -1
  56. package/fesm2022/shirkasoft-ui-components-utils.mjs +22 -11
  57. package/fesm2022/shirkasoft-ui-components-utils.mjs.map +1 -1
  58. package/fesm2022/shirkasoft-ui-components-wizard.mjs +9 -10
  59. package/fesm2022/shirkasoft-ui-components-wizard.mjs.map +1 -1
  60. package/package.json +33 -3
  61. package/src/baseline.css +2472 -0
  62. package/src/theme.css +15 -543
  63. package/src/themes/ocean.css +56 -0
  64. package/src/themes/sunset.css +55 -0
  65. package/src/themes/violet.css +25 -0
  66. package/src/tokens.css +612 -0
  67. package/types/shirkasoft-ui-components-button.d.ts +1 -1
  68. package/types/shirkasoft-ui-components-config.d.ts +368 -0
  69. package/types/shirkasoft-ui-components-confirm-dialog.d.ts +2 -1
  70. package/types/shirkasoft-ui-components-date-picker.d.ts +276 -224
  71. package/types/shirkasoft-ui-components-fieldset.d.ts +2 -1
  72. package/types/shirkasoft-ui-components-file-upload.d.ts +11 -5
  73. package/types/shirkasoft-ui-components-icons.d.ts +1422 -0
  74. package/types/shirkasoft-ui-components-knob.d.ts +28 -7
  75. package/types/shirkasoft-ui-components-modal.d.ts +11 -7
  76. package/types/shirkasoft-ui-components-notification.d.ts +2 -1
  77. package/types/shirkasoft-ui-components-price-input.d.ts +37 -9
  78. package/types/shirkasoft-ui-components-rail-sidebar.d.ts +3 -3
  79. package/types/shirkasoft-ui-components-select.d.ts +24 -8
  80. package/types/shirkasoft-ui-components-sidebar.d.ts +2 -1
  81. package/types/shirkasoft-ui-components-table.d.ts +91 -80
  82. package/types/shirkasoft-ui-components-tag.d.ts +1 -1
  83. package/types/shirkasoft-ui-components-text-field.d.ts +29 -13
  84. package/types/shirkasoft-ui-components-theme-picker.d.ts +83 -0
  85. package/types/shirkasoft-ui-components-theme.d.ts +88 -0
  86. package/types/shirkasoft-ui-components-timeline.d.ts +5 -4
  87. package/types/shirkasoft-ui-components-toggle.d.ts +20 -13
  88. package/types/shirkasoft-ui-components-tooltip.d.ts +6 -0
  89. package/types/shirkasoft-ui-components-utils.d.ts +16 -6
  90. package/types/shirkasoft-ui-components-wizard.d.ts +4 -3
@@ -1,5 +1,6 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { ControlValueAccessor } from '@angular/forms';
3
+ import { FormCheckboxControl } from '@angular/forms/signals';
3
4
 
4
5
  /**
5
6
  * Shirkasoft UI Components.
@@ -9,20 +10,25 @@ import { ControlValueAccessor } from '@angular/forms';
9
10
  /**
10
11
  * Switch / checkbox component that implements ControlValueAccessor so it can
11
12
  * be used with reactive and template-driven forms.
13
+ *
14
+ * It also implements the Angular Signal Forms `FormCheckboxControl` contract
15
+ * through its `checked` model, so it works with `[formField]` as well.
12
16
  */
13
- declare class ToggleComponent implements ControlValueAccessor {
17
+ declare class ToggleComponent implements ControlValueAccessor, FormCheckboxControl {
14
18
  /** Text displayed next to the control. */
15
19
  label: _angular_core.InputSignal<string>;
16
20
  /** Visual style: 'toggle' (switch) or 'checkbox'. Defaults to 'toggle'. */
17
21
  mode: _angular_core.InputSignal<"toggle" | "checkbox">;
18
- /** Manually controlled checked state (supports one-way binding). */
19
- checked: _angular_core.InputSignal<boolean | undefined>;
20
- /** Emitted with the new value when the user toggles the control. */
21
- checkedChange: _angular_core.OutputEmitterRef<boolean>;
22
+ /**
23
+ * Checked state. Two-way bindable with `[(checked)]`; also the model that
24
+ * Signal Forms binds to. The implicit `checkedChange` output fires with the
25
+ * new value whenever the user toggles the control.
26
+ */
27
+ checked: _angular_core.ModelSignal<boolean>;
22
28
  /** Disables the control (also settable through reactive forms). */
23
29
  disabled: _angular_core.InputSignal<boolean>;
24
- /** Internal controlled/reactive value. */
25
- _value: _angular_core.WritableSignal<boolean>;
30
+ /** Emitted on blur so Signal Forms can mark the field as touched. */
31
+ touch: _angular_core.OutputEmitterRef<void>;
26
32
  /** Reactive disabled state. */
27
33
  _disabled: _angular_core.WritableSignal<boolean>;
28
34
  /** Disabled through the `disabled` input or the form control. */
@@ -31,7 +37,6 @@ declare class ToggleComponent implements ControlValueAccessor {
31
37
  private onChange;
32
38
  /** Callback notified when the control loses focus or is touched. */
33
39
  private onTouched;
34
- constructor();
35
40
  /** Sets the value from the form control. */
36
41
  writeValue(value: any): void;
37
42
  /** Registers the callback invoked on value changes (ControlValueAccessor). */
@@ -40,15 +45,17 @@ declare class ToggleComponent implements ControlValueAccessor {
40
45
  registerOnTouched(fn: any): void;
41
46
  /** Reflects the disabled state of the form control. */
42
47
  setDisabledState(isDisabled: boolean): void;
43
- /**
44
- * Inverts the current value (unless disabled), notifies the form control,
45
- * marks the control as touched and emits `checkedChange`.
46
- */
48
+ /** Marks the control as touched when focus leaves it. */
49
+ onBlur(): void;
47
50
  /** Space/Enter toggles the focused switch or checkbox. */
48
51
  onKeydown(event: KeyboardEvent): void;
52
+ /**
53
+ * Inverts the current value (unless disabled), notifies the form control and
54
+ * marks the control as touched. The `checked` model emits `checkedChange`.
55
+ */
49
56
  toggle(): void;
50
57
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToggleComponent, never>;
51
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ToggleComponent, "shk-toggle", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "checkedChange": "checkedChange"; }, never, never, true, never>;
58
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ToggleComponent, "shk-toggle", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "touch": "touch"; }, never, never, true, never>;
52
59
  }
53
60
 
54
61
  export { ToggleComponent };
@@ -30,6 +30,12 @@ declare class TooltipComponent implements OnDestroy {
30
30
  onMouseEnter(): void;
31
31
  /** Hides the tooltip on mouseleave. */
32
32
  onMouseLeave(): void;
33
+ /** Also opens on keyboard focus, so icon-only triggers are readable. */
34
+ onFocusIn(): void;
35
+ /** Closes when the focus leaves the trigger. */
36
+ onFocusOut(): void;
37
+ /** Opens the tooltip when there is text to show. */
38
+ private open;
33
39
  /** Creates and positions the tooltip element on `document.body`. */
34
40
  private show;
35
41
  /** Computes the tooltip position, clamped to the viewport. */
@@ -1,12 +1,22 @@
1
+ import { IconNode } from 'shirkasoft-ui-components/icons';
1
2
  import * as i0 from '@angular/core';
2
3
 
3
- /** Maps the icon names used across the library to their Lucide component. */
4
- declare const ICONS: Record<string, any>;
4
+ /** Maps the icon names used across the library to their SVG data. */
5
+ declare const ICONS: Record<string, IconNode>;
5
6
  /**
6
- * Resolves the icon passed to a component into a lucide component.
7
- * Accepts a registered string name, an existing lucide component or a LucideIconData object.
7
+ * True when `icon` is a per-item resolver function such as `(row) => 'pencil'`.
8
+ *
9
+ * Classes are functions too, but must never be called: a v1 `@lucide/angular`
10
+ * component passed by an app that has not migrated yet would throw
11
+ * "Class constructor cannot be invoked without 'new'". Those fall through to
12
+ * `getIcon()`, which renders the fallback icon instead.
13
+ */
14
+ declare function isIconResolver(icon: unknown): icon is (...args: any[]) => unknown;
15
+ /**
16
+ * Resolves the icon passed to a component into SVG data.
17
+ * Accepts a registered string name or an icon node array.
8
18
  */
9
- declare function getIcon(icon?: any, fallback?: any): any;
19
+ declare function getIcon(icon?: any, fallback?: any): IconNode | null;
10
20
 
11
21
  /**
12
22
  * Shirkasoft UI Components.
@@ -49,4 +59,4 @@ declare class PortalDirective {
49
59
  static ɵdir: i0.ɵɵDirectiveDeclaration<PortalDirective, "[shkPortal]", never, {}, {}, never, never, true, never>;
50
60
  }
51
61
 
52
- export { ICONS, PortalDirective, getIcon, portalToBody };
62
+ export { ICONS, PortalDirective, getIcon, isIconResolver, portalToBody };
@@ -1,3 +1,4 @@
1
+ import * as shirkasoft_ui_components_icons from 'shirkasoft-ui-components/icons';
1
2
  import * as _angular_core from '@angular/core';
2
3
  import { TemplateRef } from '@angular/core';
3
4
 
@@ -5,7 +6,7 @@ import { TemplateRef } from '@angular/core';
5
6
  interface WizardStep {
6
7
  id: string | number;
7
8
  label: string;
8
- /** Optional lucide icon rendered inside the step circle. */
9
+ /** Optional icon (name or `IconNode` data) rendered inside the step circle. */
9
10
  icon?: string;
10
11
  /** Overrides the primary footer button label for this step. */
11
12
  primaryLabel?: string;
@@ -30,7 +31,7 @@ declare class ShkWizardStepContent {
30
31
  * content templates declared with `shkWizardStepContent`.
31
32
  */
32
33
  declare class WizardComponent {
33
- protected getIcon: (name: any) => any;
34
+ protected getIcon: (name: any) => shirkasoft_ui_components_icons.IconNode | null;
34
35
  /** Steps definition shown in the stepper and used to resolve step content. */
35
36
  steps: _angular_core.InputSignal<WizardStep[]>;
36
37
  /** Active step id. Two-way bindable with [(currentStep)]. Null resolves to the first step. */
@@ -42,7 +43,7 @@ declare class WizardComponent {
42
43
  /** Shows the round back button in the header. */
43
44
  showBackButton: _angular_core.InputSignal<boolean>;
44
45
  backTooltip: _angular_core.InputSignal<string>;
45
- /** Optional lucide icon shown before the title. */
46
+ /** Optional icon (name or `IconNode` data) shown before the title. */
46
47
  headerIcon: _angular_core.InputSignal<string>;
47
48
  /** Shows the progress stepper (hide it for edit mode, like wac-app does). */
48
49
  showStepper: _angular_core.InputSignal<boolean>;