katanakit-js 6.2.0 → 6.6.1

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 (116) hide show
  1. package/README.md +11 -3
  2. package/dist/adapters/better-auth/better-auth.service.d.ts +83 -0
  3. package/dist/adapters/better-auth/better-auth.service.d.ts.map +1 -0
  4. package/dist/adapters/better-auth/better-auth.service.js +110 -0
  5. package/dist/adapters/better-auth/better-auth.service.js.map +1 -0
  6. package/dist/adapters/better-auth/client.d.ts +51 -0
  7. package/dist/adapters/better-auth/client.d.ts.map +1 -0
  8. package/dist/adapters/better-auth/client.js +67 -0
  9. package/dist/adapters/better-auth/client.js.map +1 -0
  10. package/dist/adapters/better-auth/index.d.ts +3 -0
  11. package/dist/adapters/better-auth/index.d.ts.map +1 -0
  12. package/dist/adapters/better-auth/index.js +3 -0
  13. package/dist/adapters/better-auth/index.js.map +1 -0
  14. package/dist/adapters/express/server.d.ts +133 -1
  15. package/dist/adapters/express/server.d.ts.map +1 -1
  16. package/dist/adapters/express/server.js +199 -97
  17. package/dist/adapters/express/server.js.map +1 -1
  18. package/dist/adapters/index.d.ts +2 -0
  19. package/dist/adapters/index.d.ts.map +1 -1
  20. package/dist/adapters/index.js +2 -0
  21. package/dist/adapters/index.js.map +1 -1
  22. package/dist/adapters/insforge/insforge.service.d.ts +139 -4
  23. package/dist/adapters/insforge/insforge.service.d.ts.map +1 -1
  24. package/dist/adapters/insforge/insforge.service.js +383 -213
  25. package/dist/adapters/insforge/insforge.service.js.map +1 -1
  26. package/dist/adapters/notion/notion.service.d.ts +130 -144
  27. package/dist/adapters/notion/notion.service.d.ts.map +1 -1
  28. package/dist/adapters/notion/notion.service.js +330 -341
  29. package/dist/adapters/notion/notion.service.js.map +1 -1
  30. package/dist/adapters/photoswipe/index.d.ts +2 -0
  31. package/dist/adapters/photoswipe/index.d.ts.map +1 -0
  32. package/dist/adapters/photoswipe/index.js +2 -0
  33. package/dist/adapters/photoswipe/index.js.map +1 -0
  34. package/dist/adapters/photoswipe/photoswipe.service.d.ts +99 -0
  35. package/dist/adapters/photoswipe/photoswipe.service.d.ts.map +1 -0
  36. package/dist/adapters/photoswipe/photoswipe.service.js +150 -0
  37. package/dist/adapters/photoswipe/photoswipe.service.js.map +1 -0
  38. package/dist/adapters/telegram/telegram.service.d.ts +82 -13
  39. package/dist/adapters/telegram/telegram.service.d.ts.map +1 -1
  40. package/dist/adapters/telegram/telegram.service.js +133 -55
  41. package/dist/adapters/telegram/telegram.service.js.map +1 -1
  42. package/dist/adapters/wordpress/wordpress.service.d.ts +181 -110
  43. package/dist/adapters/wordpress/wordpress.service.d.ts.map +1 -1
  44. package/dist/adapters/wordpress/wordpress.service.js +556 -465
  45. package/dist/adapters/wordpress/wordpress.service.js.map +1 -1
  46. package/dist/config/seo.service.d.ts +1 -1
  47. package/dist/config/seo.service.d.ts.map +1 -1
  48. package/dist/config/seo.service.js +1 -1
  49. package/dist/config/seo.service.js.map +1 -1
  50. package/dist/core/services/access.service.d.ts +167 -4
  51. package/dist/core/services/access.service.d.ts.map +1 -1
  52. package/dist/core/services/access.service.js +241 -31
  53. package/dist/core/services/access.service.js.map +1 -1
  54. package/dist/core/services/agent.service.d.ts +182 -27
  55. package/dist/core/services/agent.service.d.ts.map +1 -1
  56. package/dist/core/services/agent.service.js +296 -164
  57. package/dist/core/services/agent.service.js.map +1 -1
  58. package/dist/core/services/assistant.service.d.ts +96 -5
  59. package/dist/core/services/assistant.service.d.ts.map +1 -1
  60. package/dist/core/services/assistant.service.js +171 -66
  61. package/dist/core/services/assistant.service.js.map +1 -1
  62. package/dist/core/services/dates.service.d.ts +183 -11
  63. package/dist/core/services/dates.service.d.ts.map +1 -1
  64. package/dist/core/services/dates.service.js +256 -57
  65. package/dist/core/services/dates.service.js.map +1 -1
  66. package/dist/core/services/http.service.d.ts +172 -133
  67. package/dist/core/services/http.service.d.ts.map +1 -1
  68. package/dist/core/services/http.service.js +367 -310
  69. package/dist/core/services/http.service.js.map +1 -1
  70. package/dist/core/services/logger.service.d.ts +96 -34
  71. package/dist/core/services/logger.service.d.ts.map +1 -1
  72. package/dist/core/services/logger.service.js +128 -41
  73. package/dist/core/services/logger.service.js.map +1 -1
  74. package/dist/core/services/query.service.d.ts +101 -0
  75. package/dist/core/services/query.service.d.ts.map +1 -1
  76. package/dist/core/services/query.service.js +131 -14
  77. package/dist/core/services/query.service.js.map +1 -1
  78. package/dist/core/services/utils.service.d.ts +286 -131
  79. package/dist/core/services/utils.service.d.ts.map +1 -1
  80. package/dist/core/services/utils.service.js +417 -227
  81. package/dist/core/services/utils.service.js.map +1 -1
  82. package/dist/core/services/validation.service.d.ts +48 -3
  83. package/dist/core/services/validation.service.d.ts.map +1 -1
  84. package/dist/core/services/validation.service.js +75 -23
  85. package/dist/core/services/validation.service.js.map +1 -1
  86. package/dist/infrastructure/decorators/cache.decorator.d.ts +53 -0
  87. package/dist/infrastructure/decorators/cache.decorator.d.ts.map +1 -0
  88. package/dist/infrastructure/decorators/cache.decorator.js +47 -0
  89. package/dist/infrastructure/decorators/cache.decorator.js.map +1 -0
  90. package/dist/infrastructure/decorators/index.d.ts +4 -0
  91. package/dist/infrastructure/decorators/index.d.ts.map +1 -0
  92. package/dist/infrastructure/decorators/index.js +4 -0
  93. package/dist/infrastructure/decorators/index.js.map +1 -0
  94. package/dist/infrastructure/decorators/logger.decorator.d.ts +38 -0
  95. package/dist/infrastructure/decorators/logger.decorator.d.ts.map +1 -0
  96. package/dist/infrastructure/decorators/logger.decorator.js +66 -0
  97. package/dist/infrastructure/decorators/logger.decorator.js.map +1 -0
  98. package/dist/infrastructure/decorators/retry.decorator.d.ts +37 -0
  99. package/dist/infrastructure/decorators/retry.decorator.d.ts.map +1 -0
  100. package/dist/infrastructure/decorators/retry.decorator.js +54 -0
  101. package/dist/infrastructure/decorators/retry.decorator.js.map +1 -0
  102. package/dist/infrastructure/index.d.ts +1 -0
  103. package/dist/infrastructure/index.d.ts.map +1 -1
  104. package/dist/infrastructure/index.js +1 -0
  105. package/dist/infrastructure/index.js.map +1 -1
  106. package/dist/styles.css +2 -0
  107. package/package.json +49 -14
  108. package/scss/_flags.scss +179 -0
  109. package/scss/_functions.scss +168 -0
  110. package/scss/_mixins.scss +658 -0
  111. package/scss/_reset.scss +275 -0
  112. package/scss/_utilities.scss +449 -0
  113. package/scss/_variables.scss +539 -0
  114. package/scss/components/_index.scss +50 -0
  115. package/scss/demo.scss +12 -0
  116. package/scss/main.scss +56 -0
