rei-kit 0.8.0 → 0.9.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.
package/README.md CHANGED
@@ -108,12 +108,13 @@ import { createSupabaseClient } from 'rei-kit/supabase'
108
108
 
109
109
  ### Wiring the styles
110
110
 
111
- Four lines, and all four are load-bearing:
111
+ Four lines, and every one is load-bearing:
112
112
 
113
113
  ```css
114
114
  /* your app's main.css */
115
115
  @import 'tailwindcss';
116
116
  @import 'rei-kit/tokens.css'; /* colour roles, the dark variant, measures, utilities */
117
+ @import 'rei-kit/shell/mobile.css'; /* or shell/web.css — see The shell, below */
117
118
  @import 'rei-kit/styles.css'; /* compiled component styles */
118
119
 
119
120
  /* Tailwind generates a utility only where it has seen the class, and it does
@@ -125,10 +126,10 @@ Four lines, and all four are load-bearing:
125
126
  The path is relative to the CSS file, so adjust the `../` depth to where your
126
127
  `main.css` sits.
127
128
 
128
- **Leaving any of the four out fails quietly:** the build succeeds, the
129
+ **Leaving any of these out fails quietly:** the build succeeds, the
129
130
  components mount, and they come out unstyled. Nothing type-checks this, so it
130
131
  is worth a test — Hibi's `kit-styling.spec.ts` reads its own stylesheet and
131
- asserts all four, at unit-test speed. Copy it.
132
+ asserts them, at unit-test speed. Copy it.
132
133
 
133
134
  That test exists because the failure is real: Hibi shipped with the tab bar
134
135
  invisible once, and separately spent three versions restating `tokens.css`
@@ -183,12 +184,22 @@ it — the same mistake as a hex inside a component, one axis over.
183
184
  }
184
185
  ```
185
186
 
186
- ### The phone shell
187
+ ### The shell
187
188
 
188
- `tokens.css` also carries the geometry of a phone shell `shell-frame`,
189
- `page-slide`, `page-auth` and the slide transitions between screens. All of it
190
- is opt-in: nothing applies unless you put the class on an element, so a wide
191
- app can ignore it. Two of the three consumers use it.
189
+ Tokens are what every app needs. A shell is a decision about what shape the app
190
+ is, so it is a separate import and there are two of them.
191
+
192
+ | | |
193
+ | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
194
+ | `rei-kit/shell/mobile.css` | `shell-frame` (a 430px column at viewport height), `page-slide` and `page-auth` scroll containers, and the sliding transition between screens |
195
+ | `rei-kit/shell/web.css` | `.shell` — the page's column as a class, for a header or footer whose bar spans the window while its contents line up with the text — and a short fade between pages |
196
+
197
+ Both are opt-in throughout: nothing applies until a class lands on an element,
198
+ and both read `--measure-page` rather than declaring a width of their own.
199
+
200
+ They were one file until 0.9.0, and it was `tokens.css` — so a wide course site
201
+ downloaded a 430px column, a full-viewport height and an iOS sheet curve in
202
+ order to ignore them, and had no counterpart of its own.
192
203
 
193
204
  ### Prerendering
194
205
 
@@ -8,7 +8,12 @@ type __VLS_Props = {
8
8
  * leave the input with no accessible name at all.
9
9
  */
10
10
  labelHidden?: boolean | undefined;
11
- type?: 'text' | 'email' | 'password' | 'number' | undefined;
11
+ /**
12
+ * Every type a text field can be, because the ones missing were the ones
13
+ * apps needed: `date` and `search` were hand-written three times each and
14
+ * `url` twice, in files that already imported this component.
15
+ */
16
+ type?: 'text' | 'email' | 'password' | 'number' | 'search' | 'tel' | 'url' | 'date' | 'time' | 'datetime-local' | undefined;
12
17
  /** `sm` for a field inside a row rather than in a form of its own. */
13
18
  size?: 'sm' | 'md' | undefined;
14
19
  };
