@jcsoftdev/ui 0.1.4 → 0.1.6

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 (67) hide show
  1. package/README.md +85 -2
  2. package/dist/atoms/button/button.d.ts +8 -4
  3. package/dist/atoms/button/button.js +16 -6
  4. package/dist/atoms/checkbox/checkbox.js +4 -1
  5. package/dist/atoms/chip/chip.d.ts +7 -3
  6. package/dist/atoms/chip/chip.js +22 -4
  7. package/dist/atoms/internal/status-icons.d.ts +4 -0
  8. package/dist/atoms/internal/status-icons.js +15 -0
  9. package/dist/atoms/radio-group/radio-group.js +1 -1
  10. package/dist/atoms/switch/switch.js +4 -1
  11. package/dist/charts/gauge-chart/gauge-chart.d.ts +1 -1
  12. package/dist/charts/gauge-chart/gauge-chart.js +6 -5
  13. package/dist/containers/banner/banner.d.ts +5 -3
  14. package/dist/containers/banner/banner.js +11 -5
  15. package/dist/containers/confirm-action/confirm-action.d.ts +17 -0
  16. package/dist/containers/confirm-action/confirm-action.js +71 -0
  17. package/dist/containers/confirm-action/index.d.ts +2 -0
  18. package/dist/containers/confirm-action/index.js +1 -0
  19. package/dist/containers/confirm-action/model.d.ts +14 -0
  20. package/dist/containers/confirm-action/model.js +12 -0
  21. package/dist/containers/index.d.ts +2 -0
  22. package/dist/containers/index.js +2 -0
  23. package/dist/containers/responsive-list/index.d.ts +1 -0
  24. package/dist/containers/responsive-list/index.js +1 -0
  25. package/dist/containers/responsive-list/responsive-list.d.ts +24 -0
  26. package/dist/containers/responsive-list/responsive-list.js +69 -0
  27. package/dist/forms/field/field.d.ts +5 -2
  28. package/dist/forms/field/field.js +11 -2
  29. package/dist/i18n/index.d.ts +2 -0
  30. package/dist/i18n/index.js +2 -0
  31. package/dist/i18n/strings.d.ts +42 -0
  32. package/dist/i18n/strings.js +31 -0
  33. package/dist/i18n/ui-strings-provider.d.ts +11 -0
  34. package/dist/i18n/ui-strings-provider.js +20 -0
  35. package/dist/overlays/dialog/dialog.js +5 -3
  36. package/dist/overlays/drawer/drawer.js +5 -3
  37. package/dist/states/error-state/error-state.d.ts +8 -3
  38. package/dist/states/error-state/error-state.js +19 -5
  39. package/dist/states/skeleton/skeleton.js +5 -2
  40. package/package.json +1 -1
  41. package/scripts/build-theme.mjs +11 -5
  42. package/src/atoms/button/button.tsx +27 -5
  43. package/src/atoms/checkbox/checkbox.tsx +4 -1
  44. package/src/atoms/chip/chip.tsx +28 -3
  45. package/src/atoms/internal/status-icons.tsx +17 -0
  46. package/src/atoms/radio-group/radio-group.tsx +1 -1
  47. package/src/atoms/switch/switch.tsx +4 -1
  48. package/src/charts/gauge-chart/gauge-chart.tsx +10 -6
  49. package/src/containers/banner/banner.tsx +18 -10
  50. package/src/containers/confirm-action/confirm-action.tsx +92 -0
  51. package/src/containers/confirm-action/index.ts +2 -0
  52. package/src/containers/confirm-action/model.ts +17 -0
  53. package/src/containers/index.ts +2 -0
  54. package/src/containers/responsive-list/index.ts +1 -0
  55. package/src/containers/responsive-list/responsive-list.tsx +127 -0
  56. package/src/forms/field/field.tsx +11 -3
  57. package/src/i18n/index.ts +2 -0
  58. package/src/i18n/strings.ts +44 -0
  59. package/src/i18n/ui-strings-provider.tsx +27 -0
  60. package/src/overlays/dialog/dialog.tsx +5 -3
  61. package/src/overlays/drawer/drawer.tsx +5 -3
  62. package/src/states/error-state/error-state.tsx +30 -7
  63. package/src/states/skeleton/skeleton.tsx +6 -2
  64. package/styles/Theme.kt +7 -0
  65. package/styles/theme.css +4 -0
  66. package/styles/tokens.css +24 -0
  67. package/tokens/default.json +34 -0
@@ -1,3 +1,6 @@
1
+ "use client";
2
+
3
+ import { useUiStrings } from "../../i18n/index.js";
1
4
  import { cn } from "../../utils/cn.js";
2
5
 
3
6
  export type SkeletonVariant = "lines" | "table" | "card";
