@pontive/pontkit-core 1.26.0 → 1.28.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.
Files changed (93) hide show
  1. package/catalog.json +1 -1
  2. package/custom-elements.json +1 -1
  3. package/dist/pont2/core/attrs.d.ts +22 -0
  4. package/dist/pont2/core/controllers/action.d.ts +79 -0
  5. package/dist/pont2/core/controllers/copy.d.ts +34 -0
  6. package/dist/pont2/core/controllers/roving-focus.d.ts +38 -0
  7. package/dist/pont2/core/events.d.ts +28 -0
  8. package/dist/pont2/core/form-control.d.ts +70 -0
  9. package/dist/pont2/core/host-element.d.ts +129 -0
  10. package/dist/pont2/core/icons.d.ts +28 -0
  11. package/dist/pont2/core/ids.d.ts +6 -0
  12. package/dist/pont2/core/index.d.ts +10 -0
  13. package/dist/pont2/core/names.d.ts +78 -0
  14. package/dist/pont2/core/popup/anchored.d.ts +48 -0
  15. package/dist/pont2/core/popup/index.d.ts +5 -0
  16. package/dist/pont2/core/popup/list.d.ts +38 -0
  17. package/dist/pont2/core/popup/popup-content.d.ts +68 -0
  18. package/dist/pont2/core/popup/popup-root.d.ts +94 -0
  19. package/dist/pont2/core/popup/position.d.ts +73 -0
  20. package/dist/pont2/globals.css +109 -0
  21. package/dist/pont2/index.d.ts +44 -0
  22. package/dist/pont2/index.mjs +5660 -0
  23. package/dist/pont2/index.mjs.map +1 -0
  24. package/dist/pont2/kit/alert/alert.d.ts +62 -0
  25. package/dist/pont2/kit/aliases.d.ts +33 -0
  26. package/dist/pont2/kit/auth-button/auth-button.d.ts +185 -0
  27. package/dist/pont2/kit/auth-button/providers.d.ts +15 -0
  28. package/dist/pont2/kit/auth-field/auth-field.d.ts +267 -0
  29. package/dist/pont2/kit/auth-field/password-field.d.ts +124 -0
  30. package/dist/pont2/kit/avatar/avatar.d.ts +52 -0
  31. package/dist/pont2/kit/block/block.d.ts +64 -0
  32. package/dist/pont2/kit/block/branding.d.ts +36 -0
  33. package/dist/pont2/kit/container/container.d.ts +40 -0
  34. package/dist/pont2/kit/countdown/countdown.d.ts +64 -0
  35. package/dist/pont2/kit/divider/divider.d.ts +30 -0
  36. package/dist/pont2/kit/edit-identifier/edit-identifier.d.ts +47 -0
  37. package/dist/pont2/kit/flow-widget/flow-widget.d.ts +151 -0
  38. package/dist/pont2/kit/gap/gap.d.ts +36 -0
  39. package/dist/pont2/kit/header/header.d.ts +37 -0
  40. package/dist/pont2/kit/index.d.ts +26 -0
  41. package/dist/pont2/kit/input-otp/input-otp.d.ts +59 -0
  42. package/dist/pont2/kit/layout/flow-error.d.ts +21 -0
  43. package/dist/pont2/kit/layout/layout.d.ts +120 -0
  44. package/dist/pont2/kit/link/link.d.ts +62 -0
  45. package/dist/pont2/kit/logo/logo.d.ts +57 -0
  46. package/dist/pont2/kit/otp-field/otp-field.d.ts +93 -0
  47. package/dist/pont2/kit/otp-field/otp-resend.d.ts +61 -0
  48. package/dist/pont2/kit/provider-field/provider-field.d.ts +87 -0
  49. package/dist/pont2/kit/qr-code/qr-code.d.ts +86 -0
  50. package/dist/pont2/kit/recovery-codes/recovery-codes.d.ts +64 -0
  51. package/dist/pont2/kit/scope-list/scope-list.d.ts +69 -0
  52. package/dist/pont2/kit/scope-list/scope-value.d.ts +16 -0
  53. package/dist/pont2/kit/secret/secret.d.ts +67 -0
  54. package/dist/pont2/kit/story-helpers.d.ts +9 -0
  55. package/dist/pont2/kit/typography/typography.d.ts +70 -0
  56. package/dist/pont2/kit/watermark/pontive-logo.d.ts +8 -0
  57. package/dist/pont2/kit/watermark/watermark.d.ts +42 -0
  58. package/dist/pont2/primitives/alert/alert.d.ts +49 -0
  59. package/dist/pont2/primitives/avatar/avatar.d.ts +89 -0
  60. package/dist/pont2/primitives/badge/badge.d.ts +30 -0
  61. package/dist/pont2/primitives/button/button.d.ts +113 -0
  62. package/dist/pont2/primitives/button-group/button-group.d.ts +55 -0
  63. package/dist/pont2/primitives/card/card.d.ts +63 -0
  64. package/dist/pont2/primitives/checkbox/checkbox.d.ts +54 -0
  65. package/dist/pont2/primitives/combobox/combobox.d.ts +213 -0
  66. package/dist/pont2/primitives/dropdown-menu/dropdown-menu.d.ts +267 -0
  67. package/dist/pont2/primitives/empty/empty.d.ts +60 -0
  68. package/dist/pont2/primitives/field/field.d.ts +146 -0
  69. package/dist/pont2/primitives/input/input.d.ts +47 -0
  70. package/dist/pont2/primitives/input-group/input-group.d.ts +97 -0
  71. package/dist/pont2/primitives/input-otp/input-otp.d.ts +121 -0
  72. package/dist/pont2/primitives/input-otp/otp.d.ts +22 -0
  73. package/dist/pont2/primitives/item/item.d.ts +100 -0
  74. package/dist/pont2/primitives/kbd/kbd.d.ts +29 -0
  75. package/dist/pont2/primitives/label/label.d.ts +37 -0
  76. package/dist/pont2/primitives/native-select/native-select.d.ts +59 -0
  77. package/dist/pont2/primitives/popover/popover.d.ts +85 -0
  78. package/dist/pont2/primitives/progress/progress.d.ts +80 -0
  79. package/dist/pont2/primitives/radio-group/radio-group.d.ts +93 -0
  80. package/dist/pont2/primitives/select/select.d.ts +184 -0
  81. package/dist/pont2/primitives/separator/separator.d.ts +34 -0
  82. package/dist/pont2/primitives/skeleton/skeleton.d.ts +18 -0
  83. package/dist/pont2/primitives/slider/slider-math.d.ts +42 -0
  84. package/dist/pont2/primitives/slider/slider.d.ts +85 -0
  85. package/dist/pont2/primitives/spinner/spinner.d.ts +29 -0
  86. package/dist/pont2/primitives/switch/switch.d.ts +55 -0
  87. package/dist/pont2/primitives/table/table.d.ts +55 -0
  88. package/dist/pont2/primitives/tabs/tabs.d.ts +126 -0
  89. package/dist/pont2/primitives/textarea/textarea.d.ts +41 -0
  90. package/dist/pont2/primitives/tooltip/tooltip.d.ts +69 -0
  91. package/dist/pont2/styles.css +4839 -0
  92. package/dist/pont2/with-legacy.css +10 -0
  93. package/package.json +16 -4
