@saasbase-io/core-elements 1.17.0 → 1.19.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/renderers/_updated/form/_form-switch.d.ts +71 -27
- package/dist/components/renderers/_updated/form/form.stories/form-switch.stories.d.ts +2 -1
- package/dist/components/renderers/_updated/form/form.types.d.ts +7 -6
- package/dist/components/renderers/_updated/passkey-button/_passkey-button.d.ts +7 -20
- package/dist/index.js +568 -577
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1878 -1842
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,61 +1,77 @@
|
|
|
1
1
|
import { LitElement } from '../../../../../node_modules/lit';
|
|
2
|
-
import {
|
|
2
|
+
import { FormSwitchProps, FormSwitchSize, FormSwitchType, FormSwitchVariant } from './form.types';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* A button for switching between auth widgets.
|
|
5
5
|
* @element sb-form-switch
|
|
6
6
|
*
|
|
7
|
-
* @
|
|
8
|
-
* @
|
|
7
|
+
* @part form-switch (rtg-button)
|
|
8
|
+
* @part form-switch-wrapper (div): contains root and optional prompt
|
|
9
|
+
* @part form-switch-prompt (p): prompt text for `"default"` form switches
|
|
10
|
+
* @part form-swith-spinner (rtg-spinner): loading indicator
|
|
11
|
+
*
|
|
12
|
+
* @fires sb-form-switch:click { id, event }
|
|
9
13
|
*/
|
|
10
|
-
export declare class SbFormSwitch extends LitElement implements
|
|
14
|
+
export declare class SbFormSwitch extends LitElement implements FormSwitchProps {
|
|
11
15
|
private static readonly _ROOT;
|
|
12
|
-
private static readonly
|
|
16
|
+
private static readonly _WRAPPER;
|
|
17
|
+
private static readonly _PROMPT;
|
|
18
|
+
private static readonly _SPINNER;
|
|
19
|
+
static readonly TAG: string;
|
|
20
|
+
static readonly CLICK_EVENT: string;
|
|
13
21
|
/**
|
|
14
22
|
* The stable CSS part names exposed for external targeting.
|
|
15
23
|
*/
|
|
16
24
|
static get parts(): {
|
|
17
25
|
root: string;
|
|
18
|
-
|
|
26
|
+
wrapper: string;
|
|
27
|
+
prompt: string;
|
|
28
|
+
spinner: string;
|
|
19
29
|
};
|
|
20
30
|
/**
|
|
21
|
-
* A unique
|
|
22
|
-
* the `child-id` prop is not provided.
|
|
31
|
+
* A unique substring for fallback part IDs generated.
|
|
23
32
|
*/
|
|
24
33
|
seed: string;
|
|
25
34
|
/**
|
|
26
|
-
* The `id`
|
|
27
|
-
* child/part IDs.
|
|
35
|
+
* The `id` of the root part and the base of sub-part IDs.
|
|
28
36
|
*/
|
|
29
37
|
childId?: string;
|
|
30
38
|
/**
|
|
31
|
-
*
|
|
32
|
-
* button element
|
|
39
|
+
* Whether the form switch is a link button with optional prompt text, or a
|
|
40
|
+
* configurable button element.
|
|
41
|
+
*/
|
|
42
|
+
type: FormSwitchType;
|
|
43
|
+
/**
|
|
44
|
+
* The visual variant of the (button) form switch.
|
|
33
45
|
*/
|
|
34
46
|
variant: FormSwitchVariant;
|
|
35
47
|
/**
|
|
36
|
-
* The
|
|
48
|
+
* The size of the (button) form switch.
|
|
49
|
+
*/
|
|
50
|
+
size: FormSwitchSize;
|
|
51
|
+
/**
|
|
52
|
+
* The text used as the form switch button label.
|
|
37
53
|
*/
|
|
38
54
|
label: string;
|
|
39
55
|
/**
|
|
40
|
-
* Optional text which precedes the
|
|
56
|
+
* Optional text which precedes the button in a `"default"` form switch.
|
|
41
57
|
*/
|
|
42
58
|
prompt?: string;
|
|
43
59
|
/**
|
|
44
|
-
* When provided, the switch
|
|
60
|
+
* When provided, the switch reflects a disabled state.
|
|
45
61
|
*/
|
|
46
62
|
disabled?: boolean;
|
|
47
63
|
/**
|
|
48
|
-
*
|
|
64
|
+
* When provided, the switch reflects a loading state.
|
|
49
65
|
*/
|
|
50
|
-
|
|
66
|
+
loading?: boolean;
|
|
51
67
|
/**
|
|
52
|
-
* The
|
|
68
|
+
* The event name as defined in the loginflow auth service.
|
|
53
69
|
*/
|
|
54
|
-
|
|
70
|
+
event?: string;
|
|
55
71
|
/**
|
|
56
|
-
*
|
|
72
|
+
* Whether the switch is in a loading state.
|
|
57
73
|
*/
|
|
58
|
-
|
|
74
|
+
private _loading;
|
|
59
75
|
/**
|
|
60
76
|
* Overrides default behavior to render into light DOM.
|
|
61
77
|
*/
|
|
@@ -66,13 +82,41 @@ export declare class SbFormSwitch extends LitElement implements SbFormSwitchProp
|
|
|
66
82
|
*/
|
|
67
83
|
get rootId(): string;
|
|
68
84
|
/**
|
|
69
|
-
* The `id` of the
|
|
70
|
-
|
|
85
|
+
* The `id` of the wrapper element, derived from `rootId` and the part name.
|
|
86
|
+
*/
|
|
87
|
+
get wrapperId(): string;
|
|
88
|
+
/**
|
|
89
|
+
* The `id` of the prompt element, derived from `rootId` and the part name.
|
|
90
|
+
*/
|
|
91
|
+
get promptId(): string;
|
|
92
|
+
/**
|
|
93
|
+
* The `id` of the spinner element, derived from `rootId` and the part name.
|
|
94
|
+
*/
|
|
95
|
+
get spinnerId(): string;
|
|
96
|
+
/**
|
|
97
|
+
* The loading state, derived from the private `_loading` and `loading` prop.
|
|
98
|
+
*/
|
|
99
|
+
get isLoading(): boolean | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Adds the click event listener.
|
|
102
|
+
*/
|
|
103
|
+
connectedCallback(): void;
|
|
104
|
+
/**
|
|
105
|
+
* Removes the click event listener.
|
|
106
|
+
*/
|
|
107
|
+
disconnectedCallback(): void;
|
|
108
|
+
/**
|
|
109
|
+
* Handles the click event, preventing execution when disabled/loading, firing
|
|
110
|
+
* the click event, and emitting to auth service.
|
|
111
|
+
*/
|
|
112
|
+
private _handleClick;
|
|
113
|
+
/**
|
|
114
|
+
* Returns the prompt paragraph template for `"default"` form switches.
|
|
71
115
|
*/
|
|
72
|
-
|
|
116
|
+
private _renderPrompt;
|
|
73
117
|
/**
|
|
74
|
-
* Returns the
|
|
118
|
+
* Returns the loading spinner template.
|
|
75
119
|
*/
|
|
76
|
-
private
|
|
120
|
+
private _renderSpinner;
|
|
77
121
|
render(): import('../../../../../node_modules/lit-html').TemplateResult<1>;
|
|
78
122
|
}
|
|
@@ -3,8 +3,9 @@ declare const meta: Meta;
|
|
|
3
3
|
export default meta;
|
|
4
4
|
type Story = StoryObj;
|
|
5
5
|
export declare const Basic: Story;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const Type: Story;
|
|
7
7
|
export declare const Label: Story;
|
|
8
8
|
export declare const Prompt: Story;
|
|
9
9
|
export declare const Disabled: Story;
|
|
10
|
+
export declare const Loading: Story;
|
|
10
11
|
export declare const Button: Story;
|
|
@@ -28,17 +28,18 @@ export type SbFormSeparatorProps = {
|
|
|
28
28
|
childId?: string;
|
|
29
29
|
content?: string;
|
|
30
30
|
};
|
|
31
|
-
export type
|
|
32
|
-
export type
|
|
33
|
-
export type
|
|
34
|
-
export type
|
|
31
|
+
export type FormSwitchType = "default" | "button";
|
|
32
|
+
export type FormSwitchVariant = RtgButtonBasicVariant;
|
|
33
|
+
export type FormSwitchSize = RtgButtonBasicSize;
|
|
34
|
+
export type FormSwitchProps = {
|
|
35
35
|
seed: string;
|
|
36
36
|
childId?: string;
|
|
37
|
+
type: FormSwitchType;
|
|
37
38
|
variant: FormSwitchVariant;
|
|
39
|
+
size: FormSwitchSize;
|
|
38
40
|
label: string;
|
|
39
41
|
prompt?: string;
|
|
40
42
|
disabled?: boolean;
|
|
41
|
-
|
|
42
|
-
buttonSize: FormSwitchButtonSize;
|
|
43
|
+
loading?: boolean;
|
|
43
44
|
event?: string;
|
|
44
45
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement } from '../../../../../node_modules/lit';
|
|
2
2
|
import { PasskeyButtonProps, PasskeyButtonSize, PasskeyButtonSpinnerAlign, PasskeyButtonVariant } from './passkey-button.types';
|
|
3
3
|
/**
|
|
4
|
-
* A button for passkey authentication.
|
|
4
|
+
* A button for passkey authentication in auth widgets.
|
|
5
5
|
* @element sb-passkey-button
|
|
6
6
|
*
|
|
7
7
|
* @part passkey-button (rtg-button)
|
|
@@ -12,6 +12,8 @@ import { PasskeyButtonProps, PasskeyButtonSize, PasskeyButtonSpinnerAlign, Passk
|
|
|
12
12
|
export declare class SbPasskeyButton extends LitElement implements PasskeyButtonProps {
|
|
13
13
|
private static readonly _ROOT;
|
|
14
14
|
private static readonly _SPINNER;
|
|
15
|
+
static readonly TAG: string;
|
|
16
|
+
static readonly CLICK_EVENT: string;
|
|
15
17
|
/**
|
|
16
18
|
* The stable CSS part names exposed for external targeting.
|
|
17
19
|
*/
|
|
@@ -20,17 +22,11 @@ export declare class SbPasskeyButton extends LitElement implements PasskeyButton
|
|
|
20
22
|
spinner: string;
|
|
21
23
|
};
|
|
22
24
|
/**
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
static get clickEventName(): string;
|
|
26
|
-
/**
|
|
27
|
-
* A unique value used as a substring in the generated part/child IDs, when
|
|
28
|
-
* the `child-id` prop is not provided.
|
|
25
|
+
* A unique substring for fallback part IDs generated.
|
|
29
26
|
*/
|
|
30
27
|
seed: string;
|
|
31
28
|
/**
|
|
32
|
-
* The `id`
|
|
33
|
-
* child/part IDs.
|
|
29
|
+
* The `id` of the root part and the base of sub-part IDs.
|
|
34
30
|
*/
|
|
35
31
|
childId?: string;
|
|
36
32
|
/**
|
|
@@ -58,7 +54,7 @@ export declare class SbPasskeyButton extends LitElement implements PasskeyButton
|
|
|
58
54
|
*/
|
|
59
55
|
loading?: boolean;
|
|
60
56
|
/**
|
|
61
|
-
* The event
|
|
57
|
+
* The event name as defined in the loginflow auth service.
|
|
62
58
|
*/
|
|
63
59
|
event?: string;
|
|
64
60
|
/**
|
|
@@ -75,8 +71,7 @@ export declare class SbPasskeyButton extends LitElement implements PasskeyButton
|
|
|
75
71
|
*/
|
|
76
72
|
get rootId(): string;
|
|
77
73
|
/**
|
|
78
|
-
* The `id` of the spinner element, derived from `rootId`
|
|
79
|
-
* part name appended.
|
|
74
|
+
* The `id` of the spinner element, derived from `rootId` and the part name.
|
|
80
75
|
*/
|
|
81
76
|
get spinnerId(): string;
|
|
82
77
|
/**
|
|
@@ -91,14 +86,6 @@ export declare class SbPasskeyButton extends LitElement implements PasskeyButton
|
|
|
91
86
|
* Removes the click event listener.
|
|
92
87
|
*/
|
|
93
88
|
disconnectedCallback(): void;
|
|
94
|
-
/**
|
|
95
|
-
* Defines and dispatches the click event.
|
|
96
|
-
*/
|
|
97
|
-
private _dispatchClick;
|
|
98
|
-
/**
|
|
99
|
-
* Emits the provided `event` to the auth service to process.
|
|
100
|
-
*/
|
|
101
|
-
private _emitClickEvent;
|
|
102
89
|
/**
|
|
103
90
|
* Handles the click event, preventing execution when disabled/loading, firing
|
|
104
91
|
* the click event, and emitting to auth service.
|