rei-kit 0.10.1 → 0.11.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 +25 -35
- package/dist/components/BaseButton.vue.d.ts +1 -1
- package/dist/index.js +16 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,41 +16,31 @@ That is the whole trick, and everything else follows from it.
|
|
|
16
16
|
|
|
17
17
|
### What gets to be in here
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
identical in two apps is a kit candidate.**
|
|
45
|
-
|
|
46
|
-
**Both kinds:** no new required peer — anything needing a library goes behind
|
|
47
|
-
its own entry point or stays in the app — and no product decision. No colour,
|
|
48
|
-
no copy, no icon. Those arrive as props and slots.
|
|
49
|
-
|
|
50
|
-
**And one test worth more than the rule:** a raw `<button>` in a file that
|
|
51
|
-
already imports `BaseButton` is a bug in the kit, not in the app. That grep
|
|
52
|
-
found every gap closed between 0.5.0 and 0.7.0, and it found them after those
|
|
53
|
-
releases had claimed to be finished.
|
|
19
|
+
**This is a kit. It is built for the ecosystem, not for the apps that happen to
|
|
20
|
+
exist today.**
|
|
21
|
+
|
|
22
|
+
A part belongs here if it is a piece of user interface at all — a button, a
|
|
23
|
+
field, a toast, a modal, a shell. There is no waiting for a second consumer and
|
|
24
|
+
no counting of call sites: an app that needs something the kit does not have is
|
|
25
|
+
a gap in the kit, and the kit is what changes. Waiting means the next app
|
|
26
|
+
begins by copying, and a kit whose parts arrive after the apps that needed them
|
|
27
|
+
is a library of things nobody reached for.
|
|
28
|
+
|
|
29
|
+
A part is finished when three things are true:
|
|
30
|
+
|
|
31
|
+
1. **It covers every role the design system declares.** `tokens.css` names five
|
|
32
|
+
colour roles; a button that exposes two of them is incomplete, whatever the
|
|
33
|
+
apps currently use.
|
|
34
|
+
2. **The app can take the behaviour without the appearance.** `variant="unstyled"`
|
|
35
|
+
is the last resort, not the first: if several apps paint the same shape by
|
|
36
|
+
hand, that shape is a variant the kit is missing.
|
|
37
|
+
3. **It carries no product decision** — no colour value, no copy, no icon.
|
|
38
|
+
Those arrive as props and slots, which is what lets three apps that look
|
|
39
|
+
nothing alike share one part.
|
|
40
|
+
|
|
41
|
+
**The test that finds the gaps:** a hand-written control in a file that already
|
|
42
|
+
imports the kit's version of it. That is a bug in the kit, every time. Not in
|
|
43
|
+
the app, and not a matter of taste.
|
|
54
44
|
|
|
55
45
|
## Status
|
|
56
46
|
|
|
@@ -21,7 +21,7 @@ type __VLS_Props = {
|
|
|
21
21
|
* height and no padding: giving it either would make it a ghost button,
|
|
22
22
|
* which is a different thing and was already here.
|
|
23
23
|
*/
|
|
24
|
-
variant?: 'primary' | 'secondary' | 'ghost' | 'quiet' | 'danger' | 'positive' | 'warning' | 'accent' | 'link' | 'unstyled' | undefined;
|
|
24
|
+
variant?: 'primary' | 'secondary' | 'ghost' | 'quiet' | 'row' | 'danger' | 'positive' | 'warning' | 'accent' | 'link' | 'unstyled' | undefined;
|
|
25
25
|
/** `xs` is the action inside a prompt or a nudge, not on a page. */
|
|
26
26
|
size?: 'xs' | 'sm' | 'md' | 'lg' | undefined;
|
|
27
27
|
loading?: boolean | undefined;
|
package/dist/index.js
CHANGED
|
@@ -954,6 +954,7 @@ var BaseButton_default = /* @__PURE__ */ defineComponent({
|
|
|
954
954
|
primary: "bg-primary text-white hover:bg-primary/90",
|
|
955
955
|
secondary: "border-hair bg-surface text-ink border hover:bg-muted",
|
|
956
956
|
ghost: "bg-transparent text-ink hover:bg-muted",
|
|
957
|
+
row: "w-full justify-start text-left bg-transparent text-ink hover:bg-muted",
|
|
957
958
|
quiet: "bg-transparent text-ink-soft hover:text-ink",
|
|
958
959
|
danger: "bg-negative text-white hover:bg-negative/90",
|
|
959
960
|
positive: "bg-positive text-white hover:bg-positive/90",
|
|
@@ -974,6 +975,12 @@ var BaseButton_default = /* @__PURE__ */ defineComponent({
|
|
|
974
975
|
md: "size-11 text-base",
|
|
975
976
|
lg: "size-14 text-lg"
|
|
976
977
|
};
|
|
978
|
+
const ROW_SIZE_CLASS = {
|
|
979
|
+
xs: "px-2 py-1.5 text-xs",
|
|
980
|
+
sm: "px-3 py-2 text-sm",
|
|
981
|
+
md: "px-3 py-2.5 text-base",
|
|
982
|
+
lg: "px-4 py-3 text-lg"
|
|
983
|
+
};
|
|
977
984
|
const LINK_SIZE_CLASS = {
|
|
978
985
|
xs: "text-xs",
|
|
979
986
|
sm: "text-sm",
|
|
@@ -983,6 +990,7 @@ var BaseButton_default = /* @__PURE__ */ defineComponent({
|
|
|
983
990
|
const sizing = computed(() => {
|
|
984
991
|
if (__props.variant === "unstyled") return "";
|
|
985
992
|
if (__props.variant === "link") return LINK_SIZE_CLASS[__props.size];
|
|
993
|
+
if (__props.variant === "row") return ROW_SIZE_CLASS[__props.size];
|
|
986
994
|
return __props.icon ? ICON_SIZE_CLASS[__props.size] : SIZE_CLASS[__props.size];
|
|
987
995
|
});
|
|
988
996
|
const PRESSED_CLASS = {
|
|
@@ -992,9 +1000,15 @@ var BaseButton_default = /* @__PURE__ */ defineComponent({
|
|
|
992
1000
|
};
|
|
993
1001
|
const surface = computed(() => {
|
|
994
1002
|
if (__props.pressed === true) return PRESSED_CLASS[__props.variant] ?? VARIANT_CLASS[__props.variant];
|
|
1003
|
+
if (__props.variant === "quiet" && __props.icon) return `${VARIANT_CLASS.quiet} hover:bg-muted`;
|
|
995
1004
|
return VARIANT_CLASS[__props.variant];
|
|
996
1005
|
});
|
|
997
|
-
const shell = computed(() =>
|
|
1006
|
+
const shell = computed(() => {
|
|
1007
|
+
if (__props.variant === "unstyled") return "";
|
|
1008
|
+
const feel = "transition-[transform,color,background-color,border-color] duration-100 select-none";
|
|
1009
|
+
if (__props.variant === "row") return `inline-flex items-center gap-2 font-medium ${feel}`;
|
|
1010
|
+
return `inline-flex items-center justify-center gap-2 font-medium ${feel} active:scale-95`;
|
|
1011
|
+
});
|
|
998
1012
|
const radius = computed(() => {
|
|
999
1013
|
if (__props.variant === "unstyled") return "";
|
|
1000
1014
|
if (__props.variant === "link") return "rounded-xs";
|
|
@@ -2397,7 +2411,7 @@ function createI18nRuntime(options) {
|
|
|
2397
2411
|
*
|
|
2398
2412
|
* The fallback keeps `vitest` and `vite dev` honest, where no define runs.
|
|
2399
2413
|
*/
|
|
2400
|
-
var VERSION = "0.
|
|
2414
|
+
var VERSION = "0.11.0";
|
|
2401
2415
|
//#endregion
|
|
2402
2416
|
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 };
|
|
2403
2417
|
|