@@ -19,14 +22,15 @@ export function Skeleton({
19
22
  variant = "lines",
20
23
  lines = 3,
21
24
  rows = 4,
22
- label = "Loading",
25
+ label,
23
26
  className,
24
27
  }: SkeletonProps) {
28
+ const strings = useUiStrings();
25
29
  return (
26
30
  <div
27
31
  role="status"
28
32
  aria-busy="true"
29
- aria-label={label}
33
+ aria-label={label ?? strings.loading}
30
34
  className={cn("animate-pulse", className)}
31
35
  >
32
36
  {variant === "lines" ? (
package/styles/Theme.kt CHANGED
@@ -36,6 +36,8 @@ class ThemeColors(
36
36
  val dangerSoft: Color,
37
37
  val warning: Color,
38
38
  val warningSoft: Color,
39
+ val info: Color,
40
+ val infoSoft: Color,
39
41
  val success: Color,
40
42
  val successSoft: Color,
41
43
  val hatch: Color,
@@ -85,6 +87,8 @@ object UiColors {
85
87
  dangerSoft = Color(0xFFFFEBE8),
86
88
  warning = Color(0xFF865900),
87
89
  warningSoft = Color(0xFFFEEFCF),
90
+ info = Color(0xFF0B5CAD),
91
+ infoSoft = Color(0xFFE8F2FC),
88
92
  success = Color(0xFF0B7643),
89
93
  successSoft = Color(0xFFDFF8E6),
90
94
  hatch = Color(0xFFE6E6EC),
@@ -132,6 +136,8 @@ object UiColors {
132
136
  dangerSoft = Color(0xFF300F0B),
133
137
  warning = Color(0xFFEBC166),
134
138
  warningSoft = Color(0xFF241900),
139
+ info = Color(0xFF8FC3F7),
140
+ infoSoft = Color(0xFF0A1A2B),
135
141
  success = Color(0xFF80DBA2),
136
142
  successSoft = Color(0xFF062111),
137
143
  hatch = Color(0xFF1B1B1F),
@@ -211,6 +217,7 @@ object UiSizes {
211
217
  val topHeight = 58.dp
212
218
  val controlHeight = 36.dp
213
219
  val controlHeightSm = 30.dp
220
+ val controlHeightLg = 52.dp
214
221
  val inputHeight = 38.dp
215
222
  val agendaHour = 48.dp
216
223
  val agendaCol = 148.dp
package/styles/theme.css CHANGED
@@ -68,6 +68,8 @@
68
68
  --color-danger-soft: var(--danger-soft);
69
69
  --color-warning: var(--warning);
70
70
  --color-warning-soft: var(--warning-soft);
71
+ --color-info: var(--info);
72
+ --color-info-soft: var(--info-soft);
71
73
  --color-success: var(--success);
72
74
  --color-success-soft: var(--success-soft);
73
75
  --color-hatch: var(--hatch);
@@ -106,6 +108,7 @@
106
108
  --spacing-top-height: var(--top-height);
107
109
  --spacing-control-height: var(--control-height);
108
110
  --spacing-control-height-sm: var(--control-height-sm);
111
+ --spacing-control-height-lg: var(--control-height-lg);
109
112
  --spacing-input-height: var(--input-height);
110
113
  --spacing-agenda-hour: var(--agenda-hour);
111
114
  --spacing-agenda-col: var(--agenda-col);
@@ -205,6 +208,7 @@
205
208
  --ease-style: var(--motion-ease);
206
209
  --spacing-control: var(--control-height);
207
210
  --spacing-control-sm: var(--control-height-sm);
211
+ --spacing-control-lg: var(--control-height-lg);
208
212
  --spacing-input: var(--input-height);
209
213
  --spacing-control-x: var(--pad-control-x);
210
214
  --spacing-card: var(--pad-card);
package/styles/tokens.css CHANGED
@@ -69,6 +69,8 @@
69
69
  --danger-soft: #ffebe8;
70
70
  --warning: #865900;
71
71
  --warning-soft: #feefcf;
72
+ --info: #0b5cad;
73
+ --info-soft: #e8f2fc;
72
74
  --success: #0b7643;
73
75
  --success-soft: #dff8e6;
74
76
  --hatch: #e6e6ec;
@@ -117,6 +119,7 @@
117
119
  --top-height: 58px;
118
120
  --control-height: 36px;
119
121
  --control-height-sm: 30px;
122
+ --control-height-lg: 52px;
120
123
  --input-height: 38px;
121
124
  --agenda-hour: 48px;
122
125
  --agenda-col: 148px;
@@ -240,6 +243,8 @@
240
243
  --danger-soft: #300f0b;
241
244
  --warning: #ebc166;
242
245
  --warning-soft: #241900;
246
+ --info: #8fc3f7;
247
+ --info-soft: #0a1a2b;
243
248
  --success: #80dba2;
244
249
  --success-soft: #062111;
245
250
  --hatch: #1b1b1f;
@@ -340,6 +345,8 @@
340
345
  --danger-soft: #300f0b;
341
346
  --warning: #ebc166;
342
347
  --warning-soft: #241900;
348
+ --info: #8fc3f7;
349
+ --info-soft: #0a1a2b;
343
350
  --success: #80dba2;
344
351
  --success-soft: #062111;
345
352
  --hatch: #1b1b1f;
@@ -913,6 +920,7 @@
913
920
  [data-density="compact"] {
914
921
  --control-height: calc(36px * var(--density));
915
922
  --control-height-sm: calc(30px * var(--density));
923
+ --control-height-lg: calc(52px * var(--density));
916
924
  --input-height: calc(38px * var(--density));
917
925
  --density: 0.875;
918
926
  --pad-control-x: calc(16px * var(--density));
@@ -926,6 +934,7 @@
926
934
  [data-density="normal"] {
927
935
  --control-height: calc(36px * var(--density));
928
936
  --control-height-sm: calc(30px * var(--density));
937
+ --control-height-lg: calc(52px * var(--density));
929
938
  --input-height: calc(38px * var(--density));
930
939
  --density: 1;
931
940
  --pad-control-x: calc(16px * var(--density));
@@ -939,6 +948,7 @@
939
948
  [data-density="comfortable"] {
940
949
  --control-height: calc(36px * var(--density));
941
950
  --control-height-sm: calc(30px * var(--density));
951
+ --control-height-lg: calc(52px * var(--density));
942
952
  --input-height: calc(38px * var(--density));
943
953
  --density: 1.125;
944
954
  --pad-control-x: calc(16px * var(--density));
@@ -948,6 +958,20 @@
948
958
  --gap-density-lg: calc(18px * var(--density));
949
959
  }
950
960
 
961
+ :root[data-density="touch"],
962
+ [data-density="touch"] {
963
+ --control-height: 44px;
964
+ --control-height-sm: 44px;
965
+ --control-height-lg: 52px;
966
+ --input-height: 48px;
967
+ --density: 1.125;
968
+ --pad-control-x: calc(16px * var(--density));
969
+ --pad-card: calc(16px * var(--density));
970
+ --gap-density-sm: calc(8px * var(--density));
971
+ --gap-density: calc(12px * var(--density));
972
+ --gap-density-lg: calc(18px * var(--density));
973
+ }
974
+
951
975
  :root[data-radius="none"],
952
976
  [data-radius="none"] {
953
977
  --radius-xs-override: 0px;
@@ -557,6 +557,22 @@
557
557
  },
558
558
  "usage": "Fondo de la cita cuyo cliente ya llegó y del chip de aviso."
559
559
  },
560
+ {
561
+ "name": "info",
562
+ "value": {
563
+ "light": "#0b5cad",
564
+ "dark": "#8fc3f7"
565
+ },
566
+ "usage": "Aviso informativo que no pide acción: texto e icono sobre info-soft."
567
+ },
568
+ {
569
+ "name": "info-soft",
570
+ "value": {
571
+ "light": "#e8f2fc",
572
+ "dark": "#0a1a2b"
573
+ },
574
+ "usage": "Fondo del aviso informativo y del chip informativo."
575
+ },
560
576
  {
561
577
  "name": "success",
562
578
  "value": {
@@ -1089,6 +1105,11 @@
1089
1105
  "value": "30px",
1090
1106
  "usage": "Alto de botones dentro de filas."
1091
1107
  },
1108
+ {
1109
+ "name": "control-height-lg",
1110
+ "value": "52px",
1111
+ "usage": "Alto del botón grande: la acción principal de una pantalla pensada para el pulgar."
1112
+ },
1092
1113
  {
1093
1114
  "name": "input-height",
1094
1115
  "value": "38px",
@@ -1587,6 +1608,7 @@
1587
1608
  "scaled": [
1588
1609
  "control-height",
1589
1610
  "control-height-sm",
1611
+ "control-height-lg",
1590
1612
  "input-height",
1591
1613
  "pad-control-x",
1592
1614
  "pad-card",
@@ -1609,6 +1631,17 @@
1609
1631
  "id": "comfortable",
1610
1632
  "name": "Cómoda",
1611
1633
  "density": 1.125
1634
+ },
1635
+ {
1636
+ "id": "touch",
1637
+ "name": "Táctil",
1638
+ "density": 1.125,
1639
+ "values": {
1640
+ "control-height": "44px",
1641
+ "control-height-sm": "44px",
1642
+ "control-height-lg": "52px",
1643
+ "input-height": "48px"
1644
+ }
1612
1645
  }
1613
1646
  ]
1614
1647
  },
@@ -1742,6 +1775,7 @@
1742
1775
  "--ease-style": "motion-ease",
1743
1776
  "--spacing-control": "control-height",
1744
1777
  "--spacing-control-sm": "control-height-sm",
1778
+ "--spacing-control-lg": "control-height-lg",
1745
1779
  "--spacing-input": "input-height",
1746
1780
  "--spacing-control-x": "pad-control-x",
1747
1781
  "--spacing-card": "pad-card",