@eifi1/ui-kit 0.17.0 → 0.18.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 (167) hide show
  1. package/README.md +29 -4
  2. package/dist/chart.d.ts +10 -1
  3. package/dist/components/account-chips.d.ts +153 -0
  4. package/dist/components/account-chips.js +135 -0
  5. package/dist/components/account-chips.js.map +1 -0
  6. package/dist/components/account-settings-labels.d.ts +10 -2
  7. package/dist/components/account-settings-labels.js +3 -0
  8. package/dist/components/account-settings-labels.js.map +1 -1
  9. package/dist/components/amount-input.d.ts +10 -1
  10. package/dist/components/button-group.d.ts +10 -1
  11. package/dist/components/calculator.d.ts +10 -1
  12. package/dist/components/chip.d.ts +25 -1
  13. package/dist/components/chip.js +143 -6
  14. package/dist/components/chip.js.map +1 -1
  15. package/dist/components/confirm-dialog.d.ts +42 -1
  16. package/dist/components/confirm-dialog.js +36 -5
  17. package/dist/components/confirm-dialog.js.map +1 -1
  18. package/dist/components/copy-button.d.ts +10 -1
  19. package/dist/components/danger-confirm.d.ts +55 -4
  20. package/dist/components/danger-confirm.js +67 -30
  21. package/dist/components/danger-confirm.js.map +1 -1
  22. package/dist/components/data-table-cells.d.ts +1 -1
  23. package/dist/components/data-table-filter-popover.d.ts +1 -1
  24. package/dist/components/data-table-filters.d.ts +1 -1
  25. package/dist/components/data-table.d.ts +1 -1
  26. package/dist/components/data-table.js +2 -0
  27. package/dist/components/data-table.js.map +1 -1
  28. package/dist/components/facing-pair.d.ts +10 -1
  29. package/dist/components/file-button.d.ts +10 -1
  30. package/dist/components/file-dropzone.d.ts +10 -1
  31. package/dist/components/form-actions.d.ts +10 -1
  32. package/dist/components/form-actions.js +3 -0
  33. package/dist/components/form-actions.js.map +1 -1
  34. package/dist/components/money-field.d.ts +10 -1
  35. package/dist/components/number-field.d.ts +11 -2
  36. package/dist/components/number-field.js +23 -22
  37. package/dist/components/number-field.js.map +1 -1
  38. package/dist/components/number-input.d.ts +10 -1
  39. package/dist/components/numpad-sheet.d.ts +10 -1
  40. package/dist/components/passkeys-setting.d.ts +27 -1
  41. package/dist/components/passkeys-setting.js +31 -5
  42. package/dist/components/passkeys-setting.js.map +1 -1
  43. package/dist/components/progress-bar.d.ts +15 -1
  44. package/dist/components/progress-bar.js +8 -1
  45. package/dist/components/progress-bar.js.map +1 -1
  46. package/dist/components/reauth-dialog.d.ts +90 -0
  47. package/dist/components/reauth-dialog.js +158 -0
  48. package/dist/components/reauth-dialog.js.map +1 -0
  49. package/dist/components/series-chart.d.ts +10 -1
  50. package/dist/components/server-wake.d.ts +58 -0
  51. package/dist/components/server-wake.js +58 -0
  52. package/dist/components/server-wake.js.map +1 -0
  53. package/dist/components/settings-fields.d.ts +10 -1
  54. package/dist/components/share-card.d.ts +61 -0
  55. package/dist/components/share-card.js +350 -0
  56. package/dist/components/share-card.js.map +1 -0
  57. package/dist/components/status-dot.d.ts +2 -0
  58. package/dist/components/text-link.d.ts +10 -1
  59. package/dist/components/time-input.d.ts +10 -1
  60. package/dist/components/toast.d.ts +10 -1
  61. package/dist/components/toast.js +42 -2
  62. package/dist/components/toast.js.map +1 -1
  63. package/dist/components/toggle-group.js +5 -2
  64. package/dist/components/toggle-group.js.map +1 -1
  65. package/dist/components/ui.d.ts +10 -1
  66. package/dist/components/ui.js +43 -28
  67. package/dist/components/ui.js.map +1 -1
  68. package/dist/components/use-table-state.d.ts +1 -1
  69. package/dist/components/user-avatar.d.ts +2 -0
  70. package/dist/components/write-lock.d.ts +68 -0
  71. package/dist/components/write-lock.js +33 -0
  72. package/dist/components/write-lock.js.map +1 -0
  73. package/dist/{data-table-CpkWUJBY.d.ts → data-table-3mi2R3so.d.ts} +19 -1
  74. package/dist/data-table.d.ts +1 -1
  75. package/dist/hooks/use-file-drop.d.ts +10 -1
  76. package/dist/hooks/use-overlay-history.js +16 -0
  77. package/dist/hooks/use-overlay-history.js.map +1 -1
  78. package/dist/i18n/defaults.d.ts +10 -1
  79. package/dist/i18n/defaults.js +11 -1
  80. package/dist/i18n/defaults.js.map +1 -1
  81. package/dist/i18n/german.d.ts +78 -0
  82. package/dist/i18n/{locales/de.js → german.js} +59 -9
  83. package/dist/i18n/german.js.map +1 -0
  84. package/dist/i18n/kit-labels.d.ts +10 -1
  85. package/dist/i18n/kit-labels.js +5 -0
  86. package/dist/i18n/kit-labels.js.map +1 -1
  87. package/dist/i18n/locales/de-CH.d.ts +23 -8
  88. package/dist/i18n/locales/de-CH.js +7 -3
  89. package/dist/i18n/locales/de-CH.js.map +1 -1
  90. package/dist/i18n/locales/en.d.ts +10 -1
  91. package/dist/i18n/locales/es.d.ts +10 -1
  92. package/dist/i18n/locales/es.js +51 -1
  93. package/dist/i18n/locales/es.js.map +1 -1
  94. package/dist/i18n/locales/fr.d.ts +10 -1
  95. package/dist/i18n/locales/fr.js +51 -1
  96. package/dist/i18n/locales/fr.js.map +1 -1
  97. package/dist/i18n/locales/hu.d.ts +10 -1
  98. package/dist/i18n/locales/hu.js +54 -1
  99. package/dist/i18n/locales/hu.js.map +1 -1
  100. package/dist/i18n/locales/it.d.ts +10 -1
  101. package/dist/i18n/locales/it.js +51 -1
  102. package/dist/i18n/locales/it.js.map +1 -1
  103. package/dist/i18n/locales/zh.d.ts +10 -1
  104. package/dist/i18n/locales/zh.js +50 -1
  105. package/dist/i18n/locales/zh.js.map +1 -1
  106. package/dist/i18n/swiss.d.ts +3 -3
  107. package/dist/i18n/swiss.js.map +1 -1
  108. package/dist/index.d.ts +9 -4
  109. package/dist/index.js +33 -1
  110. package/dist/index.js.map +1 -1
  111. package/dist/{kit-labels-C4uB_zmg.d.ts → kit-labels-CPbsjlXr.d.ts} +229 -9
  112. package/dist/lib/server-wake.d.ts +130 -0
  113. package/dist/lib/server-wake.js +121 -0
  114. package/dist/lib/server-wake.js.map +1 -0
  115. package/dist/rhf/fields.d.ts +10 -1
  116. package/dist/rhf/form.d.ts +10 -1
  117. package/dist/rhf.d.ts +10 -1
  118. package/dist/search/global-search.d.ts +3 -1
  119. package/dist/search/global-search.js.map +1 -1
  120. package/dist/shell/app-shell.d.ts +10 -1
  121. package/dist/shell/top-bar-brand.d.ts +10 -1
  122. package/dist/shell/topbar-action-menu.d.ts +2 -0
  123. package/dist/shell.d.ts +10 -1
  124. package/dist/wizard/stepper-nav.d.ts +10 -1
  125. package/dist/wizard.d.ts +10 -1
  126. package/package.json +1 -1
  127. package/src/components/account-chips.tsx +302 -0
  128. package/src/components/account-settings-labels.ts +16 -2
  129. package/src/components/chip.tsx +239 -6
  130. package/src/components/confirm-dialog.tsx +82 -7
  131. package/src/components/danger-confirm.tsx +118 -33
  132. package/src/components/data-table.tsx +20 -0
  133. package/src/components/form-actions.tsx +22 -3
  134. package/src/components/number-field.tsx +32 -26
  135. package/src/components/passkeys-setting.tsx +68 -7
  136. package/src/components/progress-bar.tsx +21 -1
  137. package/src/components/reauth-dialog.tsx +273 -0
  138. package/src/components/server-wake.tsx +124 -0
  139. package/src/components/share-card.tsx +615 -0
  140. package/src/components/toast.tsx +72 -2
  141. package/src/components/toggle-group.tsx +5 -2
  142. package/src/components/ui.tsx +89 -32
  143. package/src/components/write-lock.tsx +96 -0
  144. package/src/hooks/use-overlay-history.ts +51 -0
  145. package/src/i18n/defaults.ts +10 -0
  146. package/src/i18n/{locales/de.ts → german.ts} +68 -13
  147. package/src/i18n/kit-labels.tsx +22 -2
  148. package/src/i18n/locales/de-CH.ts +17 -8
  149. package/src/i18n/locales/es.ts +51 -0
  150. package/src/i18n/locales/fr.ts +52 -0
  151. package/src/i18n/locales/hu.ts +55 -0
  152. package/src/i18n/locales/it.ts +51 -0
  153. package/src/i18n/locales/zh.ts +50 -0
  154. package/src/i18n/swiss.ts +3 -3
  155. package/src/index.ts +23 -1
  156. package/src/lib/server-wake.ts +270 -0
  157. package/src/search/global-search.tsx +3 -1
  158. package/dist/i18n/locales/de-CH-informal.d.ts +0 -61
  159. package/dist/i18n/locales/de-CH-informal.js +0 -8
  160. package/dist/i18n/locales/de-CH-informal.js.map +0 -1
  161. package/dist/i18n/locales/de-informal.d.ts +0 -82
  162. package/dist/i18n/locales/de-informal.js +0 -37
  163. package/dist/i18n/locales/de-informal.js.map +0 -1
  164. package/dist/i18n/locales/de.d.ts +0 -66
  165. package/dist/i18n/locales/de.js.map +0 -1
  166. package/src/i18n/locales/de-CH-informal.ts +0 -10
  167. package/src/i18n/locales/de-informal.ts +0 -61
