@revotech-group/revotech-ui-kit 0.2.0 → 0.2.2
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/LICENSE +20 -20
- package/README.md +30 -30
- package/dist/library.css +10598 -5481
- package/dist/rtg-ui-kit.js +8189 -8673
- package/dist/rtg-ui-kit.umd.cjs +654 -804
- package/dist/src/assets/icons/anchor.icon.d.ts +3 -0
- package/dist/src/assets/icons/app-window.icon.d.ts +3 -0
- package/dist/src/assets/icons/arrow-right.icon.d.ts +3 -0
- package/dist/src/assets/icons/arrow-up-right.icon.d.ts +3 -0
- package/dist/src/assets/icons/arrow-up.icon.d.ts +3 -0
- package/dist/src/assets/icons/asterisk.icon.d.ts +3 -0
- package/dist/src/assets/icons/badge-alert.icon.d.ts +3 -0
- package/dist/src/assets/icons/badge-check.icon.d.ts +3 -0
- package/dist/src/assets/icons/badge-info.icon.d.ts +3 -0
- package/dist/src/assets/icons/badge-x.icon.d.ts +3 -0
- package/dist/src/assets/icons/captions.icon.d.ts +3 -0
- package/dist/src/assets/icons/check.icon.d.ts +3 -0
- package/dist/src/assets/icons/circle-alert.icon.d.ts +3 -0
- package/dist/src/assets/icons/circle-check.icon.d.ts +3 -1
- package/dist/src/assets/icons/circle-fading-arrow-up.icon.d.ts +3 -0
- package/dist/src/assets/icons/code.icon.d.ts +3 -0
- package/dist/src/assets/icons/external-link.icon.d.ts +3 -0
- package/dist/src/assets/icons/git-branch-minus.icon.d.ts +3 -0
- package/dist/src/assets/icons/git-branch-plus.icon.d.ts +3 -0
- package/dist/src/assets/icons/house.icon.d.ts +3 -0
- package/dist/src/assets/icons/index.d.ts +41 -14
- package/dist/src/assets/icons/info.icon.d.ts +3 -0
- package/dist/src/assets/icons/loader-circle.icon.d.ts +3 -0
- package/dist/src/assets/icons/mail-warning.icon.d.ts +3 -0
- package/dist/src/assets/icons/minus.icon.d.ts +3 -1
- package/dist/src/assets/icons/plus.icon.d.ts +1 -1
- package/dist/src/assets/icons/rabbit.icon.d.ts +3 -0
- package/dist/src/assets/icons/refresh-cw.icon.d.ts +3 -0
- package/dist/src/assets/icons/search.icon.d.ts +3 -1
- package/dist/src/assets/icons/settings.icon.d.ts +3 -0
- package/dist/src/assets/icons/shopping-bag.icon.d.ts +3 -0
- package/dist/src/assets/icons/wand.icon.d.ts +3 -0
- package/dist/src/components/ui/alert/_alert-action.d.ts +22 -0
- package/dist/src/components/ui/alert/_alert-description.d.ts +22 -0
- package/dist/src/components/ui/alert/_alert-title.d.ts +21 -0
- package/dist/src/components/ui/alert/_alert.d.ts +26 -0
- package/dist/src/components/ui/alert/alert.d.ts +11 -19
- package/dist/src/components/ui/alert/alert.defs.d.ts +4 -0
- package/dist/src/components/ui/alert/alert.stories.d.ts +10 -6
- package/dist/src/components/ui/avatar/_avatar-badge.d.ts +22 -0
- package/dist/src/components/ui/avatar/_avatar-fallback.d.ts +22 -0
- package/dist/src/components/ui/avatar/_avatar-group-count.d.ts +22 -0
- package/dist/src/components/ui/avatar/_avatar-group.d.ts +22 -0
- package/dist/src/components/ui/avatar/_avatar-image.d.ts +29 -0
- package/dist/src/components/ui/avatar/_avatar.d.ts +66 -0
- package/dist/src/components/ui/avatar/avatar.d.ts +14 -13
- package/dist/src/components/ui/avatar/avatar.defs.d.ts +8 -0
- package/dist/src/components/ui/avatar/avatar.stories.d.ts +13 -4
- package/dist/src/components/ui/button/_button.d.ts +63 -0
- package/dist/src/components/ui/button/button.d.ts +9 -20
- package/dist/src/components/ui/button/button.defs.d.ts +14 -0
- package/dist/src/components/ui/button/button.stories.d.ts +9 -1
- package/dist/src/components/ui/button/button.style.d.ts +1 -1
- package/dist/src/components/ui/card/_card-action.d.ts +22 -0
- package/dist/src/components/ui/card/_card-content.d.ts +21 -0
- package/dist/src/components/ui/card/_card-description.d.ts +22 -0
- package/dist/src/components/ui/card/_card-footer.d.ts +27 -0
- package/dist/src/components/ui/card/_card-header.d.ts +27 -0
- package/dist/src/components/ui/card/_card-title.d.ts +21 -0
- package/dist/src/components/ui/card/_card.d.ts +26 -0
- package/dist/src/components/ui/card/card.d.ts +14 -18
- package/dist/src/components/ui/card/card.defs.d.ts +10 -0
- package/dist/src/components/ui/card/card.stories.d.ts +9 -3
- package/dist/src/components/ui/checkbox/_checkbox.d.ts +66 -0
- package/dist/src/components/ui/checkbox/checkbox.d.ts +5 -13
- package/dist/src/components/ui/checkbox/checkbox.defs.d.ts +11 -0
- package/dist/src/components/ui/checkbox/checkbox.stories.d.ts +8 -7
- package/dist/src/components/ui/index.d.ts +1 -1
- package/dist/src/components/ui/input/_input.d.ts +164 -0
- package/dist/src/components/ui/input/input.d.ts +7 -29
- package/dist/src/components/ui/input/input.defs.d.ts +28 -0
- package/dist/src/components/ui/input/input.stories.d.ts +16 -6
- package/dist/src/components/ui/input-otp/_input-otp-group.d.ts +26 -0
- package/dist/src/components/ui/input-otp/_input-otp-separator.d.ts +16 -0
- package/dist/src/components/ui/input-otp/_input-otp-slot.d.ts +35 -0
- package/dist/src/components/ui/input-otp/_input-otp.d.ts +213 -0
- package/dist/src/components/ui/input-otp/input-otp.d.ts +12 -28
- package/dist/src/components/ui/input-otp/input-otp.defs.d.ts +28 -0
- package/dist/src/components/ui/input-otp/input-otp.stories.d.ts +10 -7
- package/dist/src/components/ui/label/_label.d.ts +27 -0
- package/dist/src/components/ui/label/label.d.ts +5 -7
- package/dist/src/components/ui/label/label.defs.d.ts +3 -0
- package/dist/src/components/ui/label/label.stories.d.ts +10 -5
- package/dist/src/components/ui/pagination/pagination-link.d.ts +2 -2
- package/dist/src/components/ui/pagination/pagination.styles.d.ts +1 -1
- package/dist/src/components/ui/sample-demo/sample-demo.d.ts +1 -1
- package/dist/src/components/ui/sample-demo/sample.style.d.ts +1 -1
- package/dist/src/components/ui/separator/_separator.d.ts +22 -0
- package/dist/src/components/ui/separator/separator.d.ts +5 -10
- package/dist/src/components/ui/separator/separator.defs.d.ts +4 -9
- package/dist/src/components/ui/separator/separator.stories.d.ts +3 -1
- package/dist/src/components/ui/tabs/_tabs-content.d.ts +30 -0
- package/dist/src/components/ui/tabs/_tabs-list.d.ts +30 -0
- package/dist/src/components/ui/tabs/_tabs-trigger.d.ts +47 -0
- package/dist/src/components/ui/tabs/_tabs.d.ts +99 -0
- package/dist/src/components/ui/tabs/tabs.d.ts +18 -0
- package/dist/src/components/ui/tabs/tabs.defs.d.ts +22 -0
- package/dist/src/components/ui/tabs/tabs.helpers.d.ts +24 -0
- package/dist/src/components/ui/tabs/tabs.stories.d.ts +13 -0
- package/dist/src/{components/ui/input/countryOptions.d.ts → helpers/country-codes.d.ts} +1 -1
- package/dist/src/helpers/index.d.ts +3 -2
- package/dist/src/tokens/tailwind/border-radius.d.ts +0 -9
- package/dist/src/tokens/tailwind/border-width.d.ts +0 -4
- package/dist/src/tokens/tailwind/box-shadow.d.ts +0 -6
- package/dist/src/tokens/tailwind/color.d.ts +0 -78
- package/dist/src/tokens/tailwind/font-size.d.ts +1 -37
- package/dist/src/tokens/tailwind/font-weight.d.ts +0 -8
- package/dist/src/tokens/tailwind/index.d.ts +1 -202
- package/dist/src/tokens/tailwind/opacity.d.ts +0 -5
- package/dist/src/tokens/tailwind/ring-offset-width.d.ts +0 -1
- package/dist/src/tokens/tailwind/ring-width.d.ts +0 -5
- package/dist/src/tokens/tailwind/spacing.d.ts +0 -45
- package/package.json +136 -135
- package/dist/src/components/ui/alert/alert.styles.d.ts +0 -10
- package/dist/src/components/ui/alert/alert.types.d.ts +0 -1
- package/dist/src/components/ui/alert/helpers.d.ts +0 -10
- package/dist/src/components/ui/avatar/avatar-fallback.d.ts +0 -15
- package/dist/src/components/ui/avatar/avatar-image.d.ts +0 -17
- package/dist/src/components/ui/avatar/avatar.style.d.ts +0 -4
- package/dist/src/components/ui/button/button.type.d.ts +0 -3
- package/dist/src/components/ui/card/card-content.d.ts +0 -11
- package/dist/src/components/ui/card/card-description.d.ts +0 -11
- package/dist/src/components/ui/card/card-footer.d.ts +0 -11
- package/dist/src/components/ui/card/card-header.d.ts +0 -11
- package/dist/src/components/ui/card/card-title.d.ts +0 -11
- package/dist/src/components/ui/card/card.styles.d.ts +0 -4
- package/dist/src/components/ui/checkbox/checkbox.style.d.ts +0 -4
- package/dist/src/components/ui/checkbox/checkbox.type.d.ts +0 -21
- package/dist/src/components/ui/input/input.styles.d.ts +0 -7
- package/dist/src/components/ui/input/input.type.d.ts +0 -21
- package/dist/src/components/ui/input-otp/input-otp-group.d.ts +0 -18
- package/dist/src/components/ui/input-otp/input-otp-separator.d.ts +0 -12
- package/dist/src/components/ui/input-otp/input-otp-slot.d.ts +0 -26
- package/dist/src/components/ui/input-otp/input-otp.styles.d.ts +0 -10
- package/dist/src/components/ui/label/label.style.d.ts +0 -1
- package/dist/src/components/ui/separator/separator.styles.d.ts +0 -5
- package/dist/src/components/ui/tabs/tab-contents.d.ts +0 -24
- package/dist/src/components/ui/tabs/tab-list.d.ts +0 -25
- package/dist/src/components/ui/tabs/tab-trigger.d.ts +0 -26
- package/dist/src/components/ui/tabs/tab.d.ts +0 -27
- package/dist/src/components/ui/tabs/tab.stories.d.ts +0 -16
- package/dist/src/components/ui/tabs/tabs.style.d.ts +0 -12
- package/dist/src/tokens/tailwind/grid-template-columns.d.ts +0 -4
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Label } from './_label';
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
render(): import('lit').TemplateResult<1>;
|
|
8
|
-
}
|
|
3
|
+
export { Label };
|
|
4
|
+
/**
|
|
5
|
+
* Renders an accessible label associated with controls.
|
|
6
|
+
*/
|
|
9
7
|
declare global {
|
|
10
8
|
interface HTMLElementTagNameMap {
|
|
11
9
|
'rtg-label': Label;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { Meta,
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
2
|
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
5
|
-
|
|
6
|
-
export declare const
|
|
3
|
+
declare const meta: Meta;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj;
|
|
6
|
+
export declare const Demo: Story;
|
|
7
|
+
export declare const WithCheckbox: Story;
|
|
8
|
+
export declare const WithInput: Story;
|
|
9
|
+
export declare const WithTextarea: Story;
|
|
10
|
+
export declare const Disabled: Story;
|
|
11
|
+
export declare const Required: Story;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { BaseElement } from '../../../helpers';
|
|
2
2
|
import { PropertyValues } from 'lit';
|
|
3
|
-
import { ButtonSize } from '../button/button.
|
|
3
|
+
import { ButtonSize } from '../button/button.defs';
|
|
4
4
|
|
|
5
5
|
export declare class PaginationLink extends BaseElement {
|
|
6
6
|
state: string;
|
|
7
7
|
isActive: boolean;
|
|
8
|
-
size: ButtonSize
|
|
8
|
+
size: Exclude<ButtonSize, 'xs' | 'icon-xs'>;
|
|
9
9
|
href: string;
|
|
10
10
|
get _containerElement(): HTMLAnchorElement | null;
|
|
11
11
|
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
@@ -4,7 +4,7 @@ export declare const paginationStyles: {
|
|
|
4
4
|
item: string[];
|
|
5
5
|
link: (props?: ({
|
|
6
6
|
variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
7
|
-
size?: "
|
|
7
|
+
size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
8
8
|
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
|
|
9
9
|
previous: {
|
|
10
10
|
base: string[];
|
|
@@ -4,7 +4,7 @@ import * as sampleType from './sample.type';
|
|
|
4
4
|
export declare class SampleDemo extends LitElement {
|
|
5
5
|
static buttonVariants: (props?: ({
|
|
6
6
|
variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
7
|
-
size?: "
|
|
7
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
8
8
|
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
|
|
9
9
|
click: () => void;
|
|
10
10
|
disabled: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const demoStyle: (props?: ({
|
|
2
2
|
variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
3
|
-
size?: "
|
|
3
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
4
4
|
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { SeparatorOrientation, SeparatorProps } from './separator.defs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The `<rtg-separator>` component visually or semantically separates content.
|
|
6
|
+
*
|
|
7
|
+
* @element rtg-separator
|
|
8
|
+
* @slot separator
|
|
9
|
+
*/
|
|
10
|
+
export declare class Separator extends LitElement implements SeparatorProps {
|
|
11
|
+
/**
|
|
12
|
+
* The orientation of the separator.
|
|
13
|
+
*/
|
|
14
|
+
orientation: SeparatorOrientation;
|
|
15
|
+
/**
|
|
16
|
+
* When `true`, signifies that it is purely visual, carries no semantic
|
|
17
|
+
* meaning, and ensures it is not present in the accessibility tree.
|
|
18
|
+
*/
|
|
19
|
+
decorative?: boolean;
|
|
20
|
+
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
21
|
+
render(): import('lit').TemplateResult<1>;
|
|
22
|
+
}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PropertyValues } from 'lit';
|
|
3
|
-
import { SEPARATOR_ORIENTATION } from './separator.defs';
|
|
1
|
+
import { Separator } from './_separator';
|
|
4
2
|
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
protected updated(changedProperties: PropertyValues): void;
|
|
10
|
-
render(): import('lit').TemplateResult<1>;
|
|
11
|
-
}
|
|
3
|
+
export { Separator };
|
|
4
|
+
/**
|
|
5
|
+
* Visually or semantically separates content.
|
|
6
|
+
*/
|
|
12
7
|
declare global {
|
|
13
8
|
interface HTMLElementTagNameMap {
|
|
14
9
|
'rtg-separator': Separator;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
VERTICAL = "vertical",
|
|
6
|
-
/**
|
|
7
|
-
* @horizontal Type
|
|
8
|
-
*/
|
|
9
|
-
HORIZONTAL = "horizontal"
|
|
1
|
+
export type SeparatorOrientation = 'horizontal' | 'vertical';
|
|
2
|
+
export interface SeparatorProps {
|
|
3
|
+
orientation: SeparatorOrientation;
|
|
4
|
+
decorative?: boolean;
|
|
10
5
|
}
|
|
@@ -3,6 +3,8 @@ import { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
|
3
3
|
declare const meta: Meta;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const Demo: Story;
|
|
7
7
|
export declare const Horizontal: Story;
|
|
8
8
|
export declare const Vertical: Story;
|
|
9
|
+
export declare const Menu: Story;
|
|
10
|
+
export declare const List: Story;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import { TabsContentProps } from './tabs.defs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The `<rtg-tabs-content>` component contains the content associated with each
|
|
6
|
+
* trigger.
|
|
7
|
+
*
|
|
8
|
+
* @element rtg-tabs-content
|
|
9
|
+
* @slot tabs-content
|
|
10
|
+
*/
|
|
11
|
+
export declare class TabsContent extends LitElement implements TabsContentProps {
|
|
12
|
+
/**
|
|
13
|
+
* A unique value that associates the content with a trigger.
|
|
14
|
+
*/
|
|
15
|
+
value: string;
|
|
16
|
+
/**
|
|
17
|
+
* Overrides the default behaviour to render into the light DOM.
|
|
18
|
+
*/
|
|
19
|
+
protected createRenderRoot(): this;
|
|
20
|
+
/**
|
|
21
|
+
* The slot of the tabs content.
|
|
22
|
+
*/
|
|
23
|
+
get _contentSlot(): HTMLElement | null;
|
|
24
|
+
/**
|
|
25
|
+
* Handles the first updated callback, appending the children to the content
|
|
26
|
+
* slot.
|
|
27
|
+
*/
|
|
28
|
+
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
29
|
+
render(): import('lit').TemplateResult<1>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import { TabsListProps, TabsListVariant } from './tabs.defs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The `<rtg-tabs-list>` component contains the triggers that are aligned along
|
|
6
|
+
* the edge of the active content.
|
|
7
|
+
*
|
|
8
|
+
* @element rtg-tabs-list
|
|
9
|
+
* @slot tabs-list
|
|
10
|
+
*/
|
|
11
|
+
export declare class TabsList extends LitElement implements TabsListProps {
|
|
12
|
+
/**
|
|
13
|
+
* The visual style of the tabs list.
|
|
14
|
+
*/
|
|
15
|
+
variant: TabsListVariant;
|
|
16
|
+
/**
|
|
17
|
+
* Overrides the default behaviour to render into the light DOM.
|
|
18
|
+
*/
|
|
19
|
+
protected createRenderRoot(): this;
|
|
20
|
+
/**
|
|
21
|
+
* The slot of the tabs list.
|
|
22
|
+
*/
|
|
23
|
+
get _listSlot(): HTMLElement | null;
|
|
24
|
+
/**
|
|
25
|
+
* Handles the first updated callback, appending the children to the list
|
|
26
|
+
* slot.
|
|
27
|
+
*/
|
|
28
|
+
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
29
|
+
render(): import('lit').TemplateResult<1>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import { TabsTriggerProps } from './tabs.defs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The `<rtg-tabs-trigger>` component is the button that activates its
|
|
6
|
+
* associated content.
|
|
7
|
+
*
|
|
8
|
+
* @element rtg-tabs-trigger
|
|
9
|
+
* @slot tabs-trigger
|
|
10
|
+
*/
|
|
11
|
+
export declare class TabsTrigger extends LitElement implements TabsTriggerProps {
|
|
12
|
+
/**
|
|
13
|
+
* A unique value that associates the trigger with a content.
|
|
14
|
+
*/
|
|
15
|
+
value: string;
|
|
16
|
+
/**
|
|
17
|
+
* When `true`, prevents the user from interacting with the tab.
|
|
18
|
+
*/
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Overrides the default behaviour to render into the light DOM.
|
|
22
|
+
*/
|
|
23
|
+
protected createRenderRoot(): this;
|
|
24
|
+
/**
|
|
25
|
+
* The slot of the tabs trigger.
|
|
26
|
+
*/
|
|
27
|
+
get _triggerSlot(): HTMLButtonElement | null;
|
|
28
|
+
/**
|
|
29
|
+
* Handles the first updated callback, appending the children to the trigger
|
|
30
|
+
* slot.
|
|
31
|
+
*/
|
|
32
|
+
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
33
|
+
/**
|
|
34
|
+
* Sends the trigger select event object, invoking the parent tabs' event
|
|
35
|
+
* listener.
|
|
36
|
+
*/
|
|
37
|
+
private _emitSelect;
|
|
38
|
+
/**
|
|
39
|
+
* Handles the click event of the trigger button, invoking `_emitSelect`.
|
|
40
|
+
*/
|
|
41
|
+
private _onClick;
|
|
42
|
+
/**
|
|
43
|
+
* Handles the keydown event of the trigger button, invoking `_emitSelect`.
|
|
44
|
+
*/
|
|
45
|
+
private _onKeyDown;
|
|
46
|
+
render(): import('lit').TemplateResult<1>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import { TabsProps, TabsOrientation, TabsDir, TabsActivationMode } from './tabs.defs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The `<rtg-tabs>` component is the 'root' and contains all the tabs component
|
|
6
|
+
* parts.
|
|
7
|
+
*
|
|
8
|
+
* @element rtg-tabs
|
|
9
|
+
* @slot tabs
|
|
10
|
+
*/
|
|
11
|
+
export declare class Tabs extends LitElement implements TabsProps {
|
|
12
|
+
/**
|
|
13
|
+
* The value of the tab that should be active when initially rendered. Use
|
|
14
|
+
* when you do not need to control the state of the tabs.
|
|
15
|
+
*/
|
|
16
|
+
defaultValue?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The controlled value of the tab to activate. Should be used in conjunction
|
|
19
|
+
* with `onValueChange`.
|
|
20
|
+
*/
|
|
21
|
+
value?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Event handler called when the value changes.
|
|
24
|
+
*/
|
|
25
|
+
onValueChange?: (value: string) => void;
|
|
26
|
+
/**
|
|
27
|
+
* The orientation of the tabs.
|
|
28
|
+
*/
|
|
29
|
+
orientation: TabsOrientation;
|
|
30
|
+
/**
|
|
31
|
+
* The reading direction of the tabs.
|
|
32
|
+
*/
|
|
33
|
+
dir: TabsDir;
|
|
34
|
+
/**
|
|
35
|
+
* When `automatic`, tabs are activated when receiving focus. When `manual`,
|
|
36
|
+
* tabs are activated when clicked.
|
|
37
|
+
*/
|
|
38
|
+
activationMode: TabsActivationMode;
|
|
39
|
+
/**
|
|
40
|
+
* The active tab's value - the value props of the trigger/content pair.
|
|
41
|
+
*/
|
|
42
|
+
private _activeValue?;
|
|
43
|
+
/**
|
|
44
|
+
* The tabs root's base ID, generated by `generatedId`, and used to construct
|
|
45
|
+
* the trigger and contents children's ids.
|
|
46
|
+
*/
|
|
47
|
+
private _baseId;
|
|
48
|
+
/**
|
|
49
|
+
* Overrides the default behaviour to render into the light DOM.
|
|
50
|
+
*/
|
|
51
|
+
protected createRenderRoot(): this;
|
|
52
|
+
/**
|
|
53
|
+
* The slot of the tabs root.
|
|
54
|
+
*/
|
|
55
|
+
private get _rootSlot();
|
|
56
|
+
/**
|
|
57
|
+
* The tabs list child.
|
|
58
|
+
*/
|
|
59
|
+
private get _list();
|
|
60
|
+
/**
|
|
61
|
+
* The tabs trigger children.
|
|
62
|
+
*/
|
|
63
|
+
private get _triggers();
|
|
64
|
+
/**
|
|
65
|
+
* The tabs content children.
|
|
66
|
+
*/
|
|
67
|
+
private get _contents();
|
|
68
|
+
/**
|
|
69
|
+
* Whether or not the tabs element is 'controlled' - determined by whether or
|
|
70
|
+
* not the value prop was provided by the user.
|
|
71
|
+
*/
|
|
72
|
+
private get _isControlled();
|
|
73
|
+
/**
|
|
74
|
+
* The value of the active tab: user-provided value if controlled, otherwise,
|
|
75
|
+
* the internal state value.
|
|
76
|
+
*/
|
|
77
|
+
private get _currentValue();
|
|
78
|
+
/**
|
|
79
|
+
* The event listener callback used for the trigger select event.
|
|
80
|
+
*/
|
|
81
|
+
private _onTriggerSelect;
|
|
82
|
+
/**
|
|
83
|
+
* Sync all the tabs children (list, triggers, and contents), setting their
|
|
84
|
+
* 'parent-controlled' attributes.
|
|
85
|
+
*/
|
|
86
|
+
private _sync;
|
|
87
|
+
/**
|
|
88
|
+
* Handles the first updated callback, appending the children to the root
|
|
89
|
+
* slot, determining the active tab, adding the trigger select event listener
|
|
90
|
+
* and syncing the tabs children.
|
|
91
|
+
*/
|
|
92
|
+
protected firstUpdated(): void;
|
|
93
|
+
/**
|
|
94
|
+
* Handles the updated callback, updating the active tab if changed (and
|
|
95
|
+
* controlled), and syncing the tabs children.
|
|
96
|
+
*/
|
|
97
|
+
protected updated(changed: PropertyValues): void;
|
|
98
|
+
render(): import('lit').TemplateResult<1>;
|
|
99
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Tabs } from './_tabs';
|
|
2
|
+
import { TabsList } from './_tabs-list';
|
|
3
|
+
import { TabsTrigger } from './_tabs-trigger';
|
|
4
|
+
import { TabsContent } from './_tabs-content';
|
|
5
|
+
|
|
6
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
7
|
+
/**
|
|
8
|
+
* A set of layered sections of content—known as tab panels—that are displayed
|
|
9
|
+
* one at a time.
|
|
10
|
+
*/
|
|
11
|
+
declare global {
|
|
12
|
+
interface HTMLElementTagNameMap {
|
|
13
|
+
'rtg-tabs': Tabs;
|
|
14
|
+
'rtg-tabs-list': TabsList;
|
|
15
|
+
'rtg-tabs-trigger': TabsTrigger;
|
|
16
|
+
'rtg-tabs-content': TabsContent;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type TabsOrientation = 'horizontal' | 'vertical';
|
|
2
|
+
export type TabsDir = 'ltr' | 'rtl';
|
|
3
|
+
export type TabsActivationMode = 'automatic' | 'manual';
|
|
4
|
+
export interface TabsProps {
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
onValueChange?: (value: string) => void;
|
|
8
|
+
orientation: TabsOrientation;
|
|
9
|
+
dir: TabsDir;
|
|
10
|
+
activationMode: TabsActivationMode;
|
|
11
|
+
}
|
|
12
|
+
export type TabsListVariant = 'default' | 'line';
|
|
13
|
+
export interface TabsListProps {
|
|
14
|
+
variant: TabsListVariant;
|
|
15
|
+
}
|
|
16
|
+
export interface TabsTriggerProps {
|
|
17
|
+
value: string;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface TabsContentProps {
|
|
21
|
+
value: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a unique ID for Tabs to use as its baseId value.
|
|
3
|
+
* The ID is prefixed with 'rtg-', and consists of a time component as well as a
|
|
4
|
+
* random component.
|
|
5
|
+
*
|
|
6
|
+
* @returns A unique, ~13 char ID for a Tabs baseId value.
|
|
7
|
+
*/
|
|
8
|
+
export declare function generateId(): string;
|
|
9
|
+
/**
|
|
10
|
+
* Constructs a unique ID for a TabsTrigger slot element.
|
|
11
|
+
*
|
|
12
|
+
* @param baseId The ID of the TabsTrigger's Tabs parent.
|
|
13
|
+
* @param value The value of the TabsTrigger.
|
|
14
|
+
* @returns The ID of the TabsTrigger's slot.
|
|
15
|
+
*/
|
|
16
|
+
export declare function makeTriggerId(baseId: string, value: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Constructs a unique ID for a TabsContent slot element.
|
|
19
|
+
*
|
|
20
|
+
* @param baseId The ID of the TabsContent's Tabs parent.
|
|
21
|
+
* @param value The value of the TabsContent.
|
|
22
|
+
* @returns The ID of the TabsContent's slot.
|
|
23
|
+
*/
|
|
24
|
+
export declare function makeContentId(baseId: string, value: string): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
|
|
3
|
+
declare const meta: Meta;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj;
|
|
6
|
+
export declare const Demo: Story;
|
|
7
|
+
export declare const Basic: Story;
|
|
8
|
+
export declare const Line: Story;
|
|
9
|
+
export declare const Vertical: Story;
|
|
10
|
+
export declare const Disabled: Story;
|
|
11
|
+
export declare const Icons: Story;
|
|
12
|
+
export declare const IconOnly: Story;
|
|
13
|
+
export declare const WithContent: Story;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export * from './mouse-conroller.helper';
|
|
2
|
-
export * from './style.helpers';
|
|
3
1
|
export * from './base-element';
|
|
2
|
+
export * from './country-codes';
|
|
4
3
|
export * from './genrate-uuid.helper';
|
|
4
|
+
export * from './mouse-conroller.helper';
|
|
5
5
|
export * from './shadow-wrapper';
|
|
6
|
+
export * from './style.helpers';
|
|
6
7
|
export * from './widget-controller';
|
|
@@ -8,13 +8,10 @@ export declare const borderRadius: {
|
|
|
8
8
|
'combo-box-item-radius': string;
|
|
9
9
|
'carousel-button-radius': string;
|
|
10
10
|
'textarea-radius': string;
|
|
11
|
-
'tab-list-radius': string;
|
|
12
|
-
'tab-trigger-radius': string;
|
|
13
11
|
'toast-viewport-item-radius': string;
|
|
14
12
|
'toast-action-radius': string;
|
|
15
13
|
'toggle-group-item-radius': string;
|
|
16
14
|
'toggle-radius': string;
|
|
17
|
-
'input-radius': string;
|
|
18
15
|
'scrollarea-radius': string;
|
|
19
16
|
'switch-radius': string;
|
|
20
17
|
'switch-thumb-radius': string;
|
|
@@ -31,7 +28,6 @@ export declare const borderRadius: {
|
|
|
31
28
|
'menubar-item-radius': string;
|
|
32
29
|
'menubar-checkbox-item-radius': string;
|
|
33
30
|
'menubar-radio-item-radius': string;
|
|
34
|
-
'input-otp-slot-radius': string;
|
|
35
31
|
'hover-card-content-radius': string;
|
|
36
32
|
'dropdown-menu-content-radius': string;
|
|
37
33
|
'dropdown-menu-item-radius': string;
|
|
@@ -48,14 +44,9 @@ export declare const borderRadius: {
|
|
|
48
44
|
'command-radius': string;
|
|
49
45
|
'command-input-radius': string;
|
|
50
46
|
'command-item-radius': string;
|
|
51
|
-
'checkbox-radius': string;
|
|
52
|
-
'card-radius': string;
|
|
53
47
|
'calendar-weekday-radius': string;
|
|
54
48
|
'calendar-day-radius': string;
|
|
55
49
|
'button-radius': string;
|
|
56
50
|
'badge-radius': string;
|
|
57
|
-
'avatar-radius': string;
|
|
58
|
-
'avatar-fallback-radius': string;
|
|
59
|
-
'alert-radius': string;
|
|
60
51
|
'accordion-trigger-radius': string;
|
|
61
52
|
};
|
|
@@ -12,21 +12,17 @@ export declare const borderWidth: {
|
|
|
12
12
|
'popover-content-width-border': string;
|
|
13
13
|
'menubar-width-border': string;
|
|
14
14
|
'menubar-content-width-border': string;
|
|
15
|
-
'input-otp-slot-width-border': string;
|
|
16
15
|
'hover-card-content-width-border': string;
|
|
17
16
|
'dropdown-menu-content-width-border': string;
|
|
18
17
|
'drawer-content-width-border': string;
|
|
19
18
|
'dialog-content-width-border': string;
|
|
20
19
|
'context-menu-content-width-border': string;
|
|
21
20
|
'command-input-wrapper-width-border': string;
|
|
22
|
-
'checkbox-width-border': string;
|
|
23
|
-
'card-width-border': string;
|
|
24
21
|
'calendar-day-width-border-focus': string;
|
|
25
22
|
'button-width-border-focus': string;
|
|
26
23
|
'button-width-border-invalid': string;
|
|
27
24
|
'button-outline-width-border': string;
|
|
28
25
|
'badge-width-border': string;
|
|
29
|
-
'alert-width-border': string;
|
|
30
26
|
'accordion-item-width-border': string;
|
|
31
27
|
'accordion-trigger-width-border-focus': string;
|
|
32
28
|
};
|
|
@@ -2,7 +2,6 @@ export declare const boxShadow: {
|
|
|
2
2
|
'navigation-menu-item-shadow-focus': string;
|
|
3
3
|
'navigation-menu-content-container-shadow': string;
|
|
4
4
|
'combo-box-group-shadow': string;
|
|
5
|
-
'tab-trigger-shadow-active': string;
|
|
6
5
|
'toast-viewport-item-shadow': string;
|
|
7
6
|
'switch-shadow': string;
|
|
8
7
|
'select-trigger-shadow': string;
|
|
@@ -11,13 +10,8 @@ export declare const boxShadow: {
|
|
|
11
10
|
'popover-content-shadow': string;
|
|
12
11
|
'menubar-shadow': string;
|
|
13
12
|
'menubar-content-shadow': string;
|
|
14
|
-
'input-otp-slot-shadow': string;
|
|
15
|
-
'input-shadow': string;
|
|
16
13
|
'hover-card-content-shadow': string;
|
|
17
14
|
'dropdown-menu-content-shadow': string;
|
|
18
15
|
'dialog-content-shadow': string;
|
|
19
16
|
'context-menu-content-shadow': string;
|
|
20
|
-
'checkbox-shadow': string;
|
|
21
|
-
'card-shadow': string;
|
|
22
|
-
'button-outline-shadow': string;
|
|
23
17
|
};
|