@pontive/pontkit-core 1.26.0 → 1.27.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/catalog.json +1 -1
- package/custom-elements.json +1 -1
- package/dist/pont2/core/attrs.d.ts +22 -0
- package/dist/pont2/core/controllers/roving-focus.d.ts +38 -0
- package/dist/pont2/core/events.d.ts +28 -0
- package/dist/pont2/core/form-control.d.ts +70 -0
- package/dist/pont2/core/host-element.d.ts +129 -0
- package/dist/pont2/core/icons.d.ts +20 -0
- package/dist/pont2/core/ids.d.ts +6 -0
- package/dist/pont2/core/index.d.ts +8 -0
- package/dist/pont2/core/names.d.ts +78 -0
- package/dist/pont2/core/popup/anchored.d.ts +48 -0
- package/dist/pont2/core/popup/index.d.ts +5 -0
- package/dist/pont2/core/popup/list.d.ts +38 -0
- package/dist/pont2/core/popup/popup-content.d.ts +68 -0
- package/dist/pont2/core/popup/popup-root.d.ts +94 -0
- package/dist/pont2/core/popup/position.d.ts +73 -0
- package/dist/pont2/globals.css +109 -0
- package/dist/pont2/index.d.ts +44 -0
- package/dist/pont2/index.mjs +3805 -0
- package/dist/pont2/index.mjs.map +1 -0
- package/dist/pont2/kit/alert/alert.d.ts +62 -0
- package/dist/pont2/kit/aliases.d.ts +33 -0
- package/dist/pont2/kit/avatar/avatar.d.ts +52 -0
- package/dist/pont2/kit/index.d.ts +3 -0
- package/dist/pont2/kit/input-otp/input-otp.d.ts +52 -0
- package/dist/pont2/primitives/alert/alert.d.ts +49 -0
- package/dist/pont2/primitives/avatar/avatar.d.ts +89 -0
- package/dist/pont2/primitives/badge/badge.d.ts +30 -0
- package/dist/pont2/primitives/button/button.d.ts +113 -0
- package/dist/pont2/primitives/button-group/button-group.d.ts +55 -0
- package/dist/pont2/primitives/card/card.d.ts +63 -0
- package/dist/pont2/primitives/checkbox/checkbox.d.ts +54 -0
- package/dist/pont2/primitives/combobox/combobox.d.ts +213 -0
- package/dist/pont2/primitives/dropdown-menu/dropdown-menu.d.ts +267 -0
- package/dist/pont2/primitives/empty/empty.d.ts +60 -0
- package/dist/pont2/primitives/field/field.d.ts +146 -0
- package/dist/pont2/primitives/input/input.d.ts +47 -0
- package/dist/pont2/primitives/input-group/input-group.d.ts +97 -0
- package/dist/pont2/primitives/input-otp/input-otp.d.ts +121 -0
- package/dist/pont2/primitives/input-otp/otp.d.ts +22 -0
- package/dist/pont2/primitives/item/item.d.ts +100 -0
- package/dist/pont2/primitives/kbd/kbd.d.ts +29 -0
- package/dist/pont2/primitives/label/label.d.ts +37 -0
- package/dist/pont2/primitives/native-select/native-select.d.ts +59 -0
- package/dist/pont2/primitives/popover/popover.d.ts +85 -0
- package/dist/pont2/primitives/progress/progress.d.ts +80 -0
- package/dist/pont2/primitives/radio-group/radio-group.d.ts +93 -0
- package/dist/pont2/primitives/select/select.d.ts +184 -0
- package/dist/pont2/primitives/separator/separator.d.ts +34 -0
- package/dist/pont2/primitives/skeleton/skeleton.d.ts +18 -0
- package/dist/pont2/primitives/slider/slider-math.d.ts +42 -0
- package/dist/pont2/primitives/slider/slider.d.ts +85 -0
- package/dist/pont2/primitives/spinner/spinner.d.ts +29 -0
- package/dist/pont2/primitives/switch/switch.d.ts +55 -0
- package/dist/pont2/primitives/table/table.d.ts +55 -0
- package/dist/pont2/primitives/tabs/tabs.d.ts +126 -0
- package/dist/pont2/primitives/textarea/textarea.d.ts +41 -0
- package/dist/pont2/primitives/tooltip/tooltip.d.ts +69 -0
- package/dist/pont2/styles.css +4137 -0
- package/dist/pont2/with-legacy.css +10 -0
- package/package.json +16 -4
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { PropertyDeclarations, PropertyValues } from 'lit';
|
|
2
|
+
import { HostElement } from '../../core/host-element';
|
|
3
|
+
export type TabsOrientation = "horizontal" | "vertical";
|
|
4
|
+
export type TabsListVariant = "default" | "line";
|
|
5
|
+
type ActivationDirection = "left" | "right" | "up" | "down" | "none";
|
|
6
|
+
/**
|
|
7
|
+
* # Tabs, TabsList, TabsTrigger, TabsContent: Tier 2 (widgets)
|
|
8
|
+
*
|
|
9
|
+
* shadcn: `<Tabs>` → Base UI `<Tabs.Root>` (div) > `<Tabs.List>` (div[role=tablist])
|
|
10
|
+
* > `<Tabs.Tab>` (button[role=tab]) …, and `<Tabs.Panel>` (div[role=tabpanel]).
|
|
11
|
+
*
|
|
12
|
+
* pont2: every part is host-as-root, written by the author and never moved:
|
|
13
|
+
* ```
|
|
14
|
+
* pont2-prim-tabs[data-orientation]
|
|
15
|
+
* pont2-prim-tabs-list[role=tablist][data-variant]
|
|
16
|
+
* pont2-prim-tabs-trigger[role=tab][value] ×n (data-active on the active one)
|
|
17
|
+
* pont2-prim-tabs-content[role=tabpanel][value] ×n (hidden unless active)
|
|
18
|
+
* ```
|
|
19
|
+
* The root owns the value; triggers and panels are matched by `value`.
|
|
20
|
+
* ARIA relations (`aria-controls`, `aria-labelledby`) are wired through
|
|
21
|
+
* ElementInternals, so the author's markup is not rewritten.
|
|
22
|
+
*
|
|
23
|
+
* Keyboard (Base UI / APG): the list is one tab stop (roving tabindex);
|
|
24
|
+
* arrows along the orientation move focus (wrapping), Home/End jump, and
|
|
25
|
+
* Enter/Space activate. With `activate-on-focus` on the list, moving focus
|
|
26
|
+
* also activates (Base UI default: off).
|
|
27
|
+
*
|
|
28
|
+
* @tag pont2-prim-tabs
|
|
29
|
+
* @attr value - The default active tab value; `.value` is live. Defaults to the first enabled trigger.
|
|
30
|
+
* @attr orientation - horizontal (default) | vertical
|
|
31
|
+
* @fires input, change - The active tab changed through interaction.
|
|
32
|
+
*/
|
|
33
|
+
export declare class Tabs extends HostElement {
|
|
34
|
+
static identity: string;
|
|
35
|
+
static slotName: string;
|
|
36
|
+
static properties: PropertyDeclarations;
|
|
37
|
+
defaultValue: string | null;
|
|
38
|
+
orientation: TabsOrientation;
|
|
39
|
+
protected current: string;
|
|
40
|
+
/** The active tab's value. Setting it activates that tab without firing events. */
|
|
41
|
+
get value(): string;
|
|
42
|
+
set value(v: string);
|
|
43
|
+
private dirty;
|
|
44
|
+
private direction;
|
|
45
|
+
private observer?;
|
|
46
|
+
constructor();
|
|
47
|
+
get triggers(): TabsTrigger[];
|
|
48
|
+
get panels(): TabsContent[];
|
|
49
|
+
get lists(): TabsList[];
|
|
50
|
+
private own;
|
|
51
|
+
connectedCallback(): void;
|
|
52
|
+
disconnectedCallback(): void;
|
|
53
|
+
/** Activate a trigger as the user would (fires input/change). */
|
|
54
|
+
select(trigger: TabsTrigger): void;
|
|
55
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
56
|
+
protected updated(): void;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* @tag pont2-prim-tabs-list
|
|
60
|
+
* @attr variant - default | line
|
|
61
|
+
* @attr activate-on-focus - Arrow-key focus also activates the tab (Base UI `activateOnFocus`).
|
|
62
|
+
* @attr loop - Set `loop="false"` to stop focus wrapping (Base UI `loopFocus`).
|
|
63
|
+
*/
|
|
64
|
+
export declare class TabsList extends HostElement {
|
|
65
|
+
static identity: string;
|
|
66
|
+
static slotName: string;
|
|
67
|
+
static role: string;
|
|
68
|
+
static properties: PropertyDeclarations;
|
|
69
|
+
variant: TabsListVariant;
|
|
70
|
+
activateOnFocus: boolean;
|
|
71
|
+
loop: string | null;
|
|
72
|
+
private orientation;
|
|
73
|
+
private roving;
|
|
74
|
+
constructor();
|
|
75
|
+
get root(): Tabs | null;
|
|
76
|
+
connectedCallback(): void;
|
|
77
|
+
/** @internal Called by the root. */
|
|
78
|
+
sync(orientation: TabsOrientation, direction: ActivationDirection): void;
|
|
79
|
+
/** @internal Called by the root. */
|
|
80
|
+
focusSync(active: HTMLElement | null): void;
|
|
81
|
+
protected willUpdate(): void;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* @tag pont2-prim-tabs-trigger
|
|
85
|
+
* @attr value - Identifies the tab and its panel.
|
|
86
|
+
* @attr disabled
|
|
87
|
+
*/
|
|
88
|
+
export declare class TabsTrigger extends HostElement {
|
|
89
|
+
static identity: string;
|
|
90
|
+
static slotName: string;
|
|
91
|
+
static role: string;
|
|
92
|
+
static properties: PropertyDeclarations;
|
|
93
|
+
value: string;
|
|
94
|
+
disabled: boolean;
|
|
95
|
+
constructor();
|
|
96
|
+
get root(): Tabs | null;
|
|
97
|
+
connectedCallback(): void;
|
|
98
|
+
private onClick;
|
|
99
|
+
private onKeyDown;
|
|
100
|
+
/** @internal Called by the root. */
|
|
101
|
+
sync(active: boolean, orientation: TabsOrientation, panel: Element | null): void;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* @tag pont2-prim-tabs-content
|
|
105
|
+
* @attr value - The trigger value this panel belongs to.
|
|
106
|
+
*/
|
|
107
|
+
export declare class TabsContent extends HostElement {
|
|
108
|
+
static identity: string;
|
|
109
|
+
static slotName: string;
|
|
110
|
+
static role: string;
|
|
111
|
+
static properties: PropertyDeclarations;
|
|
112
|
+
value: string;
|
|
113
|
+
constructor();
|
|
114
|
+
connectedCallback(): void;
|
|
115
|
+
/** @internal Called by the root. */
|
|
116
|
+
sync(active: boolean, orientation: TabsOrientation, trigger: Element | null): void;
|
|
117
|
+
}
|
|
118
|
+
declare global {
|
|
119
|
+
interface HTMLElementTagNameMap {
|
|
120
|
+
"pont2-prim-tabs": Tabs;
|
|
121
|
+
"pont2-prim-tabs-list": TabsList;
|
|
122
|
+
"pont2-prim-tabs-trigger": TabsTrigger;
|
|
123
|
+
"pont2-prim-tabs-content": TabsContent;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AttrMap } from '../../core/attrs';
|
|
2
|
+
import { NativeEnhancer } from '../../core/host-element';
|
|
3
|
+
/**
|
|
4
|
+
* # Textarea: Tier 3 (native-bound)
|
|
5
|
+
*
|
|
6
|
+
* shadcn: `<Textarea>` → a native `<textarea data-slot="textarea">`, auto-sized
|
|
7
|
+
* with `field-sizing: content`.
|
|
8
|
+
*
|
|
9
|
+
* - recipe: `<textarea data-pont2-textarea name="bio"></textarea>`
|
|
10
|
+
* - part: `textarea({ name: "bio" })`
|
|
11
|
+
* - enhancer: `<pont2-prim-textarea><textarea name="bio"></textarea></pont2-prim-textarea>`
|
|
12
|
+
*/
|
|
13
|
+
export interface TextareaOptions {
|
|
14
|
+
id?: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
value?: string;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
rows?: number;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
readonly?: boolean;
|
|
22
|
+
invalid?: boolean;
|
|
23
|
+
describedBy?: string;
|
|
24
|
+
slot?: string;
|
|
25
|
+
attrs?: AttrMap;
|
|
26
|
+
onInput?: (e: InputEvent) => void;
|
|
27
|
+
}
|
|
28
|
+
export declare function applyTextarea(el: HTMLTextAreaElement, slot?: string): void;
|
|
29
|
+
export declare function textarea(o?: TextareaOptions): import('lit-html').TemplateResult<1>;
|
|
30
|
+
/**
|
|
31
|
+
* @tag pont2-prim-textarea
|
|
32
|
+
*/
|
|
33
|
+
export declare class Pont2Textarea extends NativeEnhancer<HTMLTextAreaElement> {
|
|
34
|
+
static nativeSelector: string;
|
|
35
|
+
protected apply(control: HTMLTextAreaElement): void;
|
|
36
|
+
}
|
|
37
|
+
declare global {
|
|
38
|
+
interface HTMLElementTagNameMap {
|
|
39
|
+
"pont2-prim-textarea": Pont2Textarea;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { PropertyDeclarations } from 'lit';
|
|
2
|
+
import { PopupContent } from '../../core/popup/popup-content';
|
|
3
|
+
import { PopupRoot, PopupTrigger } from '../../core/popup/popup-root';
|
|
4
|
+
/**
|
|
5
|
+
* # Tooltip
|
|
6
|
+
*
|
|
7
|
+
* shadcn: `<TooltipProvider delay={0}>` > `<Tooltip>` (Base UI `Tooltip.Root`,
|
|
8
|
+
* renders nothing) > `<TooltipTrigger>` (a `<button>`) + `<TooltipContent>`
|
|
9
|
+
* (Portal > Positioner > Popup > children + `<Tooltip.Arrow>`).
|
|
10
|
+
*
|
|
11
|
+
* pont2: no Provider (a per-root `delay`, default 0 like shadcn's provider);
|
|
12
|
+
* the arrow is the content's `::before`, so the popup is one node.
|
|
13
|
+
*
|
|
14
|
+
* ```html
|
|
15
|
+
* <pont2-prim-tooltip>
|
|
16
|
+
* <pont2-prim-tooltip-trigger><button data-pont2-button data-variant="outline">Hover</button></pont2-prim-tooltip-trigger>
|
|
17
|
+
* <pont2-prim-tooltip-content>Add to library</pont2-prim-tooltip-content>
|
|
18
|
+
* </pont2-prim-tooltip>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* Opens on pointer hover and on keyboard focus; closes on leave, blur,
|
|
22
|
+
* Escape or press. The trigger is described by the content
|
|
23
|
+
* (`aria-describedby`) while it is open.
|
|
24
|
+
*
|
|
25
|
+
* @tag pont2-prim-tooltip
|
|
26
|
+
* @attr delay - ms before opening on hover (default 0)
|
|
27
|
+
* @attr close-delay - ms before closing (default 0)
|
|
28
|
+
*/
|
|
29
|
+
export declare class Tooltip extends PopupRoot {
|
|
30
|
+
static identity: string;
|
|
31
|
+
static properties: PropertyDeclarations;
|
|
32
|
+
delay: number;
|
|
33
|
+
closeDelay: number;
|
|
34
|
+
private timer;
|
|
35
|
+
constructor();
|
|
36
|
+
get triggerElement(): HTMLElement | null;
|
|
37
|
+
get contentElement(): TooltipContent | null;
|
|
38
|
+
protected get popupKind(): "true";
|
|
39
|
+
/** A tooltip is not a popup the trigger "has": no aria-haspopup/expanded, just a description. */
|
|
40
|
+
wire(): void;
|
|
41
|
+
schedule(open: boolean, reason: "trigger-hover" | "trigger-focus" | "focus-out"): void;
|
|
42
|
+
protected afterClose(): void;
|
|
43
|
+
}
|
|
44
|
+
/** @tag pont2-prim-tooltip-trigger */
|
|
45
|
+
export declare class TooltipTrigger extends PopupTrigger {
|
|
46
|
+
static rootTag: string;
|
|
47
|
+
static controlSlot: string;
|
|
48
|
+
constructor();
|
|
49
|
+
/** Pressing the trigger closes the tooltip (Base UI), it never toggles it open. */
|
|
50
|
+
protected onClick(): void;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The tooltip popup (`role=tooltip`), `side="top"` by default.
|
|
54
|
+
*
|
|
55
|
+
* @tag pont2-prim-tooltip-content
|
|
56
|
+
*/
|
|
57
|
+
export declare class TooltipContent extends PopupContent {
|
|
58
|
+
static identity: string;
|
|
59
|
+
static slotName: string;
|
|
60
|
+
static role: string;
|
|
61
|
+
constructor();
|
|
62
|
+
}
|
|
63
|
+
declare global {
|
|
64
|
+
interface HTMLElementTagNameMap {
|
|
65
|
+
"pont2-prim-tooltip": Tooltip;
|
|
66
|
+
"pont2-prim-tooltip-trigger": TooltipTrigger;
|
|
67
|
+
"pont2-prim-tooltip-content": TooltipContent;
|
|
68
|
+
}
|
|
69
|
+
}
|