@twentyfirstmedia/ui-core 0.6.0 → 0.7.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/dist/components/household.d.ts +19 -0
- package/dist/components/household.d.ts.map +1 -0
- package/dist/components/household.js +137 -0
- package/dist/components/household.js.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/life.d.ts +26 -0
- package/dist/components/life.d.ts.map +1 -0
- package/dist/components/life.js +186 -0
- package/dist/components/life.js.map +1 -0
- package/dist/components/types.d.ts +332 -0
- package/dist/components/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/strings.d.ts +96 -0
- package/dist/strings.d.ts.map +1 -1
- package/dist/strings.js +73 -1
- package/dist/strings.js.map +1 -1
- package/dist/themes.css +14121 -11161
- package/package.json +1 -1
- package/src/components/household.tsx +489 -0
- package/src/components/index.ts +22 -0
- package/src/components/life.tsx +672 -0
- package/src/components/types.ts +322 -0
- package/src/index.ts +2 -0
- package/src/strings.ts +241 -0
|
@@ -2977,4 +2977,336 @@ export interface QrCodeProps extends BaseProps {
|
|
|
2977
2977
|
/** Accessible name (default "QR code"). */
|
|
2978
2978
|
label?: string;
|
|
2979
2979
|
}
|
|
2980
|
+
export interface Habit {
|
|
2981
|
+
id: string;
|
|
2982
|
+
label: string;
|
|
2983
|
+
icon?: IconName;
|
|
2984
|
+
tint?: Tint;
|
|
2985
|
+
/** One entry per day, oldest first, today last: true done, false missed, null no data. */
|
|
2986
|
+
days: (boolean | null)[];
|
|
2987
|
+
/** Days in a row (shown as "12-day streak"). */
|
|
2988
|
+
streak?: number;
|
|
2989
|
+
/** A short target, e.g. "8 glasses" or "3× a week". */
|
|
2990
|
+
goal?: string;
|
|
2991
|
+
}
|
|
2992
|
+
export interface HabitTrackerProps extends BaseProps {
|
|
2993
|
+
habits: Habit[];
|
|
2994
|
+
/** Labels of the day columns, oldest first (default: weekday initials ending today). */
|
|
2995
|
+
dayLabels?: string[];
|
|
2996
|
+
/** Today's box of a habit was toggled. */
|
|
2997
|
+
onToggle?: (id: string, done: boolean) => void;
|
|
2998
|
+
/** Accessible name of the list (default "Habits"). */
|
|
2999
|
+
label?: string;
|
|
3000
|
+
}
|
|
3001
|
+
export type MoodLevel = 1 | 2 | 3 | 4 | 5;
|
|
3002
|
+
export interface MoodPickerProps extends BaseProps {
|
|
3003
|
+
value?: MoodLevel | null;
|
|
3004
|
+
defaultValue?: MoodLevel | null;
|
|
3005
|
+
onChange?: (mood: MoodLevel) => void;
|
|
3006
|
+
/** The question (default "How are you feeling?"). */
|
|
3007
|
+
label?: ReactNode;
|
|
3008
|
+
/** Words for the five levels, lowest first (default Awful, Low, Okay, Good, Great). */
|
|
3009
|
+
levels?: [string, string, string, string, string];
|
|
3010
|
+
/** Only the faces; the words stay as accessible names. */
|
|
3011
|
+
compact?: boolean;
|
|
3012
|
+
}
|
|
3013
|
+
export interface VitalTileProps extends BaseProps {
|
|
3014
|
+
/** `"glass"`: translucent glass over a backdrop (`Ambient`, a photo, a map); `"solid"` opts out inside a glass `UIProvider`. */
|
|
3015
|
+
surface?: Surface;
|
|
3016
|
+
label: string;
|
|
3017
|
+
value: number;
|
|
3018
|
+
unit?: string;
|
|
3019
|
+
icon?: IconName;
|
|
3020
|
+
/** The healthy range [low, high]; the tile says whether the value is below, in or above it. */
|
|
3021
|
+
normal?: [number, number];
|
|
3022
|
+
/** The whole scale of the band [min, max] (default: the normal range with room on both sides). */
|
|
3023
|
+
scale?: [number, number];
|
|
3024
|
+
/** Recent values, oldest first, drawn as a sparkline. */
|
|
3025
|
+
trend?: number[];
|
|
3026
|
+
/** Under the value: when it was measured, the source … */
|
|
3027
|
+
caption?: ReactNode;
|
|
3028
|
+
/** Digits after the decimal point (default 0). */
|
|
3029
|
+
digits?: number;
|
|
3030
|
+
}
|
|
3031
|
+
export interface ActivityRing {
|
|
3032
|
+
label: string;
|
|
3033
|
+
value: number;
|
|
3034
|
+
goal: number;
|
|
3035
|
+
unit?: string;
|
|
3036
|
+
tint?: Tint;
|
|
3037
|
+
}
|
|
3038
|
+
export interface ActivityRingsProps extends BaseProps {
|
|
3039
|
+
/** Outer ring first. */
|
|
3040
|
+
rings: ActivityRing[];
|
|
3041
|
+
/** Diameter of the rings (default 132). */
|
|
3042
|
+
size?: number;
|
|
3043
|
+
/** Hide the legend beside the rings. */
|
|
3044
|
+
legend?: boolean;
|
|
3045
|
+
/** Accessible name (default "Activity"). */
|
|
3046
|
+
label?: string;
|
|
3047
|
+
}
|
|
3048
|
+
export type SleepStage = "awake" | "rem" | "light" | "deep";
|
|
3049
|
+
export interface SleepSegment {
|
|
3050
|
+
stage: SleepStage;
|
|
3051
|
+
start: Date | string | number;
|
|
3052
|
+
end: Date | string | number;
|
|
3053
|
+
}
|
|
3054
|
+
export interface SleepChartProps extends BaseProps {
|
|
3055
|
+
/** The night in order, from falling asleep to getting up. */
|
|
3056
|
+
segments: SleepSegment[];
|
|
3057
|
+
/** Accessible name (default "Sleep stages"). */
|
|
3058
|
+
label?: string;
|
|
3059
|
+
/** Hide the totals per stage under the chart. */
|
|
3060
|
+
summary?: boolean;
|
|
3061
|
+
}
|
|
3062
|
+
export interface MedicationItem {
|
|
3063
|
+
id: string;
|
|
3064
|
+
name: string;
|
|
3065
|
+
dose?: string;
|
|
3066
|
+
/** When, as shown ("08:00", "With breakfast"). */
|
|
3067
|
+
time: string;
|
|
3068
|
+
/** Set by the app, which knows the clock: default "taken" when `taken`, else "due". */
|
|
3069
|
+
status?: "taken" | "due" | "missed" | "upcoming";
|
|
3070
|
+
taken?: boolean;
|
|
3071
|
+
note?: string;
|
|
3072
|
+
icon?: IconName;
|
|
3073
|
+
}
|
|
3074
|
+
export interface MedicationListProps extends BaseProps {
|
|
3075
|
+
items: MedicationItem[];
|
|
3076
|
+
/** "Mark as taken" was pressed. */
|
|
3077
|
+
onTake?: (id: string) => void;
|
|
3078
|
+
/** Accessible name (default "Medication"). */
|
|
3079
|
+
label?: string;
|
|
3080
|
+
}
|
|
3081
|
+
export interface JournalEntryProps extends BaseProps {
|
|
3082
|
+
/** `"glass"`: translucent glass over a backdrop (`Ambient`, a photo, a map); `"solid"` opts out inside a glass `UIProvider`. */
|
|
3083
|
+
surface?: Surface;
|
|
3084
|
+
date: Date | string | number;
|
|
3085
|
+
title?: string;
|
|
3086
|
+
mood?: MoodLevel;
|
|
3087
|
+
tags?: string[];
|
|
3088
|
+
children?: ReactNode;
|
|
3089
|
+
/** Buttons at the end (edit, share …). */
|
|
3090
|
+
actions?: ReactNode;
|
|
3091
|
+
}
|
|
3092
|
+
export interface GoalCardProps extends BaseProps {
|
|
3093
|
+
/** `"glass"`: translucent glass over a backdrop (`Ambient`, a photo, a map); `"solid"` opts out inside a glass `UIProvider`. */
|
|
3094
|
+
surface?: Surface;
|
|
3095
|
+
title: string;
|
|
3096
|
+
value: number;
|
|
3097
|
+
target: number;
|
|
3098
|
+
/** How to show value and target (default number). */
|
|
3099
|
+
format?: "number" | "money" | "percent";
|
|
3100
|
+
/** Unit after numbers ("km", "books"). */
|
|
3101
|
+
unit?: string;
|
|
3102
|
+
currency?: string;
|
|
3103
|
+
due?: Date | string | number;
|
|
3104
|
+
icon?: IconName;
|
|
3105
|
+
tint?: Tint;
|
|
3106
|
+
milestones?: {
|
|
3107
|
+
label: string;
|
|
3108
|
+
done?: boolean;
|
|
3109
|
+
}[];
|
|
3110
|
+
/** A note under the progress ("€250 a month keeps you on track"). */
|
|
3111
|
+
note?: ReactNode;
|
|
3112
|
+
}
|
|
3113
|
+
export interface InsightCardProps extends BaseProps {
|
|
3114
|
+
/** `"glass"`: translucent glass over a backdrop (`Ambient`, a photo, a map); `"solid"` opts out inside a glass `UIProvider`. */
|
|
3115
|
+
surface?: Surface;
|
|
3116
|
+
title: string;
|
|
3117
|
+
children?: ReactNode;
|
|
3118
|
+
icon?: IconName;
|
|
3119
|
+
tone?: "info" | "success" | "warning" | "highlight";
|
|
3120
|
+
/** Above the title: area and time ("Money · 2 h ago"). */
|
|
3121
|
+
meta?: ReactNode;
|
|
3122
|
+
/** Where the insight comes from, as chips (like chat sources). */
|
|
3123
|
+
sources?: Source[];
|
|
3124
|
+
/** Why the assistant shows it; folded away behind "Why am I seeing this?". */
|
|
3125
|
+
why?: ReactNode;
|
|
3126
|
+
onAccept?: () => void;
|
|
3127
|
+
acceptLabel?: string;
|
|
3128
|
+
onSnooze?: () => void;
|
|
3129
|
+
onDismiss?: () => void;
|
|
3130
|
+
}
|
|
3131
|
+
export interface ConsentScope {
|
|
3132
|
+
id: string;
|
|
3133
|
+
label: string;
|
|
3134
|
+
description?: string;
|
|
3135
|
+
granted: boolean;
|
|
3136
|
+
/** Needed for the connection to work at all: shown, not switchable. */
|
|
3137
|
+
required?: boolean;
|
|
3138
|
+
}
|
|
3139
|
+
export interface ConsentConnector {
|
|
3140
|
+
id: string;
|
|
3141
|
+
name: string;
|
|
3142
|
+
icon?: IconName;
|
|
3143
|
+
/** A logo instead of the icon. */
|
|
3144
|
+
logo?: ReactNode;
|
|
3145
|
+
/** What the assistant uses it for. */
|
|
3146
|
+
purpose?: ReactNode;
|
|
3147
|
+
scopes: ConsentScope[];
|
|
3148
|
+
lastUsed?: Date | string | number;
|
|
3149
|
+
}
|
|
3150
|
+
export interface ConsentListProps extends BaseProps {
|
|
3151
|
+
/** `"glass"`: translucent glass over a backdrop (`Ambient`, a photo, a map); `"solid"` opts out inside a glass `UIProvider`. */
|
|
3152
|
+
surface?: Surface;
|
|
3153
|
+
connectors: ConsentConnector[];
|
|
3154
|
+
onScopeChange?: (connectorId: string, scopeId: string, granted: boolean) => void;
|
|
3155
|
+
onRevoke?: (connectorId: string) => void;
|
|
3156
|
+
/** Accessible name (default "Data access"). */
|
|
3157
|
+
label?: string;
|
|
3158
|
+
}
|
|
3159
|
+
export interface BudgetCategory {
|
|
3160
|
+
id: string;
|
|
3161
|
+
label: string;
|
|
3162
|
+
icon?: IconName;
|
|
3163
|
+
tint?: Tint;
|
|
3164
|
+
spent: number;
|
|
3165
|
+
limit: number;
|
|
3166
|
+
}
|
|
3167
|
+
export interface BudgetListProps extends BaseProps {
|
|
3168
|
+
categories: BudgetCategory[];
|
|
3169
|
+
currency?: string;
|
|
3170
|
+
/** A category was picked (to show its transactions). */
|
|
3171
|
+
onSelect?: (id: string) => void;
|
|
3172
|
+
/** Accessible name (default "Budgets"). */
|
|
3173
|
+
label?: string;
|
|
3174
|
+
}
|
|
3175
|
+
export interface Subscription {
|
|
3176
|
+
id: string;
|
|
3177
|
+
name: string;
|
|
3178
|
+
icon?: IconName;
|
|
3179
|
+
/** A logo instead of the icon. */
|
|
3180
|
+
logo?: ReactNode;
|
|
3181
|
+
amount: number;
|
|
3182
|
+
period: "week" | "month" | "year";
|
|
3183
|
+
/** Next charge. */
|
|
3184
|
+
next?: Date | string | number;
|
|
3185
|
+
status?: "active" | "trial" | "cancelled";
|
|
3186
|
+
category?: string;
|
|
3187
|
+
}
|
|
3188
|
+
export interface SubscriptionListProps extends BaseProps {
|
|
3189
|
+
items: Subscription[];
|
|
3190
|
+
currency?: string;
|
|
3191
|
+
/** "Manage" on a subscription (cancel, change plan …). */
|
|
3192
|
+
onManage?: (id: string) => void;
|
|
3193
|
+
/** Hide the monthly and yearly totals. */
|
|
3194
|
+
totals?: boolean;
|
|
3195
|
+
/** Accessible name (default "Subscriptions"). */
|
|
3196
|
+
label?: string;
|
|
3197
|
+
}
|
|
3198
|
+
export interface NetWorthCardProps extends BaseProps {
|
|
3199
|
+
/** `"glass"`: translucent glass over a backdrop (`Ambient`, a photo, a map); `"solid"` opts out inside a glass `UIProvider`. */
|
|
3200
|
+
surface?: Surface;
|
|
3201
|
+
assets: {
|
|
3202
|
+
label: string;
|
|
3203
|
+
value: number;
|
|
3204
|
+
icon?: IconName;
|
|
3205
|
+
}[];
|
|
3206
|
+
liabilities?: {
|
|
3207
|
+
label: string;
|
|
3208
|
+
value: number;
|
|
3209
|
+
icon?: IconName;
|
|
3210
|
+
}[];
|
|
3211
|
+
/** Net worth over time, oldest first. */
|
|
3212
|
+
history?: number[];
|
|
3213
|
+
/** Change over `changeLabel` (e.g. +1,240 "since October"). */
|
|
3214
|
+
change?: number;
|
|
3215
|
+
changeLabel?: string;
|
|
3216
|
+
currency?: string;
|
|
3217
|
+
title?: string;
|
|
3218
|
+
}
|
|
3219
|
+
export interface DeadlineItem {
|
|
3220
|
+
id: string;
|
|
3221
|
+
title: string;
|
|
3222
|
+
/** What kind: "Contract", "ID card", "Tax" … */
|
|
3223
|
+
kind?: string;
|
|
3224
|
+
icon?: IconName;
|
|
3225
|
+
date: Date | string | number;
|
|
3226
|
+
amount?: number;
|
|
3227
|
+
done?: boolean;
|
|
3228
|
+
note?: string;
|
|
3229
|
+
}
|
|
3230
|
+
export interface DeadlineListProps extends BaseProps {
|
|
3231
|
+
items: DeadlineItem[];
|
|
3232
|
+
/** The day to count from (default: now). Set it for server rendering and stable output. */
|
|
3233
|
+
today?: Date | string | number;
|
|
3234
|
+
/** Days ahead that count as soon (default 14). */
|
|
3235
|
+
soon?: number;
|
|
3236
|
+
currency?: string;
|
|
3237
|
+
onDone?: (id: string) => void;
|
|
3238
|
+
/** Accessible name (default "Deadlines"). */
|
|
3239
|
+
label?: string;
|
|
3240
|
+
}
|
|
3241
|
+
export interface PolicyCardProps extends BaseProps {
|
|
3242
|
+
/** `"glass"`: translucent glass over a backdrop (`Ambient`, a photo, a map); `"solid"` opts out inside a glass `UIProvider`. */
|
|
3243
|
+
surface?: Surface;
|
|
3244
|
+
/** The kind of insurance: "Household contents", "Liability" … */
|
|
3245
|
+
type: string;
|
|
3246
|
+
insurer: string;
|
|
3247
|
+
icon?: IconName;
|
|
3248
|
+
tint?: Tint;
|
|
3249
|
+
policyNumber?: string;
|
|
3250
|
+
/** Show only the last four characters of the policy number. */
|
|
3251
|
+
maskNumber?: boolean;
|
|
3252
|
+
/** Sum insured: a number (money) or text ("unlimited"). */
|
|
3253
|
+
coverage?: number | ReactNode;
|
|
3254
|
+
premium?: {
|
|
3255
|
+
amount: number;
|
|
3256
|
+
period: "month" | "quarter" | "year";
|
|
3257
|
+
};
|
|
3258
|
+
deductible?: number;
|
|
3259
|
+
renews?: Date | string | number;
|
|
3260
|
+
status?: "active" | "pending" | "expiring" | "lapsed";
|
|
3261
|
+
currency?: string;
|
|
3262
|
+
/** Buttons at the foot (documents, report a claim …). */
|
|
3263
|
+
actions?: ReactNode;
|
|
3264
|
+
}
|
|
3265
|
+
export interface CoverageRow {
|
|
3266
|
+
id: string;
|
|
3267
|
+
risk: string;
|
|
3268
|
+
status: "covered" | "partial" | "none";
|
|
3269
|
+
note?: ReactNode;
|
|
3270
|
+
/** Which policy covers it. */
|
|
3271
|
+
policy?: string;
|
|
3272
|
+
}
|
|
3273
|
+
export interface CoverageMatrixProps extends BaseProps {
|
|
3274
|
+
rows: CoverageRow[];
|
|
3275
|
+
/** Accessible name and caption (default "Coverage"). */
|
|
3276
|
+
label?: string;
|
|
3277
|
+
}
|
|
3278
|
+
export interface ClaimStep {
|
|
3279
|
+
label: string;
|
|
3280
|
+
date?: Date | string | number;
|
|
3281
|
+
state: "done" | "current" | "todo" | "failed";
|
|
3282
|
+
note?: ReactNode;
|
|
3283
|
+
}
|
|
3284
|
+
export interface ClaimTimelineProps extends BaseProps {
|
|
3285
|
+
title: string;
|
|
3286
|
+
/** Reference and insurer under the title. */
|
|
3287
|
+
meta?: ReactNode;
|
|
3288
|
+
amount?: number;
|
|
3289
|
+
currency?: string;
|
|
3290
|
+
steps: ClaimStep[];
|
|
3291
|
+
}
|
|
3292
|
+
export interface LifeDocument {
|
|
3293
|
+
id: string;
|
|
3294
|
+
title: string;
|
|
3295
|
+
category?: string;
|
|
3296
|
+
icon?: IconName;
|
|
3297
|
+
holder?: string;
|
|
3298
|
+
expires?: Date | string | number;
|
|
3299
|
+
/** "PDF · 240 KB" */
|
|
3300
|
+
meta?: string;
|
|
3301
|
+
}
|
|
3302
|
+
export interface DocumentListProps extends BaseProps {
|
|
3303
|
+
documents: LifeDocument[];
|
|
3304
|
+
/** The day to count expiry from (default: now). */
|
|
3305
|
+
today?: Date | string | number;
|
|
3306
|
+
/** Days ahead that count as expiring soon (default 60). */
|
|
3307
|
+
soon?: number;
|
|
3308
|
+
onOpen?: (id: string) => void;
|
|
3309
|
+
/** Accessible name (default "Documents"). */
|
|
3310
|
+
label?: string;
|
|
3311
|
+
}
|
|
2980
3312
|
//# sourceMappingURL=types.d.ts.map
|