@@ -0,0 +1,658 @@
1
+ // ============================================================
2
+ // _mixins.scss
3
+ // Layout, breakpoint, grid and flexbox mixins, generic utility
4
+ // class generators and the @apply registry.
5
+ // Loading this module also registers the built-in @apply
6
+ // utilities (top-level register-utility() calls at the bottom).
7
+ // ============================================================
8
+ @use "sass:meta";
9
+ @use "sass:math";
10
+ @use "sass:map";
11
+ @use "sass:list";
12
+ @use "sass:string";
13
+ @use "variables" as v;
14
+ @use "functions" as f;
15
+
16
+ // ============================================================
17
+ // BREAKPOINTS
18
+ // Media-query helpers. The breakpoint map mirrors the one in
19
+ // _variables.scss and can be overridden with !default before import.
20
+ // ============================================================
21
+
22
+ // Min-width values for the breakpoint mixins.
23
+ $breakpoints: (
24
+ "xs": 0, "sm": 640px, "md": 768px, "lg": 1024px,
25
+ "xl": 1280px, "2xl": 1536px, "3xl": 1920px
26
+ ) !default;
27
+
28
+ // Private: resolves a breakpoint argument. Numbers pass through
29
+ // (unitless ones gain px); strings must be keys of $breakpoints.
30
+ @function _breakpoint-value($key) {
31
+ @if meta.type-of($key) == "number" {
32
+ @return if(sass(math.is-unitless($key)): $key * 1px; else: $key);
33
+ }
34
+ @if not map.has-key($breakpoints, $key) {
35
+ @error "Breakpoint '#{$key}' no encontrado. Disponibles: #{map.keys($breakpoints)}.";
36
+ }
37
+ @return map.get($breakpoints, $key);
38
+ }
39
+
40
+ // Private: builds the media-query string for a direction.
41
+ // up → min-width
42
+ // down → max-width (0.02px below the breakpoint to avoid overlap)
43
+ // only → min + max (exclusive upper bound)
44
+ // between → min + max (inclusive upper bound)
45
+ @function _media-query($direction, $from, $to: null) {
46
+ @if $direction == "up" { @return "(min-width: #{$from})"; }
47
+ @if $direction == "down" { $max: calc(#{$from} - 0.02px); @return "(max-width: #{$max})"; }
48
+ @if $direction == "only" {
49
+ @if $to == null { @error "only requiere un breakpoint 'to'."; }
50
+ $max: calc(#{$to} - 0.02px);
51
+ @return "(min-width: #{$from}) and (max-width: #{$max})";
52
+ }
53
+ @if $direction == "between" {
54
+ @if $to == null { @error "between requiere un breakpoint 'to'."; }
55
+ @return "(min-width: #{$from}) and (max-width: #{$to})";
56
+ }
57
+ @error "Dirección '#{$direction}' no válida. Use: up, down, only, between.";
58
+ }
59
+
60
+ // Wraps @content in a media query. Direction defaults to "up".
61
+ // Examples:
62
+ // @include m.breakpoint("md") { … } // ≥ 768px
63
+ // @include m.breakpoint("md", "down") { … } // ≤ 767.98px
64
+ // @include m.breakpoint("md", "only", "lg") { … } // 768–1023.98px
65
+ @mixin breakpoint($from, $direction: up, $to: null) {
66
+ $from-val: _breakpoint-value($from);
67
+ $to-val: if(sass($to != null): _breakpoint-value($to); else: null);
68
+ @media #{_media-query($direction, $from-val, $to-val)} { @content; }
69
+ }
70
+
71
+ // Argument-forwarding alias: @include bp("md", "only", "lg") { … }.
72
+ @mixin bp($args...) { @include breakpoint($args...) { @content; } }
73
+
74
+ // Shorthand mixins for min-width queries, one per breakpoint.
75
+ @mixin xs { @include breakpoint("xs", up) { @content; } }
76
+ @mixin sm { @include breakpoint("sm", up) { @content; } }
77
+ @mixin md { @include breakpoint("md", up) { @content; } }
78
+ @mixin lg { @include breakpoint("lg", up) { @content; } }
79
+ @mixin xl { @include breakpoint("xl", up) { @content; } }
80
+ @mixin xxl { @include breakpoint("2xl", up) { @content; } }
81
+ @mixin xxxl { @include breakpoint("3xl", up) { @content; } }
82
+
83
+ // Shorthand mixins for max-width queries (mobile-first "below" queries).
84
+ @mixin xs-down { @include breakpoint("xs", down) { @content; } }
85
+ @mixin sm-down { @include breakpoint("sm", down) { @content; } }
86
+ @mixin md-down { @include breakpoint("md", down) { @content; } }
87
+ @mixin lg-down { @include breakpoint("lg", down) { @content; } }
88
+ @mixin xl-down { @include breakpoint("xl", down) { @content; } }
89
+ @mixin x2l-down { @include breakpoint("2xl", down) { @content; } }
90
+ @mixin x3l-down { @include breakpoint("3xl", down) { @content; } }
91
+ // Aliases with friendlier names for the 2xl/3xl down queries.
92
+ @mixin xxl-down { @include x2l-down { @content; } }
93
+ @mixin xxxl-down { @include x3l-down { @content; } }
94
+
95
+ // Media-feature queries: orientation, motion and pointer preferences
96
+ // plus OS color scheme.
97
+ @mixin portrait { @media (orientation: portrait) { @content; } }
98
+ @mixin landscape { @media (orientation: landscape) { @content; } }
99
+ @mixin reduced-motion { @media (prefers-reduced-motion: reduce) { @content; } }
100
+ @mixin hoverable { @media (hover: hover) and (pointer: fine) { @content; } }
101
+ @mixin touch { @media (hover: none) and (pointer: coarse) { @content; } }
102
+ @mixin dark-mode { @media (prefers-color-scheme: dark) { @content; } }
103
+ @mixin light-mode { @media (prefers-color-scheme: light) { @content; } }
104
+
105
+ // ============================================================
106
+ // GRID
107
+ // CSS Grid helpers: containers, responsive/auto grids, spans,
108
+ // placements, areas, subgrid, masonry and stacking.
109
+ // ============================================================
110
+
111
+ // Defaults used by the grid mixins (gap = 10px → 1rem, 12 columns).
112
+ // Override with !default semantics before import.
113
+ $grid-gap-default: f.rem(10px) !default;
114
+ $grid-columns-default: 12 !default;
115
+
116
+ // Private: unitless numbers are treated as rem (4 → 4rem); anything
117
+ // with a unit passes through untouched.
118
+ @function _to-rem($value) {
119
+ @if meta.type-of($value) == "number" and math.is-unitless($value) { @return $value * 1rem; }
120
+ @return $value;
121
+ }
122
+
123
+ // Private: validates and rounds a grid-stack() column/row index
124
+ // (must be a unitless number ≥ 1).
125
+ @function _stack-index($value, $name) {
126
+ @if meta.type-of($value) != "number" { @error "grid-stack(): #{$name} debe ser un número, recibió #{meta.inspect($value)}."; }
127
+ @if not math.is-unitless($value) { @error "grid-stack(): #{$name} debe ser sin unidad, recibió #{$value}."; }
128
+ @if $value < 1 { @error "grid-stack(): #{$name} debe ser >= 1, recibió #{$value}."; }
129
+ @return math.round($value);
130
+ }
131
+
132
+ // Private: strips a leading dot from a parent selector string.
133
+ @function _stack-parent($parent) {
134
+ @if meta.type-of($parent) == "string" and string.index($parent, ".") == 1 { @return string.slice($parent, 2); }
135
+ @return $parent;
136
+ }
137
+
138
+ // Private: shared start of every grid mixin — display: grid plus an
139
+ // optional gap (unitless → rem). Passes @content through.
140
+ @mixin _grid-base($gap: null) {
141
+ display: grid;
142
+ @if $gap != null { gap: _to-rem($gap); }
143
+ @content;
144
+ }
145
+
146
+ // Responsive auto-grid: as many columns as fit, each at least
147
+ // $min-size wide (unitless → rem) and at most $max-size.
148
+ // $mode: "fill" (auto-fill, keeps empty tracks) or "fit" (auto-fit,
149
+ // collapses empty tracks).
150
+ @mixin grid-responsive($min-size, $mode: fill, $max-size: 1fr, $gap: null) {
151
+ $keyword: null;
152
+ @if $mode == fill { $keyword: "auto-fill"; }
153
+ @else if $mode == fit { $keyword: "auto-fit"; }
154
+ @if $keyword == null { @error "grid-responsive(): invalid mode '#{$mode}'. Use 'fill' or 'fit'."; }
155
+ @include _grid-base($gap) {
156
+ grid-template-columns: repeat(#{$keyword}, minmax(_to-rem($min-size), #{$max-size}));
157
+ @content;
158
+ }
159
+ }
160
+
161
+ // Convenience wrappers for the two grid-responsive modes.
162
+ @mixin grid-autofill($min-size, $max-size: 1fr, $gap: null) { @include grid-responsive($min-size, fill, $max-size, $gap) { @content; } }
163
+ @mixin grid-autofit($min-size, $max-size: 1fr, $gap: null) { @include grid-responsive($min-size, fit, $max-size, $gap) { @content; } }
164
+
165
+ // Fixed-column grid container. Defaults: 12 equal columns, centered
166
+ // items. When $place-items/$place-content are null it falls back to
167
+ // the individual $align-items/$justify-content values.
168
+ @mixin grid-container(
169
+ $cols: $grid-columns-default, $rows: null, $gap: $grid-gap-default,
170
+ $place-items: center, $place-content: center, $align-items: null, $justify-content: null
171
+ ) {
172
+ @include _grid-base($gap) {
173
+ grid-template-columns: repeat($cols, 1fr);
174
+ grid-template-rows: $rows;
175
+ @if $place-items != null and $place-content != null {
176
+ place-items: $place-items; place-content: $place-content;
177
+ } @else { align-items: $align-items; justify-content: $justify-content; }
178
+ @content;
179
+ }
180
+ }
181
+
182
+ // Grid that centers its items both ways.
183
+ @mixin grid-center($gap: null) { @include _grid-base($gap) { place-items: center; place-content: center; @content; } }
184
+ // Sets gap and also exposes it as a custom property ($var-name) so it
185
+ // can be overridden or read from plain CSS.
186
+ @mixin grid-gap($value: $grid-gap-default, $var-name: --grid-gap) { #{$var-name}: #{_to-rem($value)}; gap: var(#{$var-name}); }
187
+
188
+ // Makes an item span $cols columns and optionally $rows rows.
189
+ @mixin grid-span($cols: 1, $rows: null) {
190
+ grid-column: span $cols;
191
+ @if $rows != null { grid-row: span $rows; }
192
+ }
193
+
194
+ // Explicit grid placement using line numbers (1-based; -1 = last line).
195
+ // Rows are only emitted when row positions are provided.
196
+ @mixin grid-placement($col-start: 1, $col-end: -1, $row-start: null, $row-end: null) {
197
+ grid-column: #{$col-start} / #{$col-end};
198
+ @if $row-start != null and $row-end != null { grid-row: #{$row-start} / #{$row-end}; }
199
+ @else if $row-start != null { grid-row: $row-start; }
200
+ @content;
201
+ }
202
+
203
+ // Named grid areas: pass the ASCII-area string directly.
204
+ @mixin grid-areas($areas, $gap: null) { @include _grid-base($gap) { grid-template-areas: $areas; @content; } }
205
+ // Assigns an item to a named area.
206
+ @mixin grid-area($name) { grid-area: $name; @content; }
207
+ // Centers a single grid item inside its cell.
208
+ @mixin grid-item-center { place-self: center center; }
209
+
210
+ // Spans the full width of the grid by default (columns 1 to -1),
211
+ // optionally with a row range.
212
+ @mixin grid-item-full($col: "1 / -1", $row: null) {
213
+ grid-column: #{$col};
214
+ @if $row != null { grid-row: $row; }
215
+ @content;
216
+ }
217
+
218
+ // Responsive column count driven by a map, e.g.
219
+ // ("default": 1, "md": 2, "lg": 4) → 1 column, 2 from md, 4 from lg.
220
+ // Without a "default" key the first entry is used as the base.
221
+ @mixin grid-breakpoint-columns($columns-map, $gap: $grid-gap-default, $align-items: stretch) {
222
+ @include _grid-base($gap) {
223
+ align-items: $align-items;
224
+ $default: map.get($columns-map, "default");
225
+ @if $default { grid-template-columns: repeat($default, 1fr); }
226
+ @else { $first: list.nth(map.keys($columns-map), 1); grid-template-columns: repeat(map.get($columns-map, $first), 1fr); }
227
+ @each $bp, $cols in $columns-map {
228
+ @if $bp != "default" { @include breakpoint($bp) { grid-template-columns: repeat($cols, 1fr); } }
229
+ }
230
+ @content;
231
+ }
232
+ }
233
+
234
+ // Makes an item a subgrid of its parent on the given axis
235
+ // ("column", "row" or "both", the default).
236
+ @mixin subgrid($axis: both) {
237
+ display: grid;
238
+ @if $axis == column or $axis == both { grid-template-columns: subgrid; }
239
+ @if $axis == row or $axis == both { grid-template-rows: subgrid; }
240
+ }
241
+
242
+ // Experimental CSS masonry layout (grid-template-rows: masonry).
243
+ // $axis: "block" (rows flow like masonry) or "inline" (columns).
244
+ @mixin grid-masonry($axis: block, $gap: null) {
245
+ @include _grid-base($gap) {
246
+ grid-template-rows: masonry;
247
+ @if $axis == inline { grid-template-columns: masonry; grid-template-rows: none; }
248
+ @content;
249
+ }
250
+ }
251
+
252
+ // Auto-fill grid where every column is exactly $col-width wide.
253
+ @mixin grid-fixed-columns($col-width, $gap: null) {
254
+ @include _grid-base($gap) { grid-template-columns: repeat(auto-fill, _to-rem($col-width)); @content; }
255
+ }
256
+
257
+ // Stacks children on top of each other in the same grid cell
258
+ // ($col/$row — both must be unitless numbers ≥ 1).
259
+ // With $parent (class name, optional leading dot) it emits the parent
260
+ // rule plus one placement rule per $children selector; without
261
+ // $parent it styles the current element (&) and its children.
262
+ // $dp is the display value for the stack container (default "grid").
263
+ @mixin grid-stack($dp: grid, $parent: null, $children: ("*"), $col: 1, $row: 1) {
264
+ @if $parent != null and meta.type-of($parent) != "string" and meta.type-of($parent) != "number" {
265
+ @error "grid-stack(): $parent debe ser un string o null, recibió #{meta.inspect($parent)}.";
266
+ }
267
+ $col: _stack-index($col, "$col"); $row: _stack-index($row, "$row"); $parent: _stack-parent($parent);
268
+ @if $parent != null { .#{$parent} { display: #{$dp}; @content; } }
269
+ @else { display: #{$dp}; @content; }
270
+ @if $children != null and list.length($children) > 0 {
271
+ @each $child in $children {
272
+ @if meta.type-of($child) != "string" and meta.type-of($child) != "number" {
273
+ @error "grid-stack(): cada child debe ser un string, recibió #{meta.inspect($child)}.";
274
+ }
275
+ @if $parent != null { .#{$parent} > #{$child} { @include grid-placement($col, $col + 1, $row, $row + 1); } }
276
+ @else { & > #{$child} { @include grid-placement($col, $col + 1, $row, $row + 1); } }
277
+ }
278
+ }
279
+ }
280
+
281
+ // Places the current item into a specific stack cell (1-based).
282
+ @mixin grid-stack-item($col: 1, $row: 1) {
283
+ $col: _stack-index($col, "$col"); $row: _stack-index($row, "$row");
284
+ @include grid-placement($col, $col + 1, $row, $row + 1);
285
+ }
286
+
287
+ // ============================================================
288
+ // FLEXBOX
289
+ // Flex container and flex item helpers.
290
+ // ============================================================
291
+
292
+ // Private: shared start of every flex mixin — display: flex plus an
293
+ // optional gap (unitless → rem).
294
+ @mixin _flex-base($gap: null) {
295
+ display: flex;
296
+ @if $gap != null { gap: _to-rem($gap); }
297
+ @content;
298
+ }
299
+
300
+ // Full-featured flex container. $place-items/$place-content win over
301
+ // the individual $align-items/$justify-content/$align-content when set.
302
+ @mixin flex-container(
303
+ $direction: row, $wrap: nowrap, $gap: null, $align-items: stretch,
304
+ $justify-content: flex-start, $align-content: normal, $place-items: null, $place-content: null
305
+ ) {
306
+ @include _flex-base($gap) {
307
+ flex-direction: $direction; flex-wrap: $wrap;
308
+ @if $place-items != null { place-items: $place-items; } @else { align-items: $align-items; }
309
+ @if $place-content != null { place-content: $place-content; } @else { justify-content: $justify-content; align-content: $align-content; }
310
+ @content;
311
+ }
312
+ }
313
+
314
+ // Flex that centers its items both ways.
315
+ @mixin flex-center($gap: null) { @include _flex-base($gap) { place-items: center; place-content: center; @content; } }
316
+ // Sets gap and exposes it as the custom property $var-name.
317
+ @mixin flex-gap($value: 1rem, $var-name: --flex-gap) { #{$var-name}: #{_to-rem($value)}; gap: var(#{$var-name}); }
318
+ // Individual flex-item properties.
319
+ @mixin flex-grow($grow: 1) { flex-grow: $grow; }
320
+ @mixin flex-shrink($shrink: 1) { flex-shrink: $shrink; }
321
+ @mixin flex-basis($basis: auto) { flex-basis: $basis; }
322
+ // Shorthand for the flex property (grow, shrink, basis).
323
+ @mixin flex-item($grow: 1, $shrink: 1, $basis: auto) { flex: $grow $shrink $basis; }
324
+ // Centers the item on the cross axis.
325
+ @mixin flex-item-center { align-self: center; }
326
+ // Item that fills its row (grow 1, basis 100%).
327
+ @mixin flex-item-full { @include flex-item(1, 1, 100%); @content; }
328
+
329
+ // ============================================================
330
+ // GENERIC UTIL HELPERS
331
+ // Building blocks used to emit utility classes and custom
332
+ // properties from Sass lists and maps.
333
+ // ============================================================
334
+
335
+ // Emits a custom property per list item: --prefix-item: item
336
+ // (or --item: item when no prefix is given).
337
+ @mixin vars-list($list, $prefix: null) {
338
+ @each $value in $list {
339
+ @if $prefix != null { --#{$prefix}-#{$value}: #{$value}; } @else { --#{$value}: #{$value}; }
340
+ }
341
+ }
342
+
343
+ // Same as vars-list() but for maps: --prefix-key: value.
344
+ @mixin vars-map($map, $prefix: null) {
345
+ @each $key, $value in $map {
346
+ @if $prefix != null { --#{$prefix}-#{$key}: #{$value}; } @else { --#{$key}: #{$value}; }
347
+ }
348
+ }
349
+
350
+ // Centers an element with position + translate(-50%, -50%).
351
+ // $pos can be "absolute" (default) or "fixed".
352
+ @mixin absolute-center($pos: absolute, $y: 50%, $x: 50%) {
353
+ position: #{$pos}; top: #{$y}; left: #{$x}; transform: translate(-50%, -50%); @content;
354
+ }
355
+
356
+ // Horizontal / vertical auto-margin centering.
357
+ @mixin center-mx($xvalue: auto) { margin-inline: #{$xvalue}; @content; }
358
+ @mixin center-my($yvalue: auto) { margin-block: #{$yvalue}; @content; }
359
+
360
+ // Emits one utility class per entry. Lists: class = value
361
+ // (.prefix-value { prop: value }). Maps: class = key
362
+ // (.prefix-key { prop: value }). No prefix → bare class names.
363
+ @mixin utils-classes($input, $property, $prefix: null) {
364
+ @if meta.type-of($input) == "list" {
365
+ @each $value in $input {
366
+ @if $prefix != null { .#{$prefix}-#{$value} { #{$property}: #{$value}; } }
367
+ @else { .#{$value} { #{$property}: #{$value}; } }
368
+ }
369
+ } @else if meta.type-of($input) == "map" {
370
+ @each $key, $value in $input {
371
+ @if $prefix != null { .#{$prefix}-#{$key} { #{$property}: #{$value}; } }
372
+ @else { .#{$key} { #{$property}: #{$value}; } }
373
+ }
374
+ } @else { @error "utils-classes(): se esperaba lista o mapa, recibió #{meta.type-of($input)}."; }
375
+ }
376
+
377
+ // Hover variant of utils-classes(): emits .prefix-key:hover rules
378
+ // (or .hover-key:hover when no prefix is given).
379
+ @mixin utils-classes-hover($input, $property, $prefix: null) {
380
+ @if meta.type-of($input) == "list" {
381
+ @each $value in $input {
382
+ @if $prefix != null { .#{$prefix}-#{$value}:hover { #{$property}: #{$value}; } }
383
+ @else { .hover-#{$value}:hover { #{$property}: #{$value}; } }
384
+ }
385
+ } @else if meta.type-of($input) == "map" {
386
+ @each $key, $value in $input {
387
+ @if $prefix != null { .#{$prefix}-#{$key}:hover { #{$property}: #{$value}; } }
388
+ @else { .hover-#{$key}:hover { #{$property}: #{$value}; } }
389
+ }
390
+ }
391
+ }
392
+
393
+ // ============================================================
394
+ // @APPLY REGISTRY
395
+ // A lightweight @apply implementation: utilities are registered
396
+ // at load time and applied inside components via apply().
397
+ // ============================================================
398
+
399
+ // Global map holding every registered utility: name → (prop: value).
400
+ $_utility-registry: ();
401
+
402
+ // Registers a utility name with its declaration map so apply() can
403
+ // use it later. Call once per utility (typically at module top level).
404
+ @mixin register-utility($name, $styles) {
405
+ $_utility-registry: map.merge($_utility-registry, ($name: $styles)) !global;
406
+ }
407
+
408
+ // Emits the declarations of the given registered utilities inside the
409
+ // current rule. Errors at compile time for unknown names.
410
+ // Example: @include m.apply(flex, items-center, gap-4);
411
+ @mixin apply($utilities...) {
412
+ @each $util in $utilities {
413
+ $util-str: "#{$util}";
414
+ @if not map.has-key($_utility-registry, $util-str) {
415
+ @error "apply(): utilidad '#{$util}' no registrada. Usa register-utility() primero.";
416
+ }
417
+ $styles: map.get($_utility-registry, $util-str);
418
+ @each $prop, $value in $styles { #{$prop}: #{$value}; }
419
+ }
420
+ }
421
+
422
+ // === Built-in registrations (executed when the module loads) ===
423
+
424
+ // --- Display ---
425
+ @include register-utility("block", (display: block));
426
+ @include register-utility("inline-block", (display: inline-block));
427
+ @include register-utility("inline", (display: inline));
428
+ @include register-utility("flex", (display: flex));
429
+ @include register-utility("inline-flex", (display: inline-flex));
430
+ @include register-utility("grid", (display: grid));
431
+ @include register-utility("hidden", (display: none));
432
+
433
+ // --- Flexbox ---
434
+ @include register-utility("flex-row", (flex-direction: row));
435
+ @include register-utility("flex-col", (flex-direction: column));
436
+ @include register-utility("flex-wrap", (flex-wrap: wrap));
437
+ @include register-utility("flex-nowrap", (flex-wrap: nowrap));
438
+ @include register-utility("flex-1", (flex: 1 1 0%));
439
+ @include register-utility("flex-auto", (flex: 1 1 auto));
440
+ @include register-utility("flex-none", (flex: none));
441
+ @include register-utility("items-center", (align-items: center));
442
+ @include register-utility("items-start", (align-items: flex-start));
443
+ @include register-utility("items-end", (align-items: flex-end));
444
+ @include register-utility("justify-center", (justify-content: center));
445
+ @include register-utility("justify-between", (justify-content: space-between));
446
+ @include register-utility("justify-around", (justify-content: space-around));
447
+ @include register-utility("justify-evenly", (justify-content: space-evenly));
448
+
449
+ // --- Grid ---
450
+ @include register-utility("grid-cols-1", (grid-template-columns: repeat(1, 1fr)));
451
+ @include register-utility("grid-cols-2", (grid-template-columns: repeat(2, 1fr)));
452
+ @include register-utility("grid-cols-3", (grid-template-columns: repeat(3, 1fr)));
453
+ @include register-utility("grid-cols-4", (grid-template-columns: repeat(4, 1fr)));
454
+ @include register-utility("grid-cols-6", (grid-template-columns: repeat(6, 1fr)));
455
+ @include register-utility("grid-cols-12", (grid-template-columns: repeat(12, 1fr)));
456
+ @include register-utility("col-span-full", (grid-column: list.slash(1, -1)));
457
+
458
+ // --- Spacing (from v.$spacing-map — same source of truth as the
459
+ // classes emitted by _utilities.scss) ---
460
+ @each $key, $value in v.$spacing-map {
461
+ @include register-utility("p-#{$key}", (padding: $value));
462
+ @include register-utility("px-#{$key}", (padding-left: $value, padding-right: $value));
463
+ @include register-utility("py-#{$key}", (padding-top: $value, padding-bottom: $value));
464
+ @include register-utility("pt-#{$key}", (padding-top: $value));
465
+ @include register-utility("pb-#{$key}", (padding-bottom: $value));
466
+ @include register-utility("pl-#{$key}", (padding-left: $value));
467
+ @include register-utility("pr-#{$key}", (padding-right: $value));
468
+ @include register-utility("m-#{$key}", (margin: $value));
469
+ @include register-utility("mx-#{$key}", (margin-left: $value, margin-right: $value));
470
+ @include register-utility("my-#{$key}", (margin-top: $value, margin-bottom: $value));
471
+ @include register-utility("mt-#{$key}", (margin-top: $value));
472
+ @include register-utility("mb-#{$key}", (margin-bottom: $value));
473
+ @include register-utility("ml-#{$key}", (margin-left: $value));
474
+ @include register-utility("mr-#{$key}", (margin-right: $value));
475
+ @include register-utility("gap-#{$key}", (gap: $value));
476
+ @include register-utility("gap-x-#{$key}", (column-gap: $value));
477
+ @include register-utility("gap-y-#{$key}", (row-gap: $value));
478
+ }
479
+
480
+ // --- Typography ---
481
+ @include register-utility("text-xs", (font-size: 0.75rem));
482
+ @include register-utility("text-sm", (font-size: 0.875rem));
483
+ @include register-utility("text-base", (font-size: 1rem));
484
+ @include register-utility("text-lg", (font-size: 1.125rem));
485
+ @include register-utility("text-xl", (font-size: 1.25rem));
486
+ @include register-utility("text-2xl", (font-size: 1.5rem));
487
+ @include register-utility("text-3xl", (font-size: 1.875rem));
488
+ @include register-utility("text-4xl", (font-size: 2.25rem));
489
+ @include register-utility("font-thin", (font-weight: 100));
490
+ @include register-utility("font-light", (font-weight: 300));
491
+ @include register-utility("font-normal", (font-weight: 400));
492
+ @include register-utility("font-medium", (font-weight: 500));
493
+ @include register-utility("font-semibold", (font-weight: 600));
494
+ @include register-utility("font-bold", (font-weight: 700));
495
+ @include register-utility("font-extrabold", (font-weight: 800));
496
+ @include register-utility("font-black", (font-weight: 900));
497
+ @include register-utility("text-left", (text-align: left));
498
+ @include register-utility("text-center", (text-align: center));
499
+ @include register-utility("text-right", (text-align: right));
500
+
501
+ // --- Sizing ---
502
+ @include register-utility("w-full", (width: 100%));
503
+ @include register-utility("w-screen", (width: 100vw));
504
+ @include register-utility("w-auto", (width: auto));
505
+ @include register-utility("h-full", (height: 100%));
506
+ @include register-utility("h-screen", (height: 100vh));
507
+ @include register-utility("h-auto", (height: auto));
508
+
509
+ // --- Borders ---
510
+ @include register-utility("rounded", (border-radius: 0.25rem));
511
+ @include register-utility("rounded-md", (border-radius: 0.375rem));
512
+ @include register-utility("rounded-lg", (border-radius: 0.5rem));
513
+ @include register-utility("rounded-xl", (border-radius: 0.75rem));
514
+ @include register-utility("rounded-full", (border-radius: 9999px));
515
+ @include register-utility("border", (border-width: 1px, border-style: solid));
516
+ @include register-utility("border-0", (border-width: 0));
517
+ @include register-utility("border-2", (border-width: 2px, border-style: solid));
518
+ @include register-utility("border-4", (border-width: 4px, border-style: solid));
519
+ @include register-utility("border-8", (border-width: 8px, border-style: solid));
520
+
521
+ // --- Effects ---
522
+ @include register-utility("shadow-sm", (box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05)));
523
+ @include register-utility("shadow", (box-shadow: (0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1))));
524
+ @include register-utility("shadow-md", (box-shadow: (0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1))));
525
+ @include register-utility("shadow-lg", (box-shadow: (0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1))));
526
+ @include register-utility("shadow-xl", (box-shadow: (0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1))));
527
+ @include register-utility("opacity-0", (opacity: 0));
528
+ @include register-utility("opacity-25", (opacity: 0.25));
529
+ @include register-utility("opacity-50", (opacity: 0.5));
530
+ @include register-utility("opacity-75", (opacity: 0.75));
531
+ @include register-utility("opacity-100", (opacity: 1));
532
+
533
+ // --- Position ---
534
+ @include register-utility("static", (position: static));
535
+ @include register-utility("fixed", (position: fixed));
536
+ @include register-utility("absolute", (position: absolute));
537
+ @include register-utility("relative", (position: relative));
538
+ @include register-utility("sticky", (position: sticky));
539
+
540
+ // --- Overflow ---
541
+ @include register-utility("overflow-auto", (overflow: auto));
542
+ @include register-utility("overflow-hidden", (overflow: hidden));
543
+ @include register-utility("overflow-visible", (overflow: visible));
544
+ @include register-utility("overflow-scroll", (overflow: scroll));
545
+
546
+ // --- Colors ---
547
+ @include register-utility("text-white", (color: v.get-color("white")));
548
+ @include register-utility("text-black", (color: v.get-color("black")));
549
+ @include register-utility("bg-white", (background-color: v.get-color("white")));
550
+ @include register-utility("bg-black", (background-color: v.get-color("black")));
551
+ @include register-utility("bg-transparent", (background-color: v.get-color("transparent")));
552
+
553
+ // --- Transitions ---
554
+ @include register-utility("transition", (transition: all 150ms ease));
555
+ @include register-utility("transition-colors", (transition: (color 150ms ease, background-color 150ms ease, border-color 150ms ease)));
556
+ @include register-utility("transition-opacity", (transition: opacity 150ms ease));
557
+ @include register-utility("transition-transform", (transition: transform 150ms ease));
558
+
559
+ // --- Map-derived registrations (same maps as _utilities.scss) ---
560
+
561
+ // Local copies of the design-token maps so the registry stays
562
+ // independent from the variables module. Every map is !default, so
563
+ // it can be overridden before importing this module.
564
+ // Box-shadow scale used for .shadow-*.
565
+ $shadow-map: (
566
+ "none": none, "sm": 0 1px 2px 0 rgb(0 0 0 / 0.05),
567
+ "md": (0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)),
568
+ "lg": (0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)),
569
+ "xl": (0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)),
570
+ "2xl": 0 25px 50px -12px rgb(0 0 0 / 0.25), "inner": inset 0 2px 4px 0 rgb(0 0 0 / 0.05)
571
+ ) !default;
572
+
573
+ // Border-radius scale used for .rounded-*.
574
+ $radius-map: (
575
+ "none": 0, "sm": 0.125rem, "md": 0.375rem, "lg": 0.5rem,
576
+ "xl": 0.75rem, "2xl": 1rem, "3xl": 1.5rem, "full": 9999px
577
+ ) !default;
578
+
579
+ // Z-index scale used for .z-*.
580
+ $z-layers-map: (
581
+ "auto": auto, "0": 0, "10": 10, "20": 20, "30": 30, "40": 40, "50": 50,
582
+ "dropdown": 1000, "sticky": 1020, "fixed": 1030, "modal": 1040, "popover": 1050, "tooltip": 1060
583
+ ) !default;
584
+
585
+ // Transition durations used for .duration-*.
586
+ $transition-duration-map: (
587
+ "75": 75ms, "100": 100ms, "150": 150ms, "200": 200ms,
588
+ "300": 300ms, "500": 500ms, "700": 700ms, "1000": 1000ms
589
+ ) !default;
590
+
591
+ // Timing functions used for .ease-*.
592
+ $transition-timing-map: (
593
+ "linear": linear, "in": cubic-bezier(0.4, 0, 1, 1),
594
+ "out": cubic-bezier(0, 0, 0.2, 1), "in-out": cubic-bezier(0.4, 0, 0.2, 1)
595
+ ) !default;
596
+
597
+ // Opacity steps used for .opacity-*.
598
+ $opacity-values: (
599
+ "0": 0, "5": 0.05, "10": 0.1, "20": 0.2, "25": 0.25, "30": 0.3,
600
+ "40": 0.4, "50": 0.5, "60": 0.6, "70": 0.7, "75": 0.75,
601
+ "80": 0.8, "90": 0.9, "95": 0.95, "100": 1
602
+ ) !default;
603
+
604
+ // Font weights used for .font-*.
605
+ $font-weight-values: (
606
+ "thin": 100, "extralight": 200, "light": 300, "normal": 400,
607
+ "medium": 500, "semibold": 600, "bold": 700, "extrabold": 800, "black": 900
608
+ ) !default;
609
+
610
+ // Text alignments used for .text-*.
611
+ $text-align-values: (left, center, right, justify) !default;
612
+
613
+ // Display values used for display utilities (bare class names).
614
+ $display-values: (
615
+ block: block, inline-block: inline-block, inline: inline, flex: flex,
616
+ inline-flex: inline-flex, grid: grid, inline-grid: inline-grid,
617
+ table: table, table-row: table-row, table-cell: table-cell,
618
+ hidden: none, contents: contents
619
+ ) !default;
620
+
621
+ // Position and overflow scales for .static/.fixed/… and .overflow-*.
622
+ $position-values: (static, fixed, absolute, relative, sticky) !default;
623
+ $overflow-values: (auto, hidden, scroll, visible) !default;
624
+
625
+ // Flex direction/wrap and alignment maps used by the flex utilities.
626
+ $flex-direction-map: ("row": row, "row-reverse": row-reverse, "col": column, "col-reverse": column-reverse) !default;
627
+ $flex-wrap-list: (wrap, nowrap) !default;
628
+ $align-items-map: ("start": flex-start, "center": center, "end": flex-end, "stretch": stretch) !default;
629
+ $justify-content-map: ("start": flex-start, "center": center, "end": flex-end, "between": space-between, "around": space-around, "evenly": space-evenly) !default;
630
+
631
+ // Whitespace-related scales.
632
+ $white-space-list: (nowrap, pre, normal) !default;
633
+ $overflow-wrap-list: (break-word,) !default;
634
+
635
+ // Effects: register every entry of the effect maps
636
+ // (.rounded-*, .shadow-*, .z-*, .duration-*, .ease-*, .opacity-*).
637
+ @each $key, $value in $radius-map { @include register-utility("rounded-#{$key}", (border-radius: $value)); }
638
+ @each $key, $value in $shadow-map { @include register-utility("shadow-#{$key}", (box-shadow: $value)); }
639
+ @each $key, $value in $z-layers-map { @include register-utility("z-#{$key}", (z-index: $value)); }
640
+ @each $key, $value in $transition-duration-map { @include register-utility("duration-#{$key}", (transition-duration: $value)); }
641
+ @each $key, $value in $transition-timing-map { @include register-utility("ease-#{$key}", (transition-timing-function: $value)); }
642
+ @each $key, $value in $opacity-values { @include register-utility("opacity-#{$key}", (opacity: $value)); }
643
+
644
+ // Layout: display, position, overflow, text-align, font-weight and
645
+ // whitespace utilities.
646
+ @each $key, $value in $display-values { @include register-utility($key, (display: $value)); }
647
+ @each $value in $position-values { @include register-utility($value, (position: $value)); }
648
+ @each $value in $overflow-values { @include register-utility("overflow-#{$value}", (overflow: $value)); }
649
+ @each $value in $text-align-values { @include register-utility("text-#{$value}", (text-align: $value)); }
650
+ @each $key, $value in $font-weight-values { @include register-utility("font-#{$key}", (font-weight: $value)); }
651
+ @each $value in $white-space-list { @include register-utility("whitespace-#{$value}", (white-space: $value)); }
652
+ @each $value in $overflow-wrap-list { @include register-utility("wrap-#{$value}", (overflow-wrap: $value)); }
653
+
654
+ // Flexbox: direction, wrap and alignment utilities.
655
+ @each $key, $value in $flex-direction-map { @include register-utility("flex-#{$key}", (flex-direction: $value)); }
656
+ @each $value in $flex-wrap-list { @include register-utility("flex-#{$value}", (flex-wrap: $value)); }
657
+ @each $key, $value in $align-items-map { @include register-utility("items-#{$key}", (align-items: $value)); }
658
+ @each $key, $value in $justify-content-map { @include register-utility("justify-#{$key}", (justify-content: $value)); }