shirkasoft-ui-components 1.13.18 → 2.0.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 (98) hide show
  1. package/README.md +415 -42
  2. package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs +189 -100
  3. package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs.map +1 -1
  4. package/fesm2022/shirkasoft-ui-components-button.mjs +367 -73
  5. package/fesm2022/shirkasoft-ui-components-button.mjs.map +1 -1
  6. package/fesm2022/shirkasoft-ui-components-chart.mjs +206 -142
  7. package/fesm2022/shirkasoft-ui-components-chart.mjs.map +1 -1
  8. package/fesm2022/shirkasoft-ui-components-config.mjs +976 -0
  9. package/fesm2022/shirkasoft-ui-components-config.mjs.map +1 -0
  10. package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs +307 -142
  11. package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs.map +1 -1
  12. package/fesm2022/shirkasoft-ui-components-date-picker.mjs +1624 -1400
  13. package/fesm2022/shirkasoft-ui-components-date-picker.mjs.map +1 -1
  14. package/fesm2022/shirkasoft-ui-components-fieldset.mjs +347 -92
  15. package/fesm2022/shirkasoft-ui-components-fieldset.mjs.map +1 -1
  16. package/fesm2022/shirkasoft-ui-components-file-upload.mjs +484 -293
  17. package/fesm2022/shirkasoft-ui-components-file-upload.mjs.map +1 -1
  18. package/fesm2022/shirkasoft-ui-components-icons.mjs +1141 -0
  19. package/fesm2022/shirkasoft-ui-components-icons.mjs.map +1 -0
  20. package/fesm2022/shirkasoft-ui-components-knob.mjs +395 -180
  21. package/fesm2022/shirkasoft-ui-components-knob.mjs.map +1 -1
  22. package/fesm2022/shirkasoft-ui-components-loading.mjs +505 -128
  23. package/fesm2022/shirkasoft-ui-components-loading.mjs.map +1 -1
  24. package/fesm2022/shirkasoft-ui-components-modal.mjs +311 -303
  25. package/fesm2022/shirkasoft-ui-components-modal.mjs.map +1 -1
  26. package/fesm2022/shirkasoft-ui-components-notification.mjs +188 -142
  27. package/fesm2022/shirkasoft-ui-components-notification.mjs.map +1 -1
  28. package/fesm2022/shirkasoft-ui-components-price-input.mjs +517 -277
  29. package/fesm2022/shirkasoft-ui-components-price-input.mjs.map +1 -1
  30. package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs +669 -289
  31. package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs.map +1 -1
  32. package/fesm2022/shirkasoft-ui-components-select.mjs +1014 -814
  33. package/fesm2022/shirkasoft-ui-components-select.mjs.map +1 -1
  34. package/fesm2022/shirkasoft-ui-components-sidebar.mjs +508 -184
  35. package/fesm2022/shirkasoft-ui-components-sidebar.mjs.map +1 -1
  36. package/fesm2022/shirkasoft-ui-components-skeleton.mjs +197 -57
  37. package/fesm2022/shirkasoft-ui-components-skeleton.mjs.map +1 -1
  38. package/fesm2022/shirkasoft-ui-components-table.mjs +1918 -1676
  39. package/fesm2022/shirkasoft-ui-components-table.mjs.map +1 -1
  40. package/fesm2022/shirkasoft-ui-components-tabs.mjs +419 -177
  41. package/fesm2022/shirkasoft-ui-components-tabs.mjs.map +1 -1
  42. package/fesm2022/shirkasoft-ui-components-tag.mjs +177 -51
  43. package/fesm2022/shirkasoft-ui-components-tag.mjs.map +1 -1
  44. package/fesm2022/shirkasoft-ui-components-text-field.mjs +687 -369
  45. package/fesm2022/shirkasoft-ui-components-text-field.mjs.map +1 -1
  46. package/fesm2022/shirkasoft-ui-components-theme-picker.mjs +466 -0
  47. package/fesm2022/shirkasoft-ui-components-theme-picker.mjs.map +1 -0
  48. package/fesm2022/shirkasoft-ui-components-theme.mjs +147 -0
  49. package/fesm2022/shirkasoft-ui-components-theme.mjs.map +1 -0
  50. package/fesm2022/shirkasoft-ui-components-timeline.mjs +791 -215
  51. package/fesm2022/shirkasoft-ui-components-timeline.mjs.map +1 -1
  52. package/fesm2022/shirkasoft-ui-components-toggle.mjs +205 -128
  53. package/fesm2022/shirkasoft-ui-components-toggle.mjs.map +1 -1
  54. package/fesm2022/shirkasoft-ui-components-tooltip.mjs +244 -180
  55. package/fesm2022/shirkasoft-ui-components-tooltip.mjs.map +1 -1
  56. package/fesm2022/shirkasoft-ui-components-utils.mjs +97 -125
  57. package/fesm2022/shirkasoft-ui-components-utils.mjs.map +1 -1
  58. package/fesm2022/shirkasoft-ui-components-wizard.mjs +673 -166
  59. package/fesm2022/shirkasoft-ui-components-wizard.mjs.map +1 -1
  60. package/fesm2022/shirkasoft-ui-components.mjs +0 -9
  61. package/package.json +37 -7
  62. package/src/baseline.css +2472 -0
  63. package/src/theme.css +15 -543
  64. package/src/themes/ocean.css +56 -0
  65. package/src/themes/sunset.css +55 -0
  66. package/src/themes/violet.css +25 -0
  67. package/src/tokens.css +612 -0
  68. package/types/shirkasoft-ui-components-breadcrumb.d.ts +59 -44
  69. package/types/shirkasoft-ui-components-button.d.ts +142 -49
  70. package/types/shirkasoft-ui-components-chart.d.ts +59 -44
  71. package/types/shirkasoft-ui-components-config.d.ts +357 -0
  72. package/types/shirkasoft-ui-components-confirm-dialog.d.ts +107 -65
  73. package/types/shirkasoft-ui-components-date-picker.d.ts +527 -373
  74. package/types/shirkasoft-ui-components-fieldset.d.ts +135 -59
  75. package/types/shirkasoft-ui-components-file-upload.d.ts +176 -106
  76. package/types/shirkasoft-ui-components-icons.d.ts +1430 -0
  77. package/types/shirkasoft-ui-components-knob.d.ts +151 -64
  78. package/types/shirkasoft-ui-components-loading.d.ts +155 -64
  79. package/types/shirkasoft-ui-components-modal.d.ts +134 -132
  80. package/types/shirkasoft-ui-components-notification.d.ts +63 -58
  81. package/types/shirkasoft-ui-components-price-input.d.ts +198 -85
  82. package/types/shirkasoft-ui-components-rail-sidebar.d.ts +262 -142
  83. package/types/shirkasoft-ui-components-select.d.ts +301 -192
  84. package/types/shirkasoft-ui-components-sidebar.d.ts +198 -92
  85. package/types/shirkasoft-ui-components-skeleton.d.ts +68 -27
  86. package/types/shirkasoft-ui-components-table.d.ts +849 -649
  87. package/types/shirkasoft-ui-components-tabs.d.ts +102 -61
  88. package/types/shirkasoft-ui-components-tag.d.ts +54 -23
  89. package/types/shirkasoft-ui-components-text-field.d.ts +231 -111
  90. package/types/shirkasoft-ui-components-theme-picker.d.ts +117 -0
  91. package/types/shirkasoft-ui-components-theme.d.ts +80 -0
  92. package/types/shirkasoft-ui-components-timeline.d.ts +326 -150
  93. package/types/shirkasoft-ui-components-toggle.d.ts +76 -45
  94. package/types/shirkasoft-ui-components-tooltip.d.ts +64 -43
  95. package/types/shirkasoft-ui-components-utils.d.ts +26 -17
  96. package/types/shirkasoft-ui-components-wizard.d.ts +236 -86
  97. package/types/shirkasoft-ui-components.d.ts +1 -2
  98. package/fesm2022/shirkasoft-ui-components.mjs.map +0 -1
