rei-kit 0.11.2 → 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"
@@ -997,7 +997,8 @@ var BaseButton_default = /* @__PURE__ */ defineComponent({
997
997
  const PRESSED_CLASS = {
998
998
  ghost: "bg-primary text-white hover:bg-primary/90",
999
999
  quiet: "bg-primary text-white hover:bg-primary/90",
1000
- secondary: "bg-primary border-primary text-white hover:bg-primary/90"
1000
+ secondary: "bg-primary border-primary text-white hover:bg-primary/90",
1001
+ row: "w-full justify-start text-left bg-muted text-ink hover:bg-muted"
1001
1002
  };
1002
1003
  const surface = computed(() => {
1003
1004
  if (__props.pressed === true) return PRESSED_CLASS[__props.variant] ?? VARIANT_CLASS[__props.variant];
@@ -1037,7 +1038,7 @@ var BaseButton_default = /* @__PURE__ */ defineComponent({
1037
1038
  __props.block ? "w-full" : ""
1038
1039
  ]]
1039
1040
  }), {
1040
- 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")]),
1041
1042
  _: 3
1042
1043
  }, 16, [
1043
1044
  "type",
@@ -1052,7 +1053,7 @@ var BaseButton_default = /* @__PURE__ */ defineComponent({
1052
1053
  });
1053
1054
  //#endregion
1054
1055
  //#region src/components/FormField.vue?vue&type=script&setup=true&lang.ts
1055
- var _hoisted_1$21 = ["for"];
1056
+ var _hoisted_1$20 = ["for"];
1056
1057
  //#endregion
1057
1058
  //#region src/components/FormField.vue
1058
1059
  var FormField_default = /* @__PURE__ */ defineComponent({
@@ -1080,7 +1081,7 @@ var FormField_default = /* @__PURE__ */ defineComponent({
1080
1081
  createElementVNode("label", {
1081
1082
  for: unref(id),
1082
1083
  class: normalizeClass(["font-medium", [__props.labelHidden ? "sr-only" : "", __props.size === "sm" ? "text-ink-soft text-xs" : "text-ink text-sm"]])
1083
- }, toDisplayString(__props.label), 11, _hoisted_1$21),
1084
+ }, toDisplayString(__props.label), 11, _hoisted_1$20),
1084
1085
  renderSlot(_ctx.$slots, "default", {
1085
1086
  id: unref(id),
1086
1087
  describedBy: describedBy.value,
@@ -1102,7 +1103,7 @@ var FormField_default = /* @__PURE__ */ defineComponent({
1102
1103
  });
1103
1104
  //#endregion
1104
1105
  //#region src/components/BaseInput.vue?vue&type=script&setup=true&lang.ts
1105
- var _hoisted_1$20 = [
1106
+ var _hoisted_1$19 = [
1106
1107
  "id",
1107
1108
  "type",
1108
1109
  "aria-invalid",
@@ -1150,7 +1151,7 @@ var BaseInput_default = /* @__PURE__ */ defineComponent({
1150
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",
1151
1152
  __props.variant === "unstyled" ? "text-base" : CONTROL_CLASS,
1152
1153
  __props.variant !== "unstyled" && invalid ? "border-negative" : ""
1153
- ] }), null, 16, _hoisted_1$20), [[vModelDynamic, model.value]])]),
1154
+ ] }), null, 16, _hoisted_1$19), [[vModelDynamic, model.value]])]),
1154
1155
  _: 1
1155
1156
  }, 8, [
1156
1157
  "label",
@@ -1164,9 +1165,9 @@ var BaseInput_default = /* @__PURE__ */ defineComponent({
1164
1165
  });
1165
1166
  //#endregion
1166
1167
  //#region src/components/BaseSheet.vue?vue&type=script&setup=true&lang.ts
1167
- var _hoisted_1$19 = { class: "shell-frame md:rounded-shell relative flex max-h-full flex-col justify-end overflow-hidden" };
1168
- var _hoisted_2$16 = ["aria-label"];
1169
- 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" };
1170
1171
  var _hoisted_4$7 = { class: "min-w-0 flex-1" };
1171
1172
  var _hoisted_5$4 = { class: "text-ink text-xl leading-tight font-semibold" };
1172
1173
  var _hoisted_6$2 = {
@@ -1244,7 +1245,7 @@ var BaseSheet_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
1244
1245
  key: 0,
1245
1246
  class: "fixed inset-x-0 top-0 bottom-0 z-50 flex items-center justify-center",
1246
1247
  style: normalizeStyle(viewportStyle.value)
1247
- }, [createElementVNode("div", _hoisted_1$19, [createElementVNode("div", {
1248
+ }, [createElementVNode("div", _hoisted_1$18, [createElementVNode("div", {
1248
1249
  class: "bg-ink/45 absolute inset-0 backdrop-blur-[2px]",
1249
1250
  onClick: close
1250
1251
  }), createElementVNode("section", {
@@ -1260,7 +1261,7 @@ var BaseSheet_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
1260
1261
  class: "flex shrink-0 justify-center pt-3",
1261
1262
  "aria-hidden": "true"
1262
1263
  }, [createElementVNode("span", { class: "bg-hair h-1.5 w-10 rounded-full" })], -1)),
1263
- 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, {
1264
1265
  variant: "unstyled",
1265
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",
1266
1267
  "aria-label": __props.closeLabel,
@@ -1270,7 +1271,7 @@ var BaseSheet_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
1270
1271
  _: 1
1271
1272
  }, 8, ["aria-label"])]),
1272
1273
  createElementVNode("div", _hoisted_7$2, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])
1273
- ], 8, _hoisted_2$16)])], 4)) : createCommentVNode("", true)]),
1274
+ ], 8, _hoisted_2$15)])], 4)) : createCommentVNode("", true)]),
1274
1275
  _: 3
