@saasbase-io/core-elements 1.9.0 → 1.10.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/provider/_provider-field.d.ts +111 -0
- package/dist/components/renderers/_updated/provider/index.d.ts +3 -1
- package/dist/components/renderers/_updated/provider/provider.stories/provider-field.stories.d.ts +14 -0
- package/dist/components/renderers/_updated/provider/provider.types.d.ts +21 -6
- package/dist/index.js +463 -438
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3285 -3137
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { LitElement } from '../../../../../node_modules/lit';
|
|
2
|
+
import { Provider, ProviderButtonContent, ProviderButtonIconAlign, ProviderButtonSize, ProviderButtonVariant, ProviderFieldOverride, ProviderFieldProps } from './provider.types';
|
|
3
|
+
/**
|
|
4
|
+
* A wrapper field, containing and styling auth provider buttons.
|
|
5
|
+
* @element sb-provider-field
|
|
6
|
+
*
|
|
7
|
+
* @part provider-field (rtg-field)
|
|
8
|
+
* @part provider-field-button (sb-provider-button)
|
|
9
|
+
*/
|
|
10
|
+
export declare class SbProviderField extends LitElement implements ProviderFieldProps {
|
|
11
|
+
private static readonly _ROOT;
|
|
12
|
+
private static readonly _BUTTON;
|
|
13
|
+
/**
|
|
14
|
+
* The stable CSS part names exposed for external targeting.
|
|
15
|
+
*/
|
|
16
|
+
static get parts(): {
|
|
17
|
+
root: string;
|
|
18
|
+
button: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A unique value used as a substring in the generated part/child IDs, when
|
|
22
|
+
* the `child-id` prop is not provided.
|
|
23
|
+
*/
|
|
24
|
+
seed: string;
|
|
25
|
+
/**
|
|
26
|
+
* The `id` value given to the root child/part and used as the base of other
|
|
27
|
+
* child/part IDs.
|
|
28
|
+
*/
|
|
29
|
+
childId?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The providers included as provider buttons in this field.
|
|
32
|
+
*/
|
|
33
|
+
providers: Provider[];
|
|
34
|
+
/**
|
|
35
|
+
* The `content` prop passed to each of the provider buttons.
|
|
36
|
+
*/
|
|
37
|
+
content?: ProviderButtonContent;
|
|
38
|
+
/**
|
|
39
|
+
* The `variant` prop passed to each of the provider buttons.
|
|
40
|
+
*/
|
|
41
|
+
variant?: ProviderButtonVariant;
|
|
42
|
+
/**
|
|
43
|
+
* The `size` prop passed to each of the provider buttons.
|
|
44
|
+
*/
|
|
45
|
+
size?: ProviderButtonSize;
|
|
46
|
+
/**
|
|
47
|
+
* The `prompt` prop passed to each of the provider buttons.
|
|
48
|
+
*/
|
|
49
|
+
prompt?: string;
|
|
50
|
+
/**
|
|
51
|
+
* The `icon-align` prop passed to each of the provider buttons.
|
|
52
|
+
*/
|
|
53
|
+
iconAlign?: ProviderButtonIconAlign;
|
|
54
|
+
/**
|
|
55
|
+
* The `label` prop passed to each of the provider buttons.
|
|
56
|
+
*/
|
|
57
|
+
label?: string;
|
|
58
|
+
/**
|
|
59
|
+
* The `disabled` prop passed to each of the provider buttons.
|
|
60
|
+
*/
|
|
61
|
+
disabled?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* The `loading` prop passed to each of the provider buttons.
|
|
64
|
+
*/
|
|
65
|
+
loading?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* The `event` prop passed to each of the provider buttons.
|
|
68
|
+
*/
|
|
69
|
+
event?: string;
|
|
70
|
+
/**
|
|
71
|
+
* A list of provider-specific prop overrides.
|
|
72
|
+
*/
|
|
73
|
+
overrides: ProviderFieldOverride[];
|
|
74
|
+
/**
|
|
75
|
+
* Overrides default behavior to render into light DOM.
|
|
76
|
+
*/
|
|
77
|
+
protected createRenderRoot(): this;
|
|
78
|
+
/**
|
|
79
|
+
* The `id` of the root element. Equal to `childId` when provided, otherwise
|
|
80
|
+
* derived from the component's part name and `seed`.
|
|
81
|
+
*/
|
|
82
|
+
get rootId(): string;
|
|
83
|
+
/**
|
|
84
|
+
* The `id` of the provider button element, derived from `rootId` with the
|
|
85
|
+
* button part name appended.
|
|
86
|
+
*/
|
|
87
|
+
get buttonId(): string;
|
|
88
|
+
/**
|
|
89
|
+
* The number of columns within the field, given to the root element via its
|
|
90
|
+
* `data-columns` attribute. In hyphenated values (e.g. `"two-three"`), the
|
|
91
|
+
* first part is the number of columns in the first row, and the second part
|
|
92
|
+
* is the number of columns in the second row.
|
|
93
|
+
*/
|
|
94
|
+
get columns(): "one" | "three" | "two-three" | "three-four" | "four";
|
|
95
|
+
/**
|
|
96
|
+
* The `providers` array without any duplicates.
|
|
97
|
+
*/
|
|
98
|
+
private get _providers();
|
|
99
|
+
/**
|
|
100
|
+
* The `overrides` array without any duplicate `provider` entries (i.e. no
|
|
101
|
+
* two override items have the same `provider` value).
|
|
102
|
+
*/
|
|
103
|
+
private get _overrides();
|
|
104
|
+
/**
|
|
105
|
+
* Returns the template for the button part, specifically an
|
|
106
|
+
* `sb-provider-button` element with props originating from `overrides` if
|
|
107
|
+
* given, otherwise the general prop given to this field component.
|
|
108
|
+
*/
|
|
109
|
+
private _renderButton;
|
|
110
|
+
render(): import('../../../../../node_modules/lit-html').TemplateResult<1>;
|
|
111
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { SbProviderButton } from './_provider-button';
|
|
2
|
-
|
|
2
|
+
import { SbProviderField } from './_provider-field';
|
|
3
|
+
export { SbProviderButton, SbProviderField };
|
|
3
4
|
declare global {
|
|
4
5
|
interface HTMLElementTagNameMap {
|
|
5
6
|
"sb-provider-button": SbProviderButton;
|
|
7
|
+
"sb-provider-field": SbProviderField;
|
|
6
8
|
}
|
|
7
9
|
}
|
package/dist/components/renderers/_updated/provider/provider.stories/provider-field.stories.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
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 Content: Story;
|
|
7
|
+
export declare const Variant: Story;
|
|
8
|
+
export declare const Size: Story;
|
|
9
|
+
export declare const Prompt: Story;
|
|
10
|
+
export declare const IconAlign: Story;
|
|
11
|
+
export declare const Label: Story;
|
|
12
|
+
export declare const Disabled: Story;
|
|
13
|
+
export declare const Loading: Story;
|
|
14
|
+
export declare const Overrides: Story;
|
|
@@ -4,17 +4,32 @@ export type ProviderButtonContent = "icon" | "icon-label" | "label";
|
|
|
4
4
|
export type ProviderButtonVariant = RtgButtonBasicVariant;
|
|
5
5
|
export type ProviderButtonSize = RtgButtonBasicSize;
|
|
6
6
|
export type ProviderButtonIconAlign = IconAlign;
|
|
7
|
-
|
|
8
|
-
seed
|
|
7
|
+
type BaseProviderButtonProps = {
|
|
8
|
+
seed?: string;
|
|
9
9
|
childId?: string;
|
|
10
10
|
provider: Provider;
|
|
11
|
+
content?: ProviderButtonContent;
|
|
12
|
+
variant?: ProviderButtonVariant;
|
|
13
|
+
size?: ProviderButtonSize;
|
|
14
|
+
prompt?: string;
|
|
15
|
+
iconAlign?: ProviderButtonIconAlign;
|
|
16
|
+
label?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
event?: string;
|
|
20
|
+
};
|
|
21
|
+
export type ProviderButtonProps = Omit<BaseProviderButtonProps, "seed" | "content" | "variant" | "size" | "prompt" | "iconAlign"> & {
|
|
22
|
+
seed: string;
|
|
11
23
|
content: ProviderButtonContent;
|
|
12
24
|
variant: ProviderButtonVariant;
|
|
13
25
|
size: ProviderButtonSize;
|
|
14
26
|
prompt: string;
|
|
15
27
|
iconAlign: ProviderButtonIconAlign;
|
|
16
|
-
label?: string;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
loading?: boolean;
|
|
19
|
-
event?: string;
|
|
20
28
|
};
|
|
29
|
+
export type ProviderFieldOverride = BaseProviderButtonProps;
|
|
30
|
+
export type ProviderFieldProps = Omit<BaseProviderButtonProps, "seed" | "provider"> & {
|
|
31
|
+
seed: string;
|
|
32
|
+
providers: Provider[];
|
|
33
|
+
overrides: ProviderFieldOverride[];
|
|
34
|
+
};
|
|
35
|
+
export {};
|