@@ -0,0 +1,267 @@
1
+ import { PropertyDeclarations, PropertyValues } from 'lit';
2
+ import { HostElement } from '../../core/host-element';
3
+ import { PopupContent } from '../../core/popup/popup-content';
4
+ import { PopupRoot, PopupTrigger } from '../../core/popup/popup-root';
5
+ import { Separator } from '../separator/separator';
6
+ type FocusTarget = "first" | "last" | "popup";
7
+ /**
8
+ * # DropdownMenu
9
+ *
10
+ * shadcn: `<DropdownMenu>` = Base UI `Menu.Root` (renders nothing).
11
+ *
12
+ * ```html
13
+ * <pont2-prim-dropdown-menu>
14
+ * <pont2-prim-dropdown-menu-trigger><button data-pont2-button data-variant="outline">Open</button></pont2-prim-dropdown-menu-trigger>
15
+ * <pont2-prim-dropdown-menu-content>
16
+ * <pont2-prim-dropdown-menu-group>
17
+ * <pont2-prim-dropdown-menu-label>My Account</pont2-prim-dropdown-menu-label>
18
+ * <pont2-prim-dropdown-menu-item>Profile <pont2-prim-dropdown-menu-shortcut>⇧⌘P</pont2-prim-dropdown-menu-shortcut></pont2-prim-dropdown-menu-item>
19
+ * </pont2-prim-dropdown-menu-group>
20
+ * </pont2-prim-dropdown-menu-content>
21
+ * </pont2-prim-dropdown-menu>
22
+ * ```
23
+ *
24
+ * @tag pont2-prim-dropdown-menu
25
+ * @fires pont2-open-change - cancelable `{ open, reason }`
26
+ */
27
+ export declare class DropdownMenu extends PopupRoot {
28
+ static identity: string;
29
+ /** Where focus goes when the menu opens (set by the trigger's key handling). */
30
+ focusOnOpen: FocusTarget;
31
+ get triggerElement(): HTMLElement | null;
32
+ get contentElement(): DropdownMenuContent | null;
33
+ protected get popupKind(): "menu";
34
+ openWith(focus: FocusTarget, reason?: "trigger-press" | "list-navigation"): void;
35
+ toggle(reason?: "trigger-press", opts?: {
36
+ keyboard?: boolean;
37
+ }): void;
38
+ protected afterOpen(): void;
39
+ }
40
+ /**
41
+ * # DropdownMenuSub
42
+ *
43
+ * Base UI `Menu.SubmenuRoot` (renders nothing). Its trigger is a
44
+ * `pont2-prim-dropdown-menu-sub-trigger` (a menuitem), its popup a
45
+ * `pont2-prim-dropdown-menu-sub-content`.
46
+ *
47
+ * @tag pont2-prim-dropdown-menu-sub
48
+ */
49
+ export declare class DropdownMenuSub extends PopupRoot {
50
+ static identity: string;
51
+ focusOnOpen: FocusTarget;
52
+ get triggerElement(): DropdownMenuSubTrigger | null;
53
+ get contentElement(): DropdownMenuSubContent | null;
54
+ protected get popupKind(): "menu";
55
+ openWith(focus: FocusTarget, reason: "trigger-press" | "trigger-hover" | "list-navigation"): void;
56
+ protected afterOpen(): void;
57
+ }
58
+ /**
59
+ * Tier 3 enhancer around a native `<button>`; combine freely with the
60
+ * button recipe (`<button data-pont2-button data-variant="outline">`).
61
+ * ArrowDown/ArrowUp open the menu and highlight the first/last item.
62
+ *
63
+ * @tag pont2-prim-dropdown-menu-trigger
64
+ */
65
+ export declare class DropdownMenuTrigger extends PopupTrigger {
66
+ static rootTag: string;
67
+ static controlSlot: string;
68
+ protected onKeyDown(e: KeyboardEvent): void;
69
+ }
70
+ /**
71
+ * The menu popup: Base UI `Menu.Popup` (`role="menu"`). Items get real
72
+ * focus (roving), so the highlighted item is `document.activeElement`.
73
+ *
74
+ * @tag pont2-prim-dropdown-menu-content
75
+ * @attr side - bottom (default) … @attr align - start (default) …
76
+ * @attr side-offset - 4 @attr align-offset - 0
77
+ */
78
+ export declare class DropdownMenuContent extends PopupContent {
79
+ static identity: string;
80
+ static slotName: string;
81
+ static role: string;
82
+ private typeahead;
83
+ private subCloseTimer;
84
+ constructor();
85
+ /** This menu's own items (not its submenus'), visible, in order. */
86
+ get items(): MenuItemBase[];
87
+ connectedCallback(): void;
88
+ show(): void;
89
+ hide(): Promise<void>;
90
+ focusTarget(target: FocusTarget): void;
91
+ /** Close open submenus of this menu, optionally keeping one. */
92
+ closeSubs(except?: Element | null): void;
93
+ /** Called when the pointer rests on one of this menu's items. */
94
+ scheduleSubClose(keep: Element | null): void;
95
+ cancelSubClose(): void;
96
+ private onPointerLeave;
97
+ private onKeyDown;
98
+ }
99
+ /** @tag pont2-prim-dropdown-menu-sub-content */
100
+ export declare class DropdownMenuSubContent extends DropdownMenuContent {
101
+ static identity: string;
102
+ static slotName: string;
103
+ constructor();
104
+ }
105
+ /**
106
+ * Shared behaviour of every menu item (Base UI `Menu.Item` and friends):
107
+ * host-as-root `role=menuitem*`, `tabindex=-1`, focus ⇄ `data-highlighted`,
108
+ * pointer hover highlights, click activates and (optionally) closes the menu.
109
+ */
110
+ export declare abstract class MenuItemBase extends HostElement {
111
+ static identity: string;
112
+ static role: string;
113
+ static properties: PropertyDeclarations;
114
+ disabled: boolean;
115
+ inset: boolean;
116
+ closeOnClick: boolean;
117
+ constructor();
118
+ /** Text used by typeahead (Base UI `label`): the `label` attribute, else the text content. */
119
+ get label(): string;
120
+ connectedCallback(): void;
121
+ protected get menu(): DropdownMenuContent | null;
122
+ private onPointerMove;
123
+ private onClick;
124
+ /** What pressing the item does beyond firing `click`. */
125
+ protected activate(): void;
126
+ protected willUpdate(changed: PropertyValues): void;
127
+ }
128
+ /**
129
+ * Base UI `Menu.Item`. Listen for `click` to act on it.
130
+ *
131
+ * @tag pont2-prim-dropdown-menu-item
132
+ * @attr variant - default | destructive
133
+ * @attr inset, disabled, close-on-click="false"
134
+ */
135
+ export declare class DropdownMenuItem extends MenuItemBase {
136
+ static identity: string;
137
+ static slotName: string;
138
+ static properties: PropertyDeclarations;
139
+ variant: "default" | "destructive";
140
+ constructor();
141
+ protected willUpdate(changed: PropertyValues): void;
142
+ }
143
+ /**
144
+ * Base UI `Menu.CheckboxItem` (`role=menuitemcheckbox`). Stays open on
145
+ * click by default, like Base UI. Fires `change` when toggled.
146
+ *
147
+ * @tag pont2-prim-dropdown-menu-checkbox-item
148
+ * @attr checked
149
+ * @fires change
150
+ */
151
+ export declare class DropdownMenuCheckboxItem extends MenuItemBase {
152
+ static identity: string;
153
+ static slotName: string;
154
+ static role: string;
155
+ static properties: PropertyDeclarations;
156
+ checked: boolean;
157
+ constructor();
158
+ protected activate(): void;
159
+ protected willUpdate(changed: PropertyValues): void;
160
+ render(): import('lit-html').TemplateResult<1>;
161
+ }
162
+ /**
163
+ * Base UI `Menu.RadioGroup` (`role=group`). Holds `value`; fires `change`
164
+ * when a radio item is picked.
165
+ *
166
+ * @tag pont2-prim-dropdown-menu-radio-group
167
+ * @attr value
168
+ * @fires change
169
+ */
170
+ export declare class DropdownMenuRadioGroup extends HostElement {
171
+ static identity: string;
172
+ static slotName: string;
173
+ static role: string;
174
+ static properties: PropertyDeclarations;
175
+ value: string;
176
+ constructor();
177
+ select(value: string): void;
178
+ protected updated(): void;
179
+ }
180
+ /**
181
+ * Base UI `Menu.RadioItem` (`role=menuitemradio`).
182
+ *
183
+ * @tag pont2-prim-dropdown-menu-radio-item
184
+ * @attr value
185
+ */
186
+ export declare class DropdownMenuRadioItem extends MenuItemBase {
187
+ static identity: string;
188
+ static slotName: string;
189
+ static role: string;
190
+ static properties: PropertyDeclarations;
191
+ value: string;
192
+ constructor();
193
+ get group(): DropdownMenuRadioGroup | null;
194
+ get checked(): boolean;
195
+ protected activate(): void;
196
+ protected willUpdate(changed: PropertyValues): void;
197
+ render(): import('lit-html').TemplateResult<1>;
198
+ }
199
+ /**
200
+ * Base UI `Menu.SubmenuTrigger`: a menuitem that opens a submenu on hover
201
+ * (100 ms), click, Enter/Space, or ArrowRight (ArrowLeft in RTL). Renders the
202
+ * chevron after your content, as shadcn does.
203
+ *
204
+ * @tag pont2-prim-dropdown-menu-sub-trigger
205
+ */
206
+ export declare class DropdownMenuSubTrigger extends MenuItemBase {
207
+ static identity: string;
208
+ static slotName: string;
209
+ private hoverTimer;
210
+ constructor();
211
+ get sub(): DropdownMenuSub | null;
212
+ get isSubOpen(): boolean;
213
+ protected activate(): void;
214
+ private onEnter;
215
+ private onKey;
216
+ render(): import('lit-html').TemplateResult<1>;
217
+ }
218
+ /** Base UI `Menu.Group` (`role=group`, labelled by its label). @tag pont2-prim-dropdown-menu-group */
219
+ export declare class DropdownMenuGroup extends HostElement {
220
+ static identity: string;
221
+ static slotName: string;
222
+ static role: string;
223
+ connectedCallback(): void;
224
+ }
225
+ /** Base UI `Menu.GroupLabel`. @tag pont2-prim-dropdown-menu-label @attr inset */
226
+ export declare class DropdownMenuLabel extends HostElement {
227
+ static identity: string;
228
+ static slotName: string;
229
+ static properties: PropertyDeclarations;
230
+ inset: boolean;
231
+ constructor();
232
+ protected willUpdate(): void;
233
+ }
234
+ /**
235
+ * Base UI `Menu.Separator`. **Is a** Separator (`extends Separator`), so it
236
+ * carries `data-pont2-separator` (the look) and its own slot.
237
+ *
238
+ * @tag pont2-prim-dropdown-menu-separator
239
+ */
240
+ export declare class DropdownMenuSeparator extends Separator {
241
+ static identity: string;
242
+ static slotName: string;
243
+ }
244
+ /** shadcn `DropdownMenuShortcut` (a `<span>`). @tag pont2-prim-dropdown-menu-shortcut */
245
+ export declare class DropdownMenuShortcut extends HostElement {
246
+ static identity: string;
247
+ static slotName: string;
248
+ }
249
+ declare global {
250
+ interface HTMLElementTagNameMap {
251
+ "pont2-prim-dropdown-menu": DropdownMenu;
252
+ "pont2-prim-dropdown-menu-sub": DropdownMenuSub;
253
+ "pont2-prim-dropdown-menu-trigger": DropdownMenuTrigger;
254
+ "pont2-prim-dropdown-menu-content": DropdownMenuContent;
255
+ "pont2-prim-dropdown-menu-sub-content": DropdownMenuSubContent;
256
+ "pont2-prim-dropdown-menu-item": DropdownMenuItem;
257
+ "pont2-prim-dropdown-menu-checkbox-item": DropdownMenuCheckboxItem;
258
+ "pont2-prim-dropdown-menu-radio-group": DropdownMenuRadioGroup;
259
+ "pont2-prim-dropdown-menu-radio-item": DropdownMenuRadioItem;
260
+ "pont2-prim-dropdown-menu-sub-trigger": DropdownMenuSubTrigger;
261
+ "pont2-prim-dropdown-menu-group": DropdownMenuGroup;
262
+ "pont2-prim-dropdown-menu-label": DropdownMenuLabel;
263
+ "pont2-prim-dropdown-menu-separator": DropdownMenuSeparator;
264
+ "pont2-prim-dropdown-menu-shortcut": DropdownMenuShortcut;
265
+ }
266
+ }
267
+ export {};
@@ -0,0 +1,60 @@
1
+ import { PropertyDeclarations } from 'lit';
2
+ import { HostElement } from '../../core/host-element';
3
+ export type EmptyMediaVariant = "default" | "icon";
4
+ /**
5
+ * # Empty: Tier 1 (structural)
6
+ *
7
+ * shadcn: `<Empty>` → `<div data-slot="empty">` with `EmptyHeader`,
8
+ * `EmptyMedia` (`data-slot="empty-icon"`, `data-variant`), `EmptyTitle`,
9
+ * `EmptyDescription`, `EmptyContent`, all divs. All host-as-root here.
10
+ *
11
+ * @tag pont2-prim-empty
12
+ */
13
+ export declare class Empty extends HostElement {
14
+ static identity: string;
15
+ static slotName: string;
16
+ }
17
+ /** @tag pont2-prim-empty-header */
18
+ export declare class EmptyHeader extends HostElement {
19
+ static identity: string;
20
+ static slotName: string;
21
+ }
22
+ /**
23
+ * Note shadcn's slot name for the media part is `empty-icon` (kept verbatim).
24
+ *
25
+ * @tag pont2-prim-empty-media
26
+ * @attr variant - default | icon
27
+ */
28
+ export declare class EmptyMedia extends HostElement {
29
+ static identity: string;
30
+ static slotName: string;
31
+ static properties: PropertyDeclarations;
32
+ variant: EmptyMediaVariant;
33
+ constructor();
34
+ protected willUpdate(): void;
35
+ }
36
+ /** @tag pont2-prim-empty-title */
37
+ export declare class EmptyTitle extends HostElement {
38
+ static identity: string;
39
+ static slotName: string;
40
+ }
41
+ /** @tag pont2-prim-empty-description */
42
+ export declare class EmptyDescription extends HostElement {
43
+ static identity: string;
44
+ static slotName: string;
45
+ }
46
+ /** @tag pont2-prim-empty-content */
47
+ export declare class EmptyContent extends HostElement {
48
+ static identity: string;
49
+ static slotName: string;
50
+ }
51
+ declare global {
52
+ interface HTMLElementTagNameMap {
53
+ "pont2-prim-empty": Empty;
54
+ "pont2-prim-empty-header": EmptyHeader;
55
+ "pont2-prim-empty-media": EmptyMedia;
56
+ "pont2-prim-empty-title": EmptyTitle;
57
+ "pont2-prim-empty-description": EmptyDescription;
58
+ "pont2-prim-empty-content": EmptyContent;
59
+ }
60
+ }
@@ -0,0 +1,146 @@
1
+ import { nothing, PropertyDeclarations, PropertyValues } from 'lit';
2
+ import { AttrMap } from '../../core/attrs';
3
+ import { HostElement, NativeEnhancer } from '../../core/host-element';
4
+ /**
5
+ * # Field family
6
+ *
7
+ * shadcn's `field.tsx` is plain markup (no Base UI primitive):
8
+ *
9
+ * | shadcn | renders | pont2 | tier |
10
+ * |-------------------|--------------------------------------------|-------------------------------|------|
11
+ * | FieldSet | `<fieldset data-slot="field-set">` | recipe/part on `<fieldset>`, `<pont2-prim-field-set>` enhancer | 3 |
12
+ * | FieldLegend | `<legend data-slot="field-legend" data-variant>` | recipe/part on `<legend>` only | 3 |
13
+ * | FieldGroup | `<div data-slot="field-group">` | `<pont2-prim-field-group>` | 1 |
14
+ * | Field | `<div role="group" data-slot="field" data-orientation>` | `<pont2-prim-field>` | 1 |
15
+ * | FieldContent | `<div data-slot="field-content">` | `<pont2-prim-field-content>` | 1 |
16
+ * | FieldLabel | `<label data-slot="field-label">` (Label) | recipe/part on `<label>`, `<pont2-prim-field-label>` enhancer | 3 |
17
+ * | FieldTitle | `<div data-slot="field-label">` | `<pont2-prim-field-title>` | 1 |
18
+ * | FieldDescription | `<p data-slot="field-description">` | `<pont2-prim-field-description>` | 1 |
19
+ * | FieldSeparator | `<div data-slot="field-separator">` > Separator + `<span>` | `<pont2-prim-field-separator>` (lines drawn in CSS) | 1 |
20
+ * | FieldError | `<div role="alert" data-slot="field-error">` | `<pont2-prim-field-error>` | 1 |
21
+ *
22
+ * Like shadcn, the family does no id wiring: you write `for`/`id` and
23
+ * `aria-describedby` yourself (Base UI's own `Field` primitive does wire ids;
24
+ * shadcn's Field does not use it). See docs/primitives/field.md.
25
+ */
26
+ export declare function applyFieldSet(el: HTMLFieldSetElement): void;
27
+ export declare function fieldSet(o: {
28
+ disabled?: boolean;
29
+ attrs?: AttrMap;
30
+ }, content: unknown): import('lit-html').TemplateResult<1>;
31
+ export declare function fieldLegend(o: {
32
+ variant?: "legend" | "label";
33
+ attrs?: AttrMap;
34
+ }, content: unknown): import('lit-html').TemplateResult<1>;
35
+ /**
36
+ * Applies the FieldSet recipe to the `<fieldset>` inside it. The legend must
37
+ * be a direct child of that `<fieldset>` to name it, so write
38
+ * `<legend data-pont2-field-legend>` (there is no legend element).
39
+ *
40
+ * @tag pont2-prim-field-set
41
+ */
42
+ export declare class FieldSetElement extends NativeEnhancer<HTMLFieldSetElement> {
43
+ static nativeSelector: string;
44
+ protected apply(control: HTMLFieldSetElement): void;
45
+ }
46
+ /** @tag pont2-prim-field-group */
47
+ export declare class FieldGroup extends HostElement {
48
+ static identity: string;
49
+ static slotName: string;
50
+ }
51
+ export type FieldOrientation = "vertical" | "horizontal" | "responsive";
52
+ /**
53
+ * @tag pont2-prim-field
54
+ * @attr orientation - vertical (default) | horizontal | responsive
55
+ * @attr invalid - Sets `data-invalid` (destructive text colour), like shadcn's `data-invalid`.
56
+ * @attr disabled - Sets `data-disabled` (dims the label/title), like shadcn's `data-disabled`.
57
+ */
58
+ export declare class Field extends HostElement {
59
+ static identity: string;
60
+ static slotName: string;
61
+ static role: string;
62
+ static properties: PropertyDeclarations;
63
+ orientation: FieldOrientation;
64
+ invalid: boolean;
65
+ disabled: boolean;
66
+ constructor();
67
+ protected willUpdate(changed: PropertyValues): void;
68
+ }
69
+ /** @tag pont2-prim-field-content */
70
+ export declare class FieldContent extends HostElement {
71
+ static identity: string;
72
+ static slotName: string;
73
+ }
74
+ export declare function applyFieldLabel(el: HTMLLabelElement): void;
75
+ /** `<label data-pont2-label data-pont2-field-label data-slot="field-label">` */
76
+ export declare function fieldLabel(o: {
77
+ for?: string;
78
+ id?: string;
79
+ attrs?: AttrMap;
80
+ }, content: unknown): import('lit-html').TemplateResult<1>;
81
+ /** @tag pont2-prim-field-label */
82
+ export declare class FieldLabelElement extends NativeEnhancer<HTMLLabelElement> {
83
+ static nativeSelector: string;
84
+ protected apply(control: HTMLLabelElement): void;
85
+ }
86
+ /**
87
+ * A label-styled title for a field that has no single control to label
88
+ * (shadcn gives it `data-slot="field-label"` too, kept verbatim).
89
+ *
90
+ * @tag pont2-prim-field-title
91
+ */
92
+ export declare class FieldTitle extends HostElement {
93
+ static identity: string;
94
+ static slotName: string;
95
+ }
96
+ /** @tag pont2-prim-field-description */
97
+ export declare class FieldDescription extends HostElement {
98
+ static identity: string;
99
+ static slotName: string;
100
+ }
101
+ /**
102
+ * shadcn renders `div > Separator + span`. pont2 draws the two rule halves
103
+ * with `::before`/`::after`, so the only nodes are the host and your text.
104
+ * `data-content` is set when the separator has text, as in shadcn.
105
+ *
106
+ * @tag pont2-prim-field-separator
107
+ */
108
+ export declare class FieldSeparator extends HostElement {
109
+ static identity: string;
110
+ static slotName: string;
111
+ private observer?;
112
+ connectedCallback(): void;
113
+ disconnectedCallback(): void;
114
+ private sync;
115
+ }
116
+ export interface FieldErrorItem {
117
+ message?: string;
118
+ }
119
+ /**
120
+ * Write the message as children, or set `.errors` (shadcn's `errors` prop:
121
+ * de-duplicated by message; one renders as text, several as a list). Hidden
122
+ * while empty, like shadcn returning `null`.
123
+ *
124
+ * @tag pont2-prim-field-error
125
+ */
126
+ export declare class FieldError extends HostElement {
127
+ static identity: string;
128
+ static slotName: string;
129
+ static role: string;
130
+ static properties: PropertyDeclarations;
131
+ errors: Array<FieldErrorItem | undefined> | undefined;
132
+ render(): string | import('lit-html').TemplateResult<1> | typeof nothing | undefined;
133
+ }
134
+ declare global {
135
+ interface HTMLElementTagNameMap {
136
+ "pont2-prim-field-set": FieldSetElement;
137
+ "pont2-prim-field-group": FieldGroup;
138
+ "pont2-prim-field": Field;
139
+ "pont2-prim-field-content": FieldContent;
140
+ "pont2-prim-field-label": FieldLabelElement;
141
+ "pont2-prim-field-title": FieldTitle;
142
+ "pont2-prim-field-description": FieldDescription;
143
+ "pont2-prim-field-separator": FieldSeparator;
144
+ "pont2-prim-field-error": FieldError;
145
+ }
146
+ }
@@ -0,0 +1,47 @@
1
+ import { AttrMap } from '../../core/attrs';
2
+ import { NativeEnhancer } from '../../core/host-element';
3
+ /**
4
+ * # Input: Tier 3 (native-bound)
5
+ *
6
+ * shadcn: `<Input>` → Base UI `<Input>` → a native `<input data-slot="input">`.
7
+ *
8
+ * A sign-in kit's inputs must be native and in light DOM: autofill, password
9
+ * managers, `autocomplete="one-time-code"`, form submission, `<label for>`
10
+ * and `aria-describedby` all depend on it.
11
+ *
12
+ * - recipe: `<input data-pont2-input type="email" name="email">`
13
+ * - part: `input({ type: "email", name: "email" })`
14
+ * - enhancer: `<pont2-prim-input><input type="email" name="email"></pont2-prim-input>`
15
+ */
16
+ export interface InputOptions {
17
+ id?: string;
18
+ name?: string;
19
+ type?: string;
20
+ value?: string;
21
+ placeholder?: string;
22
+ autocomplete?: string;
23
+ inputmode?: string;
24
+ required?: boolean;
25
+ disabled?: boolean;
26
+ readonly?: boolean;
27
+ invalid?: boolean;
28
+ describedBy?: string;
29
+ slot?: string;
30
+ attrs?: AttrMap;
31
+ onInput?: (e: InputEvent) => void;
32
+ onChange?: (e: Event) => void;
33
+ }
34
+ export declare function applyInput(el: HTMLInputElement, slot?: string): void;
35
+ export declare function input(o?: InputOptions): import('lit-html').TemplateResult<1>;
36
+ /**
37
+ * @tag pont2-prim-input
38
+ */
39
+ export declare class Pont2Input extends NativeEnhancer<HTMLInputElement> {
40
+ static nativeSelector: string;
41
+ protected apply(control: HTMLInputElement): void;
42
+ }
43
+ declare global {
44
+ interface HTMLElementTagNameMap {
45
+ "pont2-prim-input": Pont2Input;
46
+ }
47
+ }
@@ -0,0 +1,97 @@
1
+ import { PropertyDeclarations, PropertyValues } from 'lit';
2
+ import { HostElement, NativeEnhancer } from '../../core/host-element';
3
+ import { Pont2Button, ButtonOptions } from '../button/button';
4
+ import { InputOptions } from '../input/input';
5
+ import { TextareaOptions } from '../textarea/textarea';
6
+ export type InputGroupAddonAlign = "inline-start" | "inline-end" | "block-start" | "block-end";
7
+ export type InputGroupButtonSize = "xs" | "sm" | "icon-xs" | "icon-sm";
8
+ /**
9
+ * # InputGroup family
10
+ *
11
+ * shadcn: `InputGroup` (`div role="group" data-slot="input-group"`),
12
+ * `InputGroupAddon` (`div role="group" data-align`, click focuses the input),
13
+ * `InputGroupText` (a `span`), and the controls `InputGroupInput` /
14
+ * `InputGroupTextarea` / `InputGroupButton`, which are shadcn's `Input`,
15
+ * `Textarea` and `Button` with extra classes and
16
+ * `data-slot="input-group-control"` (button: ghost, size xs).
17
+ *
18
+ * pont2:
19
+ * - `<pont2-prim-input-group>`, `<pont2-prim-input-group-addon>`, `<pont2-prim-input-group-text>`
20
+ * are host-as-root (Tier 1).
21
+ * - The controls stay native (Tier 3): the Input/Textarea/Button recipe plus
22
+ * an extra identity. Write them as recipes
23
+ * (`<input data-pont2-input data-pont2-input-group-input data-slot="input-group-control">`),
24
+ * parts (`inputGroupInput()`), or enhancers (`<pont2-prim-input-group-input><input></…>`).
25
+ *
26
+ * Like shadcn, the control must be a *direct* child of the group for the
27
+ * group's `has-[>input]` padding rules; with an enhancer the shell is
28
+ * `display: contents` and the rules also match through it.
29
+ */
30
+ /**
31
+ * @tag pont2-prim-input-group
32
+ * @attr disabled - Sets `data-disabled` (dims addons), like shadcn's `data-disabled="true"`.
33
+ */
34
+ export declare class InputGroup extends HostElement {
35
+ static identity: string;
36
+ static slotName: string;
37
+ static role: string;
38
+ static properties: PropertyDeclarations;
39
+ disabled: boolean;
40
+ constructor();
41
+ protected willUpdate(changed: PropertyValues): void;
42
+ }
43
+ /**
44
+ * @tag pont2-prim-input-group-addon
45
+ * @attr align - inline-start (default) | inline-end | block-start | block-end
46
+ */
47
+ export declare class InputGroupAddon extends HostElement {
48
+ static identity: string;
49
+ static slotName: string;
50
+ static role: string;
51
+ static properties: PropertyDeclarations;
52
+ align: InputGroupAddonAlign;
53
+ constructor();
54
+ protected willUpdate(): void;
55
+ }
56
+ /** shadcn's InputGroupText has no data-slot; pont2 keeps it that way. @tag pont2-prim-input-group-text */
57
+ export declare class InputGroupText extends HostElement {
58
+ static identity: string;
59
+ }
60
+ export declare function inputGroupInput(o?: InputOptions): import('lit-html').TemplateResult<1>;
61
+ export declare function inputGroupTextarea(o?: TextareaOptions): import('lit-html').TemplateResult<1>;
62
+ export interface InputGroupButtonOptions extends Omit<ButtonOptions, "size"> {
63
+ size?: InputGroupButtonSize;
64
+ }
65
+ /** shadcn defaults: `variant="ghost"`, `size="xs"`, `type="button"`. */
66
+ export declare function inputGroupButton(o: InputGroupButtonOptions, content: unknown): import('lit-html').TemplateResult<1>;
67
+ /** @tag pont2-prim-input-group-input */
68
+ export declare class InputGroupInput extends NativeEnhancer<HTMLInputElement> {
69
+ static nativeSelector: string;
70
+ protected apply(control: HTMLInputElement): void;
71
+ }
72
+ /** @tag pont2-prim-input-group-textarea */
73
+ export declare class InputGroupTextarea extends NativeEnhancer<HTMLTextAreaElement> {
74
+ static nativeSelector: string;
75
+ protected apply(control: HTMLTextAreaElement): void;
76
+ }
77
+ /**
78
+ * `<pont2-prim-button>` with shadcn's InputGroupButton defaults (ghost, xs) and its
79
+ * extra recipe. It *is* a Pont2Button enhancer, so everything else is inherited.
80
+ *
81
+ * @tag pont2-prim-input-group-button
82
+ * @attr size - xs (default) | sm | icon-xs | icon-sm
83
+ */
84
+ export declare class InputGroupButton extends Pont2Button {
85
+ constructor();
86
+ protected apply(control: HTMLButtonElement | HTMLAnchorElement): void;
87
+ }
88
+ declare global {
89
+ interface HTMLElementTagNameMap {
90
+ "pont2-prim-input-group": InputGroup;
91
+ "pont2-prim-input-group-addon": InputGroupAddon;
92
+ "pont2-prim-input-group-text": InputGroupText;
93
+ "pont2-prim-input-group-input": InputGroupInput;
94
+ "pont2-prim-input-group-textarea": InputGroupTextarea;
95
+ "pont2-prim-input-group-button": InputGroupButton;
96
+ }
97
+ }