@saasbase-io/core-elements 1.13.0 → 1.14.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,77 @@
1
+ import { LitElement } from '../../../../../node_modules/lit';
2
+ import { ErrorContent, ErrorIcon, ErrorProps, ErrorVariant } from './error.types';
3
+ /**
4
+ * A destructive alert used for displaying auth errors.
5
+ * @element sb-error
6
+ *
7
+ * @part error (rtg-alert)
8
+ * @part error-icon (svg)
9
+ * @part error-title (rtg-alert-title)
10
+ * @part error-description (rtg-alert-description)
11
+ */
12
+ export declare class SbError extends LitElement implements ErrorProps {
13
+ private static readonly _ROOT;
14
+ private static readonly _ICON;
15
+ private static readonly _TITLE;
16
+ private static readonly _DESCRIPTION;
17
+ /**
18
+ * The stable CSS part names exposed for external targeting.
19
+ */
20
+ static get parts(): {
21
+ root: string;
22
+ icon: string;
23
+ title: string;
24
+ description: string;
25
+ };
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 alert.
36
+ */
37
+ variant: ErrorVariant;
38
+ /**
39
+ * The text content (title and/or description) of the error alert.
40
+ */
41
+ content: ErrorContent;
42
+ /**
43
+ * The Lucide icon rendered in the error alert.
44
+ */
45
+ icon?: ErrorIcon;
46
+ /**
47
+ * Overrides default behavior to render into light DOM.
48
+ */
49
+ protected createRenderRoot(): this;
50
+ /**
51
+ * The `id` of the root element. Equal to `childId` when provided, otherwise
52
+ * derived from the component's part name and `seed`.
53
+ */
54
+ get rootId(): string;
55
+ /**
56
+ * The `id` of the spinner element, derived from `rootId` with the icon part
57
+ * name appended.
58
+ */
59
+ get iconId(): string;
60
+ /**
61
+ * The `id` of the spinner element, derived from `rootId` with the title part
62
+ * name appended.
63
+ */
64
+ get titleId(): string;
65
+ /**
66
+ * The `id` of the spinner element, derived from `rootId` with the description
67
+ * part name appended.
68
+ */
69
+ get descriptionId(): string;
70
+ /**
71
+ * Uses the `variant` prop to derive the `variant` prop passed to `rtg-alert`.
72
+ * - `"default"` error = `"destructive"` alert
73
+ * - `"tonal"` error = `"destructive-tonal"` alert
74
+ */
75
+ private get _variant();
76
+ render(): import('../../../../../node_modules/lit-html').TemplateResult<1>;
77
+ }
@@ -0,0 +1,3 @@
1
+ import { TemplateResult } from '../../../../../node_modules/lit';
2
+ import { ErrorIcon } from './error.types';
3
+ export declare const ERROR_ICONS: Record<ErrorIcon, (id: string, part: string) => TemplateResult<1>>;
@@ -0,0 +1,8 @@
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 Content: Story;
8
+ export declare const Icon: Story;
@@ -1,3 +1,4 @@
1
+ export type ErrorVariant = "default" | "tonal";
1
2
  export type ErrorIcon = "badge-alert" | "badge-x" | "circle-alert" | "circle-x" | "shield-alert" | "shield-x";
2
3
  export type ErrorContent = {
3
4
  title: string;
@@ -11,7 +12,8 @@ export type ErrorContent = {
11
12
  };
12
13
  export type ErrorProps = {
13
14
  seed: string;
14
- icon?: ErrorIcon;
15
+ childId?: string;
16
+ variant: ErrorVariant;
15
17
  content: ErrorContent;
16
- tonal?: boolean;
18
+ icon?: ErrorIcon;
17
19
  };
@@ -1,4 +1,5 @@
1
1
  import { SbError } from './_error';
2
+ export { SbError };
2
3
  declare global {
3
4
  interface HTMLElementTagNameMap {
4
5
  "sb-error": SbError;
@@ -1,13 +1,13 @@
1
+ export * from './error';
1
2
  export * from './field';
2
3
  export * from './form';
3
4
  export * from './passkey-button';
4
5
  export * from './provider';
5
- export * from './sb-error';
6
+ export * from './sb-container';
6
7
  export * from './sb-gap';
7
8
  export * from './sb-header';
8
9
  export * from './sb-logo';
9
10
  export * from './sb-otp';
10
11
  export * from './sb-subtitle';
11
- export * from './sb-container';
12
12
  export * from './sb-title';
13
13
  export * from './watermark';
@@ -1,5 +1,5 @@
1
1
  import { PropertyValues } from '../../../../node_modules/lit';
2
- import { BaseElement } from '../..';
2
+ import { BaseElement } from '../../wrappers/base-element/base-element';
3
3
  export declare class SbContainer extends BaseElement {
4
4
  id: string;
5
5
  type: "flex_column" | "flex_row";