rei-kit 0.4.3 → 0.5.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 +110 -38
- package/dist/components/BaseButton.vue.d.ts +36 -4
- package/dist/components/BaseCheckbox.vue.d.ts +29 -0
- package/dist/components/BaseRadioGroup.vue.d.ts +33 -0
- package/dist/components/BaseSelect.vue.d.ts +40 -0
- package/dist/components/BaseTextarea.vue.d.ts +18 -0
- package/dist/components/FormField.vue.d.ts +51 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +389 -64
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as registerErrorMapper, r as toAppError, t as AppError } from "./app-error-DF9cijE0.js";
|
|
2
|
-
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createStaticVNode, createTextVNode, createVNode, defineComponent, mergeModels, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onErrorCaptured, onMounted, onScopeDispose, onUnmounted, openBlock, readonly, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useId, useModel, vModelDynamic, vModelRadio, watch, watchEffect, withCtx, withDirectives } from "vue";
|
|
3
|
-
import { ArrowDown, ArrowRight, ArrowUp, ChevronRight, X } from "lucide-vue-next";
|
|
2
|
+
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createStaticVNode, createTextVNode, createVNode, defineComponent, mergeModels, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onErrorCaptured, onMounted, onScopeDispose, onUnmounted, openBlock, readonly, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useId, useModel, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, watch, watchEffect, withCtx, withDirectives } from "vue";
|
|
3
|
+
import { ArrowDown, ArrowRight, ArrowUp, ChevronDown, ChevronRight, X } from "lucide-vue-next";
|
|
4
4
|
import { RouterLink } from "vue-router";
|
|
5
5
|
import { createI18n } from "vue-i18n";
|
|
6
6
|
//#region src/utils/date.ts
|
|
@@ -728,9 +728,9 @@ function useVisualViewport() {
|
|
|
728
728
|
}
|
|
729
729
|
//#endregion
|
|
730
730
|
//#region src/components/BaseAlert.vue?vue&type=script&setup=true&lang.ts
|
|
731
|
-
var _hoisted_1$
|
|
732
|
-
var _hoisted_2$
|
|
733
|
-
var _hoisted_3$
|
|
731
|
+
var _hoisted_1$22 = ["role", "aria-live"];
|
|
732
|
+
var _hoisted_2$17 = { class: "min-w-0 flex-1" };
|
|
733
|
+
var _hoisted_3$12 = {
|
|
734
734
|
key: 0,
|
|
735
735
|
class: "text-ink font-semibold"
|
|
736
736
|
};
|
|
@@ -771,9 +771,9 @@ var BaseAlert_default = /* @__PURE__ */ defineComponent({
|
|
|
771
771
|
class: normalizeClass(["mt-px grid size-6 shrink-0 place-items-center rounded-full text-xs font-semibold", mark.value]),
|
|
772
772
|
"aria-hidden": "true"
|
|
773
773
|
}, [renderSlot(_ctx.$slots, "mark")], 2)) : createCommentVNode("", true),
|
|
774
|
-
createElementVNode("div", _hoisted_2$
|
|
774
|
+
createElementVNode("div", _hoisted_2$17, [_ctx.$slots.title ? (openBlock(), createElementBlock("p", _hoisted_3$12, [renderSlot(_ctx.$slots, "title")])) : createCommentVNode("", true), createElementVNode("div", { class: normalizeClass(_ctx.$slots.title ? "mt-1" : "") }, [renderSlot(_ctx.$slots, "default")], 2)]),
|
|
775
775
|
renderSlot(_ctx.$slots, "action")
|
|
776
|
-
], 10, _hoisted_1$
|
|
776
|
+
], 10, _hoisted_1$22);
|
|
777
777
|
};
|
|
778
778
|
}
|
|
779
779
|
});
|
|
@@ -798,12 +798,7 @@ var BaseBadge_default = /* @__PURE__ */ defineComponent({
|
|
|
798
798
|
});
|
|
799
799
|
//#endregion
|
|
800
800
|
//#region src/components/BaseButton.vue?vue&type=script&setup=true&lang.ts
|
|
801
|
-
var _hoisted_1$
|
|
802
|
-
"type",
|
|
803
|
-
"disabled",
|
|
804
|
-
"aria-busy"
|
|
805
|
-
];
|
|
806
|
-
var _hoisted_2$14 = {
|
|
801
|
+
var _hoisted_1$21 = {
|
|
807
802
|
key: 0,
|
|
808
803
|
class: "size-4 animate-spin rounded-full border-2 border-current border-t-transparent",
|
|
809
804
|
"aria-hidden": "true"
|
|
@@ -813,6 +808,7 @@ var _hoisted_2$14 = {
|
|
|
813
808
|
var BaseButton_default = /* @__PURE__ */ defineComponent({
|
|
814
809
|
__name: "BaseButton",
|
|
815
810
|
props: {
|
|
811
|
+
as: { default: "button" },
|
|
816
812
|
variant: { default: "primary" },
|
|
817
813
|
size: { default: "md" },
|
|
818
814
|
loading: {
|
|
@@ -823,33 +819,118 @@ var BaseButton_default = /* @__PURE__ */ defineComponent({
|
|
|
823
819
|
type: Boolean,
|
|
824
820
|
default: false
|
|
825
821
|
},
|
|
826
|
-
type: { default: "button" }
|
|
822
|
+
type: { default: "button" },
|
|
823
|
+
icon: {
|
|
824
|
+
type: Boolean,
|
|
825
|
+
default: false
|
|
826
|
+
},
|
|
827
|
+
block: {
|
|
828
|
+
type: Boolean,
|
|
829
|
+
default: false
|
|
830
|
+
},
|
|
831
|
+
to: { default: () => void 0 },
|
|
832
|
+
href: { default: () => void 0 }
|
|
827
833
|
},
|
|
828
834
|
setup(__props) {
|
|
829
835
|
const VARIANT_CLASS = {
|
|
830
836
|
primary: "bg-primary text-white hover:bg-primary/90",
|
|
837
|
+
secondary: "border-hair bg-surface text-ink border hover:bg-muted",
|
|
831
838
|
ghost: "bg-transparent text-ink hover:bg-muted",
|
|
832
839
|
danger: "bg-negative text-white hover:bg-negative/90"
|
|
833
840
|
};
|
|
834
841
|
const SIZE_CLASS = {
|
|
835
842
|
sm: "h-9 px-3 text-sm",
|
|
836
|
-
md: "h-11 px-4 text-base"
|
|
843
|
+
md: "h-11 px-4 text-base",
|
|
844
|
+
lg: "h-14 px-6 text-lg"
|
|
845
|
+
};
|
|
846
|
+
const ICON_SIZE_CLASS = {
|
|
847
|
+
sm: "size-9 text-sm",
|
|
848
|
+
md: "size-11 text-base",
|
|
849
|
+
lg: "size-14 text-lg"
|
|
837
850
|
};
|
|
851
|
+
/** Anything that is not a `<button>` cannot be `disabled`; it has to be told. */
|
|
852
|
+
const inactive = computed(() => __props.disabled || __props.loading);
|
|
853
|
+
const linkProps = computed(() => {
|
|
854
|
+
if (__props.as === "router-link") return { to: __props.to };
|
|
855
|
+
if (__props.as === "a") return inactive.value ? {} : { href: __props.href };
|
|
856
|
+
return {};
|
|
857
|
+
});
|
|
838
858
|
return (_ctx, _cache) => {
|
|
839
|
-
return openBlock(),
|
|
840
|
-
type: __props.type,
|
|
841
|
-
disabled: __props.
|
|
859
|
+
return openBlock(), createBlock(resolveDynamicComponent(__props.as), mergeProps(linkProps.value, {
|
|
860
|
+
type: __props.as === "button" ? __props.type : void 0,
|
|
861
|
+
disabled: __props.as === "button" ? inactive.value : void 0,
|
|
862
|
+
"aria-disabled": __props.as !== "button" && inactive.value ? "true" : void 0,
|
|
842
863
|
"aria-busy": __props.loading,
|
|
843
|
-
class:
|
|
844
|
-
|
|
864
|
+
class: ["rounded-card focus-visible:outline-primary inline-flex items-center justify-center gap-2 font-medium transition-transform duration-100 select-none focus-visible:outline-2 focus-visible:outline-offset-2 active:scale-95 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50", [
|
|
865
|
+
VARIANT_CLASS[__props.variant],
|
|
866
|
+
__props.icon ? ICON_SIZE_CLASS[__props.size] : SIZE_CLASS[__props.size],
|
|
867
|
+
__props.block ? "w-full" : ""
|
|
868
|
+
]]
|
|
869
|
+
}), {
|
|
870
|
+
default: withCtx(() => [__props.loading ? (openBlock(), createElementBlock("span", _hoisted_1$21)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default")]),
|
|
871
|
+
_: 3
|
|
872
|
+
}, 16, [
|
|
873
|
+
"type",
|
|
874
|
+
"disabled",
|
|
875
|
+
"aria-disabled",
|
|
876
|
+
"aria-busy",
|
|
877
|
+
"class"
|
|
878
|
+
]);
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
});
|
|
882
|
+
//#endregion
|
|
883
|
+
//#region src/components/FormField.vue?vue&type=script&setup=true&lang.ts
|
|
884
|
+
var _hoisted_1$20 = { class: "flex flex-col gap-1.5" };
|
|
885
|
+
var _hoisted_2$16 = ["for"];
|
|
886
|
+
//#endregion
|
|
887
|
+
//#region src/components/FormField.vue
|
|
888
|
+
var FormField_default = /* @__PURE__ */ defineComponent({
|
|
889
|
+
__name: "FormField",
|
|
890
|
+
props: {
|
|
891
|
+
label: {},
|
|
892
|
+
error: { default: "" },
|
|
893
|
+
hint: { default: "" },
|
|
894
|
+
labelHidden: {
|
|
895
|
+
type: Boolean,
|
|
896
|
+
default: false
|
|
897
|
+
}
|
|
898
|
+
},
|
|
899
|
+
setup(__props) {
|
|
900
|
+
const id = useId();
|
|
901
|
+
const errorId = `${id}-error`;
|
|
902
|
+
const hintId = `${id}-hint`;
|
|
903
|
+
const describedBy = computed(() => {
|
|
904
|
+
if (__props.error) return errorId;
|
|
905
|
+
if (__props.hint) return hintId;
|
|
906
|
+
});
|
|
907
|
+
return (_ctx, _cache) => {
|
|
908
|
+
return openBlock(), createElementBlock("div", _hoisted_1$20, [
|
|
909
|
+
createElementVNode("label", {
|
|
910
|
+
for: unref(id),
|
|
911
|
+
class: normalizeClass(["text-ink text-sm font-medium", __props.labelHidden ? "sr-only" : ""])
|
|
912
|
+
}, toDisplayString(__props.label), 11, _hoisted_2$16),
|
|
913
|
+
renderSlot(_ctx.$slots, "default", {
|
|
914
|
+
id: unref(id),
|
|
915
|
+
describedBy: describedBy.value,
|
|
916
|
+
invalid: Boolean(__props.error)
|
|
917
|
+
}),
|
|
918
|
+
__props.error ? (openBlock(), createElementBlock("p", {
|
|
919
|
+
key: 0,
|
|
920
|
+
id: errorId,
|
|
921
|
+
class: "text-negative text-xs"
|
|
922
|
+
}, toDisplayString(__props.error), 1)) : __props.hint ? (openBlock(), createElementBlock("p", {
|
|
923
|
+
key: 1,
|
|
924
|
+
id: hintId,
|
|
925
|
+
class: "text-ink-soft text-xs"
|
|
926
|
+
}, toDisplayString(__props.hint), 1)) : createCommentVNode("", true)
|
|
927
|
+
]);
|
|
845
928
|
};
|
|
846
929
|
}
|
|
847
930
|
});
|
|
848
931
|
//#endregion
|
|
849
932
|
//#region src/components/BaseInput.vue?vue&type=script&setup=true&lang.ts
|
|
850
|
-
var _hoisted_1$
|
|
851
|
-
var _hoisted_2$13 = ["for"];
|
|
852
|
-
var _hoisted_3$9 = [
|
|
933
|
+
var _hoisted_1$19 = [
|
|
853
934
|
"id",
|
|
854
935
|
"type",
|
|
855
936
|
"aria-invalid",
|
|
@@ -876,45 +957,36 @@ var BaseInput_default = /* @__PURE__ */ defineComponent({
|
|
|
876
957
|
emits: ["update:modelValue"],
|
|
877
958
|
setup(__props) {
|
|
878
959
|
const model = useModel(__props, "modelValue");
|
|
879
|
-
const id = useId();
|
|
880
|
-
const errorId = `${id}-error`;
|
|
881
|
-
const hintId = `${id}-hint`;
|
|
882
|
-
const describedBy = computed(() => {
|
|
883
|
-
if (__props.error) return errorId;
|
|
884
|
-
if (__props.hint) return hintId;
|
|
885
|
-
});
|
|
886
960
|
return (_ctx, _cache) => {
|
|
887
|
-
return openBlock(),
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
961
|
+
return openBlock(), createBlock(FormField_default, {
|
|
962
|
+
label: __props.label,
|
|
963
|
+
error: __props.error,
|
|
964
|
+
hint: __props.hint,
|
|
965
|
+
"label-hidden": __props.labelHidden
|
|
966
|
+
}, {
|
|
967
|
+
default: withCtx(({ id, describedBy, invalid }) => [withDirectives(createElementVNode("input", mergeProps({
|
|
968
|
+
id,
|
|
894
969
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
895
970
|
type: __props.type,
|
|
896
|
-
"aria-invalid":
|
|
897
|
-
"aria-describedby": describedBy
|
|
898
|
-
}, _ctx.$attrs, { class: ["border-hair bg-surface text-ink rounded-card focus-visible:outline-primary h-11 border px-3 focus-visible:outline-2 focus-visible:outline-offset-1",
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
id: hintId,
|
|
906
|
-
class: "text-ink-soft text-xs"
|
|
907
|
-
}, toDisplayString(__props.hint), 1)) : createCommentVNode("", true)
|
|
971
|
+
"aria-invalid": invalid,
|
|
972
|
+
"aria-describedby": describedBy
|
|
973
|
+
}, _ctx.$attrs, { class: ["border-hair bg-surface text-ink rounded-card focus-visible:outline-primary h-11 border px-3 focus-visible:outline-2 focus-visible:outline-offset-1", invalid ? "border-negative" : ""] }), null, 16, _hoisted_1$19), [[vModelDynamic, model.value]])]),
|
|
974
|
+
_: 1
|
|
975
|
+
}, 8, [
|
|
976
|
+
"label",
|
|
977
|
+
"error",
|
|
978
|
+
"hint",
|
|
979
|
+
"label-hidden"
|
|
908
980
|
]);
|
|
909
981
|
};
|
|
910
982
|
}
|
|
911
983
|
});
|
|
912
984
|
//#endregion
|
|
913
985
|
//#region src/components/BaseSheet.vue?vue&type=script&setup=true&lang.ts
|
|
914
|
-
var _hoisted_1$
|
|
915
|
-
var _hoisted_2$
|
|
916
|
-
var _hoisted_3$
|
|
917
|
-
var _hoisted_4$
|
|
986
|
+
var _hoisted_1$18 = { class: "shell-frame md:rounded-shell relative flex max-h-full flex-col justify-end overflow-hidden" };
|
|
987
|
+
var _hoisted_2$15 = ["aria-label"];
|
|
988
|
+
var _hoisted_3$11 = { class: "flex shrink-0 items-start gap-3 px-6 pt-4 pb-5" };
|
|
989
|
+
var _hoisted_4$8 = { class: "min-w-0 flex-1" };
|
|
918
990
|
var _hoisted_5$4 = { class: "text-ink text-xl leading-tight font-semibold" };
|
|
919
991
|
var _hoisted_6$2 = {
|
|
920
992
|
key: 0,
|
|
@@ -992,7 +1064,7 @@ var BaseSheet_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
992
1064
|
key: 0,
|
|
993
1065
|
class: "fixed inset-x-0 top-0 bottom-0 z-50 flex items-center justify-center",
|
|
994
1066
|
style: normalizeStyle(viewportStyle.value)
|
|
995
|
-
}, [createElementVNode("div", _hoisted_1$
|
|
1067
|
+
}, [createElementVNode("div", _hoisted_1$18, [createElementVNode("div", {
|
|
996
1068
|
class: "bg-ink/45 absolute inset-0 backdrop-blur-[2px]",
|
|
997
1069
|
onClick: close
|
|
998
1070
|
}), createElementVNode("section", {
|
|
@@ -1008,14 +1080,14 @@ var BaseSheet_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
1008
1080
|
class: "flex shrink-0 justify-center pt-3",
|
|
1009
1081
|
"aria-hidden": "true"
|
|
1010
1082
|
}, [createElementVNode("span", { class: "bg-hair h-1.5 w-10 rounded-full" })], -1)),
|
|
1011
|
-
createElementVNode("header", _hoisted_3$
|
|
1083
|
+
createElementVNode("header", _hoisted_3$11, [createElementVNode("div", _hoisted_4$8, [createElementVNode("h2", _hoisted_5$4, toDisplayString(__props.title), 1), __props.subtitle ? (openBlock(), createElementBlock("p", _hoisted_6$2, toDisplayString(__props.subtitle), 1)) : createCommentVNode("", true)]), createElementVNode("button", {
|
|
1012
1084
|
type: "button",
|
|
1013
1085
|
class: "text-ink-soft hover:bg-muted hover:text-ink -mt-1 flex size-10 shrink-0 items-center justify-center rounded-full transition-colors active:scale-90",
|
|
1014
1086
|
"aria-label": __props.closeLabel,
|
|
1015
1087
|
onClick: close
|
|
1016
1088
|
}, [createVNode(unref(X), { class: "size-5" })], 8, _hoisted_7$2)]),
|
|
1017
1089
|
createElementVNode("div", _hoisted_8$1, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])
|
|
1018
|
-
], 8, _hoisted_2$
|
|
1090
|
+
], 8, _hoisted_2$15)])], 4)) : createCommentVNode("", true)]),
|
|
1019
1091
|
_: 3
|
|
1020
1092
|
})]);
|
|
1021
1093
|
};
|
|
@@ -1033,12 +1105,12 @@ var _plugin_vue_export_helper_default = (sfc, props) => {
|
|
|
1033
1105
|
var BaseSheet_default = /*#__PURE__*/ _plugin_vue_export_helper_default(BaseSheet_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-cb967015"]]);
|
|
1034
1106
|
//#endregion
|
|
1035
1107
|
//#region src/components/BaseCard.vue?vue&type=script&setup=true&lang.ts
|
|
1036
|
-
var _hoisted_1$
|
|
1108
|
+
var _hoisted_1$17 = {
|
|
1037
1109
|
key: 0,
|
|
1038
1110
|
class: "border-hair/70 border-b px-5 py-4"
|
|
1039
1111
|
};
|
|
1040
|
-
var _hoisted_2$
|
|
1041
|
-
var _hoisted_3$
|
|
1112
|
+
var _hoisted_2$14 = { class: "px-5 py-4" };
|
|
1113
|
+
var _hoisted_3$10 = {
|
|
1042
1114
|
key: 1,
|
|
1043
1115
|
class: "border-hair/70 bg-muted/30 border-t px-5 py-3.5"
|
|
1044
1116
|
};
|
|
@@ -1069,9 +1141,9 @@ var BaseCard_default = /* @__PURE__ */ defineComponent({
|
|
|
1069
1141
|
return (_ctx, _cache) => {
|
|
1070
1142
|
return openBlock(), createBlock(resolveDynamicComponent(__props.as), { class: normalizeClass(["border-hair bg-surface rounded-card border", __props.interactive ? "transition-[transform,box-shadow] duration-300 ease-out hover:-translate-y-0.5 hover:shadow-lg active:translate-y-0 active:shadow-sm" : ""]) }, {
|
|
1071
1143
|
default: withCtx(() => [
|
|
1072
|
-
_ctx.$slots.head ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
1073
|
-
createElementVNode("div", _hoisted_2$
|
|
1074
|
-
_ctx.$slots.foot ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
1144
|
+
_ctx.$slots.head ? (openBlock(), createElementBlock("div", _hoisted_1$17, [renderSlot(_ctx.$slots, "head")])) : createCommentVNode("", true),
|
|
1145
|
+
createElementVNode("div", _hoisted_2$14, [renderSlot(_ctx.$slots, "default")]),
|
|
1146
|
+
_ctx.$slots.foot ? (openBlock(), createElementBlock("div", _hoisted_3$10, [renderSlot(_ctx.$slots, "foot")])) : createCommentVNode("", true)
|
|
1075
1147
|
]),
|
|
1076
1148
|
_: 3
|
|
1077
1149
|
}, 8, ["class"]);
|
|
@@ -1079,6 +1151,259 @@ var BaseCard_default = /* @__PURE__ */ defineComponent({
|
|
|
1079
1151
|
}
|
|
1080
1152
|
});
|
|
1081
1153
|
//#endregion
|
|
1154
|
+
//#region src/components/BaseCheckbox.vue?vue&type=script&setup=true&lang.ts
|
|
1155
|
+
var _hoisted_1$16 = { class: "flex flex-col gap-1.5" };
|
|
1156
|
+
var _hoisted_2$13 = ["for"];
|
|
1157
|
+
var _hoisted_3$9 = [
|
|
1158
|
+
"id",
|
|
1159
|
+
"disabled",
|
|
1160
|
+
"aria-invalid",
|
|
1161
|
+
"aria-describedby"
|
|
1162
|
+
];
|
|
1163
|
+
var _hoisted_4$7 = { class: "text-ink text-sm" };
|
|
1164
|
+
//#endregion
|
|
1165
|
+
//#region src/components/BaseCheckbox.vue
|
|
1166
|
+
var BaseCheckbox_default = /* @__PURE__ */ defineComponent({
|
|
1167
|
+
__name: "BaseCheckbox",
|
|
1168
|
+
props: /*@__PURE__*/ mergeModels({
|
|
1169
|
+
label: {},
|
|
1170
|
+
error: { default: "" },
|
|
1171
|
+
hint: { default: "" },
|
|
1172
|
+
disabled: {
|
|
1173
|
+
type: Boolean,
|
|
1174
|
+
default: false
|
|
1175
|
+
}
|
|
1176
|
+
}, {
|
|
1177
|
+
"modelValue": {
|
|
1178
|
+
type: Boolean,
|
|
1179
|
+
default: false
|
|
1180
|
+
},
|
|
1181
|
+
"modelModifiers": {}
|
|
1182
|
+
}),
|
|
1183
|
+
emits: ["update:modelValue"],
|
|
1184
|
+
setup(__props) {
|
|
1185
|
+
const model = useModel(__props, "modelValue");
|
|
1186
|
+
const id = useId();
|
|
1187
|
+
const errorId = `${id}-error`;
|
|
1188
|
+
const hintId = `${id}-hint`;
|
|
1189
|
+
const describedBy = computed(() => {
|
|
1190
|
+
if (__props.error) return errorId;
|
|
1191
|
+
if (__props.hint) return hintId;
|
|
1192
|
+
});
|
|
1193
|
+
return (_ctx, _cache) => {
|
|
1194
|
+
return openBlock(), createElementBlock("div", _hoisted_1$16, [createElementVNode("label", {
|
|
1195
|
+
for: unref(id),
|
|
1196
|
+
class: normalizeClass(["flex items-center gap-3", __props.disabled ? "opacity-50" : "cursor-pointer"])
|
|
1197
|
+
}, [withDirectives(createElementVNode("input", {
|
|
1198
|
+
id: unref(id),
|
|
1199
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
1200
|
+
type: "checkbox",
|
|
1201
|
+
disabled: __props.disabled,
|
|
1202
|
+
"aria-invalid": Boolean(__props.error),
|
|
1203
|
+
"aria-describedby": describedBy.value,
|
|
1204
|
+
class: "accent-primary focus-visible:outline-primary size-4 shrink-0 focus-visible:outline-2 focus-visible:outline-offset-2"
|
|
1205
|
+
}, null, 8, _hoisted_3$9), [[vModelCheckbox, model.value]]), createElementVNode("span", _hoisted_4$7, toDisplayString(__props.label), 1)], 10, _hoisted_2$13), __props.error ? (openBlock(), createElementBlock("p", {
|
|
1206
|
+
key: 0,
|
|
1207
|
+
id: errorId,
|
|
1208
|
+
class: "text-negative text-xs"
|
|
1209
|
+
}, toDisplayString(__props.error), 1)) : __props.hint ? (openBlock(), createElementBlock("p", {
|
|
1210
|
+
key: 1,
|
|
1211
|
+
id: hintId,
|
|
1212
|
+
class: "text-ink-soft text-xs"
|
|
1213
|
+
}, toDisplayString(__props.hint), 1)) : createCommentVNode("", true)]);
|
|
1214
|
+
};
|
|
1215
|
+
}
|
|
1216
|
+
});
|
|
1217
|
+
//#endregion
|
|
1218
|
+
//#region src/components/BaseRadioGroup.vue?vue&type=script&setup=true&lang.ts
|
|
1219
|
+
var _hoisted_1$15 = ["aria-describedby"];
|
|
1220
|
+
var _hoisted_2$12 = [
|
|
1221
|
+
"name",
|
|
1222
|
+
"value",
|
|
1223
|
+
"disabled"
|
|
1224
|
+
];
|
|
1225
|
+
var _hoisted_3$8 = { class: "text-ink text-sm" };
|
|
1226
|
+
//#endregion
|
|
1227
|
+
//#region src/components/BaseRadioGroup.vue
|
|
1228
|
+
var BaseRadioGroup_default = /* @__PURE__ */ defineComponent({
|
|
1229
|
+
__name: "BaseRadioGroup",
|
|
1230
|
+
props: /*@__PURE__*/ mergeModels({
|
|
1231
|
+
legend: {},
|
|
1232
|
+
options: {},
|
|
1233
|
+
error: { default: "" },
|
|
1234
|
+
hint: { default: "" },
|
|
1235
|
+
legendHidden: {
|
|
1236
|
+
type: Boolean,
|
|
1237
|
+
default: false
|
|
1238
|
+
}
|
|
1239
|
+
}, {
|
|
1240
|
+
"modelValue": {},
|
|
1241
|
+
"modelModifiers": {}
|
|
1242
|
+
}),
|
|
1243
|
+
emits: ["update:modelValue"],
|
|
1244
|
+
setup(__props) {
|
|
1245
|
+
const model = useModel(__props, "modelValue");
|
|
1246
|
+
const id = useId();
|
|
1247
|
+
const errorId = `${id}-error`;
|
|
1248
|
+
const hintId = `${id}-hint`;
|
|
1249
|
+
const describedBy = computed(() => {
|
|
1250
|
+
if (__props.error) return errorId;
|
|
1251
|
+
if (__props.hint) return hintId;
|
|
1252
|
+
});
|
|
1253
|
+
return (_ctx, _cache) => {
|
|
1254
|
+
return openBlock(), createElementBlock("fieldset", {
|
|
1255
|
+
class: "flex flex-col gap-1.5",
|
|
1256
|
+
"aria-describedby": describedBy.value
|
|
1257
|
+
}, [
|
|
1258
|
+
createElementVNode("legend", { class: normalizeClass(["text-ink mb-1.5 text-sm font-medium", __props.legendHidden ? "sr-only" : ""]) }, toDisplayString(__props.legend), 3),
|
|
1259
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option) => {
|
|
1260
|
+
return openBlock(), createElementBlock("label", {
|
|
1261
|
+
key: option.value,
|
|
1262
|
+
class: normalizeClass(["flex items-center gap-3", option.disabled ? "opacity-50" : "cursor-pointer"])
|
|
1263
|
+
}, [withDirectives(createElementVNode("input", {
|
|
1264
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
1265
|
+
type: "radio",
|
|
1266
|
+
name: unref(id),
|
|
1267
|
+
value: option.value,
|
|
1268
|
+
disabled: option.disabled,
|
|
1269
|
+
class: "accent-primary focus-visible:outline-primary size-4 shrink-0 focus-visible:outline-2 focus-visible:outline-offset-2"
|
|
1270
|
+
}, null, 8, _hoisted_2$12), [[vModelRadio, model.value]]), createElementVNode("span", _hoisted_3$8, toDisplayString(option.label), 1)], 2);
|
|
1271
|
+
}), 128)),
|
|
1272
|
+
__props.error ? (openBlock(), createElementBlock("p", {
|
|
1273
|
+
key: 0,
|
|
1274
|
+
id: errorId,
|
|
1275
|
+
class: "text-negative text-xs"
|
|
1276
|
+
}, toDisplayString(__props.error), 1)) : __props.hint ? (openBlock(), createElementBlock("p", {
|
|
1277
|
+
key: 1,
|
|
1278
|
+
id: hintId,
|
|
1279
|
+
class: "text-ink-soft text-xs"
|
|
1280
|
+
}, toDisplayString(__props.hint), 1)) : createCommentVNode("", true)
|
|
1281
|
+
], 8, _hoisted_1$15);
|
|
1282
|
+
};
|
|
1283
|
+
}
|
|
1284
|
+
});
|
|
1285
|
+
//#endregion
|
|
1286
|
+
//#region src/components/BaseSelect.vue?vue&type=script&setup=true&lang.ts
|
|
1287
|
+
var _hoisted_1$14 = { class: "relative" };
|
|
1288
|
+
var _hoisted_2$11 = [
|
|
1289
|
+
"id",
|
|
1290
|
+
"aria-invalid",
|
|
1291
|
+
"aria-describedby"
|
|
1292
|
+
];
|
|
1293
|
+
var _hoisted_3$7 = {
|
|
1294
|
+
key: 0,
|
|
1295
|
+
value: "",
|
|
1296
|
+
disabled: ""
|
|
1297
|
+
};
|
|
1298
|
+
var _hoisted_4$6 = ["value", "disabled"];
|
|
1299
|
+
//#endregion
|
|
1300
|
+
//#region src/components/BaseSelect.vue
|
|
1301
|
+
var BaseSelect_default = /* @__PURE__ */ defineComponent({
|
|
1302
|
+
__name: "BaseSelect",
|
|
1303
|
+
props: /*@__PURE__*/ mergeModels({
|
|
1304
|
+
label: {},
|
|
1305
|
+
options: {},
|
|
1306
|
+
error: { default: "" },
|
|
1307
|
+
hint: { default: "" },
|
|
1308
|
+
labelHidden: {
|
|
1309
|
+
type: Boolean,
|
|
1310
|
+
default: false
|
|
1311
|
+
},
|
|
1312
|
+
placeholder: { default: "" }
|
|
1313
|
+
}, {
|
|
1314
|
+
"modelValue": {},
|
|
1315
|
+
"modelModifiers": {}
|
|
1316
|
+
}),
|
|
1317
|
+
emits: ["update:modelValue"],
|
|
1318
|
+
setup(__props) {
|
|
1319
|
+
const model = useModel(__props, "modelValue");
|
|
1320
|
+
return (_ctx, _cache) => {
|
|
1321
|
+
return openBlock(), createBlock(FormField_default, {
|
|
1322
|
+
label: __props.label,
|
|
1323
|
+
error: __props.error,
|
|
1324
|
+
hint: __props.hint,
|
|
1325
|
+
"label-hidden": __props.labelHidden
|
|
1326
|
+
}, {
|
|
1327
|
+
default: withCtx(({ id, describedBy, invalid }) => [createElementVNode("div", _hoisted_1$14, [withDirectives(createElementVNode("select", {
|
|
1328
|
+
id,
|
|
1329
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
1330
|
+
"aria-invalid": invalid,
|
|
1331
|
+
"aria-describedby": describedBy,
|
|
1332
|
+
class: normalizeClass(["border-hair bg-surface text-ink rounded-card focus-visible:outline-primary h-11 w-full appearance-none border py-0 pr-10 pl-3 focus-visible:outline-2 focus-visible:outline-offset-1", invalid ? "border-negative" : ""])
|
|
1333
|
+
}, [__props.placeholder ? (openBlock(), createElementBlock("option", _hoisted_3$7, toDisplayString(__props.placeholder), 1)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option) => {
|
|
1334
|
+
return openBlock(), createElementBlock("option", {
|
|
1335
|
+
key: option.value,
|
|
1336
|
+
value: option.value,
|
|
1337
|
+
disabled: option.disabled
|
|
1338
|
+
}, toDisplayString(option.label), 9, _hoisted_4$6);
|
|
1339
|
+
}), 128))], 10, _hoisted_2$11), [[vModelSelect, model.value]]), createVNode(unref(ChevronDown), {
|
|
1340
|
+
class: "text-ink-soft pointer-events-none absolute top-1/2 right-3 size-4 -translate-y-1/2",
|
|
1341
|
+
"aria-hidden": "true"
|
|
1342
|
+
})])]),
|
|
1343
|
+
_: 1
|
|
1344
|
+
}, 8, [
|
|
1345
|
+
"label",
|
|
1346
|
+
"error",
|
|
1347
|
+
"hint",
|
|
1348
|
+
"label-hidden"
|
|
1349
|
+
]);
|
|
1350
|
+
};
|
|
1351
|
+
}
|
|
1352
|
+
});
|
|
1353
|
+
//#endregion
|
|
1354
|
+
//#region src/components/BaseTextarea.vue?vue&type=script&setup=true&lang.ts
|
|
1355
|
+
var _hoisted_1$13 = [
|
|
1356
|
+
"id",
|
|
1357
|
+
"rows",
|
|
1358
|
+
"aria-invalid",
|
|
1359
|
+
"aria-describedby"
|
|
1360
|
+
];
|
|
1361
|
+
//#endregion
|
|
1362
|
+
//#region src/components/BaseTextarea.vue
|
|
1363
|
+
var BaseTextarea_default = /* @__PURE__ */ defineComponent({
|
|
1364
|
+
inheritAttrs: false,
|
|
1365
|
+
__name: "BaseTextarea",
|
|
1366
|
+
props: /*@__PURE__*/ mergeModels({
|
|
1367
|
+
label: {},
|
|
1368
|
+
error: { default: "" },
|
|
1369
|
+
hint: { default: "" },
|
|
1370
|
+
labelHidden: {
|
|
1371
|
+
type: Boolean,
|
|
1372
|
+
default: false
|
|
1373
|
+
},
|
|
1374
|
+
rows: { default: 4 }
|
|
1375
|
+
}, {
|
|
1376
|
+
"modelValue": {},
|
|
1377
|
+
"modelModifiers": {}
|
|
1378
|
+
}),
|
|
1379
|
+
emits: ["update:modelValue"],
|
|
1380
|
+
setup(__props) {
|
|
1381
|
+
const model = useModel(__props, "modelValue");
|
|
1382
|
+
return (_ctx, _cache) => {
|
|
1383
|
+
return openBlock(), createBlock(FormField_default, {
|
|
1384
|
+
label: __props.label,
|
|
1385
|
+
error: __props.error,
|
|
1386
|
+
hint: __props.hint,
|
|
1387
|
+
"label-hidden": __props.labelHidden
|
|
1388
|
+
}, {
|
|
1389
|
+
default: withCtx(({ id, describedBy, invalid }) => [withDirectives(createElementVNode("textarea", mergeProps({
|
|
1390
|
+
id,
|
|
1391
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
1392
|
+
rows: __props.rows,
|
|
1393
|
+
"aria-invalid": invalid,
|
|
1394
|
+
"aria-describedby": describedBy
|
|
1395
|
+
}, _ctx.$attrs, { class: ["border-hair bg-surface text-ink rounded-card focus-visible:outline-primary resize-y border px-3 py-2 leading-relaxed focus-visible:outline-2 focus-visible:outline-offset-1", invalid ? "border-negative" : ""] }), null, 16, _hoisted_1$13), [[vModelText, model.value]])]),
|
|
1396
|
+
_: 1
|
|
1397
|
+
}, 8, [
|
|
1398
|
+
"label",
|
|
1399
|
+
"error",
|
|
1400
|
+
"hint",
|
|
1401
|
+
"label-hidden"
|
|
1402
|
+
]);
|
|
1403
|
+
};
|
|
1404
|
+
}
|
|
1405
|
+
});
|
|
1406
|
+
//#endregion
|
|
1082
1407
|
//#region src/components/EmptyState.vue?vue&type=script&setup=true&lang.ts
|
|
1083
1408
|
var _hoisted_1$12 = { class: "flex flex-col items-center gap-3 px-6 py-10 text-center" };
|
|
1084
1409
|
var _hoisted_2$10 = {
|
|
@@ -1799,8 +2124,8 @@ function createI18nRuntime(options) {
|
|
|
1799
2124
|
*
|
|
1800
2125
|
* The fallback keeps `vitest` and `vite dev` honest, where no define runs.
|
|
1801
2126
|
*/
|
|
1802
|
-
var VERSION = "0.
|
|
2127
|
+
var VERSION = "0.5.0";
|
|
1803
2128
|
//#endregion
|
|
1804
|
-
export { AppError, BaseAlert_default as BaseAlert, BaseBadge_default as BaseBadge, BaseButton_default as BaseButton, BaseCard_default as BaseCard, BaseInput_default as BaseInput, BaseSheet_default as BaseSheet, EmptyState_default as EmptyState, ErrorBoundary_default as ErrorBoundary, GoogleButton_default as GoogleButton, LocaleLinks_default as LocaleLinks, PageContainer_default as PageContainer, PageHeader_default as PageHeader, PriceCard_default as PriceCard, ProgressBar_default as ProgressBar, SectionHeading_default as SectionHeading, SegmentedControl_default as SegmentedControl, SettingsGroup_default as SettingsGroup, SettingsRow_default as SettingsRow, SkeletonList_default as SkeletonList, StatCard_default as StatCard, TabBar_default as TabBar, ToneDot_default as ToneDot, VERSION, addDays, applyTheme, createI18nRuntime, downloadJson, eachDayOfYear, formatDate, fromDateKey, isApplePortable, isInstalled, isThemePreference, lastNDays, leadingBlanks, needsIosInstall, readStoredTheme, registerErrorMapper, relativeDayLabel, safeRedirect, setFormatLocale, setThemeStorageKey, startOfWeek, tapFeedback, toAppError, toDateKey, todayKey, useDebouncedCallback, useDragScroll, useMediaQuery, useOnline, useTheme, useToday, useVisualViewport };
|
|
2129
|
+
export { AppError, BaseAlert_default as BaseAlert, BaseBadge_default as BaseBadge, BaseButton_default as BaseButton, BaseCard_default as BaseCard, BaseCheckbox_default as BaseCheckbox, BaseInput_default as BaseInput, BaseRadioGroup_default as BaseRadioGroup, BaseSelect_default as BaseSelect, BaseSheet_default as BaseSheet, BaseTextarea_default as BaseTextarea, EmptyState_default as EmptyState, ErrorBoundary_default as ErrorBoundary, FormField_default as FormField, GoogleButton_default as GoogleButton, LocaleLinks_default as LocaleLinks, PageContainer_default as PageContainer, PageHeader_default as PageHeader, PriceCard_default as PriceCard, ProgressBar_default as ProgressBar, SectionHeading_default as SectionHeading, SegmentedControl_default as SegmentedControl, SettingsGroup_default as SettingsGroup, SettingsRow_default as SettingsRow, SkeletonList_default as SkeletonList, StatCard_default as StatCard, TabBar_default as TabBar, ToneDot_default as ToneDot, VERSION, addDays, applyTheme, createI18nRuntime, downloadJson, eachDayOfYear, formatDate, fromDateKey, isApplePortable, isInstalled, isThemePreference, lastNDays, leadingBlanks, needsIosInstall, readStoredTheme, registerErrorMapper, relativeDayLabel, safeRedirect, setFormatLocale, setThemeStorageKey, startOfWeek, tapFeedback, toAppError, toDateKey, todayKey, useDebouncedCallback, useDragScroll, useMediaQuery, useOnline, useTheme, useToday, useVisualViewport };
|
|
1805
2130
|
|
|
1806
2131
|
//# sourceMappingURL=index.js.map
|