@pontive/pontkit-core 1.25.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.
Files changed (68) hide show
  1. package/README.md +4 -0
  2. package/catalog.json +1 -1
  3. package/custom-elements.json +1 -1
  4. package/dist/index.js +14 -3
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +19 -8
  7. package/dist/index.mjs.map +1 -1
  8. package/dist/pont2/core/attrs.d.ts +22 -0
  9. package/dist/pont2/core/controllers/roving-focus.d.ts +38 -0
  10. package/dist/pont2/core/events.d.ts +28 -0
  11. package/dist/pont2/core/form-control.d.ts +70 -0
  12. package/dist/pont2/core/host-element.d.ts +129 -0
  13. package/dist/pont2/core/icons.d.ts +20 -0
  14. package/dist/pont2/core/ids.d.ts +6 -0
  15. package/dist/pont2/core/index.d.ts +8 -0
  16. package/dist/pont2/core/names.d.ts +78 -0
  17. package/dist/pont2/core/popup/anchored.d.ts +48 -0
  18. package/dist/pont2/core/popup/index.d.ts +5 -0
  19. package/dist/pont2/core/popup/list.d.ts +38 -0
  20. package/dist/pont2/core/popup/popup-content.d.ts +68 -0
  21. package/dist/pont2/core/popup/popup-root.d.ts +94 -0
  22. package/dist/pont2/core/popup/position.d.ts +73 -0
  23. package/dist/pont2/globals.css +109 -0
  24. package/dist/pont2/index.d.ts +44 -0
  25. package/dist/pont2/index.mjs +3805 -0
  26. package/dist/pont2/index.mjs.map +1 -0
  27. package/dist/pont2/kit/alert/alert.d.ts +62 -0
  28. package/dist/pont2/kit/aliases.d.ts +33 -0
  29. package/dist/pont2/kit/avatar/avatar.d.ts +52 -0
  30. package/dist/pont2/kit/index.d.ts +3 -0
  31. package/dist/pont2/kit/input-otp/input-otp.d.ts +52 -0
  32. package/dist/pont2/primitives/alert/alert.d.ts +49 -0
  33. package/dist/pont2/primitives/avatar/avatar.d.ts +89 -0
  34. package/dist/pont2/primitives/badge/badge.d.ts +30 -0
  35. package/dist/pont2/primitives/button/button.d.ts +113 -0
  36. package/dist/pont2/primitives/button-group/button-group.d.ts +55 -0
  37. package/dist/pont2/primitives/card/card.d.ts +63 -0
  38. package/dist/pont2/primitives/checkbox/checkbox.d.ts +54 -0
  39. package/dist/pont2/primitives/combobox/combobox.d.ts +213 -0
  40. package/dist/pont2/primitives/dropdown-menu/dropdown-menu.d.ts +267 -0
  41. package/dist/pont2/primitives/empty/empty.d.ts +60 -0
  42. package/dist/pont2/primitives/field/field.d.ts +146 -0
  43. package/dist/pont2/primitives/input/input.d.ts +47 -0
  44. package/dist/pont2/primitives/input-group/input-group.d.ts +97 -0
  45. package/dist/pont2/primitives/input-otp/input-otp.d.ts +121 -0
  46. package/dist/pont2/primitives/input-otp/otp.d.ts +22 -0
  47. package/dist/pont2/primitives/item/item.d.ts +100 -0
  48. package/dist/pont2/primitives/kbd/kbd.d.ts +29 -0
  49. package/dist/pont2/primitives/label/label.d.ts +37 -0
  50. package/dist/pont2/primitives/native-select/native-select.d.ts +59 -0
  51. package/dist/pont2/primitives/popover/popover.d.ts +85 -0
  52. package/dist/pont2/primitives/progress/progress.d.ts +80 -0
  53. package/dist/pont2/primitives/radio-group/radio-group.d.ts +93 -0
  54. package/dist/pont2/primitives/select/select.d.ts +184 -0
  55. package/dist/pont2/primitives/separator/separator.d.ts +34 -0
  56. package/dist/pont2/primitives/skeleton/skeleton.d.ts +18 -0
  57. package/dist/pont2/primitives/slider/slider-math.d.ts +42 -0
  58. package/dist/pont2/primitives/slider/slider.d.ts +85 -0
  59. package/dist/pont2/primitives/spinner/spinner.d.ts +29 -0
  60. package/dist/pont2/primitives/switch/switch.d.ts +55 -0
  61. package/dist/pont2/primitives/table/table.d.ts +55 -0
  62. package/dist/pont2/primitives/tabs/tabs.d.ts +126 -0
  63. package/dist/pont2/primitives/textarea/textarea.d.ts +41 -0
  64. package/dist/pont2/primitives/tooltip/tooltip.d.ts +69 -0
  65. package/dist/pont2/styles.css +4137 -0
  66. package/dist/pont2/with-legacy.css +10 -0
  67. package/dist/styles.css +6 -0
  68. package/package.json +16 -4