@@ -4,7 +4,12 @@ type __VLS_Props = {
4
4
  hint?: string | undefined;
5
5
  labelHidden?: boolean | undefined;
6
6
  rows?: number | undefined;
7
- /** `sm` for editing in place, inside a row that is already small. */
7
+ /**
8
+ * `sm` tightens the label and the spacing. It does **not** shrink the text:
9
+ * iOS zooms the viewport when it focuses a field under 16px and never zooms
10
+ * back, which is why both phone apps force 16px on form elements in their
11
+ * base layer.
12
+ */
8
13
  size?: 'sm' | 'md' | undefined;
9
14
  };
10
15
  type __VLS_ModelProps = {
package/dist/index.js CHANGED
@@ -1093,6 +1093,7 @@ var _hoisted_1$20 = [
1093
1093
  "aria-invalid",
1094
1094
  "aria-describedby"
1095
1095
  ];
1096
+ var CONTROL_CLASS = "h-11 text-base";
1096
1097
  //#endregion
1097
1098
  //#region src/components/BaseInput.vue
1098
1099
  var BaseInput_default = /* @__PURE__ */ defineComponent({
@@ -1114,10 +1115,6 @@ var BaseInput_default = /* @__PURE__ */ defineComponent({
1114
1115
  }),
1115
1116
  emits: ["update:modelValue"],
1116
1117
  setup(__props) {
1117
- const SIZE_CLASS = {
1118
- sm: "h-11 text-sm",
1119
- md: "h-11 text-base"
1120
- };
1121
1118
  const model = useModel(__props, "modelValue");
1122
1119
  return (_ctx, _cache) => {
1123
1120
  return openBlock(), createBlock(FormField_default, {
@@ -1133,7 +1130,7 @@ var BaseInput_default = /* @__PURE__ */ defineComponent({
1133
1130
  type: __props.type,
1134
1131
  "aria-invalid": invalid,
1135
1132
  "aria-describedby": describedBy
1136
- }, _ctx.$attrs, { class: ["border-hair bg-surface text-ink rounded-card focus-visible:outline-primary border px-3 focus-visible:outline-2 focus-visible:outline-offset-1", [SIZE_CLASS[__props.size], invalid ? "border-negative" : ""]] }), null, 16, _hoisted_1$20), [[vModelDynamic, model.value]])]),
1133
+ }, _ctx.$attrs, { class: ["border-hair bg-surface text-ink rounded-card focus-visible:outline-primary border px-3 focus-visible:outline-2 focus-visible:outline-offset-1", [CONTROL_CLASS, invalid ? "border-negative" : ""]] }), null, 16, _hoisted_1$20), [[vModelDynamic, model.value]])]),
1137
1134
  _: 1
1138
1135
  }, 8, [
1139
1136
  "label",
@@ -1567,7 +1564,7 @@ var BaseTextarea_default = /* @__PURE__ */ defineComponent({
1567
1564
  rows: __props.rows,
1568
1565
  "aria-invalid": invalid,
1569
1566
  "aria-describedby": describedBy
1570
- }, _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", [__props.size === "sm" ? "text-sm" : "text-base", invalid ? "border-negative" : ""]] }), null, 16, _hoisted_1$14), [[vModelText, model.value]])]),
1567
+ }, _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", ["text-base", invalid ? "border-negative" : ""]] }), null, 16, _hoisted_1$14), [[vModelText, model.value]])]),
1571
1568
  _: 1
1572
1569
  }, 8, [
1573
1570
  "label",
@@ -2385,7 +2382,7 @@ function createI18nRuntime(options) {
2385
2382
  *
2386
2383
  * The fallback keeps `vitest` and `vite dev` honest, where no define runs.
2387
2384
  */
2388
- var VERSION = "0.8.0";
2385
+ var VERSION = "0.9.1";
2389
2386
  //#endregion
2390
2387
  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 };
2391
2388