rei-kit 0.9.0 → 0.10.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.
|
@@ -8,9 +8,28 @@ type __VLS_Props = {
|
|
|
8
8
|
* leave the input with no accessible name at all.
|
|
9
9
|
*/
|
|
10
10
|
labelHidden?: boolean | undefined;
|
|
11
|
-
|
|
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;
|
|
19
|
+
/**
|
|
20
|
+
* `unstyled` keeps the wiring and drops the surface.
|
|
21
|
+
*
|
|
22
|
+
* The label, the generated id, `aria-describedby` and the error are what a
|
|
23
|
+
* field is; the border and the height are what it looks like. A search box
|
|
24
|
+
* inside a bordered row, a url field in an editor popover — those places
|
|
25
|
+
* were hand-writing the whole thing to avoid the appearance, and losing the
|
|
26
|
+
* wiring with it.
|
|
27
|
+
*
|
|
28
|
+
* The same reasoning as `BaseButton`'s `unstyled`, and the same test: a
|
|
29
|
+
* primitive is finished when the app can take its behaviour without its
|
|
30
|
+
* paint.
|
|
31
|
+
*/
|
|
32
|
+
variant?: 'default' | 'unstyled' | undefined;
|
|
14
33
|
};
|
|
15
34
|
type __VLS_ModelProps = {
|
|
16
35
|
modelValue?: string | undefined;
|
|
@@ -22,6 +22,20 @@ declare const __VLS_export: <T extends string | number>(__VLS_props: NonNullable
|
|
|
22
22
|
* Every hand-written select across the three consuming apps was this one.
|
|
23
23
|
*/
|
|
24
24
|
size?: "sm" | "md" | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* `unstyled` keeps the wiring and drops the surface.
|
|
27
|
+
*
|
|
28
|
+
* The label, the generated id, `aria-describedby` and the error are what a
|
|
29
|
+
* field is; the border and the height are what it looks like. A search box
|
|
30
|
+
* inside a bordered row, a url field in an editor popover — those places
|
|
31
|
+
* were hand-writing the whole thing to avoid the appearance, and losing the
|
|
32
|
+
* wiring with it.
|
|
33
|
+
*
|
|
34
|
+
* The same reasoning as `BaseButton`'s `unstyled`, and the same test: a
|
|
35
|
+
* primitive is finished when the app can take its behaviour without its
|
|
36
|
+
* paint.
|
|
37
|
+
*/
|
|
38
|
+
variant?: "default" | "unstyled" | undefined;
|
|
25
39
|
} & {
|
|
26
40
|
modelValue?: T | undefined;
|
|
27
41
|
}) & {
|
|
@@ -4,8 +4,27 @@ type __VLS_Props = {
|
|
|
4
4
|
hint?: string | undefined;
|
|
5
5
|
labelHidden?: boolean | undefined;
|
|
6
6
|
rows?: number | undefined;
|
|
7
|
-
/**
|
|
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;
|
|
14
|
+
/**
|
|
15
|
+
* `unstyled` keeps the wiring and drops the surface.
|
|
16
|
+
*
|
|
17
|
+
* The label, the generated id, `aria-describedby` and the error are what a
|
|
18
|
+
* field is; the border and the height are what it looks like. A search box
|
|
19
|
+
* inside a bordered row, a url field in an editor popover — those places
|
|
20
|
+
* were hand-writing the whole thing to avoid the appearance, and losing the
|
|
21
|
+
* wiring with it.
|
|
22
|
+
*
|
|
23
|
+
* The same reasoning as `BaseButton`'s `unstyled`, and the same test: a
|
|
24
|
+
* primitive is finished when the app can take its behaviour without its
|
|
25
|
+
* paint.
|
|
26
|
+
*/
|
|
27
|
+
variant?: 'default' | 'unstyled' | undefined;
|
|
9
28
|
};
|
|
10
29
|
type __VLS_ModelProps = {
|
|
11
30
|
modelValue?: string | undefined;
|
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({
|
|
@@ -1107,17 +1108,14 @@ var BaseInput_default = /* @__PURE__ */ defineComponent({
|
|
|
1107
1108
|
default: false
|
|
1108
1109
|
},
|
|
1109
1110
|
type: { default: "text" },
|
|
1110
|
-
size: { default: "md" }
|
|
1111
|
+
size: { default: "md" },
|
|
1112
|
+
variant: { default: "default" }
|
|
1111
1113
|
}, {
|
|
1112
1114
|
"modelValue": {},
|
|
1113
1115
|
"modelModifiers": {}
|
|
1114
1116
|
}),
|
|
1115
1117
|
emits: ["update:modelValue"],
|
|
1116
1118
|
setup(__props) {
|
|
1117
|
-
const SIZE_CLASS = {
|
|
1118
|
-
sm: "h-11 text-sm",
|
|
1119
|
-
md: "h-11 text-base"
|
|
1120
|
-
};
|
|
1121
1119
|
const model = useModel(__props, "modelValue");
|
|
1122
1120
|
return (_ctx, _cache) => {
|
|
1123
1121
|
return openBlock(), createBlock(FormField_default, {
|
|
@@ -1133,7 +1131,11 @@ var BaseInput_default = /* @__PURE__ */ defineComponent({
|
|
|
1133
1131
|
type: __props.type,
|
|
1134
1132
|
"aria-invalid": invalid,
|
|
1135
1133
|
"aria-describedby": describedBy
|
|
1136
|
-
}, _ctx.$attrs, { class: [
|
|
1134
|
+
}, _ctx.$attrs, { class: [
|
|
1135
|
+
__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",
|
|
1136
|
+
__props.variant === "unstyled" ? "text-base" : CONTROL_CLASS,
|
|
1137
|
+
__props.variant !== "unstyled" && invalid ? "border-negative" : ""
|
|
1138
|
+
] }), null, 16, _hoisted_1$20), [[vModelDynamic, model.value]])]),
|
|
1137
1139
|
_: 1
|
|
1138
1140
|
}, 8, [
|
|
1139
1141
|
"label",
|
|
@@ -1476,7 +1478,8 @@ var BaseSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
1476
1478
|
default: false
|
|
1477
1479
|
},
|
|
1478
1480
|
placeholder: { default: "" },
|
|
1479
|
-
size: { default: "md" }
|
|
1481
|
+
size: { default: "md" },
|
|
1482
|
+
variant: { default: "default" }
|
|
1480
1483
|
}, {
|
|
1481
1484
|
"modelValue": {},
|
|
1482
1485
|
"modelModifiers": {}
|
|
@@ -1501,7 +1504,11 @@ var BaseSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
1501
1504
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
1502
1505
|
"aria-invalid": invalid,
|
|
1503
1506
|
"aria-describedby": describedBy,
|
|
1504
|
-
class: normalizeClass(["
|
|
1507
|
+
class: normalizeClass(["w-full appearance-none", [
|
|
1508
|
+
__props.variant === "unstyled" ? "" : "border-hair bg-surface text-ink rounded-card focus-visible:outline-primary border py-0 pr-10 pl-3 focus-visible:outline-2 focus-visible:outline-offset-1",
|
|
1509
|
+
__props.variant === "unstyled" ? "" : SIZE_CLASS[__props.size],
|
|
1510
|
+
__props.variant !== "unstyled" && invalid ? "border-negative" : ""
|
|
1511
|
+
]])
|
|
1505
1512
|
}, [__props.placeholder ? (openBlock(), createElementBlock("option", _hoisted_3$7, toDisplayString(__props.placeholder), 1)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option) => {
|
|
1506
1513
|
return openBlock(), createElementBlock("option", {
|
|
1507
1514
|
key: option.value,
|
|
@@ -1545,7 +1552,8 @@ var BaseTextarea_default = /* @__PURE__ */ defineComponent({
|
|
|
1545
1552
|
default: false
|
|
1546
1553
|
},
|
|
1547
1554
|
rows: { default: 4 },
|
|
1548
|
-
size: { default: "md" }
|
|
1555
|
+
size: { default: "md" },
|
|
1556
|
+
variant: { default: "default" }
|
|
1549
1557
|
}, {
|
|
1550
1558
|
"modelValue": {},
|
|
1551
1559
|
"modelModifiers": {}
|
|
@@ -1567,7 +1575,11 @@ var BaseTextarea_default = /* @__PURE__ */ defineComponent({
|
|
|
1567
1575
|
rows: __props.rows,
|
|
1568
1576
|
"aria-invalid": invalid,
|
|
1569
1577
|
"aria-describedby": describedBy
|
|
1570
|
-
}, _ctx.$attrs, { class: [
|
|
1578
|
+
}, _ctx.$attrs, { class: [
|
|
1579
|
+
__props.variant === "unstyled" ? "" : "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",
|
|
1580
|
+
"text-base",
|
|
1581
|
+
__props.variant !== "unstyled" && invalid ? "border-negative" : ""
|
|
1582
|
+
] }), null, 16, _hoisted_1$14), [[vModelText, model.value]])]),
|
|
1571
1583
|
_: 1
|
|
1572
1584
|
}, 8, [
|
|
1573
1585
|
"label",
|
|
@@ -2385,7 +2397,7 @@ function createI18nRuntime(options) {
|
|
|
2385
2397
|
*
|
|
2386
2398
|
* The fallback keeps `vitest` and `vite dev` honest, where no define runs.
|
|
2387
2399
|
*/
|
|
2388
|
-
var VERSION = "0.
|
|
2400
|
+
var VERSION = "0.10.0";
|
|
2389
2401
|
//#endregion
|
|
2390
2402
|
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
2403
|
|