rei-kit 0.18.2 → 0.20.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 +30 -27
- package/dist/{GoogleButton-DV_RIpJE.js → GoogleButton-BKOezkZr.js} +10 -2
- package/dist/{GoogleButton-DV_RIpJE.js.map → GoogleButton-BKOezkZr.js.map} +1 -1
- package/dist/{SettingsGroup-DtEB_Hrd.js → SettingsGroup-JsD19V81.js} +8 -1
- package/dist/{SettingsGroup-DtEB_Hrd.js.map → SettingsGroup-JsD19V81.js.map} +1 -1
- package/dist/app.js +2 -2
- package/dist/components/BaseAvatar.vue.d.ts +28 -0
- package/dist/components/BaseCombobox.vue.d.ts +36 -0
- package/dist/components/BaseMenu.vue.d.ts +63 -0
- package/dist/components/BaseSlider.vue.d.ts +40 -0
- package/dist/components/BaseSpinner.vue.d.ts +20 -0
- package/dist/components/BaseSwitch.vue.d.ts +34 -0
- package/dist/components/BaseTable.vue.d.ts +44 -0
- package/dist/components/EmptyState.vue.d.ts +8 -0
- package/dist/components/PageHeader.vue.d.ts +9 -0
- package/dist/components/SettingsGroup.vue.d.ts +7 -0
- package/dist/components/StatCard.vue.d.ts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +683 -19
- package/dist/index.js.map +1 -1
- package/dist/pwa.js +2 -2
- package/dist/styles.css +406 -0
- package/package.json +3 -3
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A list of actions behind one control.
|
|
3
|
+
*
|
|
4
|
+
* ## `role="menu"` is a promise
|
|
5
|
+
*
|
|
6
|
+
* Declaring it tells a screen reader that the arrow keys move between the
|
|
7
|
+
* items, that Escape closes, and that Tab leaves rather than walking through.
|
|
8
|
+
* A div with `role="menu"` and none of that is worse than a plain list of
|
|
9
|
+
* links: it announces a contract and then breaks it, and the reader is left
|
|
10
|
+
* pressing keys that do nothing.
|
|
11
|
+
*
|
|
12
|
+
* The hand-written menu this replaces declared the role and had none of the
|
|
13
|
+
* behaviour. That is the usual shape of the bug — the roles are the part people
|
|
14
|
+
* remember, because they are the part you can see in the markup.
|
|
15
|
+
*
|
|
16
|
+
* So: focus moves into the menu on open and back to the trigger on close,
|
|
17
|
+
* ArrowUp/ArrowDown move and wrap, Home and End jump, Escape closes, and a
|
|
18
|
+
* click outside closes. Items are found in the DOM rather than declared as
|
|
19
|
+
* data, so a caller can mix links, buttons and separators freely.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```vue
|
|
23
|
+
* <BaseMenu :label="t('nav.account')">
|
|
24
|
+
* <template #trigger="{ open }">
|
|
25
|
+
* <BaseAvatar :label="t('nav.account')" />
|
|
26
|
+
* </template>
|
|
27
|
+
*
|
|
28
|
+
* <RouterLink to="/profil" role="menuitem">{{ t('nav.profile') }}</RouterLink>
|
|
29
|
+
* <button type="button" role="menuitem" @click="signOut">{{ t('auth.signOut') }}</button>
|
|
30
|
+
* </BaseMenu>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
type __VLS_Props = {
|
|
34
|
+
/** Accessible name for the trigger. Required: the trigger is usually a glyph. */
|
|
35
|
+
label: string;
|
|
36
|
+
/** Which edge the panel lines up with. */
|
|
37
|
+
align?: 'start' | 'end' | undefined;
|
|
38
|
+
};
|
|
39
|
+
type __VLS_Slots = {
|
|
40
|
+
/** The control that opens it. Receives the open state for its own styling. */
|
|
41
|
+
trigger?: (props: {
|
|
42
|
+
open: boolean;
|
|
43
|
+
}) => unknown;
|
|
44
|
+
/** The items. Anything with `role="menuitem"` joins the keyboard order. */
|
|
45
|
+
default: () => unknown;
|
|
46
|
+
};
|
|
47
|
+
type __VLS_ModelProps = {
|
|
48
|
+
modelValue?: boolean;
|
|
49
|
+
};
|
|
50
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
51
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
52
|
+
"update:modelValue": (value: boolean) => any;
|
|
53
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
54
|
+
"onUpdate:modelValue"?: (value: boolean) => any;
|
|
55
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
56
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
57
|
+
declare const _default: typeof __VLS_export;
|
|
58
|
+
export default _default;
|
|
59
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
60
|
+
new (): {
|
|
61
|
+
$slots: S;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A value picked from a range, where roughly right is the point.
|
|
3
|
+
*
|
|
4
|
+
* A native `input[type="range"]`, painted. That is deliberate: the native
|
|
5
|
+
* control already has the keyboard (arrows, Page Up/Down, Home/End), the
|
|
6
|
+
* pointer, the touch target and the correct announcements, and every
|
|
7
|
+
* hand-rolled slider gives some of that up. What it does not have is a look
|
|
8
|
+
* that matches the rest of the kit, so the look is all that is replaced.
|
|
9
|
+
*
|
|
10
|
+
* `aria-valuetext` is the part worth stopping on. Without it a screen reader
|
|
11
|
+
* reads the number alone — "45" — and a number with no unit is not an answer to
|
|
12
|
+
* anything. Pass `format` and it reads "45 minutes".
|
|
13
|
+
*/
|
|
14
|
+
type __VLS_Props = {
|
|
15
|
+
label: string;
|
|
16
|
+
min?: number | undefined;
|
|
17
|
+
max?: number | undefined;
|
|
18
|
+
step?: number | undefined;
|
|
19
|
+
hint?: string | undefined;
|
|
20
|
+
disabled?: boolean | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Turns the number into something a person would say — "45 minutes", "₺12".
|
|
23
|
+
*
|
|
24
|
+
* Used for the visible readout and for `aria-valuetext`, so both say the same
|
|
25
|
+
* thing and neither is a bare number.
|
|
26
|
+
*/
|
|
27
|
+
format?: ((value: number) => string) | undefined;
|
|
28
|
+
showValue?: boolean | undefined;
|
|
29
|
+
};
|
|
30
|
+
type __VLS_ModelProps = {
|
|
31
|
+
modelValue?: number;
|
|
32
|
+
};
|
|
33
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
34
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
35
|
+
"update:modelValue": (value: number) => any;
|
|
36
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
37
|
+
"onUpdate:modelValue"?: (value: number) => any;
|
|
38
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
39
|
+
declare const _default: typeof __VLS_export;
|
|
40
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Work in progress, with no idea how much is left.
|
|
3
|
+
*
|
|
4
|
+
* `ProgressBar` is the one to reach for when the amount is known; this is for
|
|
5
|
+
* when it is not. Showing a bar that cannot move is worse than a spinner,
|
|
6
|
+
* because a bar is a promise about how long.
|
|
7
|
+
*
|
|
8
|
+
* `role="status"` and a label, so a screen reader says what is happening. A
|
|
9
|
+
* spinner with no accessible name is a decoration that happens to be the only
|
|
10
|
+
* thing on screen — which is why `label` is required and not defaulted to
|
|
11
|
+
* "Loading" in a language the app may not speak.
|
|
12
|
+
*/
|
|
13
|
+
type __VLS_Props = {
|
|
14
|
+
/** What is being waited for. Already translated. */
|
|
15
|
+
label: string;
|
|
16
|
+
size?: 'sm' | 'md' | 'lg' | undefined;
|
|
17
|
+
};
|
|
18
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A setting that takes effect the moment it is touched.
|
|
3
|
+
*
|
|
4
|
+
* Not `BaseCheckbox` with a rounder skin, and the difference is not visual. A
|
|
5
|
+
* checkbox states an intention that something else commits — a form is
|
|
6
|
+
* submitted, a dialog is confirmed. A switch *is* the commit: there is no Save
|
|
7
|
+
* after it, which is why it belongs in a settings row and why a form full of
|
|
8
|
+
* them is usually a form of checkboxes drawn wrong.
|
|
9
|
+
*
|
|
10
|
+
* `role="switch"` rather than a styled checkbox, because a screen reader
|
|
11
|
+
* announces "on"/"off" for a switch and "checked"/"unchecked" for a checkbox,
|
|
12
|
+
* and those are different sentences about different things.
|
|
13
|
+
*
|
|
14
|
+
* The whole row is the label, so the words are part of the hit target. On a
|
|
15
|
+
* phone that is the difference between a control and a coin toss.
|
|
16
|
+
*/
|
|
17
|
+
type __VLS_Props = {
|
|
18
|
+
label: string;
|
|
19
|
+
hint?: string | undefined;
|
|
20
|
+
disabled?: boolean | undefined;
|
|
21
|
+
/** For a switch inside a row that already names it — it keeps its accessible name. */
|
|
22
|
+
labelHidden?: boolean | undefined;
|
|
23
|
+
};
|
|
24
|
+
type __VLS_ModelProps = {
|
|
25
|
+
modelValue?: boolean;
|
|
26
|
+
};
|
|
27
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
28
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
29
|
+
"update:modelValue": (value: boolean) => any;
|
|
30
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
31
|
+
"onUpdate:modelValue"?: (value: boolean) => any;
|
|
32
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
33
|
+
declare const _default: typeof __VLS_export;
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface Column<Row> {
|
|
2
|
+
/** Key into the row, and the slot name for a custom cell. */
|
|
3
|
+
key: string & keyof Row;
|
|
4
|
+
/** Column heading. Already translated. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** `end` for money and counts, which are read by their last digit. */
|
|
7
|
+
align?: 'start' | 'end' | undefined;
|
|
8
|
+
/** Stops a column wrapping — dates, short codes. */
|
|
9
|
+
nowrap?: boolean | undefined;
|
|
10
|
+
}
|
|
11
|
+
declare const __VLS_export: <Row extends Record<string, unknown>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
12
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<{
|
|
13
|
+
columns: readonly Column<Row>[];
|
|
14
|
+
rows: readonly Row[];
|
|
15
|
+
/** What this table is. Required — an unnamed table is a box of numbers. */
|
|
16
|
+
caption: string;
|
|
17
|
+
/** Keeps the caption for assistive tech when the page already shows a heading. */
|
|
18
|
+
captionHidden?: boolean | undefined;
|
|
19
|
+
/** Which field identifies a row. Falls back to the index. */
|
|
20
|
+
rowKey?: (string & keyof Row) | undefined;
|
|
21
|
+
}> & (typeof globalThis extends {
|
|
22
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
23
|
+
} ? P : {});
|
|
24
|
+
expose: (exposed: {}) => void;
|
|
25
|
+
attrs: any;
|
|
26
|
+
slots: {
|
|
27
|
+
[key: string]: (props: {
|
|
28
|
+
row: Row;
|
|
29
|
+
value: unknown;
|
|
30
|
+
}) => unknown;
|
|
31
|
+
/** Shown instead of the body when there are no rows. */
|
|
32
|
+
empty?: () => unknown;
|
|
33
|
+
};
|
|
34
|
+
emit: {};
|
|
35
|
+
}>) => import('vue').VNode & {
|
|
36
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
37
|
+
};
|
|
38
|
+
declare const _default: typeof __VLS_export;
|
|
39
|
+
export default _default;
|
|
40
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
41
|
+
[K in keyof T]: T[K];
|
|
42
|
+
} : {
|
|
43
|
+
[K in keyof T as K]: T[K];
|
|
44
|
+
}) & {};
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A list with nothing in it yet, said kindly.
|
|
3
|
+
*
|
|
4
|
+
* A blank area reads as a page that failed to load, and the reader's first
|
|
5
|
+
* thought is that something is broken rather than that they have not started.
|
|
6
|
+
* So there is always a sentence, and the slot below it is where the way out
|
|
7
|
+
* goes — the button that creates the first one.
|
|
8
|
+
*/
|
|
1
9
|
type __VLS_Props = {
|
|
2
10
|
title: string;
|
|
3
11
|
description?: string | undefined;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bar at the top of a screen: a title with room either side of it.
|
|
3
|
+
*
|
|
4
|
+
* Three fixed columns rather than a flex row, so the title is centred on the
|
|
5
|
+
* screen rather than centred on what is left after the buttons. A back arrow on
|
|
6
|
+
* one side and nothing on the other would otherwise push every title off centre
|
|
7
|
+
* by exactly half a button, which is visible the moment two screens sit next to
|
|
8
|
+
* each other.
|
|
9
|
+
*/
|
|
1
10
|
type __VLS_Props = {
|
|
2
11
|
title: string;
|
|
3
12
|
};
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A titled run of settings rows.
|
|
3
|
+
*
|
|
4
|
+
* The heading is a real `h2` rather than styled text, because a settings screen
|
|
5
|
+
* is long and the headings are how somebody moves through it without reading
|
|
6
|
+
* all of it. Uppercase and quiet in the design, structural in the markup.
|
|
7
|
+
*/
|
|
1
8
|
type __VLS_Props = {
|
|
2
9
|
title: string;
|
|
3
10
|
};
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One number, with what it means and which way it is going.
|
|
3
|
+
*
|
|
4
|
+
* The trend is an arrow and a colour, and neither is allowed to be the whole
|
|
5
|
+
* message: the direction is also in the arrow's shape, so it survives a reader
|
|
6
|
+
* who cannot separate the kit's positive and negative hues. `null` is a real
|
|
7
|
+
* state rather than a missing one — a figure with no comparison yet is not a
|
|
8
|
+
* flat figure.
|
|
9
|
+
*/
|
|
1
10
|
type __VLS_Props = {
|
|
2
11
|
value: string;
|
|
3
12
|
label: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -43,15 +43,24 @@ export { useVisualViewport } from './composables/use-visual-viewport';
|
|
|
43
43
|
export { useToast } from './composables/use-toast';
|
|
44
44
|
export type { Toast, ToastOptions, ToastTone } from './composables/use-toast';
|
|
45
45
|
export type { VisualViewportRect } from './composables/use-visual-viewport';
|
|
46
|
+
export { default as BaseAvatar } from './components/BaseAvatar.vue';
|
|
46
47
|
export { default as BaseAlert } from './components/BaseAlert.vue';
|
|
47
48
|
export { default as BaseBadge } from './components/BaseBadge.vue';
|
|
48
49
|
export { default as BaseButton } from './components/BaseButton.vue';
|
|
49
50
|
export { default as BaseInput } from './components/BaseInput.vue';
|
|
51
|
+
export { default as BaseMenu } from './components/BaseMenu.vue';
|
|
50
52
|
export { default as BaseSheet } from './components/BaseSheet.vue';
|
|
51
53
|
export { default as BaseCard } from './components/BaseCard.vue';
|
|
54
|
+
export { default as BaseCombobox } from './components/BaseCombobox.vue';
|
|
55
|
+
export type { ComboboxOption } from './components/BaseCombobox.vue';
|
|
52
56
|
export { default as BaseCheckbox } from './components/BaseCheckbox.vue';
|
|
53
57
|
export { default as BaseRadioGroup } from './components/BaseRadioGroup.vue';
|
|
54
58
|
export { default as BaseSelect } from './components/BaseSelect.vue';
|
|
59
|
+
export { default as BaseSlider } from './components/BaseSlider.vue';
|
|
60
|
+
export { default as BaseSpinner } from './components/BaseSpinner.vue';
|
|
61
|
+
export { default as BaseSwitch } from './components/BaseSwitch.vue';
|
|
62
|
+
export { default as BaseTable } from './components/BaseTable.vue';
|
|
63
|
+
export type { Column } from './components/BaseTable.vue';
|
|
55
64
|
export { default as BaseTextarea } from './components/BaseTextarea.vue';
|
|
56
65
|
export { default as EmptyState } from './components/EmptyState.vue';
|
|
57
66
|
export { default as FormField } from './components/FormField.vue';
|