rei-kit 0.11.3 → 0.12.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.
@@ -13,6 +13,20 @@
13
13
  type __VLS_Props = {
14
14
  interactive?: boolean | undefined;
15
15
  as?: string | undefined;
16
+ /**
17
+ * How much room the card gives its contents.
18
+ *
19
+ * This component shipped with `px-5 py-4` baked in and was then used by
20
+ * nobody, across three apps and thirty-five hand-written card surfaces —
21
+ * which used `p-3` six times, `p-4` six times, `p-5` five times and `p-1`
22
+ * four times, and not once the pair this insisted on. A card that fixes its
23
+ * padding cannot be reached for, which is the same mistake `PageContainer`
24
+ * made with its width and `size="sm"` made with its height.
25
+ *
26
+ * `none` is for a card that holds a list: the rows own the padding, and the
27
+ * dividers have to reach the border.
28
+ */
29
+ padding?: 'none' | 'sm' | 'md' | 'lg' | undefined;
16
30
  };
17
31
  declare var __VLS_8: {}, __VLS_10: {}, __VLS_12: {};
18
32
  type __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$23 = ["role", "aria-live"];
842
- var _hoisted_2$17 = { class: "min-w-0 flex-1" };
843
- var _hoisted_3$12 = {
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$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)]),
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$23);
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$22 = {
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$22)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default")]),
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$21 = ["for"];
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$21),
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$20 = [
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$20), [[vModelDynamic, model.value]])]),
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$19 = { class: "shell-frame md:rounded-shell relative flex max-h-full flex-col justify-end overflow-hidden" };
1169
- var _hoisted_2$16 = ["aria-label"];
1170
- var _hoisted_3$11 = { class: "flex shrink-0 items-start gap-3 px-6 pt-4 pb-5" };
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$19, [createElementVNode("div", {
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$11, [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, {
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$16)])], 4)) : createCommentVNode("", true)]),
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
  /**
@@ -1322,12 +1312,30 @@ var BaseCard_default = /* @__PURE__ */ defineComponent({
1322
1312
  * the press, and it is opt-in because a card holding a form should not move
1323
1313
  * when the pointer crosses it.
1324
1314
  */
1315
+ const BODY = {
1316
+ none: "",
1317
+ sm: "p-3",
1318
+ md: "p-4",
1319
+ lg: "p-5"
1320
+ };
1321
+ const HEAD = {
1322
+ none: "",
1323
+ sm: "px-3 py-2.5",
1324
+ md: "px-4 py-3",
1325
+ lg: "px-5 py-4"
1326
+ };
1325
1327
  return (_ctx, _cache) => {
1326
1328
  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" : ""]) }, {
1327
1329
  default: withCtx(() => [
1328
- _ctx.$slots.head ? (openBlock(), createElementBlock("div", _hoisted_1$18, [renderSlot(_ctx.$slots, "head")])) : createCommentVNode("", true),
1329
- createElementVNode("div", _hoisted_2$15, [renderSlot(_ctx.$slots, "default")]),
1330
- _ctx.$slots.foot ? (openBlock(), createElementBlock("div", _hoisted_3$10, [renderSlot(_ctx.$slots, "foot")])) : createCommentVNode("", true)
1330
+ _ctx.$slots.head ? (openBlock(), createElementBlock("div", {
1331
+ key: 0,
1332
+ class: normalizeClass(["border-hair/70 border-b", HEAD[__props.padding]])
1333
+ }, [renderSlot(_ctx.$slots, "head")], 2)) : createCommentVNode("", true),
1334
+ createElementVNode("div", { class: normalizeClass(BODY[__props.padding]) }, [renderSlot(_ctx.$slots, "default")], 2),
1335
+ _ctx.$slots.foot ? (openBlock(), createElementBlock("div", {
1336
+ key: 1,
1337
+ class: normalizeClass(["border-hair/70 bg-muted/30 border-t", HEAD[__props.padding]])
1338
+ }, [renderSlot(_ctx.$slots, "foot")], 2)) : createCommentVNode("", true)
1331
1339
  ]),
1332
1340
  _: 3
1333
1341
  }, 8, ["class"]);
@@ -1734,16 +1742,22 @@ var ProgressBar_default = /* @__PURE__ */ defineComponent({
1734
1742
  props: {
1735
1743
  value: {},
1736
1744
  max: { default: 100 },
1745
+ size: { default: "md" },
1737
1746
  label: {}
1738
1747
  },
1739
1748
  setup(__props) {
1749
+ const TRACK = {
1750
+ sm: "h-1",
1751
+ md: "h-1.5",
1752
+ lg: "h-2"
1753
+ };
1740
1754
  const portion = computed(() => {
1741
1755
  if (!Number.isFinite(__props.value) || !Number.isFinite(__props.max) || __props.max <= 0) return 0;
1742
1756
  return Math.min(100, Math.max(0, __props.value / __props.max * 100));
1743
1757
  });
1744
1758
  return (_ctx, _cache) => {
1745
1759
  return openBlock(), createElementBlock("div", {
1746
- class: "bg-muted h-1.5 w-full overflow-hidden rounded-full",
1760
+ class: normalizeClass(["bg-muted w-full overflow-hidden rounded-full", TRACK[__props.size]]),
1747
1761
  role: "progressbar",
1748
1762
  "aria-valuenow": Math.round(portion.value),
1749
1763
  "aria-valuemin": "0",
@@ -1752,7 +1766,7 @@ var ProgressBar_default = /* @__PURE__ */ defineComponent({
1752
1766
  }, [createElementVNode("div", {
1753
1767
  class: "bg-primary h-full rounded-full transition-[width] duration-700 ease-out",
1754
1768
  style: normalizeStyle({ width: `${portion.value}%` })
1755
- }, null, 4)], 8, _hoisted_1$11);
1769
+ }, null, 4)], 10, _hoisted_1$11);
1756
1770
  };
1757
1771
  }
1758
1772
  });
@@ -2413,7 +2427,7 @@ function createI18nRuntime(options) {
2413
2427
  *
2414
2428
  * The fallback keeps `vitest` and `vite dev` honest, where no define runs.
2415
2429
  */
2416
- var VERSION = "0.11.3";
2430
+ var VERSION = "0.12.0";
2417
2431
  //#endregion
2418
2432
  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
2433