lutra 0.0.33 → 0.1.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 +4 -24
- package/dist/components/AspectRatio.svelte +26 -0
- package/dist/components/AspectRatio.svelte.d.ts +8 -0
- package/dist/components/Dialog.svelte +78 -0
- package/dist/components/Dialog.svelte.d.ts +14 -0
- package/dist/components/Layout.svelte +32 -0
- package/dist/components/Layout.svelte.d.ts +11 -0
- package/dist/components/PageContent.svelte +108 -0
- package/dist/components/PageContent.svelte.d.ts +38 -0
- package/dist/components/Theme.svelte +87 -0
- package/dist/components/Theme.svelte.d.ts +17 -0
- package/dist/{display → components}/Tooltip.svelte +33 -8
- package/dist/components/Tooltip.svelte.d.ts +12 -0
- package/dist/config.d.ts +30 -0
- package/dist/config.js +18 -0
- package/dist/css/0-layers.css +1 -0
- package/dist/css/1-props.css +775 -0
- package/dist/css/2-base.css +209 -0
- package/dist/css/3-typo.css +65 -0
- package/dist/css/4-layout.css +5 -0
- package/dist/css/5-media.css +21 -0
- package/dist/css/lutra.css +6 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +5 -2
- package/dist/types.d.ts +39 -0
- package/dist/types.js +25 -0
- package/package.json +29 -82
- package/dist/color.css +0 -0
- package/dist/display/Avatar.svelte +0 -61
- package/dist/display/Avatar.svelte.d.ts +0 -19
- package/dist/display/Badge.svelte +0 -91
- package/dist/display/Badge.svelte.d.ts +0 -30
- package/dist/display/Callout.svelte +0 -109
- package/dist/display/Callout.svelte.d.ts +0 -28
- package/dist/display/Close.svelte +0 -58
- package/dist/display/Close.svelte.d.ts +0 -18
- package/dist/display/Code.svelte +0 -190
- package/dist/display/Code.svelte.d.ts +0 -32
- package/dist/display/ContextTip.svelte +0 -23
- package/dist/display/ContextTip.svelte.d.ts +0 -18
- package/dist/display/DataList.svelte +0 -16
- package/dist/display/DataList.svelte.d.ts +0 -21
- package/dist/display/Details.svelte +0 -49
- package/dist/display/Details.svelte.d.ts +0 -27
- package/dist/display/Hero.svelte +0 -50
- package/dist/display/Hero.svelte.d.ts +0 -26
- package/dist/display/Icon.svelte +0 -39
- package/dist/display/Icon.svelte.d.ts +0 -19
- package/dist/display/IconButton.svelte +0 -91
- package/dist/display/IconButton.svelte.d.ts +0 -27
- package/dist/display/Image.svelte +0 -91
- package/dist/display/Image.svelte.d.ts +0 -26
- package/dist/display/Indicator.svelte +0 -352
- package/dist/display/Indicator.svelte.d.ts +0 -23
- package/dist/display/Inset.svelte +0 -18
- package/dist/display/Inset.svelte.d.ts +0 -18
- package/dist/display/LineChart.svelte +0 -385
- package/dist/display/LineChart.svelte.d.ts +0 -24
- package/dist/display/LoadingIndicator.svelte +0 -33
- package/dist/display/LoadingIndicator.svelte.d.ts +0 -15
- package/dist/display/Modal.svelte +0 -116
- package/dist/display/Modal.svelte.d.ts +0 -27
- package/dist/display/Notification.svelte +0 -104
- package/dist/display/Notification.svelte.d.ts +0 -23
- package/dist/display/Panel.svelte +0 -23
- package/dist/display/Panel.svelte.d.ts +0 -19
- package/dist/display/Popup.svelte +0 -111
- package/dist/display/Popup.svelte.d.ts +0 -25
- package/dist/display/Stat.svelte +0 -81
- package/dist/display/Stat.svelte.d.ts +0 -30
- package/dist/display/Table.svelte +0 -28
- package/dist/display/Table.svelte.d.ts +0 -24
- package/dist/display/TablePaginator.svelte +0 -51
- package/dist/display/TablePaginator.svelte.d.ts +0 -21
- package/dist/display/Tag.svelte +0 -90
- package/dist/display/Tag.svelte.d.ts +0 -32
- package/dist/display/Tooltip.svelte.d.ts +0 -23
- package/dist/display/chart.d.ts +0 -78
- package/dist/display/chart.js +0 -212
- package/dist/display/index.d.ts +0 -24
- package/dist/display/index.js +0 -24
- package/dist/display/notifications.svelte.d.ts +0 -21
- package/dist/display/notifications.svelte.js +0 -31
- package/dist/form/Button.svelte +0 -39
- package/dist/form/Button.svelte.d.ts +0 -26
- package/dist/form/FieldActions.svelte +0 -68
- package/dist/form/FieldActions.svelte.d.ts +0 -20
- package/dist/form/FieldContainer.svelte +0 -37
- package/dist/form/FieldContainer.svelte.d.ts +0 -19
- package/dist/form/FieldContent.svelte +0 -153
- package/dist/form/FieldContent.svelte.d.ts +0 -31
- package/dist/form/FieldError.svelte +0 -14
- package/dist/form/FieldError.svelte.d.ts +0 -18
- package/dist/form/FieldSection.svelte +0 -86
- package/dist/form/FieldSection.svelte.d.ts +0 -20
- package/dist/form/Fieldset.svelte +0 -68
- package/dist/form/Fieldset.svelte.d.ts +0 -31
- package/dist/form/Form.svelte +0 -136
- package/dist/form/Form.svelte.d.ts +0 -38
- package/dist/form/ImageUpload.svelte +0 -259
- package/dist/form/ImageUpload.svelte.d.ts +0 -31
- package/dist/form/Input.svelte +0 -326
- package/dist/form/Input.svelte.d.ts +0 -117
- package/dist/form/InputLength.svelte +0 -32
- package/dist/form/InputLength.svelte.d.ts +0 -20
- package/dist/form/Label.svelte +0 -44
- package/dist/form/Label.svelte.d.ts +0 -25
- package/dist/form/LogoUpload.svelte +0 -100
- package/dist/form/LogoUpload.svelte.d.ts +0 -29
- package/dist/form/Select.svelte +0 -136
- package/dist/form/Select.svelte.d.ts +0 -70
- package/dist/form/Textarea.svelte +0 -163
- package/dist/form/Textarea.svelte.d.ts +0 -108
- package/dist/form/Toggle.svelte +0 -2
- package/dist/form/Toggle.svelte.d.ts +0 -15
- package/dist/form/client.svelte.d.ts +0 -44
- package/dist/form/client.svelte.js +0 -98
- package/dist/form/form.d.ts +0 -54
- package/dist/form/form.js +0 -340
- package/dist/form/index.d.ts +0 -18
- package/dist/form/index.js +0 -18
- package/dist/form/types.d.ts +0 -62
- package/dist/form/types.js +0 -1
- package/dist/icons/IconAlert.svelte +0 -3
- package/dist/icons/IconAlert.svelte.d.ts +0 -23
- package/dist/icons/IconCopy.svelte +0 -3
- package/dist/icons/IconCopy.svelte.d.ts +0 -23
- package/dist/icons/IconDone.svelte +0 -3
- package/dist/icons/IconDone.svelte.d.ts +0 -23
- package/dist/icons/IconError.svelte +0 -3
- package/dist/icons/IconError.svelte.d.ts +0 -23
- package/dist/icons/IconHelp.svelte +0 -3
- package/dist/icons/IconHelp.svelte.d.ts +0 -23
- package/dist/icons/IconHide.svelte +0 -3
- package/dist/icons/IconHide.svelte.d.ts +0 -23
- package/dist/icons/IconInfo.svelte +0 -3
- package/dist/icons/IconInfo.svelte.d.ts +0 -23
- package/dist/icons/IconLink.svelte +0 -3
- package/dist/icons/IconLink.svelte.d.ts +0 -23
- package/dist/icons/IconMenuBurger.svelte +0 -3
- package/dist/icons/IconMenuBurger.svelte.d.ts +0 -23
- package/dist/icons/IconMenuDots.svelte +0 -3
- package/dist/icons/IconMenuDots.svelte.d.ts +0 -23
- package/dist/icons/IconSearch.svelte +0 -3
- package/dist/icons/IconSearch.svelte.d.ts +0 -23
- package/dist/icons/IconShow.svelte +0 -3
- package/dist/icons/IconShow.svelte.d.ts +0 -23
- package/dist/icons/IconSuccess.svelte +0 -3
- package/dist/icons/IconSuccess.svelte.d.ts +0 -23
- package/dist/icons/IconWarning.svelte +0 -3
- package/dist/icons/IconWarning.svelte.d.ts +0 -23
- package/dist/icons/index.d.ts +0 -14
- package/dist/icons/index.js +0 -14
- package/dist/layout/Layout.svelte +0 -47
- package/dist/layout/Layout.svelte.d.ts +0 -22
- package/dist/layout/LayoutFooter.svelte +0 -21
- package/dist/layout/LayoutFooter.svelte.d.ts +0 -18
- package/dist/layout/LayoutGrid.svelte +0 -51
- package/dist/layout/LayoutGrid.svelte.d.ts +0 -27
- package/dist/layout/LayoutHeader.svelte +0 -97
- package/dist/layout/LayoutHeader.svelte.d.ts +0 -34
- package/dist/layout/LayoutSideMenu.svelte +0 -55
- package/dist/layout/LayoutSideMenu.svelte.d.ts +0 -21
- package/dist/layout/LayoutTypes.d.ts +0 -15
- package/dist/layout/LayoutTypes.js +0 -9
- package/dist/layout/Overlay.svelte +0 -20
- package/dist/layout/Overlay.svelte.d.ts +0 -25
- package/dist/layout/OverlayContainer.svelte +0 -28
- package/dist/layout/OverlayContainer.svelte.d.ts +0 -15
- package/dist/layout/OverlayLayer.svelte +0 -140
- package/dist/layout/OverlayLayer.svelte.d.ts +0 -19
- package/dist/layout/PageContent.svelte +0 -82
- package/dist/layout/PageContent.svelte.d.ts +0 -25
- package/dist/layout/Theme.svelte +0 -243
- package/dist/layout/Theme.svelte.d.ts +0 -19
- package/dist/layout/UIContent.svelte +0 -15
- package/dist/layout/UIContent.svelte.d.ts +0 -18
- package/dist/layout/index.d.ts +0 -11
- package/dist/layout/index.js +0 -11
- package/dist/layout/overlays.svelte.d.ts +0 -34
- package/dist/layout/overlays.svelte.js +0 -44
- package/dist/nav/Breadcrumb.svelte +0 -82
- package/dist/nav/Breadcrumb.svelte.d.ts +0 -28
- package/dist/nav/Menu.svelte +0 -170
- package/dist/nav/Menu.svelte.d.ts +0 -27
- package/dist/nav/MenuItem.svelte +0 -147
- package/dist/nav/MenuItem.svelte.d.ts +0 -22
- package/dist/nav/MenuTypes.d.ts +0 -58
- package/dist/nav/MenuTypes.js +0 -1
- package/dist/nav/NavMenu.svelte +0 -181
- package/dist/nav/NavMenu.svelte.d.ts +0 -19
- package/dist/nav/TabbedContent.svelte +0 -43
- package/dist/nav/TabbedContent.svelte.d.ts +0 -23
- package/dist/nav/Tabs.svelte +0 -158
- package/dist/nav/Tabs.svelte.d.ts +0 -25
- package/dist/nav/index.d.ts +0 -7
- package/dist/nav/index.js +0 -6
- package/dist/style.css +0 -950
- package/dist/typo/Clamp.svelte +0 -25
- package/dist/typo/Clamp.svelte.d.ts +0 -24
- package/dist/typo/H.svelte +0 -52
- package/dist/typo/H.svelte.d.ts +0 -28
- package/dist/typo/H1.svelte +0 -14
- package/dist/typo/H1.svelte.d.ts +0 -26
- package/dist/typo/H2.svelte +0 -14
- package/dist/typo/H2.svelte.d.ts +0 -26
- package/dist/typo/H3.svelte +0 -14
- package/dist/typo/H3.svelte.d.ts +0 -26
- package/dist/typo/H4.svelte +0 -14
- package/dist/typo/H4.svelte.d.ts +0 -26
- package/dist/typo/H5.svelte +0 -14
- package/dist/typo/H5.svelte.d.ts +0 -26
- package/dist/typo/H6.svelte +0 -14
- package/dist/typo/H6.svelte.d.ts +0 -26
- package/dist/typo/P.svelte +0 -34
- package/dist/typo/P.svelte.d.ts +0 -26
- package/dist/typo/index.d.ts +0 -9
- package/dist/typo/index.js +0 -9
- package/dist/utils/StringOrComponent.svelte +0 -14
- package/dist/utils/StringOrComponent.svelte.d.ts +0 -19
- package/dist/utils/StringOrSnippet.svelte +0 -11
- package/dist/utils/StringOrSnippet.svelte.d.ts +0 -19
- package/dist/utils/attr.d.ts +0 -5
- package/dist/utils/attr.js +0 -21
- package/dist/utils/color.d.ts +0 -51
- package/dist/utils/color.js +0 -97
- package/dist/utils/defaults.d.ts +0 -4
- package/dist/utils/defaults.js +0 -1
- package/dist/utils/dom.d.ts +0 -15
- package/dist/utils/dom.js +0 -74
- package/dist/utils/hooks.server.d.ts +0 -2
- package/dist/utils/hooks.server.js +0 -16
- package/dist/utils/id.d.ts +0 -1
- package/dist/utils/id.js +0 -3
- package/dist/utils/index.d.ts +0 -9
- package/dist/utils/index.js +0 -6
- package/dist/utils/isSnippet.d.ts +0 -3
- package/dist/utils/isSnippet.js +0 -11
- package/dist/utils/keyboard.svelte.d.ts +0 -22
- package/dist/utils/keyboard.svelte.js +0 -161
- /package/dist/{utils → util}/transitions.d.ts +0 -0
- /package/dist/{utils → util}/transitions.js +0 -0
package/dist/form/form.js
DELETED
@@ -1,340 +0,0 @@
|
|
1
|
-
import { Bodyguard } from "@auth70/bodyguard";
|
2
|
-
import { ZodArray, ZodNullable, ZodOptional, ZodEffects, ZodObject, ZodDefault, ZodString, ZodNumber, ZodBoolean, ZodDate } from "zod";
|
3
|
-
import { zerialize, dezerialize } from "@auth70/zodex-esm";
|
4
|
-
export const bodyguard = new Bodyguard();
|
5
|
-
/**
|
6
|
-
* Map a Zod type to a field type as a string.
|
7
|
-
* @param {Zod.ZodType} schema - The Zod schema to map to a field type.
|
8
|
-
* @returns {string} - The field type as a string.
|
9
|
-
*/
|
10
|
-
function mapZodTypeToFieldType(schema) {
|
11
|
-
if (schema instanceof ZodNullable) {
|
12
|
-
return mapZodTypeToFieldType(schema.unwrap());
|
13
|
-
}
|
14
|
-
if (schema instanceof ZodOptional) {
|
15
|
-
return mapZodTypeToFieldType(schema.unwrap());
|
16
|
-
}
|
17
|
-
if (schema instanceof ZodEffects) {
|
18
|
-
return mapZodTypeToFieldType(schema._def?.schema ?? schema);
|
19
|
-
}
|
20
|
-
if (schema instanceof ZodArray) {
|
21
|
-
return `Array<${mapZodTypeToFieldType(schema.element)}>`;
|
22
|
-
}
|
23
|
-
if (schema instanceof ZodObject) {
|
24
|
-
return 'object';
|
25
|
-
}
|
26
|
-
if (schema instanceof ZodDefault) {
|
27
|
-
return mapZodTypeToFieldType(schema._def.innerType);
|
28
|
-
}
|
29
|
-
if (schema instanceof ZodDate) {
|
30
|
-
return 'date';
|
31
|
-
}
|
32
|
-
if (schema instanceof ZodString) {
|
33
|
-
return 'string';
|
34
|
-
}
|
35
|
-
if (schema instanceof ZodNumber) {
|
36
|
-
return 'number';
|
37
|
-
}
|
38
|
-
if (schema instanceof ZodBoolean) {
|
39
|
-
return 'boolean';
|
40
|
-
}
|
41
|
-
return schema.constructor.name;
|
42
|
-
}
|
43
|
-
/**
|
44
|
-
* Get fields from a Zod schema.
|
45
|
-
* @param {ZodObject<any>} schema - The schema to get fields from.
|
46
|
-
* @returns {Record<string, any>} - The fields from the schema.
|
47
|
-
*/
|
48
|
-
export function getFieldsFromSchema(schema, data, parents) {
|
49
|
-
if (!parents)
|
50
|
-
parents = [];
|
51
|
-
else
|
52
|
-
parents = [...parents];
|
53
|
-
const fields = {};
|
54
|
-
if (schema instanceof ZodEffects) {
|
55
|
-
return getFieldsFromSchema(schema._def.schema, data);
|
56
|
-
}
|
57
|
-
if (!(schema instanceof ZodObject)) {
|
58
|
-
console.error('[lutra] getFieldsFromSchema: Schema is not an object:', schema.constructor.name);
|
59
|
-
return fields;
|
60
|
-
}
|
61
|
-
for (const key in schema.shape) {
|
62
|
-
const field = schema.shape[key];
|
63
|
-
// Fields can be wrapped like ZodDefault._def.innerType._def.InnerType, etc. We want the last inner type's definition.
|
64
|
-
// On the way, let's check if any of the _def include a defaultValue.
|
65
|
-
let required = true;
|
66
|
-
let defaultValue = undefined;
|
67
|
-
let min = undefined;
|
68
|
-
let max = undefined;
|
69
|
-
let pattern = undefined;
|
70
|
-
let minlength = undefined;
|
71
|
-
let maxlength = undefined;
|
72
|
-
let type = field;
|
73
|
-
while (type instanceof ZodEffects || type instanceof ZodOptional || type instanceof ZodDefault || type instanceof ZodNullable) {
|
74
|
-
if (type instanceof ZodOptional || type instanceof ZodNullable) {
|
75
|
-
required = false;
|
76
|
-
type = type._def.innerType;
|
77
|
-
}
|
78
|
-
if (type instanceof ZodDefault) {
|
79
|
-
defaultValue = type._def.defaultValue();
|
80
|
-
type = type._def.innerType;
|
81
|
-
}
|
82
|
-
else {
|
83
|
-
type = type._def.innerType ? type._def.innerType : type;
|
84
|
-
}
|
85
|
-
}
|
86
|
-
// Check for min/max/regex checks
|
87
|
-
if (type._def.checks) {
|
88
|
-
for (const check of type._def.checks) {
|
89
|
-
if (check.kind === 'min') {
|
90
|
-
if (field instanceof ZodString || field._def?.innerType instanceof ZodString) {
|
91
|
-
minlength = check.value;
|
92
|
-
}
|
93
|
-
else {
|
94
|
-
min = check.value;
|
95
|
-
}
|
96
|
-
}
|
97
|
-
if (check.kind === 'max') {
|
98
|
-
if (field instanceof ZodString || field._def?.innerType instanceof ZodString) {
|
99
|
-
maxlength = check.value;
|
100
|
-
}
|
101
|
-
else {
|
102
|
-
max = check.value;
|
103
|
-
}
|
104
|
-
}
|
105
|
-
if (check.kind === 'regex') {
|
106
|
-
pattern = check.regex.source;
|
107
|
-
}
|
108
|
-
if (check.kind === 'email') {
|
109
|
-
// ...
|
110
|
-
}
|
111
|
-
}
|
112
|
-
}
|
113
|
-
if (type instanceof ZodObject) {
|
114
|
-
const children = getFieldsFromSchema(type, data, [...parents, key]);
|
115
|
-
Object.entries(children).forEach(([childKey, childField]) => {
|
116
|
-
const name = [...parents, key, childKey].join('.');
|
117
|
-
fields[name] = {
|
118
|
-
name,
|
119
|
-
tainted: childField.tainted,
|
120
|
-
coerce: childField.coerce,
|
121
|
-
min: childField.min,
|
122
|
-
max: childField.max,
|
123
|
-
minlength: childField.minlength,
|
124
|
-
maxlength: childField.maxlength,
|
125
|
-
pattern: childField.pattern,
|
126
|
-
required: childField.required,
|
127
|
-
defaultValue: childField.defaultValue,
|
128
|
-
isArray: childField.isArray,
|
129
|
-
type: childField.type,
|
130
|
-
};
|
131
|
-
});
|
132
|
-
}
|
133
|
-
else {
|
134
|
-
fields[key] = {
|
135
|
-
name: [...parents, key].join('.'),
|
136
|
-
tainted: false,
|
137
|
-
min,
|
138
|
-
max,
|
139
|
-
minlength,
|
140
|
-
maxlength,
|
141
|
-
pattern,
|
142
|
-
required,
|
143
|
-
defaultValue,
|
144
|
-
isArray: field instanceof ZodArray,
|
145
|
-
type: mapZodTypeToFieldType(field instanceof ZodArray ? field.element : field),
|
146
|
-
};
|
147
|
-
}
|
148
|
-
}
|
149
|
-
return fields;
|
150
|
-
}
|
151
|
-
/**
|
152
|
-
* Server page load call. Optionally with a default object to populate the form with from locals.
|
153
|
-
* @param {ZodType} schema - The schema to parse the form with.
|
154
|
-
* @param {RequestEvent} event - The event to load the (possible) form from.
|
155
|
-
* @param {JSONLike | string} objOrName - The default object to populate the form with, or the name of the object in locals.
|
156
|
-
* @param {JSONLike} obj - The default object to populate the form with.
|
157
|
-
* @returns {Promise<Form<Z>>} - The form to use.
|
158
|
-
*/
|
159
|
-
export async function loadForm(schema, event, objOrName = 'form', obj) {
|
160
|
-
let name = typeof objOrName === 'string' ? objOrName : 'form';
|
161
|
-
let _obj = typeof objOrName === 'string' ? obj : objOrName;
|
162
|
-
// If there is a form in locals, it's been passed down from a form action using parseForm. Return it.
|
163
|
-
if (event.locals[name]) {
|
164
|
-
return Promise.resolve(event.locals[name]);
|
165
|
-
}
|
166
|
-
// Serialize the schema to send over the wire.
|
167
|
-
const serializedSchema = zerialize(schema);
|
168
|
-
// Get the fields from the schema.
|
169
|
-
const fields = getFieldsFromSchema(schema);
|
170
|
-
// Create the form object.
|
171
|
-
const form = event.locals.form;
|
172
|
-
return {
|
173
|
-
name,
|
174
|
-
valid: form ? form.valid : (obj ? true : false),
|
175
|
-
tainted: form ? form.tainted : false,
|
176
|
-
schema: serializedSchema,
|
177
|
-
posted: form ? form.posted : false,
|
178
|
-
state: form ? form.state : 'idle',
|
179
|
-
fields,
|
180
|
-
data: Object.assign(Object.fromEntries(Object.entries(fields).map(([key, value]) => {
|
181
|
-
// If the key is in the passed object, use that value. Otherwise, try to use the default value.
|
182
|
-
return [key, value.defaultValue];
|
183
|
-
})), _obj ? _obj : {}),
|
184
|
-
};
|
185
|
-
}
|
186
|
-
/**
|
187
|
-
* Parse zod issues into form issues (with a path string).
|
188
|
-
* @param {ZodIssue[]} issues - The issues to parse.
|
189
|
-
* @returns {FormIssue[]} - The parsed issues.
|
190
|
-
*/
|
191
|
-
export function parseFormIssues(issues) {
|
192
|
-
return JSON.parse(JSON.stringify((issues || []).map((issue) => {
|
193
|
-
return {
|
194
|
-
...issue,
|
195
|
-
name: arrayPathToStringPath(issue.path),
|
196
|
-
};
|
197
|
-
})));
|
198
|
-
}
|
199
|
-
/**
|
200
|
-
* Parse a form using a schema.
|
201
|
-
* @param {ZodType} schema - The schema to parse the form with.
|
202
|
-
* @param {Request} request - The request to parse.
|
203
|
-
* @param {BodyguardFormConfig | string} optsOrName - The options for the form validation, or the name of the form in locals.
|
204
|
-
* @param {BodyguardFormConfig} opts - The options for the form validation.
|
205
|
-
* @returns {Promise<{ valid: false } | { valid: true, data: Infer<Z> }>} - The result of the form validation.
|
206
|
-
*/
|
207
|
-
export async function parseForm(schema, event, optsOrName = 'form', opts) {
|
208
|
-
let name = typeof optsOrName === 'string' ? optsOrName : 'form';
|
209
|
-
opts = typeof optsOrName === 'string' ? opts : optsOrName;
|
210
|
-
// Use bodyguard to parse the form.
|
211
|
-
const data = await bodyguard.softForm(event.request, schema.parse, opts);
|
212
|
-
// Get the fields from the schema.
|
213
|
-
const fields = getFieldsFromSchema(schema, data);
|
214
|
-
// Serialize the schema to send over the wire.
|
215
|
-
const serializedSchema = zerialize(schema);
|
216
|
-
// Create the form object.
|
217
|
-
const form = {
|
218
|
-
name: name,
|
219
|
-
valid: data.success,
|
220
|
-
tainted: !data.success,
|
221
|
-
state: data.success ? 'success' : 'error',
|
222
|
-
schema: serializedSchema,
|
223
|
-
posted: true,
|
224
|
-
fields: Object.fromEntries(Object.entries(fields).map(([key, field]) => {
|
225
|
-
// Mark fields as tainted if they were in the request.
|
226
|
-
return [key, {
|
227
|
-
...field,
|
228
|
-
tainted: data.success ? false : data.value.hasOwnProperty(key),
|
229
|
-
}];
|
230
|
-
})),
|
231
|
-
// ensure all fields are present by populating `data` from `fields` instead of trusting `data` to have all fields
|
232
|
-
data: Object.assign(Object.fromEntries(Object.entries(fields).map(([key, value]) => {
|
233
|
-
return [key, value.isArray ? (data.value[key] || []) : (data.value[key] !== undefined ? data.value[key] : (value.defaultValue ?? null))];
|
234
|
-
})), data.value),
|
235
|
-
issues: data.success ? undefined : parseFormIssues(data.error.issues),
|
236
|
-
};
|
237
|
-
// Attach the form to the locals to pass it to the client via loadForm.
|
238
|
-
event.locals[name] = form;
|
239
|
-
return form;
|
240
|
-
}
|
241
|
-
/**
|
242
|
-
* Convert an array path from a Zod issue to a string path for a form field.
|
243
|
-
* @param {(string | number)[]} path - The path to convert.
|
244
|
-
* @returns {string} - The string path.
|
245
|
-
*/
|
246
|
-
export function arrayPathToStringPath(path) {
|
247
|
-
// Joins the path with dots. For arrays, it adds brackets.
|
248
|
-
return path.map((p) => {
|
249
|
-
if (p.toString().match(/^\d+$/)) {
|
250
|
-
return `${p}[]`;
|
251
|
-
}
|
252
|
-
return p;
|
253
|
-
}).join('.');
|
254
|
-
}
|
255
|
-
/**
|
256
|
-
* Get a value from an object using a string path.
|
257
|
-
* @param {any} obj - The object to get the value from.
|
258
|
-
* @param {string} path - The path to get the value from.
|
259
|
-
* @returns {string | number | Date | boolean | object | undefined} - The value from the object.
|
260
|
-
*/
|
261
|
-
export function getFromObjWithStringPath(obj, path) {
|
262
|
-
if (!obj)
|
263
|
-
return undefined;
|
264
|
-
const parts = path.split('.');
|
265
|
-
let current = obj;
|
266
|
-
for (let i = 0; i < parts.length; i++) {
|
267
|
-
const part = parts[i];
|
268
|
-
// Support for array access patterns: foo[] or foo[0]
|
269
|
-
const arrayMatch = part.match(/^(.+?)(\[\d*\])?$/);
|
270
|
-
if (arrayMatch) {
|
271
|
-
const [, key, indexPart] = arrayMatch;
|
272
|
-
// Navigate into 'properties' if it exists
|
273
|
-
if (current.properties && current.properties[key]) {
|
274
|
-
current = current.properties[key];
|
275
|
-
}
|
276
|
-
else if (current[key]) {
|
277
|
-
current = current[key];
|
278
|
-
}
|
279
|
-
else {
|
280
|
-
// The path is invalid for the given structure or the index is not a number
|
281
|
-
return undefined;
|
282
|
-
}
|
283
|
-
// If indexPart is defined, it means we're dealing with an array index
|
284
|
-
if (indexPart) {
|
285
|
-
// Dealing with an array index, e.g., [0]
|
286
|
-
const index = parseInt(indexPart.slice(1, -1), 10);
|
287
|
-
if (!Array.isArray(current) || isNaN(index)) {
|
288
|
-
return undefined;
|
289
|
-
}
|
290
|
-
current = current[index];
|
291
|
-
}
|
292
|
-
}
|
293
|
-
else {
|
294
|
-
// Direct property access
|
295
|
-
if (current.properties && current.properties[part]) {
|
296
|
-
current = current.properties[part];
|
297
|
-
}
|
298
|
-
else if (current[part]) {
|
299
|
-
current = current[part];
|
300
|
-
}
|
301
|
-
else {
|
302
|
-
return undefined;
|
303
|
-
}
|
304
|
-
}
|
305
|
-
if (current === undefined) {
|
306
|
-
return undefined;
|
307
|
-
}
|
308
|
-
}
|
309
|
-
// The value must be directly returnable without checking type,
|
310
|
-
// as we might be looking for an object structure.
|
311
|
-
return current;
|
312
|
-
}
|
313
|
-
/**
|
314
|
-
* Get individual validators for each field in a form.
|
315
|
-
* @param {Form} form - The form to get the validators from.
|
316
|
-
* @returns {Record<keyof Infer<T>, (value: any) => boolean>} - The validators for each field.
|
317
|
-
*/
|
318
|
-
export function getIndividualValidators(form) {
|
319
|
-
if (!form)
|
320
|
-
return {};
|
321
|
-
const schema = form.schema;
|
322
|
-
const fields = form.fields;
|
323
|
-
//console.log('[lutra] getIndividualValidators:', schema, fields, form)
|
324
|
-
if (!schema || !fields) {
|
325
|
-
console.error('[lutra] getIndividualValidators: Schema or fields not found:', schema, fields);
|
326
|
-
return {};
|
327
|
-
}
|
328
|
-
// Match the dot-notation form fields with the object schema fields.
|
329
|
-
// For each field, create a validator function by dezerilizing the schema for that field from the schema.
|
330
|
-
// Return the validators, not the parsed data.
|
331
|
-
const validators = Object.fromEntries(Object.entries(fields).map(([key, field]) => {
|
332
|
-
const schemaField = getFromObjWithStringPath(schema, key);
|
333
|
-
if (!schemaField) {
|
334
|
-
console.error('[lutra] getIndividualValidators: Schema field not found:', key);
|
335
|
-
return [key, (value) => true];
|
336
|
-
}
|
337
|
-
return [key, dezerialize(schemaField)];
|
338
|
-
}));
|
339
|
-
return validators;
|
340
|
-
}
|
package/dist/form/index.d.ts
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
export { default as Button } from './Button.svelte';
|
2
|
-
export { default as FieldActions } from './FieldActions.svelte';
|
3
|
-
export { default as FieldContainer } from './FieldContainer.svelte';
|
4
|
-
export { default as FieldContent } from './FieldContent.svelte';
|
5
|
-
export { default as FieldError } from './FieldError.svelte';
|
6
|
-
export { default as FieldSection } from './FieldSection.svelte';
|
7
|
-
export { default as Fieldset } from './Fieldset.svelte';
|
8
|
-
export { default as Form } from './Form.svelte';
|
9
|
-
export { default as ImageUpload } from './ImageUpload.svelte';
|
10
|
-
export { default as Input } from './Input.svelte';
|
11
|
-
export { default as InputLength } from './InputLength.svelte';
|
12
|
-
export { default as Label } from './Label.svelte';
|
13
|
-
export { default as LogoUpload } from './LogoUpload.svelte';
|
14
|
-
export { default as Select } from './Select.svelte';
|
15
|
-
export { default as Textarea } from './Textarea.svelte';
|
16
|
-
export * from './types.js';
|
17
|
-
export * from './form.js';
|
18
|
-
export * from './client.svelte.js';
|
package/dist/form/index.js
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
export { default as Button } from './Button.svelte';
|
2
|
-
export { default as FieldActions } from './FieldActions.svelte';
|
3
|
-
export { default as FieldContainer } from './FieldContainer.svelte';
|
4
|
-
export { default as FieldContent } from './FieldContent.svelte';
|
5
|
-
export { default as FieldError } from './FieldError.svelte';
|
6
|
-
export { default as FieldSection } from './FieldSection.svelte';
|
7
|
-
export { default as Fieldset } from './Fieldset.svelte';
|
8
|
-
export { default as Form } from './Form.svelte';
|
9
|
-
export { default as ImageUpload } from './ImageUpload.svelte';
|
10
|
-
export { default as Input } from './Input.svelte';
|
11
|
-
export { default as InputLength } from './InputLength.svelte';
|
12
|
-
export { default as Label } from './Label.svelte';
|
13
|
-
export { default as LogoUpload } from './LogoUpload.svelte';
|
14
|
-
export { default as Select } from './Select.svelte';
|
15
|
-
export { default as Textarea } from './Textarea.svelte';
|
16
|
-
export * from './types.js';
|
17
|
-
export * from './form.js';
|
18
|
-
export * from './client.svelte.js';
|
package/dist/form/types.d.ts
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
import type { GenericIssue } from "@auth70/bodyguard";
|
2
|
-
import type { ZodType, infer as Infer, ZodTuple, ZodBigInt, ZodNaN, ZodSet, ZodVoid, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodRecord, ZodMap, ZodDiscriminatedUnion, ZodUnion, ZodIntersection, ZodNativeEnum, ZodEnum, ZodFunction, ZodLazy, ZodLiteral, ZodCatch, ZodPipeline, ZodBranded, ZodPromise, ZodArray, ZodNullable, ZodOptional, ZodEffects, ZodObject, ZodDefault, ZodString, ZodNumber, ZodBoolean, ZodDate } from "zod";
|
3
|
-
export type Autocomplete = 'on' | 'off' | AutocompleteSingleToken | AutocompleteBilling | AutocompleteShipping;
|
4
|
-
export type AutocompleteBilling = 'billing' | `billing ${AutocompleteSingleToken}`;
|
5
|
-
export type AutocompleteShipping = 'shipping' | `shipping ${AutocompleteSingleToken}`;
|
6
|
-
export type BeforeSubmitFn = (opts: {
|
7
|
-
form: HTMLFormElement;
|
8
|
-
data: FormData;
|
9
|
-
cancel: () => void;
|
10
|
-
}) => void | Promise<void>;
|
11
|
-
export type AddBeforeSubmitFn = (id: string, fn: BeforeSubmitFn) => void;
|
12
|
-
export type AutocompleteSingleToken = `section-${string}` | "name" | "honorific-prefix" | "given-name" | "additional-name" | "family-name" | "honorific-suffix" | "nickname" | "email" | "username" | "new-password" | "current-password" | "one-time-code" | "organization-title" | "organization" | "street-address" | "address-line1" | "address-line2" | "address-line3" | "address-level4" | "address-level3" | "address-level2" | "address-level1" | "country" | "country-name" | "postal-code" | "cc-name" | "cc-given-name" | "cc-additional-name" | "cc-family-name" | "cc-number" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-csc" | "cc-type" | "transaction-currency" | "transaction-amount" | "language" | "bday" | "bday-day" | "bday-month" | "bday-year" | "sex" | "tel" | "tel-country-code" | "tel-national" | "tel-area-code" | "tel-local" | "tel-extension" | "impp" | "url" | "photo" | "webauthn";
|
13
|
-
export type Modifiers = ZodOptional<ZodTypes> | ZodNullable<ZodTypes> | ZodDefault<ZodTypes>;
|
14
|
-
export type Primitives = ZodString | ZodNumber | ZodNaN | ZodBigInt | ZodBoolean | ZodDate | ZodUndefined | ZodNull | ZodAny | ZodUnknown | ZodNever | ZodVoid;
|
15
|
-
export type ListCollections = ZodTuple<any, any> | ZodSet<ZodTypes> | ZodArray<ZodTypes>;
|
16
|
-
export type KVCollections = ZodObject<any> | ZodRecord<any, ZodTypes> | ZodMap<ZodTypes, ZodTypes>;
|
17
|
-
export type ADTs = ZodUnion<readonly [ZodTypes, ...ZodTypes[]]> | ZodDiscriminatedUnion<any, ZodObject<{
|
18
|
-
[k: string]: ZodTypes;
|
19
|
-
}>[]> | ZodIntersection<ZodTypes, ZodTypes> | ZodNativeEnum<any> | ZodEnum<any>;
|
20
|
-
export type ZodTypes = Modifiers | Primitives | ListCollections | KVCollections | ADTs | ZodFunction<any, ZodTypes> | ZodLazy<ZodTypes> | ZodLiteral<any> | ZodEffects<any, any> | ZodCatch<ZodTypes> | ZodPromise<ZodTypes> | ZodBranded<ZodTypes, any> | ZodPipeline<ZodTypes, ZodTypes>;
|
21
|
-
export type ZTypeName<T extends ZodTypes> = T["_def"]["typeName"];
|
22
|
-
export type FormIssue = GenericIssue & {
|
23
|
-
name: string;
|
24
|
-
};
|
25
|
-
export type LutraForm<T extends ZodType<any, any>> = {
|
26
|
-
/** The name of the form. */
|
27
|
-
name: string;
|
28
|
-
/** Whether the form is valid. */
|
29
|
-
valid: boolean;
|
30
|
-
/** Whether the user has interacted with the form. */
|
31
|
-
tainted?: boolean;
|
32
|
-
/** Whether the form has been posted. */
|
33
|
-
posted: boolean;
|
34
|
-
/** The schema to parse the form with. */
|
35
|
-
schema?: T;
|
36
|
-
/** The fields of the form. */
|
37
|
-
fields: Record<string, FormField>;
|
38
|
-
/** The data of the form. */
|
39
|
-
data?: Infer<T>;
|
40
|
-
/** Original data for form before editing */
|
41
|
-
originalData?: Infer<T>;
|
42
|
-
/** The issues of the form. */
|
43
|
-
issues?: FormIssue[];
|
44
|
-
/** The state of the form. */
|
45
|
-
state: 'idle' | 'loading' | 'success' | 'error';
|
46
|
-
};
|
47
|
-
export type FormField = {
|
48
|
-
name: string;
|
49
|
-
tainted: boolean;
|
50
|
-
coerce?: boolean;
|
51
|
-
min?: number;
|
52
|
-
max?: number;
|
53
|
-
minlength?: number;
|
54
|
-
maxlength?: number;
|
55
|
-
hasIssue?: boolean;
|
56
|
-
pattern?: string;
|
57
|
-
required: boolean;
|
58
|
-
defaultValue?: string | number | boolean;
|
59
|
-
isArray: boolean;
|
60
|
-
type: string;
|
61
|
-
children?: Record<string, FormField>;
|
62
|
-
};
|
package/dist/form/types.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,3 +0,0 @@
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 16 16">
|
2
|
-
<path fill="currentColor" d="M7.999,1.063C7.419,1.063 6.84,1.339 6.51,1.889L0.232,12.38C-0.435,13.489 0.42,14.937 1.717,14.937L14.277,14.937C15.578,14.937 16.433,13.489 15.77,12.38L9.488,1.889C9.159,1.339 8.579,1.063 7.999,1.063ZM7.999,2.114C8.22,2.114 8.441,2.223 8.575,2.44L14.852,12.926C15.115,13.364 14.823,13.869 14.277,13.869L1.717,13.869C1.175,13.869 0.883,13.364 1.146,12.926L7.423,2.44C7.557,2.223 7.778,2.114 7.999,2.114ZM7.457,11.733L7.457,12.801L8.525,12.801L8.525,11.733L7.457,11.733ZM7.457,5.326L7.457,10.665L8.525,10.665L8.525,5.326L7.457,5.326Z" />
|
3
|
-
</svg>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
export default IconAlert;
|
2
|
-
type IconAlert = SvelteComponent<{
|
3
|
-
[x: string]: never;
|
4
|
-
}, {
|
5
|
-
[evt: string]: CustomEvent<any>;
|
6
|
-
}, {}> & {
|
7
|
-
$$bindings?: string | undefined;
|
8
|
-
};
|
9
|
-
declare const IconAlert: $$__sveltets_2_IsomorphicComponent<{
|
10
|
-
[x: string]: never;
|
11
|
-
}, {
|
12
|
-
[evt: string]: CustomEvent<any>;
|
13
|
-
}, {}, {}, string>;
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
16
|
-
$$bindings?: Bindings;
|
17
|
-
} & Exports;
|
18
|
-
(internal: unknown, props: {
|
19
|
-
$$events?: Events;
|
20
|
-
$$slots?: Slots;
|
21
|
-
}): Exports;
|
22
|
-
z_$$bindings?: Bindings;
|
23
|
-
}
|
@@ -1,3 +0,0 @@
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 16 16">
|
2
|
-
<path fill="currentColor" d="M1.714,0.571C0.772,0.571 0,1.344 0,2.286L0,11.429C0,12.371 0.772,13.143 1.714,13.143L3.429,13.143L3.429,13.714C3.429,14.656 4.201,15.429 5.143,15.429L14.286,15.429C15.228,15.429 16,14.656 16,13.714L16,4.571C16,3.629 15.228,2.857 14.286,2.857L12.571,2.857L12.571,2.286C12.571,1.344 11.799,0.571 10.857,0.571L1.714,0.571ZM12.571,4L14.286,4C14.607,4 14.857,4.25 14.857,4.571L14.857,13.714C14.857,14.036 14.607,14.286 14.286,14.286L5.143,14.286C4.821,14.286 4.571,14.036 4.571,13.714L4.571,13.143L10.857,13.143C11.799,13.143 12.571,12.371 12.571,11.429L12.571,4ZM1.714,1.714L10.857,1.714C11.179,1.714 11.429,1.964 11.429,2.286L11.429,11.429C11.429,11.75 11.179,12 10.857,12L1.714,12C1.393,12 1.143,11.75 1.143,11.429L1.143,2.286C1.143,1.964 1.393,1.714 1.714,1.714Z" />
|
3
|
-
</svg>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
export default IconCopy;
|
2
|
-
type IconCopy = SvelteComponent<{
|
3
|
-
[x: string]: never;
|
4
|
-
}, {
|
5
|
-
[evt: string]: CustomEvent<any>;
|
6
|
-
}, {}> & {
|
7
|
-
$$bindings?: string | undefined;
|
8
|
-
};
|
9
|
-
declare const IconCopy: $$__sveltets_2_IsomorphicComponent<{
|
10
|
-
[x: string]: never;
|
11
|
-
}, {
|
12
|
-
[evt: string]: CustomEvent<any>;
|
13
|
-
}, {}, {}, string>;
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
16
|
-
$$bindings?: Bindings;
|
17
|
-
} & Exports;
|
18
|
-
(internal: unknown, props: {
|
19
|
-
$$events?: Events;
|
20
|
-
$$slots?: Slots;
|
21
|
-
}): Exports;
|
22
|
-
z_$$bindings?: Bindings;
|
23
|
-
}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
export default IconDone;
|
2
|
-
type IconDone = SvelteComponent<{
|
3
|
-
[x: string]: never;
|
4
|
-
}, {
|
5
|
-
[evt: string]: CustomEvent<any>;
|
6
|
-
}, {}> & {
|
7
|
-
$$bindings?: string | undefined;
|
8
|
-
};
|
9
|
-
declare const IconDone: $$__sveltets_2_IsomorphicComponent<{
|
10
|
-
[x: string]: never;
|
11
|
-
}, {
|
12
|
-
[evt: string]: CustomEvent<any>;
|
13
|
-
}, {}, {}, string>;
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
16
|
-
$$bindings?: Bindings;
|
17
|
-
} & Exports;
|
18
|
-
(internal: unknown, props: {
|
19
|
-
$$events?: Events;
|
20
|
-
$$slots?: Slots;
|
21
|
-
}): Exports;
|
22
|
-
z_$$bindings?: Bindings;
|
23
|
-
}
|
@@ -1,3 +0,0 @@
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 16 16">
|
2
|
-
<path fill="currentColor" d="M8,0.004C7.721,0.004 7.446,0.108 7.234,0.316L0.316,7.234C-0.1,7.655 -0.1,8.346 0.316,8.767L7.234,15.684C7.655,16.105 8.346,16.105 8.767,15.684L15.684,8.767C16.101,8.35 16.101,7.655 15.684,7.234L8.767,0.316C8.555,0.108 8.28,0.004 8,0.004ZM8.009,1.071L14.93,7.992C14.938,8 14.938,8.005 14.93,8.013L8.009,14.93C8,14.938 7.996,14.938 7.988,14.93L1.075,8.013C1.062,8 1.058,8 1.071,7.992L7.988,1.075C8,1.062 8,1.058 8.009,1.071ZM7.467,10.667L7.467,11.734L8.534,11.734L8.534,10.667L7.467,10.667ZM7.467,4.267L7.467,9.601L8.534,9.601L8.534,4.267L7.467,4.267Z" />
|
3
|
-
</svg>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
export default IconError;
|
2
|
-
type IconError = SvelteComponent<{
|
3
|
-
[x: string]: never;
|
4
|
-
}, {
|
5
|
-
[evt: string]: CustomEvent<any>;
|
6
|
-
}, {}> & {
|
7
|
-
$$bindings?: string | undefined;
|
8
|
-
};
|
9
|
-
declare const IconError: $$__sveltets_2_IsomorphicComponent<{
|
10
|
-
[x: string]: never;
|
11
|
-
}, {
|
12
|
-
[evt: string]: CustomEvent<any>;
|
13
|
-
}, {}, {}, string>;
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
16
|
-
$$bindings?: Bindings;
|
17
|
-
} & Exports;
|
18
|
-
(internal: unknown, props: {
|
19
|
-
$$events?: Events;
|
20
|
-
$$slots?: Slots;
|
21
|
-
}): Exports;
|
22
|
-
z_$$bindings?: Bindings;
|
23
|
-
}
|
@@ -1,3 +0,0 @@
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 16 16">
|
2
|
-
<path fill="currentColor" d="M8,0C3.591,0 0,3.591 0,8C0,12.409 3.591,16 8,16C12.409,16 16,12.409 16,8C16,3.591 12.409,0 8,0ZM8,1.231C11.745,1.231 14.769,4.255 14.769,8C14.769,11.745 11.745,14.769 8,14.769C4.255,14.769 1.231,11.745 1.231,8C1.231,4.255 4.255,1.231 8,1.231ZM7.385,11.077L7.385,12.308L8.615,12.308L8.615,11.077L7.385,11.077ZM8.072,3.692C6.582,3.779 5.365,5.029 5.365,6.548L6.596,6.548C6.596,5.548 7.462,4.764 8.519,4.947C9.274,5.077 9.87,5.817 9.846,6.596C9.827,7.279 9.428,7.712 8.841,7.971C8.476,8.135 8.13,8.288 7.837,8.596C7.543,8.904 7.385,9.361 7.385,9.846L8.615,9.846C8.615,9.567 8.654,9.524 8.731,9.442C8.803,9.365 9.005,9.245 9.337,9.096C10.255,8.697 11.043,7.817 11.077,6.635C11.12,5.236 10.115,3.971 8.726,3.731C8.505,3.697 8.284,3.683 8.072,3.692Z" />
|
3
|
-
</svg>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
export default IconHelp;
|
2
|
-
type IconHelp = SvelteComponent<{
|
3
|
-
[x: string]: never;
|
4
|
-
}, {
|
5
|
-
[evt: string]: CustomEvent<any>;
|
6
|
-
}, {}> & {
|
7
|
-
$$bindings?: string | undefined;
|
8
|
-
};
|
9
|
-
declare const IconHelp: $$__sveltets_2_IsomorphicComponent<{
|
10
|
-
[x: string]: never;
|
11
|
-
}, {
|
12
|
-
[evt: string]: CustomEvent<any>;
|
13
|
-
}, {}, {}, string>;
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
16
|
-
$$bindings?: Bindings;
|
17
|
-
} & Exports;
|
18
|
-
(internal: unknown, props: {
|
19
|
-
$$events?: Events;
|
20
|
-
$$slots?: Slots;
|
21
|
-
}): Exports;
|
22
|
-
z_$$bindings?: Bindings;
|
23
|
-
}
|
@@ -1,3 +0,0 @@
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 16 16">
|
2
|
-
<path fill="currentColor" d="M1.773,1.015L1.015,1.773L3.496,4.258C1.095,5.585 0.147,7.657 0.093,7.783L0,7.998L0.093,8.213C0.173,8.402 2.177,12.85 7.998,12.85C8.196,12.85 8.373,12.824 8.562,12.816L8.571,12.816C9.678,12.753 10.643,12.546 11.464,12.226L14.218,14.985L14.985,14.218L12.509,11.746L11.772,11.009L11.704,10.946L9.455,8.689L7.307,6.541L5.378,4.616L4.528,3.769L1.773,1.015ZM4.999,5.757L6.549,7.316C6.452,7.522 6.381,7.749 6.381,7.998C6.381,8.891 7.105,9.615 7.998,9.615C8.246,9.615 8.474,9.544 8.68,9.447L10.238,10.997C9.611,11.472 8.844,11.772 7.998,11.772C5.917,11.772 4.224,10.078 4.224,7.998C4.224,7.151 4.523,6.385 4.999,5.757ZM4.081,5.176C3.5,5.972 3.146,6.941 3.146,7.998C3.146,9.059 3.5,10.036 4.081,10.832C2.346,9.902 1.474,8.529 1.188,7.998C1.474,7.467 2.354,6.111 4.081,5.176ZM7.998,3.146C7.4,3.146 6.857,3.205 6.339,3.289L7.341,4.292C7.556,4.254 7.77,4.224 7.998,4.224C10.078,4.224 11.772,5.917 11.772,7.998C11.772,8.225 11.742,8.44 11.704,8.655L12.58,9.531C12.74,9.047 12.85,8.537 12.85,7.998C12.85,6.937 12.496,5.959 11.915,5.159C13.65,6.094 14.522,7.467 14.808,7.998C14.598,8.39 14.058,9.249 13.094,10.045L13.86,10.811C15.267,9.611 15.861,8.314 15.903,8.213L16,7.998L15.903,7.783C15.823,7.594 13.818,3.146 7.998,3.146Z" />
|
3
|
-
</svg>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
export default IconHide;
|
2
|
-
type IconHide = SvelteComponent<{
|
3
|
-
[x: string]: never;
|
4
|
-
}, {
|
5
|
-
[evt: string]: CustomEvent<any>;
|
6
|
-
}, {}> & {
|
7
|
-
$$bindings?: string | undefined;
|
8
|
-
};
|
9
|
-
declare const IconHide: $$__sveltets_2_IsomorphicComponent<{
|
10
|
-
[x: string]: never;
|
11
|
-
}, {
|
12
|
-
[evt: string]: CustomEvent<any>;
|
13
|
-
}, {}, {}, string>;
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
16
|
-
$$bindings?: Bindings;
|
17
|
-
} & Exports;
|
18
|
-
(internal: unknown, props: {
|
19
|
-
$$events?: Events;
|
20
|
-
$$slots?: Slots;
|
21
|
-
}): Exports;
|
22
|
-
z_$$bindings?: Bindings;
|
23
|
-
}
|
@@ -1,3 +0,0 @@
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 16 16">
|
2
|
-
<path fill="currentColor" d="M8,0C3.591,0 0,3.591 0,8C0,12.409 3.591,16 8,16C12.409,16 16,12.409 16,8C16,3.591 12.409,0 8,0ZM8,1.231C11.745,1.231 14.769,4.255 14.769,8C14.769,11.745 11.745,14.769 8,14.769C4.255,14.769 1.231,11.745 1.231,8C1.231,4.255 4.255,1.231 8,1.231ZM7.385,6.154L7.385,12.308L8.615,12.308L8.615,6.154L7.385,6.154ZM7.385,3.692L7.385,4.923L8.615,4.923L8.615,3.692L7.385,3.692Z" />
|
3
|
-
</svg>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
export default IconInfo;
|
2
|
-
type IconInfo = SvelteComponent<{
|
3
|
-
[x: string]: never;
|
4
|
-
}, {
|
5
|
-
[evt: string]: CustomEvent<any>;
|
6
|
-
}, {}> & {
|
7
|
-
$$bindings?: string | undefined;
|
8
|
-
};
|
9
|
-
declare const IconInfo: $$__sveltets_2_IsomorphicComponent<{
|
10
|
-
[x: string]: never;
|
11
|
-
}, {
|
12
|
-
[evt: string]: CustomEvent<any>;
|
13
|
-
}, {}, {}, string>;
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
16
|
-
$$bindings?: Bindings;
|
17
|
-
} & Exports;
|
18
|
-
(internal: unknown, props: {
|
19
|
-
$$events?: Events;
|
20
|
-
$$slots?: Slots;
|
21
|
-
}): Exports;
|
22
|
-
z_$$bindings?: Bindings;
|
23
|
-
}
|