@@ -9,6 +9,7 @@ import { useMediaQuery } from "../hooks/use-media-query.js";
9
9
  import { Tooltip } from "./tooltip.js";
10
10
  import { DEFAULT_COMMON_LABELS, useKitLabels, useKitLink } from "../i18n/kit-labels.js";
11
11
  import { pickLinkRenderer, replacingClick, routerLinkNavigation } from "./text-link.js";
12
+ import { useCommitReason } from "./write-lock.js";
12
13
  const BUTTON_BASE = "inline-flex items-center justify-center rounded-md font-medium transition-colors focus:outline-none focus:ring-2 disabled:opacity-50 disabled:cursor-not-allowed";
13
14
  const BUTTON_SIZES = {
14
15
  md: "gap-2 px-3 py-2 text-sm",
@@ -144,7 +145,8 @@ function ButtonElement({
144
145
  stretch,
145
146
  tone = "default",
146
147
  pressed,
147
- disabledReason,
148
+ disabledReason: ownDisabledReason,
149
+ commit,
148
150
  pending,
149
151
  className,
150
152
  onClick,
@@ -157,6 +159,7 @@ function ButtonElement({
157
159
  ...rest
158
160
  }) {
159
161
  const reasonId = useId();
162
+ const disabledReason = useCommitReason(commit, ownDisabledReason);
160
163
  const locked = hasContent(disabledReason);
161
164
  const inert = locked || Boolean(pending);
162
165
  const ownDescribedBy = rest["aria-describedby"];
@@ -486,7 +489,8 @@ function IconButtonElement({
486
489
  tooltipSide,
487
490
  tooltipPortal,
488
491
  tooltipLazy = true,
489
- disabledReason,
492
+ disabledReason: ownDisabledReason,
493
+ commit,
490
494
  pending,
491
495
  glyphSize,
492
496
  badge,
@@ -507,6 +511,7 @@ function IconButtonElement({
507
511
  const tone = toneProp ?? (toneColor !== void 0 ? "custom" : "default");
508
512
  const keep = disabledStyle === "keep";
509
513
  const reasonId = useId();
514
+ const disabledReason = useCommitReason(commit, ownDisabledReason);
510
515
  const locked = hasContent(disabledReason);
511
516
  const inert = locked || Boolean(pending);
512
517
  const ownDescribedBy = rest["aria-describedby"];
@@ -742,8 +747,12 @@ function useFieldError(error, invalid, describedBy, ariaInvalid) {
742
747
  errorEl: hasError ? /* @__PURE__ */ jsx("p", { id: errorId, className: FIELD_ERROR_CLASS, children: error }) : null
743
748
  };
744
749
  }
745
- function FieldGroup({ errorEl, children }) {
746
- if (errorEl === null) return /* @__PURE__ */ jsx(Fragment, { children });
750
+ function FieldGroup({
751
+ errorEl,
752
+ reserve = false,
753
+ children
754
+ }) {
755
+ if (errorEl === null && !reserve) return /* @__PURE__ */ jsx(Fragment, { children });
747
756
  return /* @__PURE__ */ jsxs("div", { children: [
748
757
  children,
749
758
  errorEl
@@ -758,19 +767,21 @@ function resolvePasswordRevealLabels(partial) {
758
767
  return { ...DEFAULT_PASSWORD_REVEAL_LABELS, ...partial };
759
768
  }
760
769
  const PICKER_TYPES = /* @__PURE__ */ new Set(["date", "datetime-local", "month", "time", "week"]);
761
- const Input = forwardRef(function Input2({
762
- className,
763
- inputClassName,
764
- label,
765
- id,
766
- placeholder,
767
- type,
768
- variant = "field",
769
- invalid,
770
- error,
771
- passwordLabels,
772
- ...rest
773
- }, ref) {
770
+ const Input = forwardRef(function Input2(props, ref) {
771
+ const {
772
+ className,
773
+ inputClassName,
774
+ label,
775
+ id,
776
+ placeholder,
777
+ type,
778
+ variant = "field",
779
+ invalid,
780
+ error,
781
+ passwordLabels,
782
+ ...rest
783
+ } = props;
784
+ const reserve = "error" in props;
774
785
  const generated = useId();
775
786
  const fieldId = id ?? generated;
776
787
  const { isInvalid, describedBy, errorEl } = useFieldError(
@@ -805,7 +816,7 @@ const Input = forwardRef(function Input2({
805
816
  ) : null;
806
817
  if (label === void 0) {
807
818
  if (!isPassword) {
808
- return /* @__PURE__ */ jsx(FieldGroup, { errorEl, children: /* @__PURE__ */ jsx(
819
+ return /* @__PURE__ */ jsx(FieldGroup, { errorEl, reserve, children: /* @__PURE__ */ jsx(
809
820
  "input",
810
821
  {
811
822
  ref,
@@ -820,7 +831,7 @@ const Input = forwardRef(function Input2({
820
831
  }
821
832
  ) });
822
833
  }
823
- return /* @__PURE__ */ jsx(FieldGroup, { errorEl, children: /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
834
+ return /* @__PURE__ */ jsx(FieldGroup, { errorEl, reserve, children: /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
824
835
  /* @__PURE__ */ jsx(
825
836
  "input",
826
837
  {
@@ -837,7 +848,7 @@ const Input = forwardRef(function Input2({
837
848
  revealToggle
838
849
  ] }) });
839
850
  }
840
- return /* @__PURE__ */ jsx(FieldGroup, { errorEl, children: /* @__PURE__ */ jsxs(FloatingField, { className, htmlFor: fieldId, label, srOnlyLabel: asDisplay, children: [
851
+ return /* @__PURE__ */ jsx(FieldGroup, { errorEl, reserve, children: /* @__PURE__ */ jsxs(FloatingField, { className, htmlFor: fieldId, label, srOnlyLabel: asDisplay, children: [
841
852
  /* @__PURE__ */ jsx(
842
853
  "input",
843
854
  {
@@ -862,7 +873,9 @@ const Input = forwardRef(function Input2({
862
873
  });
863
874
  Input.displayName = "Input";
864
875
  const SELECT_SM = "h-7 py-0 ps-2 pe-7 text-xs";
865
- const Select = forwardRef(function Select2({ className, label, id, children, invalid, error, hint, size, selectClassName, ...rest }, ref) {
876
+ const Select = forwardRef(function Select2(props, ref) {
877
+ const { className, label, id, children, invalid, error, hint, size, selectClassName, ...rest } = props;
878
+ const reserve = "error" in props;
866
879
  const generated = useId();
867
880
  const nativeSize = typeof size === "number" ? size : void 0;
868
881
  const listBox = nativeSize !== void 0 && nativeSize > 1 || Boolean(rest.multiple);
@@ -906,7 +919,7 @@ const Select = forwardRef(function Select2({ className, label, id, children, inv
906
919
  }
907
920
  );
908
921
  if (hasContent(hint) && !textHint) {
909
- return /* @__PURE__ */ jsx(FieldGroup, { errorEl: below, children: /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-1.5", className), children: [
922
+ return /* @__PURE__ */ jsx(FieldGroup, { errorEl: below, reserve, children: /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-1.5", className), children: [
910
923
  /* @__PURE__ */ jsxs("div", { className: "relative min-w-0 flex-1", children: [
911
924
  select,
912
925
  chevron
@@ -914,12 +927,12 @@ const Select = forwardRef(function Select2({ className, label, id, children, inv
914
927
  /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center", children: hint })
915
928
  ] }) });
916
929
  }
917
- return /* @__PURE__ */ jsx(FieldGroup, { errorEl: below, children: /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
930
+ return /* @__PURE__ */ jsx(FieldGroup, { errorEl: below, reserve, children: /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
918
931
  select,
919
932
  chevron
920
933
  ] }) });
921
934
  }
922
- return /* @__PURE__ */ jsx(FieldGroup, { errorEl: below, children: /* @__PURE__ */ jsxs(FloatingField, { className, htmlFor: fieldId, label, staticLabel: true, hint: textHint ? void 0 : hint, children: [
935
+ return /* @__PURE__ */ jsx(FieldGroup, { errorEl: below, reserve, children: /* @__PURE__ */ jsxs(FloatingField, { className, htmlFor: fieldId, label, staticLabel: true, hint: textHint ? void 0 : hint, children: [
923
936
  /* @__PURE__ */ jsx(
924
937
  "select",
925
938
  {
@@ -947,7 +960,9 @@ const Select = forwardRef(function Select2({ className, label, id, children, inv
947
960
  ] }) });
948
961
  });
949
962
  Select.displayName = "Select";
950
- const Textarea = forwardRef(function Textarea2({ className, label, id, placeholder, invalid, error, ...rest }, ref) {
963
+ const Textarea = forwardRef(function Textarea2(props, ref) {
964
+ const { className, label, id, placeholder, invalid, error, ...rest } = props;
965
+ const reserve = "error" in props;
951
966
  const generated = useId();
952
967
  const fieldId = id ?? generated;
953
968
  const { isInvalid, describedBy, errorEl } = useFieldError(
@@ -957,7 +972,7 @@ const Textarea = forwardRef(function Textarea2({ className, label, id, placehold
957
972
  rest["aria-invalid"]
958
973
  );
959
974
  if (label === void 0) {
960
- return /* @__PURE__ */ jsx(FieldGroup, { errorEl, children: /* @__PURE__ */ jsx(
975
+ return /* @__PURE__ */ jsx(FieldGroup, { errorEl, reserve, children: /* @__PURE__ */ jsx(
961
976
  "textarea",
962
977
  {
963
978
  ref,
@@ -970,7 +985,7 @@ const Textarea = forwardRef(function Textarea2({ className, label, id, placehold
970
985
  }
971
986
  ) });
972
987
  }
973
- return /* @__PURE__ */ jsx(FieldGroup, { errorEl, children: /* @__PURE__ */ jsx(FloatingField, { className, htmlFor: fieldId, label, children: /* @__PURE__ */ jsx(
988
+ return /* @__PURE__ */ jsx(FieldGroup, { errorEl, reserve, children: /* @__PURE__ */ jsx(FloatingField, { className, htmlFor: fieldId, label, children: /* @__PURE__ */ jsx(
974
989
  "textarea",
975
990
  {
976
991
  ref,
@@ -1114,7 +1129,7 @@ function CardTitle({ className, as: Tag = "div", ...props }) {
1114
1129
  Tag,
1115
1130
  {
1116
1131
  "data-slot": "card-title",
1117
- className: cn(compact ? "text-sm font-medium" : "font-semibold", "leading-none", className),
1132
+ className: cn(compact ? "text-sm font-medium leading-snug" : "font-semibold leading-none", className),
1118
1133
  ...props
1119
1134
  }
1120
1135
  );