1275
1276
  })]);
1276
1277
  };
@@ -1287,17 +1288,6 @@ var _plugin_vue_export_helper_default = (sfc, props) => {
1287
1288
  //#region src/components/BaseSheet.vue
1288
1289
  var BaseSheet_default = /*#__PURE__*/ _plugin_vue_export_helper_default(BaseSheet_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-51709579"]]);
1289
1290
  //#endregion
1290
- //#region src/components/BaseCard.vue?vue&type=script&setup=true&lang.ts
1291
- var _hoisted_1$18 = {
1292
- key: 0,
1293
- class: "border-hair/70 border-b px-5 py-4"
1294
- };
1295
- var _hoisted_2$15 = { class: "px-5 py-4" };
1296
- var _hoisted_3$10 = {
1297
- key: 1,
1298
- class: "border-hair/70 bg-muted/30 border-t px-5 py-3.5"
1299
- };
1300
- //#endregion
1301
1291
  //#region src/components/BaseCard.vue
1302
1292
  var BaseCard_default = /* @__PURE__ */ defineComponent({
1303
1293
  __name: "BaseCard",
@@ -1306,7 +1296,8 @@ var BaseCard_default = /* @__PURE__ */ defineComponent({
1306
1296
  type: Boolean,
1307
1297
  default: false
1308
1298
  },
1309
- as: { default: "div" }
1299
+ as: { default: "div" },
1300
+ padding: { default: "md" }
1310
1301
  },
1311
1302
  setup(__props) {
1312
1303
  /**
@@ -1321,12 +1312,30 @@ var BaseCard_default = /* @__PURE__ */ defineComponent({
1321
1312
  * the press, and it is opt-in because a card holding a form should not move
1322
1313
  * when the pointer crosses it.
1323
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
+ };
1324
1327
  return (_ctx, _cache) => {
1325
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" : ""]) }, {
1326
1329
  default: withCtx(() => [
1327
- _ctx.$slots.head ? (openBlock(), createElementBlock("div", _hoisted_1$18, [renderSlot(_ctx.$slots, "head")])) : createCommentVNode("", true),
1328
- createElementVNode("div", _hoisted_2$15, [renderSlot(_ctx.$slots, "default")]),
1329
- _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)
1330
1339
  ]),
1331
1340
  _: 3
1332
1341
  }, 8, ["class"]);
@@ -1733,16 +1742,22 @@ var ProgressBar_default = /* @__PURE__ */ defineComponent({
1733
1742
  props: {
1734
1743
  value: {},
1735
1744
  max: { default: 100 },
1745
+ size: { default: "md" },
1736
1746
  label: {}
1737
1747
  },
1738
1748
  setup(__props) {
1749
+ const TRACK = {
1750
+ sm: "h-1",
1751
+ md: "h-1.5",
1752
+ lg: "h-2"
1753
+ };
1739
1754
  const portion = computed(() => {
1740
1755
  if (!Number.isFinite(__props.value) || !Number.isFinite(__props.max) || __props.max <= 0) return 0;
1741
1756
  return Math.min(100, Math.max(0, __props.value / __props.max * 100));
1742
1757
  });
1743
1758
  return (_ctx, _cache) => {
1744
1759
  return openBlock(), createElementBlock("div", {
1745
- 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]]),
1746
1761
  role: "progressbar",
1747
1762
  "aria-valuenow": Math.round(portion.value),
1748
1763
  "aria-valuemin": "0",
@@ -1751,7 +1766,7 @@ var ProgressBar_default = /* @__PURE__ */ defineComponent({
1751
1766
  }, [createElementVNode("div", {
1752
1767
  class: "bg-primary h-full rounded-full transition-[width] duration-700 ease-out",
1753
1768
  style: normalizeStyle({ width: `${portion.value}%` })
1754
- }, null, 4)], 8, _hoisted_1$11);
1769
+ }, null, 4)], 10, _hoisted_1$11);
1755
1770
  };
1756
1771
  }
1757
1772
  });
@@ -2412,7 +2427,7 @@ function createI18nRuntime(options) {
2412
2427
  *
2413
2428
  * The fallback keeps `vitest` and `vite dev` honest, where no define runs.
2414
2429
  */
2415
- var VERSION = "0.11.2";
2430
+ var VERSION = "0.12.0";
2416
2431
  //#endregion
2417
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 };
2418
2433