rei-kit 0.11.3 → 0.12.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.
|
@@ -6,6 +6,13 @@
|
|
|
6
6
|
* so a card on one screen had a heavier border than a card on the next and
|
|
7
7
|
* nobody could say why.
|
|
8
8
|
*
|
|
9
|
+
* With no head and no foot there is no wrapper div: the padding lands on the
|
|
10
|
+
* card itself and the card *is* the element. That matters more than a saved
|
|
11
|
+
* node — most cards in the apps lay their contents out (`flex items-center
|
|
12
|
+
* gap-4`, `flex flex-col gap-3`), and with a wrapper in the way those classes
|
|
13
|
+
* reach the border and not the content, so the app has to add back the div
|
|
14
|
+
* this component exists to remove. One that makes you do that is one you skip.
|
|
15
|
+
*
|
|
9
16
|
* `interactive` is for a card that is a link or a button: it adds the lift and
|
|
10
17
|
* the press, and it is opt-in because a card holding a form should not move
|
|
11
18
|
* when the pointer crosses it.
|
|
@@ -13,14 +20,30 @@
|
|
|
13
20
|
type __VLS_Props = {
|
|
14
21
|
interactive?: boolean | undefined;
|
|
15
22
|
as?: string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* How much room the card gives its contents.
|
|
25
|
+
*
|
|
26
|
+
* This component shipped with `px-5 py-4` baked in and was then used by
|
|
27
|
+
* nobody, across three apps and thirty-five hand-written card surfaces —
|
|
28
|
+
* which used `p-3` six times, `p-4` six times, `p-5` five times and `p-1`
|
|
29
|
+
* four times, and not once the pair this insisted on. A card that fixes its
|
|
30
|
+
* padding cannot be reached for, which is the same mistake `PageContainer`
|
|
31
|
+
* made with its width and `size="sm"` made with its height.
|
|
32
|
+
*
|
|
33
|
+
* `none` is for a card that holds a list: the rows own the padding, and the
|
|
34
|
+
* dividers have to reach the border.
|
|
35
|
+
*/
|
|
36
|
+
padding?: 'none' | 'sm' | 'md' | 'lg' | undefined;
|
|
16
37
|
};
|
|
17
|
-
declare var __VLS_8: {}, __VLS_10: {}, __VLS_12: {};
|
|
38
|
+
declare var __VLS_8: {}, __VLS_10: {}, __VLS_12: {}, __VLS_14: {};
|
|
18
39
|
type __VLS_Slots = {} & {
|
|
19
40
|
head?: (props: typeof __VLS_8) => any;
|
|
20
41
|
} & {
|
|
21
42
|
default?: (props: typeof __VLS_10) => any;
|
|
22
43
|
} & {
|
|
23
|
-
|
|
44
|
+
default?: (props: typeof __VLS_12) => any;
|
|
45
|
+
} & {
|
|
46
|
+
foot?: (props: typeof __VLS_14) => any;
|
|
24
47
|
};
|
|
25
48
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
26
49
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -10,6 +10,13 @@
|
|
|
10
10
|
type __VLS_Props = {
|
|
11
11
|
value: number;
|
|
12
12
|
max?: number | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* How thick the track is. `sm` for a bar under a step counter, where it is a
|
|
15
|
+
* hint rather than the subject; `lg` where the progress is the point.
|
|
16
|
+
*
|
|
17
|
+
* It shipped at one thickness and the two bars anybody wanted were `h-1`.
|
|
18
|
+
*/
|
|
19
|
+
size?: 'sm' | 'md' | 'lg' | undefined;
|
|
13
20
|
/** For screen readers. Without it this is a rectangle that means nothing. */
|
|
14
21
|
label?: string | undefined;
|
|
15
22
|
};
|
package/dist/index.js
CHANGED
|
@@ -838,9 +838,9 @@ function useToast() {
|
|
|
838
838
|
}
|
|
839
839
|
//#endregion
|
|
840
840
|
//#region src/components/BaseAlert.vue?vue&type=script&setup=true&lang.ts
|
|
841
|
-
var _hoisted_1$
|
|
842
|
-
var _hoisted_2$
|
|
843
|
-
var _hoisted_3$
|
|
841
|
+
var _hoisted_1$22 = ["role", "aria-live"];
|
|
842
|
+
var _hoisted_2$16 = { class: "min-w-0 flex-1" };
|
|
843
|
+
var _hoisted_3$11 = {
|
|
844
844
|
key: 0,
|
|
845
845
|
class: "text-ink font-semibold"
|
|
846
846
|
};
|
|
@@ -881,9 +881,9 @@ var BaseAlert_default = /* @__PURE__ */ defineComponent({
|
|
|
881
881
|
class: normalizeClass(["mt-px grid size-6 shrink-0 place-items-center rounded-full text-xs font-semibold", mark.value]),
|
|
882
882
|
"aria-hidden": "true"
|
|
883
883
|
}, [renderSlot(_ctx.$slots, "mark")], 2)) : createCommentVNode("", true),
|
|
884
|
-
createElementVNode("div", _hoisted_2$
|
|
884
|
+
createElementVNode("div", _hoisted_2$16, [_ctx.$slots.title ? (openBlock(), createElementBlock("p", _hoisted_3$11, [renderSlot(_ctx.$slots, "title")])) : createCommentVNode("", true), createElementVNode("div", { class: normalizeClass(_ctx.$slots.title ? "mt-1" : "") }, [renderSlot(_ctx.$slots, "default")], 2)]),
|
|
885
885
|
renderSlot(_ctx.$slots, "action")
|
|
886
|
-
], 10, _hoisted_1$
|
|
886
|
+
], 10, _hoisted_1$22);
|
|
887
887
|
};
|
|
888
888
|
}
|
|
889
889
|
});
|
|
@@ -908,7 +908,7 @@ var BaseBadge_default = /* @__PURE__ */ defineComponent({
|
|
|
908
908
|
});
|
|
909
909
|
//#endregion
|
|
910
910
|
//#region src/components/BaseButton.vue?vue&type=script&setup=true&lang.ts
|
|
911
|
-
var _hoisted_1$
|
|
911
|
+
var _hoisted_1$21 = {
|
|
912
912
|
key: 0,
|
|
913
913
|
class: "size-4 animate-spin rounded-full border-2 border-current border-t-transparent",
|
|
914
914
|
"aria-hidden": "true"
|
|
@@ -1038,7 +1038,7 @@ var BaseButton_default = /* @__PURE__ */ defineComponent({
|
|
|
1038
1038
|
__props.block ? "w-full" : ""
|
|
1039
1039
|
]]
|
|
1040
1040
|
}), {
|
|
1041
|
-
default: withCtx(() => [__props.loading ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
1041
|
+
default: withCtx(() => [__props.loading ? (openBlock(), createElementBlock("span", _hoisted_1$21)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default")]),
|
|
1042
1042
|
_: 3
|
|
1043
1043
|
}, 16, [
|
|
1044
1044
|
"type",
|
|
@@ -1053,7 +1053,7 @@ var BaseButton_default = /* @__PURE__ */ defineComponent({
|
|
|
1053
1053
|
});
|
|
1054
1054
|
//#endregion
|
|
1055
1055
|
//#region src/components/FormField.vue?vue&type=script&setup=true&lang.ts
|
|
1056
|
-
var _hoisted_1$
|
|
1056
|
+
var _hoisted_1$20 = ["for"];
|
|
1057
1057
|
//#endregion
|
|
1058
1058
|
//#region src/components/FormField.vue
|
|
1059
1059
|
var FormField_default = /* @__PURE__ */ defineComponent({
|
|
@@ -1081,7 +1081,7 @@ var FormField_default = /* @__PURE__ */ defineComponent({
|
|
|
1081
1081
|
createElementVNode("label", {
|
|
1082
1082
|
for: unref(id),
|
|
1083
1083
|
class: normalizeClass(["font-medium", [__props.labelHidden ? "sr-only" : "", __props.size === "sm" ? "text-ink-soft text-xs" : "text-ink text-sm"]])
|
|
1084
|
-
}, toDisplayString(__props.label), 11, _hoisted_1$
|
|
1084
|
+
}, toDisplayString(__props.label), 11, _hoisted_1$20),
|
|
1085
1085
|
renderSlot(_ctx.$slots, "default", {
|
|
1086
1086
|
id: unref(id),
|
|
1087
1087
|
describedBy: describedBy.value,
|
|
@@ -1103,7 +1103,7 @@ var FormField_default = /* @__PURE__ */ defineComponent({
|
|
|
1103
1103
|
});
|
|
1104
1104
|
//#endregion
|
|
1105
1105
|
//#region src/components/BaseInput.vue?vue&type=script&setup=true&lang.ts
|
|
1106
|
-
var _hoisted_1$
|
|
1106
|
+
var _hoisted_1$19 = [
|
|
1107
1107
|
"id",
|
|
1108
1108
|
"type",
|
|
1109
1109
|
"aria-invalid",
|
|
@@ -1151,7 +1151,7 @@ var BaseInput_default = /* @__PURE__ */ defineComponent({
|
|
|
1151
1151
|
__props.variant === "unstyled" ? "" : "border-hair bg-surface text-ink rounded-card focus-visible:outline-primary border px-3 focus-visible:outline-2 focus-visible:outline-offset-1",
|
|
1152
1152
|
__props.variant === "unstyled" ? "text-base" : CONTROL_CLASS,
|
|
1153
1153
|
__props.variant !== "unstyled" && invalid ? "border-negative" : ""
|
|
1154
|
-
] }), null, 16, _hoisted_1$
|
|
1154
|
+
] }), null, 16, _hoisted_1$19), [[vModelDynamic, model.value]])]),
|
|
1155
1155
|
_: 1
|
|
1156
1156
|
}, 8, [
|
|
1157
1157
|
"label",
|
|
@@ -1165,9 +1165,9 @@ var BaseInput_default = /* @__PURE__ */ defineComponent({
|
|
|
1165
1165
|
});
|
|
1166
1166
|
//#endregion
|
|
1167
1167
|
//#region src/components/BaseSheet.vue?vue&type=script&setup=true&lang.ts
|
|
1168
|
-
var _hoisted_1$
|
|
1169
|
-
var _hoisted_2$
|
|
1170
|
-
var _hoisted_3$
|
|
1168
|
+
var _hoisted_1$18 = { class: "shell-frame md:rounded-shell relative flex max-h-full flex-col justify-end overflow-hidden" };
|
|
1169
|
+
var _hoisted_2$15 = ["aria-label"];
|
|
1170
|
+
var _hoisted_3$10 = { class: "flex shrink-0 items-start gap-3 px-6 pt-4 pb-5" };
|
|
1171
1171
|
var _hoisted_4$7 = { class: "min-w-0 flex-1" };
|
|
1172
1172
|
var _hoisted_5$4 = { class: "text-ink text-xl leading-tight font-semibold" };
|
|
1173
1173
|
var _hoisted_6$2 = {
|
|
@@ -1245,7 +1245,7 @@ var BaseSheet_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
1245
1245
|
key: 0,
|
|
1246
1246
|
class: "fixed inset-x-0 top-0 bottom-0 z-50 flex items-center justify-center",
|
|
1247
1247
|
style: normalizeStyle(viewportStyle.value)
|
|
1248
|
-
}, [createElementVNode("div", _hoisted_1$
|
|
1248
|
+
}, [createElementVNode("div", _hoisted_1$18, [createElementVNode("div", {
|
|
1249
1249
|
class: "bg-ink/45 absolute inset-0 backdrop-blur-[2px]",
|
|
1250
1250
|
onClick: close
|
|
1251
1251
|
}), createElementVNode("section", {
|
|
@@ -1261,7 +1261,7 @@ var BaseSheet_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
1261
1261
|
class: "flex shrink-0 justify-center pt-3",
|
|
1262
1262
|
"aria-hidden": "true"
|
|
1263
1263
|
}, [createElementVNode("span", { class: "bg-hair h-1.5 w-10 rounded-full" })], -1)),
|
|
1264
|
-
createElementVNode("header", _hoisted_3$
|
|
1264
|
+
createElementVNode("header", _hoisted_3$10, [createElementVNode("div", _hoisted_4$7, [createElementVNode("h2", _hoisted_5$4, toDisplayString(__props.title), 1), __props.subtitle ? (openBlock(), createElementBlock("p", _hoisted_6$2, toDisplayString(__props.subtitle), 1)) : createCommentVNode("", true)]), createVNode(BaseButton_default, {
|
|
1265
1265
|
variant: "unstyled",
|
|
1266
1266
|
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",
|
|
1267
1267
|
"aria-label": __props.closeLabel,
|
|
@@ -1271,7 +1271,7 @@ var BaseSheet_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
1271
1271
|
_: 1
|
|
1272
1272
|
}, 8, ["aria-label"])]),
|
|
1273
1273
|
createElementVNode("div", _hoisted_7$2, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])
|
|
1274
|
-
], 8, _hoisted_2$
|
|
1274
|
+
], 8, _hoisted_2$15)])], 4)) : createCommentVNode("", true)]),
|
|
1275
1275
|
_: 3
|
|
1276
1276
|
})]);
|
|
1277
1277
|
};
|
|
@@ -1288,17 +1288,6 @@ var _plugin_vue_export_helper_default = (sfc, props) => {
|
|
|
1288
1288
|
//#region src/components/BaseSheet.vue
|
|
1289
1289
|
var BaseSheet_default = /*#__PURE__*/ _plugin_vue_export_helper_default(BaseSheet_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-51709579"]]);
|
|
1290
1290
|
//#endregion
|
|
1291
|
-
//#region src/components/BaseCard.vue?vue&type=script&setup=true&lang.ts
|
|
1292
|
-
var _hoisted_1$18 = {
|
|
1293
|
-
key: 0,
|
|
1294
|
-
class: "border-hair/70 border-b px-5 py-4"
|
|
1295
|
-
};
|
|
1296
|
-
var _hoisted_2$15 = { class: "px-5 py-4" };
|
|
1297
|
-
var _hoisted_3$10 = {
|
|
1298
|
-
key: 1,
|
|
1299
|
-
class: "border-hair/70 bg-muted/30 border-t px-5 py-3.5"
|
|
1300
|
-
};
|
|
1301
|
-
//#endregion
|
|
1302
1291
|
//#region src/components/BaseCard.vue
|
|
1303
1292
|
var BaseCard_default = /* @__PURE__ */ defineComponent({
|
|
1304
1293
|
__name: "BaseCard",
|
|
@@ -1307,7 +1296,8 @@ var BaseCard_default = /* @__PURE__ */ defineComponent({
|
|
|
1307
1296
|
type: Boolean,
|
|
1308
1297
|
default: false
|
|
1309
1298
|
},
|
|
1310
|
-
as: { default: "div" }
|
|
1299
|
+
as: { default: "div" },
|
|
1300
|
+
padding: { default: "md" }
|
|
1311
1301
|
},
|
|
1312
1302
|
setup(__props) {
|
|
1313
1303
|
/**
|
|
@@ -1318,16 +1308,44 @@ var BaseCard_default = /* @__PURE__ */ defineComponent({
|
|
|
1318
1308
|
* so a card on one screen had a heavier border than a card on the next and
|
|
1319
1309
|
* nobody could say why.
|
|
1320
1310
|
*
|
|
1311
|
+
* With no head and no foot there is no wrapper div: the padding lands on the
|
|
1312
|
+
* card itself and the card *is* the element. That matters more than a saved
|
|
1313
|
+
* node — most cards in the apps lay their contents out (`flex items-center
|
|
1314
|
+
* gap-4`, `flex flex-col gap-3`), and with a wrapper in the way those classes
|
|
1315
|
+
* reach the border and not the content, so the app has to add back the div
|
|
1316
|
+
* this component exists to remove. One that makes you do that is one you skip.
|
|
1317
|
+
*
|
|
1321
1318
|
* `interactive` is for a card that is a link or a button: it adds the lift and
|
|
1322
1319
|
* the press, and it is opt-in because a card holding a form should not move
|
|
1323
1320
|
* when the pointer crosses it.
|
|
1324
1321
|
*/
|
|
1322
|
+
const BODY = {
|
|
1323
|
+
none: "",
|
|
1324
|
+
sm: "p-3",
|
|
1325
|
+
md: "p-4",
|
|
1326
|
+
lg: "p-5"
|
|
1327
|
+
};
|
|
1328
|
+
const HEAD = {
|
|
1329
|
+
none: "",
|
|
1330
|
+
sm: "px-3 py-2.5",
|
|
1331
|
+
md: "px-4 py-3",
|
|
1332
|
+
lg: "px-5 py-4"
|
|
1333
|
+
};
|
|
1325
1334
|
return (_ctx, _cache) => {
|
|
1326
|
-
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" : ""]) }, {
|
|
1335
|
+
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" : "", _ctx.$slots.head || _ctx.$slots.foot ? "" : BODY[__props.padding]]]) }, {
|
|
1327
1336
|
default: withCtx(() => [
|
|
1328
|
-
_ctx.$slots.head ? (openBlock(), createElementBlock("div",
|
|
1329
|
-
|
|
1330
|
-
|
|
1337
|
+
_ctx.$slots.head ? (openBlock(), createElementBlock("div", {
|
|
1338
|
+
key: 0,
|
|
1339
|
+
class: normalizeClass(["border-hair/70 border-b", HEAD[__props.padding]])
|
|
1340
|
+
}, [renderSlot(_ctx.$slots, "head")], 2)) : createCommentVNode("", true),
|
|
1341
|
+
_ctx.$slots.head || _ctx.$slots.foot ? (openBlock(), createElementBlock("div", {
|
|
1342
|
+
key: 1,
|
|
1343
|
+
class: normalizeClass(BODY[__props.padding])
|
|
1344
|
+
}, [renderSlot(_ctx.$slots, "default")], 2)) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 2),
|
|
1345
|
+
_ctx.$slots.foot ? (openBlock(), createElementBlock("div", {
|
|
1346
|
+
key: 3,
|
|
1347
|
+
class: normalizeClass(["border-hair/70 bg-muted/30 border-t", HEAD[__props.padding]])
|
|
1348
|
+
}, [renderSlot(_ctx.$slots, "foot")], 2)) : createCommentVNode("", true)
|
|
1331
1349
|
]),
|
|
1332
1350
|
_: 3
|
|
1333
1351
|
}, 8, ["class"]);
|
|
@@ -1734,16 +1752,22 @@ var ProgressBar_default = /* @__PURE__ */ defineComponent({
|
|
|
1734
1752
|
props: {
|
|
1735
1753
|
value: {},
|
|
1736
1754
|
max: { default: 100 },
|
|
1755
|
+
size: { default: "md" },
|
|
1737
1756
|
label: {}
|
|
1738
1757
|
},
|
|
1739
1758
|
setup(__props) {
|
|
1759
|
+
const TRACK = {
|
|
1760
|
+
sm: "h-1",
|
|
1761
|
+
md: "h-1.5",
|
|
1762
|
+
lg: "h-2"
|
|
1763
|
+
};
|
|
1740
1764
|
const portion = computed(() => {
|
|
1741
1765
|
if (!Number.isFinite(__props.value) || !Number.isFinite(__props.max) || __props.max <= 0) return 0;
|
|
1742
1766
|
return Math.min(100, Math.max(0, __props.value / __props.max * 100));
|
|
1743
1767
|
});
|
|
1744
1768
|
return (_ctx, _cache) => {
|
|
1745
1769
|
return openBlock(), createElementBlock("div", {
|
|
1746
|
-
class: "bg-muted
|
|
1770
|
+
class: normalizeClass(["bg-muted w-full overflow-hidden rounded-full", TRACK[__props.size]]),
|
|
1747
1771
|
role: "progressbar",
|
|
1748
1772
|
"aria-valuenow": Math.round(portion.value),
|
|
1749
1773
|
"aria-valuemin": "0",
|
|
@@ -1752,7 +1776,7 @@ var ProgressBar_default = /* @__PURE__ */ defineComponent({
|
|
|
1752
1776
|
}, [createElementVNode("div", {
|
|
1753
1777
|
class: "bg-primary h-full rounded-full transition-[width] duration-700 ease-out",
|
|
1754
1778
|
style: normalizeStyle({ width: `${portion.value}%` })
|
|
1755
|
-
}, null, 4)],
|
|
1779
|
+
}, null, 4)], 10, _hoisted_1$11);
|
|
1756
1780
|
};
|
|
1757
1781
|
}
|
|
1758
1782
|
});
|
|
@@ -2413,7 +2437,7 @@ function createI18nRuntime(options) {
|
|
|
2413
2437
|
*
|
|
2414
2438
|
* The fallback keeps `vitest` and `vite dev` honest, where no define runs.
|
|
2415
2439
|
*/
|
|
2416
|
-
var VERSION = "0.
|
|
2440
|
+
var VERSION = "0.12.1";
|
|
2417
2441
|
//#endregion
|
|
2418
2442
|
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, ToastHost_default as ToastHost, 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, useToast, useToday, useVisualViewport };
|
|
2419
2443
|
|