@@ -1,132 +1,104 @@
1
- import { LucideX, LucideUpload, LucideTriangleAlert, LucideTrash2, LucideSearch, LucideRefreshCw, LucidePlus, LucidePanelRight, LucideMinimize2, LucideMenu, LucideMaximize2, LucideLogOut, LucideLoaderCircle, LucideLoader, LucideInfo, LucideInbox, LucideLanguages, LucideGlobe, LucideFunnel, LucideFileText, LucideFileSpreadsheet, LucideFile, LucideEyeOff, LucideEye, LucideEllipsisVertical, LucideDownload, LucideCirclePlus, LucideCircleQuestionMark, LucideChevronsRight, LucideChevronsLeft, LucideChevronRight, LucideChevronLeft, LucideChevronDown, LucideCalendarDays, LucideCheck, LucideArrowUpDown, LucideArrowUp, LucideArrowDown, LucideArrowLeft } from '@lucide/angular';
2
- import * as i0 from '@angular/core';
3
- import { inject, ElementRef, afterNextRender, DestroyRef, Directive } from '@angular/core';
4
-
5
- /**
6
- * Shirkasoft UI Components.
7
- * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
8
- * Belongs to Shirkasoft.
9
- */
10
- /** Maps the icon names used across the library to their Lucide component. */
1
+ import { ICON_BY_NAME, LucideArrowDown, LucideArrowLeft, LucideArrowUp, LucideArrowUpDown, LucideCalendarDays, LucideCheck, LucideChevronDown, LucideChevronLeft, LucideChevronRight, LucideChevronsLeft, LucideChevronsRight, LucideCirclePlus, LucideCircleQuestionMark, LucideDownload, LucideEllipsisVertical, LucideEye, LucideEyeOff, LucideFile, LucideFileSpreadsheet, LucideFileText, LucideFunnel, LucideGlobe, LucideInbox, LucideInfo, LucideLanguages, LucideLoader, LucideLoaderCircle, LucideLogOut, LucideMaximize2, LucideMenu, LucideMinimize2, LucidePanelRight, LucidePlus, LucideRefreshCw, LucideSearch, LucideTrash2, LucideTriangleAlert, LucideUpload, LucideX } from "shirkasoft-ui-components/icons";
2
+ import * as i0 from "@angular/core";
3
+ import { DestroyRef, Directive, ElementRef, afterNextRender, inject } from "@angular/core";
11
4
  const ICONS = {
12
- 'arrow-left': LucideArrowLeft,
13
- 'arrow-down': LucideArrowDown,
14
- 'arrow-up': LucideArrowUp,
15
- 'arrow-up-down': LucideArrowUpDown,
16
- check: LucideCheck,
17
- 'calendar-days': LucideCalendarDays,
18
- 'chevron-down': LucideChevronDown,
19
- 'chevron-left': LucideChevronLeft,
20
- 'chevron-right': LucideChevronRight,
21
- 'chevrons-left': LucideChevronsLeft,
22
- 'chevrons-right': LucideChevronsRight,
23
- 'circle-help': LucideCircleQuestionMark,
24
- 'circle-plus': LucideCirclePlus,
25
- download: LucideDownload,
26
- 'ellipsis-vertical': LucideEllipsisVertical,
27
- eye: LucideEye,
28
- 'eye-off': LucideEyeOff,
29
- file: LucideFile,
30
- 'file-spreadsheet': LucideFileSpreadsheet,
31
- 'file-text': LucideFileText,
32
- filter: LucideFunnel,
33
- globe: LucideGlobe,
34
- languages: LucideLanguages,
35
- inbox: LucideInbox,
36
- info: LucideInfo,
37
- loader: LucideLoader,
38
- 'loader-circle': LucideLoaderCircle,
39
- 'log-out': LucideLogOut,
40
- 'maximize-2': LucideMaximize2,
41
- menu: LucideMenu,
42
- 'minimize-2': LucideMinimize2,
43
- 'panel-right': LucidePanelRight,
44
- plus: LucidePlus,
45
- refresh: LucideRefreshCw,
46
- search: LucideSearch,
47
- 'trash-2': LucideTrash2,
48
- 'triangle-alert': LucideTriangleAlert,
49
- upload: LucideUpload,
50
- x: LucideX,
5
+ "arrow-left": LucideArrowLeft,
6
+ "arrow-down": LucideArrowDown,
7
+ "arrow-up": LucideArrowUp,
8
+ "arrow-up-down": LucideArrowUpDown,
9
+ check: LucideCheck,
10
+ "calendar-days": LucideCalendarDays,
11
+ "chevron-down": LucideChevronDown,
12
+ "chevron-left": LucideChevronLeft,
13
+ "chevron-right": LucideChevronRight,
14
+ "chevrons-left": LucideChevronsLeft,
15
+ "chevrons-right": LucideChevronsRight,
16
+ "circle-help": LucideCircleQuestionMark,
17
+ "circle-plus": LucideCirclePlus,
18
+ download: LucideDownload,
19
+ "ellipsis-vertical": LucideEllipsisVertical,
20
+ eye: LucideEye,
21
+ "eye-off": LucideEyeOff,
22
+ file: LucideFile,
23
+ "file-spreadsheet": LucideFileSpreadsheet,
24
+ "file-text": LucideFileText,
25
+ filter: LucideFunnel,
26
+ globe: LucideGlobe,
27
+ languages: LucideLanguages,
28
+ inbox: LucideInbox,
29
+ info: LucideInfo,
30
+ loader: LucideLoader,
31
+ "loader-circle": LucideLoaderCircle,
32
+ "log-out": LucideLogOut,
33
+ "maximize-2": LucideMaximize2,
34
+ menu: LucideMenu,
35
+ "minimize-2": LucideMinimize2,
36
+ "panel-right": LucidePanelRight,
37
+ plus: LucidePlus,
38
+ refresh: LucideRefreshCw,
39
+ search: LucideSearch,
40
+ "trash-2": LucideTrash2,
41
+ "triangle-alert": LucideTriangleAlert,
42
+ upload: LucideUpload,
43
+ x: LucideX
51
44
  };
