@saasbase-io/core-elements 1.11.0 → 1.12.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.
@@ -0,0 +1,102 @@
1
+ import { LitElement } from '../../../../../node_modules/lit';
2
+ import { FormSubmitProps, FormSubmitSize, FormSubmitSpinnerAlign, FormSubmitVariant } from './form.types';
3
+ /**
4
+ * A submit button for auth widget forms.
5
+ * @element sb-form-submit
6
+ *
7
+ * @part form-submit (rtg-button)
8
+ * @part form-submit-spinner (rtg-spinner): loading indicator
9
+ *
10
+ * @fires sb-form-submit:click { id, event }
11
+ */
12
+ export declare class SbFormSubmit extends LitElement implements FormSubmitProps {
13
+ private static readonly _ROOT;
14
+ private static readonly _SPINNER;
15
+ /**
16
+ * The stable CSS part names exposed for external targeting.
17
+ */
18
+ static get parts(): {
19
+ root: string;
20
+ spinner: string;
21
+ };
22
+ /**
23
+ * The name of the custom event fired on click.
24
+ */
25
+ static get clickEventName(): string;
26
+ /**
27
+ * A unique substring for fallback part IDs generated.
28
+ */
29
+ seed: string;
30
+ /**
31
+ * The `id` of the root part and the base of sub-part IDs.
32
+ */
33
+ childId?: string;
34
+ /**
35
+ * The visual variant of the button.
36
+ */
37
+ variant: FormSubmitVariant;
38
+ /**
39
+ * The size of the button.
40
+ */
41
+ size: FormSubmitSize;
42
+ /**
43
+ * The text used as the button label.
44
+ */
45
+ label: string;
46
+ /**
47
+ * Whether the loading spinner should be rendered before or after the label.
48
+ */
49
+ spinnerAlign: FormSubmitSpinnerAlign;
50
+ /**
51
+ * When provided, the button reflects a disabled state.
52
+ */
53
+ disabled?: boolean;
54
+ /**
55
+ * When provided, the button reflects a loading state.
56
+ */
57
+ loading?: boolean;
58
+ /**
59
+ * The event name as defined in the loginflow auth service.
60
+ */
61
+ event?: string;
62
+ /**
63
+ * Whether the button is in a loading state.
64
+ */
65
+ private _loading;
66
+ /**
67
+ * Overrides default behavior to render into light DOM.
68
+ */
69
+ protected createRenderRoot(): this;
70
+ /**
71
+ * The `id` of the root element. Equal to `childId` when provided, otherwise
72
+ * derived from the component's part name and `seed`.
73
+ */
74
+ get rootId(): string;
75
+ /**
76
+ * The `id` of the spinner element, derived from `rootId` with the spinner
77
+ * part name appended.
78
+ */
79
+ get spinnerId(): string;
80
+ /**
81
+ * The loading state, derived from the private `_loading` and `loading` prop.
82
+ */
83
+ get isLoading(): boolean | undefined;
84
+ /**
85
+ * Adds the click event listener.
86
+ */
87
+ connectedCallback(): void;
88
+ /**
89
+ * Removes the click event listener.
90
+ */
91
+ disconnectedCallback(): void;
92
+ /**
93
+ * Handles the click event, preventing execution when disabled/loading, and
94
+ * firing the click event.
95
+ */
96
+ private _handleClick;
97
+ /**
98
+ * Returns the loading spinner template.
99
+ */
100
+ private _renderSpinner;
101
+ render(): import('../../../../../node_modules/lit-html').TemplateResult<1>;
102
+ }
@@ -0,0 +1,11 @@
1
+ import { Meta, StoryObj } from '@storybook/web-components-vite';
2
+ declare const meta: Meta;
3
+ export default meta;
4
+ type Story = StoryObj;
5
+ export declare const Basic: Story;
6
+ export declare const Variant: Story;
7
+ export declare const Size: Story;
8
+ export declare const Label: Story;
9
+ export declare const Disabled: Story;
10
+ export declare const Loading: Story;
11
+ export declare const SpinnerAlign: Story;
@@ -1,4 +1,18 @@
1
- import { RtgButtonBasicSize, RtgButtonBasicVariant } from '../../../../types';
1
+ import { IconAlign, RtgButtonBasicSize, RtgButtonBasicVariant } from '../../../../types';
2
+ export type FormSubmitVariant = RtgButtonBasicVariant;
3
+ export type FormSubmitSize = RtgButtonBasicSize;
4
+ export type FormSubmitSpinnerAlign = IconAlign;
5
+ export type FormSubmitProps = {
6
+ seed: string;
7
+ childId?: string;
8
+ variant: FormSubmitVariant;
9
+ size: FormSubmitSize;
10
+ label: string;
11
+ spinnerAlign: FormSubmitSpinnerAlign;
12
+ disabled?: boolean;
13
+ loading?: boolean;
14
+ event?: string;
15
+ };
2
16
  export type SbFormSeparatorProps = {
3
17
  seed: string;
4
18
  childId?: string;
@@ -1,8 +1,10 @@
1
1
  import { SbFormSeparator } from './_form-separator';
2
+ import { SbFormSubmit } from './_form-submit';
2
3
  import { SbFormSwitch } from './_form-switch';
3
- export { SbFormSeparator, SbFormSwitch };
4
+ export { SbFormSeparator, SbFormSubmit, SbFormSwitch };
4
5
  declare global {
5
6
  interface HTMLElementTagNameMap {
7
+ "sb-form-submit": SbFormSubmit;
6
8
  "sb-form-separator": SbFormSeparator;
7
9
  "sb-form-switch": SbFormSwitch;
8
10
  }
@@ -1,4 +1,4 @@
1
- import { BaseElement } from '../..';
1
+ import { BaseElement } from '../../wrappers/base-element/base-element';
2
2
  export declare class SbGap extends BaseElement {
3
3
  size: string;
4
4
  type: "vertical" | "horizontal";
@@ -10,7 +10,7 @@ export declare class SbAuthenticated extends LitElement {
10
10
  * Defaults to environment variable, can be overridden via property.
11
11
  */
12
12
  redirectUrl: string;
13
- env?: EnvConfig;
13
+ env: EnvConfig | null;
14
14
  auth?: AuthState;
15
15
  render(): import('../../../../node_modules/lit-html').TemplateResult<1> | typeof nothing;
16
16
  }