@@ -0,0 +1,93 @@
1
+ import { nothing, PropertyDeclarations, PropertyValues } from 'lit';
2
+ import { Orientation } from '../../core/controllers/roving-focus';
3
+ import { FormControlElement, ValidityResult } from '../../core/form-control';
4
+ import { HostElement } from '../../core/host-element';
5
+ /**
6
+ * # RadioGroup, RadioGroupItem: Tier 2 (widgets)
7
+ *
8
+ * shadcn: `<RadioGroup>` → Base UI `<RadioGroup>` (`<div role="radiogroup">`
9
+ * plus a hidden input) and `<RadioGroupItem value>` → Base UI `<Radio.Root>`
10
+ * (`<span role="radio">`) > `<Radio.Indicator>` > `<span>` (the dot).
11
+ *
12
+ * pont2:
13
+ * ```
14
+ * pont2-prim-radio-group[role=radiogroup] ← form-associated: submits name=value
15
+ * pont2-prim-radio-group-item[role=radio] ← author-written, never moved
16
+ * span[data-slot=radio-group-indicator] ← rendered while checked
17
+ * span[data-pont2-radio-group-indicator-icon]
18
+ * ```
19
+ *
20
+ * The group owns the value, the form value, validity and the roving tab stop.
21
+ * Items are independent stateful widgets nested inside it, which is the one
22
+ * kind of nesting the architecture keeps (04-composition.md); they find their
23
+ * group with `closest()` and report presses to it. Items are also
24
+ * form-associated (submitting nothing) purely so that they are *labelable*:
25
+ * shadcn's `<RadioGroupItem id="r1"/><Label htmlFor="r1">` works unchanged.
26
+ *
27
+ * Keyboard (Base UI / APG): Tab enters at the checked item (or the first),
28
+ * arrows move focus **and select** (wrapping), Space selects the focused item.
29
+ */
30
+ export declare class RadioGroup extends FormControlElement {
31
+ static identity: string;
32
+ static slotName: string;
33
+ static role: string;
34
+ static properties: PropertyDeclarations;
35
+ /** The selected item's value; `""` when nothing is selected. */
36
+ value: string;
37
+ /** Arrow-key axis. Base UI accepts both axes by default. */
38
+ orientation: Orientation | undefined;
39
+ private roving;
40
+ private observer?;
41
+ constructor();
42
+ /** The items that belong to this group (not to a nested group). */
43
+ get items(): RadioGroupItem[];
44
+ protected get hostFocusable(): boolean;
45
+ protected get validationAnchor(): HTMLElement | undefined;
46
+ connectedCallback(): void;
47
+ disconnectedCallback(): void;
48
+ /** Called by an item when it is pressed. */
49
+ selectItem(item: RadioGroupItem): void;
50
+ /** Called by items when they connect, so a late-upgrading item is synced. */
51
+ itemsChanged(): void;
52
+ protected formValue(): string | null;
53
+ protected resetToDefault(): void;
54
+ protected restoreState(state: string | File | FormData | null): void;
55
+ protected validate(): ValidityResult | null;
56
+ protected willUpdate(changed: PropertyValues): void;
57
+ protected updated(changed: PropertyValues): void;
58
+ }
59
+ /**
60
+ * @tag pont2-prim-radio-group-item
61
+ * @attr value - The value the group takes when this item is selected.
62
+ * @attr disabled
63
+ */
64
+ export declare class RadioGroupItem extends HostElement {
65
+ static formAssociated: boolean;
66
+ static identity: string;
67
+ static slotName: string;
68
+ static role: string;
69
+ static properties: PropertyDeclarations;
70
+ value: string;
71
+ disabled: boolean;
72
+ checked: boolean;
73
+ groupDisabled: boolean;
74
+ groupReadOnly: boolean;
75
+ groupRequired: boolean;
76
+ protected formDisabled: boolean;
77
+ constructor();
78
+ get group(): RadioGroup | null;
79
+ get isDisabled(): boolean;
80
+ get labels(): NodeList;
81
+ formDisabledCallback(disabled: boolean): void;
82
+ connectedCallback(): void;
83
+ private onClick;
84
+ private onKeyDown;
85
+ protected willUpdate(): void;
86
+ render(): import('lit-html').TemplateResult<1> | typeof nothing;
87
+ }
88
+ declare global {
89
+ interface HTMLElementTagNameMap {
90
+ "pont2-prim-radio-group": RadioGroup;
91
+ "pont2-prim-radio-group-item": RadioGroupItem;
92
+ }
93
+ }
@@ -0,0 +1,184 @@
1
+ import { nothing, PropertyDeclarations, PropertyValues } from 'lit';
2
+ import { HostElement, ShellElement } from '../../core/host-element';
3
+ import { PopupContent } from '../../core/popup/popup-content';
4
+ import { PopupRoot } from '../../core/popup/popup-root';
5
+ import { Separator } from '../separator/separator';
6
+ /**
7
+ * # Select
8
+ *
9
+ * shadcn: `<Select>` = Base UI `Select.Root` (renders a hidden `<input>` for
10
+ * forms, nothing else) > `<SelectTrigger>` (`<button role=combobox>` with
11
+ * `<SelectValue>` + chevron) + `<SelectContent>` (Portal > Positioner > Popup >
12
+ * List > items).
13
+ *
14
+ * pont2:
15
+ * ```html
16
+ * <pont2-prim-select name="fruit" value="apple"> coordinator + form-associated, display: contents
17
+ * <pont2-prim-select-trigger placeholder="Select a fruit"></pont2-prim-select-trigger> shell > native <button>
18
+ * <pont2-prim-select-content> the popup: [popover], role=listbox
19
+ * <pont2-prim-select-group>
20
+ * <pont2-prim-select-label>Fruits</pont2-prim-select-label>
21
+ * <pont2-prim-select-item value="apple">Apple</pont2-prim-select-item>
22
+ * </pont2-prim-select-group>
23
+ * </pont2-prim-select-content>
24
+ * </pont2-prim-select>
25
+ * ```
26
+ *
27
+ * The **root is the form control** (a form-associated custom element):
28
+ * `name`/`value` submit with the form, `required` blocks submission,
29
+ * `<fieldset disabled>` and form reset work, and `<label for="…">` targets it
30
+ * (the label's text becomes the trigger's accessible name). That replaces
31
+ * Base UI's hidden `<input>`, one node fewer.
32
+ *
33
+ * @tag pont2-prim-select
34
+ * @attr value - selected value (initially: Base UI `defaultValue`)
35
+ * @attr name, required, disabled, open
36
+ * @fires input, change - the user picked a value (read `.value`)
37
+ * @fires pont2-open-change - cancelable `{ open, reason }`
38
+ */
39
+ export declare class Select extends PopupRoot {
40
+ static formAssociated: boolean;
41
+ static identity: string;
42
+ static properties: PropertyDeclarations;
43
+ value: string;
44
+ name: string;
45
+ required: boolean;
46
+ invalid: string | null;
47
+ protected formDisabled: boolean;
48
+ private typeahead;
49
+ private focusSelectedOnOpen;
50
+ constructor();
51
+ get triggerElement(): HTMLButtonElement | null;
52
+ get triggerHost(): SelectTrigger | null;
53
+ get contentElement(): SelectContent | null;
54
+ protected get popupKind(): "listbox";
55
+ get items(): SelectItem[];
56
+ get selectedItem(): SelectItem | null;
57
+ get form(): HTMLFormElement | null;
58
+ get labels(): NodeList;
59
+ get validity(): ValidityState;
60
+ get validationMessage(): string;
61
+ get isDisabled(): boolean;
62
+ checkValidity(): boolean;
63
+ reportValidity(): boolean;
64
+ formResetCallback(): void;
65
+ formDisabledCallback(disabled: boolean): void;
66
+ formStateRestoreCallback(state: string | null): void;
67
+ wire(): void;
68
+ /** Pick `value` as the user did: updates, fires input/change, closes. */
69
+ select(value: string): void;
70
+ /** Called by the trigger for keys pressed while it has focus. */
71
+ handleTriggerKey(e: KeyboardEvent): void;
72
+ setOpen(open: boolean, reason: Parameters<PopupRoot["setOpen"]>[1], opts?: {
73
+ keyboard?: boolean;
74
+ }): boolean;
75
+ protected afterOpen(): void;
76
+ protected updated(changed: PropertyValues): void;
77
+ }
78
+ /**
79
+ * shadcn `SelectTrigger` + `SelectValue`. Tier 3, **self-rendering**: the
80
+ * trigger generates all of its content (the selected item's label or the
81
+ * placeholder, then the chevron), so it renders its own native `<button>`
82
+ * rather than enhancing one you write (docs/02-conventions.md, "Tier 3
83
+ * entry points").
84
+ *
85
+ * ```
86
+ * shadcn: button[data-slot=select-trigger][role=combobox] > span[data-slot=select-value] + svg
87
+ * pont2: pont2-prim-select-trigger (shell) > button[data-slot=select-trigger][role=combobox] > span[data-slot=select-value] + svg
88
+ * ```
89
+ *
90
+ * @tag pont2-prim-select-trigger
91
+ * @attr placeholder - shown when no value is selected (Base UI `Select.Value` placeholder)
92
+ * @attr size - default | sm
93
+ */
94
+ export declare class SelectTrigger extends ShellElement {
95
+ static properties: PropertyDeclarations;
96
+ placeholder: string;
97
+ size: "default" | "sm";
98
+ constructor();
99
+ get root(): Select | null;
100
+ get control(): HTMLButtonElement | null;
101
+ private onClick;
102
+ private onKeyDown;
103
+ protected updated(): void;
104
+ render(): import('lit-html').TemplateResult<1>;
105
+ }
106
+ /**
107
+ * The popup (`role=listbox`). By default the selected item is laid over the
108
+ * trigger (Base UI `alignItemWithTrigger`, macOS-style); when that cannot fit
109
+ * it falls back to opening below the trigger.
110
+ *
111
+ * @tag pont2-prim-select-content
112
+ * @attr align-item-with-trigger - default true; `="false"` always opens on `side`
113
+ * @attr side - bottom @attr align - center @attr side-offset - 4
114
+ */
115
+ export declare class SelectContent extends PopupContent {
116
+ static identity: string;
117
+ static slotName: string;
118
+ static role: string;
119
+ static properties: PropertyDeclarations;
120
+ alignItemWithTrigger: boolean;
121
+ private typeahead;
122
+ constructor();
123
+ get root(): Select | null;
124
+ protected alignItem(): HTMLElement | null;
125
+ protected willUpdate(): void;
126
+ show(): void;
127
+ private onKeyDown;
128
+ }
129
+ /**
130
+ * Base UI `Select.Item` (`role=option`): host-as-root. Your content is the
131
+ * item text (Base UI `ItemText`); the check indicator is rendered after it
132
+ * when selected.
133
+ *
134
+ * @tag pont2-prim-select-item
135
+ * @attr value - required
136
+ * @attr label - text for typeahead and the trigger (defaults to the text content)
137
+ * @attr disabled
138
+ */
139
+ export declare class SelectItem extends HostElement {
140
+ static identity: string;
141
+ static slotName: string;
142
+ static role: string;
143
+ static properties: PropertyDeclarations;
144
+ value: string;
145
+ disabled: boolean;
146
+ constructor();
147
+ get root(): Select | null;
148
+ get selected(): boolean;
149
+ get label(): string;
150
+ private textOf;
151
+ /** Copies of the author's content, for the trigger to display (Base UI renders the item label). */
152
+ labelNodes(): Node[];
153
+ connectedCallback(): void;
154
+ protected willUpdate(): void;
155
+ render(): import('lit-html').TemplateResult<1> | typeof nothing;
156
+ }
157
+ /** Base UI `Select.Group` (`role=group`). @tag pont2-prim-select-group */
158
+ export declare class SelectGroup extends HostElement {
159
+ static identity: string;
160
+ static slotName: string;
161
+ static role: string;
162
+ connectedCallback(): void;
163
+ }
164
+ /** Base UI `Select.GroupLabel`. @tag pont2-prim-select-label */
165
+ export declare class SelectLabel extends HostElement {
166
+ static identity: string;
167
+ static slotName: string;
168
+ }
169
+ /** Base UI `Select.Separator`; is-a Separator. @tag pont2-prim-select-separator */
170
+ export declare class SelectSeparator extends Separator {
171
+ static identity: string;
172
+ static slotName: string;
173
+ }
174
+ declare global {
175
+ interface HTMLElementTagNameMap {
176
+ "pont2-prim-select": Select;
177
+ "pont2-prim-select-trigger": SelectTrigger;
178
+ "pont2-prim-select-content": SelectContent;
179
+ "pont2-prim-select-item": SelectItem;
180
+ "pont2-prim-select-group": SelectGroup;
181
+ "pont2-prim-select-label": SelectLabel;
182
+ "pont2-prim-select-separator": SelectSeparator;
183
+ }
184
+ }
@@ -0,0 +1,34 @@
1
+ import { PropertyDeclarations } from 'lit';
2
+ import { HostElement } from '../../core/host-element';
3
+ export type SeparatorOrientation = "horizontal" | "vertical";
4
+ /**
5
+ * # Separator: Tier 1 (structural)
6
+ *
7
+ * shadcn: `<Separator orientation>` → Base UI `<Separator>` →
8
+ * `<div role="separator" aria-orientation data-orientation data-slot="separator">`.
9
+ *
10
+ * pont2: the host **is** that div. No `render()`, no children, one node.
11
+ * Role and orientation are ElementInternals defaults, so an author's own
12
+ * `role="none"` (purely decorative rule) still wins.
13
+ *
14
+ * Subclass it to make a separator with another meaning, e.g.
15
+ * `class ItemSeparator extends Separator { static identity = "item-separator" }`:
16
+ * it keeps `data-pont2-separator` (the look) and gains its own slot.
17
+ *
18
+ * @tag pont2-prim-separator
19
+ * @attr orientation - horizontal (default) | vertical
20
+ */
21
+ export declare class Separator extends HostElement {
22
+ static identity: string;
23
+ static slotName: string;
24
+ static role: string;
25
+ static properties: PropertyDeclarations;
26
+ orientation: SeparatorOrientation;
27
+ constructor();
28
+ protected willUpdate(): void;
29
+ }
30
+ declare global {
31
+ interface HTMLElementTagNameMap {
32
+ "pont2-prim-separator": Separator;
33
+ }
34
+ }
@@ -0,0 +1,18 @@
1
+ import { HostElement } from '../../core/host-element';
2
+ /**
3
+ * # Skeleton: Tier 1 (structural)
4
+ *
5
+ * shadcn: `<Skeleton>` → `<div data-slot="skeleton" class="animate-pulse bg-muted rounded-md">`.
6
+ * Size it with your own CSS (`style="width:12rem;height:1rem"` or a class).
7
+ *
8
+ * @tag pont2-prim-skeleton
9
+ */
10
+ export declare class Skeleton extends HostElement {
11
+ static identity: string;
12
+ static slotName: string;
13
+ }
14
+ declare global {
15
+ interface HTMLElementTagNameMap {
16
+ "pont2-prim-skeleton": Skeleton;
17
+ }
18
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Pure slider maths (no DOM), shared by <pont2-prim-slider> and unit-tested in node.
3
+ * Mirrors Base UI's Slider value handling: values are clamped to [min, max],
4
+ * snapped to `step` measured from `min`, and in a range slider a thumb can
5
+ * neither cross nor come closer than `minStepsBetweenValues * step` to its
6
+ * neighbours.
7
+ */
8
+ export interface SliderRange {
9
+ min: number;
10
+ max: number;
11
+ step: number;
12
+ }
13
+ export declare const clamp: (v: number, min: number, max: number) => number;
14
+ /** Decimal places of a number, so 0.1 + 0.2 snaps to 0.3 rather than 0.30000000000000004. */
15
+ export declare function decimals(n: number): number;
16
+ export declare function snap(value: number, { min, max, step }: SliderRange): number;
17
+ /** 0..1 position of a value along the track. */
18
+ export declare function fraction(value: number, { min, max }: Pick<SliderRange, "min" | "max">): number;
19
+ /** Value at a 0..1 position along the track (before snapping). */
20
+ export declare function valueAt(f: number, { min, max }: Pick<SliderRange, "min" | "max">): number;
21
+ /** Index of the thumb a pointer press at `value` should grab. Ties go to the later thumb when pressing above it. */
22
+ export declare function closestThumb(values: number[], value: number): number;
23
+ /**
24
+ * Sets thumb `index` to `value`, keeping the values ordered: the thumb is
25
+ * clamped between its neighbours (Base UI's default "none" collision
26
+ * behaviour), `minSteps` steps apart.
27
+ */
28
+ export declare function setThumb(values: number[], index: number, value: number, range: SliderRange, minSteps?: number): number[];
29
+ export type SliderKey = "ArrowUp" | "ArrowDown" | "ArrowLeft" | "ArrowRight" | "PageUp" | "PageDown" | "Home" | "End";
30
+ /**
31
+ * The value a key press moves a thumb to (APG slider pattern).
32
+ * `rtl` flips Left/Right for horizontal sliders. Shift+Arrow moves by `largeStep`.
33
+ */
34
+ export declare function keyValue(key: string, current: number, range: SliderRange & {
35
+ largeStep: number;
36
+ }, opts?: {
37
+ shift?: boolean;
38
+ rtl?: boolean;
39
+ vertical?: boolean;
40
+ }): number | null;
41
+ /** Parses `value="25"` or `value="25, 75"` (the default value attribute). */
42
+ export declare function parseValues(attr: string | null | undefined, fallback: number): number[];
@@ -0,0 +1,85 @@
1
+ import { PropertyDeclarations, PropertyValues } from 'lit';
2
+ import { FormControlElement } from '../../core/form-control';
3
+ export type SliderOrientation = "horizontal" | "vertical";
4
+ /**
5
+ * # Slider: Tier 2 (widget, form-associated)
6
+ *
7
+ * shadcn: `<Slider defaultValue min max>` → Base UI
8
+ * ```
9
+ * Slider.Root div[data-slot=slider][data-orientation]
10
+ * Control div
11
+ * Track div[data-slot=slider-track]
12
+ * Indicator div[data-slot=slider-range]
13
+ * Thumb ×n div[data-slot=slider-thumb] > input[type=range] (the input carries role=slider)
14
+ * ```
15
+ * pont2:
16
+ * ```
17
+ * pont2-prim-slider ← root, form-associated (submits name=value per thumb)
18
+ * div[data-slot=slider-control]
19
+ * div[data-slot=slider-track] > div[data-slot=slider-range]
20
+ * div[data-slot=slider-thumb][role=slider] ×n
21
+ * ```
22
+ * The thumbs carry `role="slider"` and the ARIA values themselves, so Base UI's
23
+ * per-thumb hidden `<input type="range">` is not needed (one node fewer per
24
+ * thumb); the root is the form control. Everything inside the root is
25
+ * rendered by the slider (shadcn's Slider takes no children either).
26
+ *
27
+ * Single value: `value="40"`. Range: `value="20, 80"` (one thumb per value).
28
+ * With no value, one thumb at `min`. Thumbs never cross.
29
+ *
30
+ * Keyboard (APG / Base UI): ←/↓ −step, →/↑ +step (← and → swap in RTL),
31
+ * Shift+arrow and PageUp/PageDown ±largeStep, Home/End min/max.
32
+ * Pointer: press anywhere on the control moves the closest thumb, then drags.
33
+ *
34
+ * @tag pont2-prim-slider
35
+ * @attr value - Default value(s), comma-separated for a range. `.value` / `.values` are live.
36
+ * @attr min, max, step, large-step, min-steps-between-values
37
+ * @attr orientation - horizontal (default) | vertical
38
+ * @attr name, disabled, readonly
39
+ * @fires input - While the value changes (keyboard or drag).
40
+ * @fires change - When a change is committed (key press, pointer release). Base UI `onValueCommitted`.
41
+ */
42
+ export declare class Slider extends FormControlElement {
43
+ static identity: string;
44
+ static slotName: string;
45
+ static properties: PropertyDeclarations;
46
+ defaultValue: string | null;
47
+ min: number;
48
+ max: number;
49
+ step: number;
50
+ largeStep: number;
51
+ minStepsBetweenValues: number;
52
+ orientation: SliderOrientation;
53
+ /** Live values, ascending; one per thumb. */
54
+ values: number[];
55
+ protected activeThumb: number;
56
+ private dirty;
57
+ private dragging;
58
+ constructor();
59
+ /** A number for a single-thumb slider, an array for a range (Base UI's shape). */
60
+ get value(): number | number[];
61
+ set value(v: number | number[]);
62
+ private get range();
63
+ protected get hostFocusable(): boolean;
64
+ protected get validationAnchor(): HTMLElement | undefined;
65
+ private get thumbs();
66
+ private get control();
67
+ protected formValue(): string | FormData | null;
68
+ protected resetToDefault(): void;
69
+ protected restoreState(state: string | File | FormData | null): void;
70
+ private initialValues;
71
+ private commit;
72
+ private onKeyDown;
73
+ private valueFromPointer;
74
+ private onPointerDown;
75
+ private onPointerMove;
76
+ private onPointerUp;
77
+ protected willUpdate(changed: PropertyValues): void;
78
+ protected updated(changed: PropertyValues): void;
79
+ render(): import('lit-html').TemplateResult<1>;
80
+ }
81
+ declare global {
82
+ interface HTMLElementTagNameMap {
83
+ "pont2-prim-slider": Slider;
84
+ }
85
+ }
@@ -0,0 +1,29 @@
1
+ import { HostElement } from '../../core/host-element';
2
+ /**
3
+ * # Spinner: Tier 1 (structural)
4
+ *
5
+ * shadcn: `<Spinner>` → lucide `<Loader2Icon role="status" aria-label="Loading"
6
+ * data-slot="spinner" class="size-4 animate-spin">`, i.e. one `<svg>`.
7
+ *
8
+ * A custom element cannot *be* an `<svg>`, and rendering one inside would add
9
+ * a node. pont2 draws the identical lucide `loader-circle` geometry as a CSS
10
+ * mask on the host, so the spinner is still one node and still `currentColor`.
11
+ * Swap the glyph with `--pont2-spinner-icon: url(…)`.
12
+ *
13
+ * `role="status"` and `aria-label="Loading"` are ElementInternals defaults;
14
+ * write your own `aria-label` to localise it.
15
+ *
16
+ * @tag pont2-prim-spinner
17
+ * @cssprop --pont2-spinner-icon - mask image (default: lucide loader-circle)
18
+ */
19
+ export declare class Spinner extends HostElement {
20
+ static identity: string;
21
+ static slotName: string;
22
+ static role: string;
23
+ connectedCallback(): void;
24
+ }
25
+ declare global {
26
+ interface HTMLElementTagNameMap {
27
+ "pont2-prim-spinner": Spinner;
28
+ }
29
+ }
@@ -0,0 +1,55 @@
1
+ import { PropertyDeclarations, PropertyValues } from 'lit';
2
+ import { FormControlElement, ValidityResult } from '../../core/form-control';
3
+ export type SwitchSize = "default" | "sm";
4
+ /**
5
+ * # Switch: Tier 2 (widget, form-associated)
6
+ *
7
+ * shadcn: `<Switch size>` → Base UI `<Switch.Root>` (`<span role="switch">`
8
+ * plus a hidden `<input type="checkbox">`) > `<Switch.Thumb>` (`<span>`).
9
+ *
10
+ * pont2: the host **is** the `role="switch"` root and a form-associated
11
+ * custom element (no hidden input); it renders only the thumb.
12
+ *
13
+ * ```
14
+ * shadcn/Base UI: span[role=switch][data-slot=switch] > span[data-slot=switch-thumb] + input[hidden]
15
+ * pont2: pont2-prim-switch > span[data-slot=switch-thumb]
16
+ * ```
17
+ *
18
+ * State attributes (Base UI): `data-checked` | `data-unchecked`, `data-disabled`,
19
+ * `data-readonly`, `data-required`, on the root and the thumb. `data-size`
20
+ * is shadcn's.
21
+ *
22
+ * @tag pont2-prim-switch
23
+ * @attr checked - Initial state (`defaultChecked`); `.checked` is the live state.
24
+ * @attr size - default | sm
25
+ * @attr name, value, unchecked-value, disabled, required, readonly
26
+ * @fires input - The state changed through interaction.
27
+ * @fires change - Same moment as `input`, like a native checkbox.
28
+ */
29
+ export declare class Switch extends FormControlElement {
30
+ static identity: string;
31
+ static slotName: string;
32
+ static role: string;
33
+ static properties: PropertyDeclarations;
34
+ checked: boolean;
35
+ size: SwitchSize;
36
+ value: string;
37
+ uncheckedValue: string | undefined;
38
+ constructor();
39
+ /** Toggle as if the user clicked (fires input/change). */
40
+ toggle(): void;
41
+ protected formValue(): string | null;
42
+ protected resetToDefault(): void;
43
+ protected restoreState(state: string | File | FormData | null): void;
44
+ protected validate(): ValidityResult | null;
45
+ private onClick;
46
+ private onKeyDown;
47
+ private onKeyUp;
48
+ protected willUpdate(changed: PropertyValues): void;
49
+ render(): import('lit-html').TemplateResult<1>;
50
+ }
51
+ declare global {
52
+ interface HTMLElementTagNameMap {
53
+ "pont2-prim-switch": Switch;
54
+ }
55
+ }
@@ -0,0 +1,55 @@
1
+ import { HostElement } from '../../core/host-element';
2
+ /**
3
+ * # Table: Tier 1 container + native table (recipe)
4
+ *
5
+ * shadcn: `<Table>` → `<div data-slot="table-container"><table data-slot="table">`,
6
+ * and `TableHeader | TableBody | TableFooter | TableRow | TableHead |
7
+ * TableCell | TableCaption` are the native `thead | tbody | tfoot | tr | th |
8
+ * td | caption` with a `data-slot` each.
9
+ *
10
+ * Table parts cannot be custom elements: the HTML parser "foster-parents"
11
+ * unknown elements out of a `<table>` (`<table><pont2-tr>` puts the
12
+ * `pont2-tr` *before* the table). And `colspan`, `headers`, `scope` and the
13
+ * native table semantics only exist on the native elements.
14
+ *
15
+ * So `<pont2-prim-table>` **is** the container div (host-as-root), and you write a
16
+ * plain native `<table>` inside it:
17
+ *
18
+ * ```html
19
+ * <pont2-prim-table>
20
+ * <table>
21
+ * <caption>Recent invoices</caption>
22
+ * <thead><tr><th>Invoice</th><th>Amount</th></tr></thead>
23
+ * <tbody><tr><td>INV001</td><td>$250.00</td></tr></tbody>
24
+ * </table>
25
+ * </pont2-prim-table>
26
+ * ```
27
+ *
28
+ * The host stamps each part's recipe (`data-pont2-table-*` + shadcn's
29
+ * `data-slot`) onto the native elements of *its own* table (not nested ones),
30
+ * and keeps doing so as rows are added. Styling also works before upgrade and
31
+ * with no JS, through `pont2-prim-table > table …` selectors, and outside the
32
+ * element via the recipe attributes (`applyTable()`).
33
+ *
34
+ * @tag pont2-prim-table
35
+ */
36
+ export declare class Table extends HostElement {
37
+ static identity: string;
38
+ static slotName: string;
39
+ private observer?;
40
+ /** The native `<table>` this container holds. */
41
+ get table(): HTMLTableElement | null;
42
+ connectedCallback(): void;
43
+ disconnectedCallback(): void;
44
+ private stamp;
45
+ }
46
+ /**
47
+ * Applies the table recipe to a native `<table>` and its own sections, rows
48
+ * and cells (not those of nested tables). Idempotent.
49
+ */
50
+ export declare function applyTable(table: HTMLTableElement): void;
51
+ declare global {
52
+ interface HTMLElementTagNameMap {
53
+ "pont2-prim-table": Table;
54
+ }
55
+ }