52
- /**
53
- * Resolves the icon passed to a component into a lucide component.
54
- * Accepts a registered string name, an existing lucide component or a LucideIconData object.
55
- */
45
+ function isIconResolver(icon) {
46
+ return typeof icon === "function" && !/^class[\s{]/.test(Function.prototype.toString.call(icon));
47
+ }
56
48
  function getIcon(icon, fallback = LucideCircleQuestionMark) {
57
- if (!icon)
58
- return null;
59
- if (typeof icon === 'string') {
60
- return ICONS[icon] ?? fallback;
61
- }
62
- if (typeof icon === 'function') {
63
- return icon;
64
- }
65
- return fallback;
49
+ if (!icon) return null;
50
+ if (typeof icon === "string") return ICONS[icon] ?? ICON_BY_NAME[icon] ?? fallback;
51
+ if (Array.isArray(icon)) return icon;
52
+ return fallback;
66
53
  }
67
-
68
- /**
69
- * Shirkasoft UI Components.
70
- * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
71
- * Belongs to Shirkasoft.
72
- */
73
- /**
74
- * Moves a floating element (dropdown panel, popup, overlay) to `document.body`
75
- * so it always renders above the rest of the page.
76
- *
77
- * `position: fixed` + a high `z-index` is not enough on its own: an ancestor
78
- * with `transform`, `filter`, `backdrop-filter`, `contain`, or its own stacking
79
- * context (`z-index` + `position`, `sticky`, `opacity < 1`...) traps the element
80
- * inside it. Rendering it as a direct child of `body` avoids all of that.
81
- *
82
- * The element keeps being managed by Angular (bindings and listeners keep
83
- * working, and Angular removes it with `node.remove()` when it is hidden).
84
- * If the anchor lives inside a `.dark` container, the class is copied onto the
85
- * element so the dark theme (CSS variables, Tailwind `dark:` variants and
86
- * component `.dark .x` rules) still applies once it is outside the host.
87
- *
88
- * Returns a function that removes the element from the DOM; call it when the
89
- * owner component is destroyed so the element does not stay orphaned in `body`.
90
- */
91
54
  function portalToBody(element, anchor) {
92
- const doc = element.ownerDocument;
93
- if (element.parentNode !== doc.body) {
94
- doc.body.appendChild(element);
95
- }
96
- element.classList.toggle('dark', !!anchor?.closest('.dark'));
97
- return () => element.remove();
55
+ const doc = element.ownerDocument;
56
+ if (element.parentNode !== doc.body) doc.body.appendChild(element);
57
+ element.classList.toggle("dark", !!anchor?.closest(".dark"));
58
+ return () => element.remove();
98
59
  }
99
- /**
100
- * Renders the host element in `document.body` (see `portalToBody`) once it is
101
- * rendered, and removes it when the element or its owner is destroyed.
102
- *
103
- * ```html
104
- * @if (isOpen()) {
105
- * <div shkPortal class="fixed z-[9999]" [style.top.px]="top">...</div>
106
- * }
107
- * ```
108
- */
109
- class PortalDirective {
110
- constructor() {
111
- this.el = inject(ElementRef);
112
- let remove = null;
113
- afterNextRender(() => {
114
- const node = this.el.nativeElement;
115
- remove = portalToBody(node, node.parentElement);
116
- });
117
- inject(DestroyRef).onDestroy(() => remove?.());
118
- }
119
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: PortalDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
120
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.23", type: PortalDirective, isStandalone: true, selector: "[shkPortal]", ngImport: i0 }); }
121
- }
122
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: PortalDirective, decorators: [{
123
- type: Directive,
124
- args: [{ selector: '[shkPortal]', standalone: true }]
125
- }], ctorParameters: () => [] });
126
-
127
- /**
128
- * Generated bundle index. Do not edit.
129
- */
60
+ var PortalDirective = class PortalDirective {
61
+ constructor() {
62
+ this.el = inject(ElementRef);
63
+ let remove = null;
64
+ afterNextRender(() => {
65
+ const node = this.el.nativeElement;
66
+ remove = portalToBody(node, node.parentElement);
67
+ });
68
+ inject(DestroyRef).onDestroy(() => remove?.());
69
+ }
70
+ static {
71
+ this.ɵfac = i0.ɵɵngDeclareFactory({
72
+ minVersion: "12.0.0",
73
+ version: "22.3.2",
74
+ ngImport: i0,
75
+ type: PortalDirective,
76
+ deps: [],
77
+ target: i0.ɵɵFactoryTarget.Directive
78
+ });
79
+ }
80
+ static {
81
+ this.ɵdir = i0.ɵɵngDeclareDirective({
82
+ minVersion: "14.0.0",
83
+ version: "22.3.2",
84
+ type: PortalDirective,
85
+ isStandalone: true,
86
+ selector: "[shkPortal]",
87
+ ngImport: i0
88
+ });
89
+ }
90
+ };
91
+ i0.ɵɵngDeclareClassMetadata({
92
+ minVersion: "12.0.0",
93
+ version: "22.3.2",
94
+ ngImport: i0,
95
+ type: PortalDirective,
96
+ decorators: [{
97
+ type: Directive,
98
+ args: [{ selector: "[shkPortal]" }]
99
+ }],
100
+ ctorParameters: () => []
101
+ });
102
+ export { ICONS, PortalDirective, getIcon, isIconResolver, portalToBody };
130
103
 
