@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.
- package/README.md +29 -4
- package/dist/chart.d.ts +10 -1
- package/dist/components/account-chips.d.ts +153 -0
- package/dist/components/account-chips.js +135 -0
- package/dist/components/account-chips.js.map +1 -0
- package/dist/components/account-settings-labels.d.ts +10 -2
- package/dist/components/account-settings-labels.js +3 -0
- package/dist/components/account-settings-labels.js.map +1 -1
- package/dist/components/amount-input.d.ts +10 -1
- package/dist/components/button-group.d.ts +10 -1
- package/dist/components/calculator.d.ts +10 -1
- package/dist/components/chip.d.ts +25 -1
- package/dist/components/chip.js +143 -6
- package/dist/components/chip.js.map +1 -1
- package/dist/components/confirm-dialog.d.ts +42 -1
- package/dist/components/confirm-dialog.js +36 -5
- package/dist/components/confirm-dialog.js.map +1 -1
- package/dist/components/copy-button.d.ts +10 -1
- package/dist/components/danger-confirm.d.ts +55 -4
- package/dist/components/danger-confirm.js +67 -30
- package/dist/components/danger-confirm.js.map +1 -1
- package/dist/components/data-table-cells.d.ts +1 -1
- package/dist/components/data-table-filter-popover.d.ts +1 -1
- package/dist/components/data-table-filters.d.ts +1 -1
- package/dist/components/data-table.d.ts +1 -1
- package/dist/components/data-table.js +2 -0
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/facing-pair.d.ts +10 -1
- package/dist/components/file-button.d.ts +10 -1
- package/dist/components/file-dropzone.d.ts +10 -1
- package/dist/components/form-actions.d.ts +10 -1
- package/dist/components/form-actions.js +3 -0
- package/dist/components/form-actions.js.map +1 -1
- package/dist/components/money-field.d.ts +10 -1
- package/dist/components/number-field.d.ts +11 -2
- package/dist/components/number-field.js +23 -22
- package/dist/components/number-field.js.map +1 -1
- package/dist/components/number-input.d.ts +10 -1
- package/dist/components/numpad-sheet.d.ts +10 -1
- package/dist/components/passkeys-setting.d.ts +27 -1
- package/dist/components/passkeys-setting.js +31 -5
- package/dist/components/passkeys-setting.js.map +1 -1
- package/dist/components/progress-bar.d.ts +15 -1
- package/dist/components/progress-bar.js +8 -1
- package/dist/components/progress-bar.js.map +1 -1
- package/dist/components/reauth-dialog.d.ts +90 -0
- package/dist/components/reauth-dialog.js +158 -0
- package/dist/components/reauth-dialog.js.map +1 -0
- package/dist/components/series-chart.d.ts +10 -1
- package/dist/components/server-wake.d.ts +58 -0
- package/dist/components/server-wake.js +58 -0
- package/dist/components/server-wake.js.map +1 -0
- package/dist/components/settings-fields.d.ts +10 -1
- package/dist/components/share-card.d.ts +61 -0
- package/dist/components/share-card.js +350 -0
- package/dist/components/share-card.js.map +1 -0
- package/dist/components/status-dot.d.ts +2 -0
- package/dist/components/text-link.d.ts +10 -1
- package/dist/components/time-input.d.ts +10 -1
- package/dist/components/toast.d.ts +10 -1
- package/dist/components/toast.js +42 -2
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toggle-group.js +5 -2
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/ui.d.ts +10 -1
- package/dist/components/ui.js +43 -28
- package/dist/components/ui.js.map +1 -1
- package/dist/components/use-table-state.d.ts +1 -1
- package/dist/components/user-avatar.d.ts +2 -0
- package/dist/components/write-lock.d.ts +68 -0
- package/dist/components/write-lock.js +33 -0
- package/dist/components/write-lock.js.map +1 -0
- package/dist/{data-table-CpkWUJBY.d.ts → data-table-3mi2R3so.d.ts} +19 -1
- package/dist/data-table.d.ts +1 -1
- package/dist/hooks/use-file-drop.d.ts +10 -1
- package/dist/hooks/use-overlay-history.js +16 -0
- package/dist/hooks/use-overlay-history.js.map +1 -1
- package/dist/i18n/defaults.d.ts +10 -1
- package/dist/i18n/defaults.js +11 -1
- package/dist/i18n/defaults.js.map +1 -1
- package/dist/i18n/german.d.ts +78 -0
- package/dist/i18n/{locales/de.js → german.js} +59 -9
- package/dist/i18n/german.js.map +1 -0
- package/dist/i18n/kit-labels.d.ts +10 -1
- package/dist/i18n/kit-labels.js +5 -0
- package/dist/i18n/kit-labels.js.map +1 -1
- package/dist/i18n/locales/de-CH.d.ts +23 -8
- package/dist/i18n/locales/de-CH.js +7 -3
- package/dist/i18n/locales/de-CH.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +10 -1
- package/dist/i18n/locales/es.d.ts +10 -1
- package/dist/i18n/locales/es.js +51 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +10 -1
- package/dist/i18n/locales/fr.js +51 -1
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.d.ts +10 -1
- package/dist/i18n/locales/hu.js +54 -1
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +10 -1
- package/dist/i18n/locales/it.js +51 -1
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +10 -1
- package/dist/i18n/locales/zh.js +50 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/i18n/swiss.d.ts +3 -3
- package/dist/i18n/swiss.js.map +1 -1
- package/dist/index.d.ts +9 -4
- package/dist/index.js +33 -1
- package/dist/index.js.map +1 -1
- package/dist/{kit-labels-C4uB_zmg.d.ts → kit-labels-CPbsjlXr.d.ts} +229 -9
- package/dist/lib/server-wake.d.ts +130 -0
- package/dist/lib/server-wake.js +121 -0
- package/dist/lib/server-wake.js.map +1 -0
- package/dist/rhf/fields.d.ts +10 -1
- package/dist/rhf/form.d.ts +10 -1
- package/dist/rhf.d.ts +10 -1
- package/dist/search/global-search.d.ts +3 -1
- package/dist/search/global-search.js.map +1 -1
- package/dist/shell/app-shell.d.ts +10 -1
- package/dist/shell/top-bar-brand.d.ts +10 -1
- package/dist/shell/topbar-action-menu.d.ts +2 -0
- package/dist/shell.d.ts +10 -1
- package/dist/wizard/stepper-nav.d.ts +10 -1
- package/dist/wizard.d.ts +10 -1
- package/package.json +1 -1
- package/src/components/account-chips.tsx +302 -0
- package/src/components/account-settings-labels.ts +16 -2
- package/src/components/chip.tsx +239 -6
- package/src/components/confirm-dialog.tsx +82 -7
- package/src/components/danger-confirm.tsx +118 -33
- package/src/components/data-table.tsx +20 -0
- package/src/components/form-actions.tsx +22 -3
- package/src/components/number-field.tsx +32 -26
- package/src/components/passkeys-setting.tsx +68 -7
- package/src/components/progress-bar.tsx +21 -1
- package/src/components/reauth-dialog.tsx +273 -0
- package/src/components/server-wake.tsx +124 -0
- package/src/components/share-card.tsx +615 -0
- package/src/components/toast.tsx +72 -2
- package/src/components/toggle-group.tsx +5 -2
- package/src/components/ui.tsx +89 -32
- package/src/components/write-lock.tsx +96 -0
- package/src/hooks/use-overlay-history.ts +51 -0
- package/src/i18n/defaults.ts +10 -0
- package/src/i18n/{locales/de.ts → german.ts} +68 -13
- package/src/i18n/kit-labels.tsx +22 -2
- package/src/i18n/locales/de-CH.ts +17 -8
- package/src/i18n/locales/es.ts +51 -0
- package/src/i18n/locales/fr.ts +52 -0
- package/src/i18n/locales/hu.ts +55 -0
- package/src/i18n/locales/it.ts +51 -0
- package/src/i18n/locales/zh.ts +50 -0
- package/src/i18n/swiss.ts +3 -3
- package/src/index.ts +23 -1
- package/src/lib/server-wake.ts +270 -0
- package/src/search/global-search.tsx +3 -1
- package/dist/i18n/locales/de-CH-informal.d.ts +0 -61
- package/dist/i18n/locales/de-CH-informal.js +0 -8
- package/dist/i18n/locales/de-CH-informal.js.map +0 -1
- package/dist/i18n/locales/de-informal.d.ts +0 -82
- package/dist/i18n/locales/de-informal.js +0 -37
- package/dist/i18n/locales/de-informal.js.map +0 -1
- package/dist/i18n/locales/de.d.ts +0 -66
- package/dist/i18n/locales/de.js.map +0 -1
- package/src/i18n/locales/de-CH-informal.ts +0 -10
- package/src/i18n/locales/de-informal.ts +0 -61
package/dist/components/ui.js
CHANGED
|
@@ -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({
|
|
746
|
-
|
|
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
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
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(
|
|
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(
|
|
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
|
|
1132
|
+
className: cn(compact ? "text-sm font-medium leading-snug" : "font-semibold leading-none", className),
|
|
1118
1133
|
...props
|
|
1119
1134
|
}
|
|
1120
1135
|
);
|