131
- export { ICONS, PortalDirective, getIcon, portalToBody };
132
- //# sourceMappingURL=shirkasoft-ui-components-utils.mjs.map
104
+ //# sourceMappingURL=shirkasoft-ui-components-utils.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"shirkasoft-ui-components-utils.mjs","sources":["../../../projects/ui-components/utils/icons.ts","../../../projects/ui-components/utils/portal.ts","../../../projects/ui-components/utils/shirkasoft-ui-components-utils.ts"],"sourcesContent":["/**\n * Shirkasoft UI Components.\n * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).\n * Belongs to Shirkasoft.\n */\nimport {\n LucideArrowDown,\n LucideArrowLeft,\n LucideArrowUp,\n LucideArrowUpDown,\n LucideCalendarDays,\n LucideCheck,\n LucideChevronDown,\n LucideChevronLeft,\n LucideChevronRight,\n LucideChevronsLeft,\n LucideChevronsRight,\n LucideCircleQuestionMark,\n LucideCirclePlus,\n LucideDownload,\n LucideEllipsisVertical,\n LucideEye,\n LucideEyeOff,\n LucideFile,\n LucideFileSpreadsheet,\n LucideFileText,\n LucideFunnel,\n LucideGlobe,\n LucideLanguages,\n LucideInbox,\n LucideInfo,\n LucideLoader,\n LucideLoaderCircle,\n LucideLogOut,\n LucideMaximize2,\n LucideMenu,\n LucideMinimize2,\n LucidePanelRight,\n LucidePlus,\n LucideRefreshCw,\n LucideSearch,\n LucideTrash2,\n LucideTriangleAlert,\n LucideUpload,\n LucideX,\n} from '@lucide/angular';\n\n/** Maps the icon names used across the library to their Lucide component. */\nexport const ICONS: Record<string, any> = {\n 'arrow-left': LucideArrowLeft,\n 'arrow-down': LucideArrowDown,\n 'arrow-up': LucideArrowUp,\n 'arrow-up-down': LucideArrowUpDown,\n check: LucideCheck,\n 'calendar-days': LucideCalendarDays,\n 'chevron-down': LucideChevronDown,\n 'chevron-left': LucideChevronLeft,\n 'chevron-right': LucideChevronRight,\n 'chevrons-left': LucideChevronsLeft,\n 'chevrons-right': LucideChevronsRight,\n 'circle-help': LucideCircleQuestionMark,\n 'circle-plus': LucideCirclePlus,\n download: LucideDownload,\n 'ellipsis-vertical': LucideEllipsisVertical,\n eye: LucideEye,\n 'eye-off': LucideEyeOff,\n file: LucideFile,\n 'file-spreadsheet': LucideFileSpreadsheet,\n 'file-text': LucideFileText,\n filter: LucideFunnel,\n globe: LucideGlobe,\n languages: LucideLanguages,\n inbox: LucideInbox,\n info: LucideInfo,\n loader: LucideLoader,\n 'loader-circle': LucideLoaderCircle,\n 'log-out': LucideLogOut,\n 'maximize-2': LucideMaximize2,\n menu: LucideMenu,\n 'minimize-2': LucideMinimize2,\n 'panel-right': LucidePanelRight,\n plus: LucidePlus,\n refresh: LucideRefreshCw,\n search: LucideSearch,\n 'trash-2': LucideTrash2,\n 'triangle-alert': LucideTriangleAlert,\n upload: LucideUpload,\n x: LucideX,\n};\n\n/**\n * Resolves the icon passed to a component into a lucide component.\n * Accepts a registered string name, an existing lucide component or a LucideIconData object.\n */\nexport function getIcon(icon?: any, fallback: any = LucideCircleQuestionMark): any {\n if (!icon) return null;\n if (typeof icon === 'string') {\n return ICONS[icon] ?? fallback;\n }\n if (typeof icon === 'function') {\n return icon;\n }\n return fallback;\n}","import { Directive, DestroyRef, ElementRef, afterNextRender, inject } from '@angular/core';\n\n/**\n * Shirkasoft UI Components.\n * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).\n * Belongs to Shirkasoft.\n */\n\n/**\n * Moves a floating element (dropdown panel, popup, overlay) to `document.body`\n * so it always renders above the rest of the page.\n *\n * `position: fixed` + a high `z-index` is not enough on its own: an ancestor\n * with `transform`, `filter`, `backdrop-filter`, `contain`, or its own stacking\n * context (`z-index` + `position`, `sticky`, `opacity < 1`...) traps the element\n * inside it. Rendering it as a direct child of `body` avoids all of that.\n *\n * The element keeps being managed by Angular (bindings and listeners keep\n * working, and Angular removes it with `node.remove()` when it is hidden).\n * If the anchor lives inside a `.dark` container, the class is copied onto the\n * element so the dark theme (CSS variables, Tailwind `dark:` variants and\n * component `.dark .x` rules) still applies once it is outside the host.\n *\n * Returns a function that removes the element from the DOM; call it when the\n * owner component is destroyed so the element does not stay orphaned in `body`.\n */\nexport function portalToBody(element: HTMLElement, anchor?: HTMLElement | null): () => void {\n const doc = element.ownerDocument;\n if (element.parentNode !== doc.body) {\n doc.body.appendChild(element);\n }\n element.classList.toggle('dark', !!anchor?.closest('.dark'));\n return () => element.remove();\n}\n\n/**\n * Renders the host element in `document.body` (see `portalToBody`) once it is\n * rendered, and removes it when the element or its owner is destroyed.\n *\n * ```html\n * @if (isOpen()) {\n * <div shkPortal class=\"fixed z-[9999]\" [style.top.px]=\"top\">...</div>\n * }\n * ```\n */\n@Directive({ selector: '[shkPortal]', standalone: true })\nexport class PortalDirective {\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n\n constructor() {\n let remove: (() => void) | null = null;\n afterNextRender(() => {\n const node = this.el.nativeElement;\n remove = portalToBody(node, node.parentElement);\n });\n inject(DestroyRef).onDestroy(() => remove?.());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;;;;AAIG;AA2CH;AACO,MAAM,KAAK,GAAwB;AACxC,IAAA,YAAY,EAAE,eAAe;AAC7B,IAAA,YAAY,EAAE,eAAe;AAC7B,IAAA,UAAU,EAAE,aAAa;AACzB,IAAA,eAAe,EAAE,iBAAiB;AAClC,IAAA,KAAK,EAAE,WAAW;AAClB,IAAA,eAAe,EAAE,kBAAkB;AACnC,IAAA,cAAc,EAAE,iBAAiB;AACjC,IAAA,cAAc,EAAE,iBAAiB;AACjC,IAAA,eAAe,EAAE,kBAAkB;AACnC,IAAA,eAAe,EAAE,kBAAkB;AACnC,IAAA,gBAAgB,EAAE,mBAAmB;AACr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irkasoft-ui-components-utils.mjs","names":[],"sources":["../../../projects/ui-components/utils/icons.ts","../../../projects/ui-components/utils/portal.ts"],"sourcesContent":["/**\n * Shirkasoft UI Components.\n * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).\n * Belongs to Shirkasoft.\n */\nimport {\n LucideArrowDown,\n LucideArrowLeft,\n LucideArrowUp,\n LucideArrowUpDown,\n LucideCalendarDays,\n LucideCheck,\n LucideChevronDown,\n LucideChevronLeft,\n LucideChevronRight,\n LucideChevronsLeft,\n LucideChevronsRight,\n LucideCircleQuestionMark,\n LucideCirclePlus,\n LucideDownload,\n LucideEllipsisVertical,\n LucideEye,\n LucideEyeOff,\n LucideFile,\n LucideFileSpreadsheet,\n LucideFileText,\n LucideFunnel,\n LucideGlobe,\n LucideLanguages,\n LucideInbox,\n LucideInfo,\n LucideLoader,\n LucideLoaderCircle,\n LucideLogOut,\n LucideMaximize2,\n LucideMenu,\n LucideMinimize2,\n LucidePanelRight,\n LucidePlus,\n LucideRefreshCw,\n LucideSearch,\n LucideTrash2,\n LucideTriangleAlert,\n LucideUpload,\n LucideX,\n} from 'shirkasoft-ui-components/icons';\nimport { ICON_BY_NAME } from 'shirkasoft-ui-components/icons';\nimport type { IconNode } from 'shirkasoft-ui-components/icons';\n\n/** Maps the icon names used across the library to their SVG data. */\nexport const ICONS: Record<string, IconNode> = {\n 'arrow-left': LucideArrowLeft,\n 'arrow-down': LucideArrowDown,\n 'arrow-up': LucideArrowUp,\n 'arrow-up-down': LucideArrowUpDown,\n check: LucideCheck,\n 'calendar-days': LucideCalendarDays,\n 'chevron-down': LucideChevronDown,\n 'chevron-left': LucideChevronLeft,\n 'chevron-right': LucideChevronRight,\n 'chevrons-left': LucideChevronsLeft,\n 'chevrons-right': LucideChevronsRight,\n 'circle-help': LucideCircleQuestionMark,\n 'circle-plus': LucideCirclePlus,\n download: LucideDownload,\n 'ellipsis-vertical': LucideEllipsisVertical,\n eye: LucideEye,\n 'eye-off': LucideEyeOff,\n file: LucideFile,\n 'file-spreadsheet': LucideFileSpreadsheet,\n 'file-text': LucideFileText,\n filter: LucideFunnel,\n globe: LucideGlobe,\n languages: LucideLanguages,\n inbox: LucideInbox,\n info: LucideInfo,\n loader: LucideLoader,\n 'loader-circle': LucideLoaderCircle,\n 'log-out': LucideLogOut,\n 'maximize-2': LucideMaximize2,\n menu: LucideMenu,\n 'minimize-2': LucideMinimize2,\n 'panel-right': LucidePanelRight,\n plus: LucidePlus,\n refresh: LucideRefreshCw,\n search: LucideSearch,\n 'trash-2': LucideTrash2,\n 'triangle-alert': LucideTriangleAlert,\n upload: LucideUpload,\n x: LucideX,\n};\n\n/**\n * True when `icon` is a per-item resolver function such as `(row) => 'pencil'`.\n *\n * Classes are functions too, but must never be called: a v1 `@lucide/angular`\n * component passed by an app that has not migrated yet would throw\n * \"Class constructor cannot be invoked without 'new'\". Those fall through to\n * `getIcon()`, which renders the fallback icon instead.\n */\nexport function isIconResolver(icon: unknown): icon is (...args: any[]) => unknown {\n return typeof icon === 'function' && !/^class[\\s{]/.test(Function.prototype.toString.call(icon));\n}\n\n/**\n * Resolves the icon passed to a component into SVG data.\n * Accepts a registered string name or an icon node array.\n */\nexport function getIcon(icon?: any, fallback: any = LucideCircleQuestionMark): IconNode | null {\n if (!icon) return null;\n if (typeof icon === 'string') {\n return ICONS[icon] ?? ICON_BY_NAME[icon] ?? fallback;\n }\n if (Array.isArray(icon)) {\n return icon;\n }\n return fallback;\n}","import { Directive, DestroyRef, ElementRef, afterNextRender, inject } from '@angular/core';\n\n/**\n * Shirkasoft UI Components.\n * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).\n * Belongs to Shirkasoft.\n */\n\n/**\n * Moves a floating element (dropdown panel, popup, overlay) to `document.body`\n * so it always renders above the rest of the page.\n *\n * `position: fixed` + a high `z-index` is not enough on its own: an ancestor\n * with `transform`, `filter`, `backdrop-filter`, `contain`, or its own stacking\n * context (`z-index` + `position`, `sticky`, `opacity < 1`...) traps the element\n * inside it. Rendering it as a direct child of `body` avoids all of that.\n *\n * The element keeps being managed by Angular (bindings and listeners keep\n * working, and Angular removes it with `node.remove()` when it is hidden).\n * If the anchor lives inside a `.dark` container, the class is copied onto the\n * element so the dark theme (CSS variables, Tailwind `dark:` variants and\n * component `.dark .x` rules) still applies once it is outside the host.\n *\n * Returns a function that removes the element from the DOM; call it when the\n * owner component is destroyed so the element does not stay orphaned in `body`.\n */\nexport function portalToBody(element: HTMLElement, anchor?: HTMLElement | null): () => void {\n const doc = element.ownerDocument;\n if (element.parentNode !== doc.body) {\n doc.body.appendChild(element);\n }\n element.classList.toggle('dark', !!anchor?.closest('.dark'));\n return () => element.remove();\n}\n\n/**\n * Renders the host element in `document.body` (see `portalToBody`) once it is\n * rendered, and removes it when the element or its owner is destroyed.\n *\n * ```html\n * @if (isOpen()) {\n * <div shkPortal class=\"fixed z-[9999]\" [style.top.px]=\"top\">...</div>\n * }\n * ```\n */\n@Directive({ selector: '[shkPortal]' })\nexport class PortalDirective {\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n\n constructor() {\n let remove: (() => void) | null = null;\n afterNextRender(() => {\n const node = this.el.nativeElement;\n remove = portalToBody(node, node.parentElement);\n });\n inject(DestroyRef).onDestroy(() => remove?.());\n }\n}\n"],"mappings":";;;AAkDA,MAAa,QAAkC;CAC7C,cAAc;CACd,cAAc;CACd,YAAY;CACZ,iBAAiB;CACjB,OAAO;CACP,iBAAiB;CACjB,gBAAgB;CAChB,gBAAgB;CAChB,iBAAiB;CACjB,iBAAiB;CACjB,kBAAkB;CAClB,eAAe;CACf,eAAe;CACf,UAAU;CACV,qBAAqB;CACrB,KAAK;CACL,WAAW;CACX,MAAM;CACN,oBAAoB;CACpB,aAAa;CACb,QAAQ;CACR,OAAO;CACP,WAAW;CACX,OAAO;CACP,MAAM;CACN,QAAQ;CACR,iBAAiB;CACjB,WAAW;CACX,cAAc;CACd,MAAM;CACN,cAAc;CACd,eAAe;CACf,MAA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