@joralvmel/cosmos-elements 0.1.0 → 0.3.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/README.md +10 -0
- package/dist/components/icon/cosm-icon.d.ts +65 -0
- package/dist/components/icon/cosm-icon.d.ts.map +1 -0
- package/dist/components/icon/cosm-icon.js +137 -0
- package/dist/components/icon/cosm-icon.js.map +1 -0
- package/dist/components/icon-button/cosm-icon-button.d.ts +79 -0
- package/dist/components/icon-button/cosm-icon-button.d.ts.map +1 -0
- package/dist/components/icon-button/cosm-icon-button.js +206 -0
- package/dist/components/icon-button/cosm-icon-button.js.map +1 -0
- package/dist/components/listbox/cosm-listbox.d.ts +140 -0
- package/dist/components/listbox/cosm-listbox.d.ts.map +1 -0
- package/dist/components/listbox/cosm-listbox.js +580 -0
- package/dist/components/listbox/cosm-listbox.js.map +1 -0
- package/dist/components/popover/cosm-popover.d.ts +122 -0
- package/dist/components/popover/cosm-popover.d.ts.map +1 -0
- package/dist/components/popover/cosm-popover.js +809 -0
- package/dist/components/popover/cosm-popover.js.map +1 -0
- package/dist/components/text-field/cosm-text-field.d.ts +203 -0
- package/dist/components/text-field/cosm-text-field.d.ts.map +1 -0
- package/dist/components/text-field/cosm-text-field.js +679 -0
- package/dist/components/text-field/cosm-text-field.js.map +1 -0
- package/dist/custom-elements.json +3103 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/llms.md +189 -0
- package/package.json +23 -2
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { type ContractProps, type PopoverOpenChangeDetail, popoverContract } from '@joralvmel/cosmos-core';
|
|
2
|
+
import '../icon/cosm-icon.js';
|
|
3
|
+
import '../icon-button/cosm-icon-button.js';
|
|
4
|
+
import { CosmElement } from '../../internal/cosm-element.js';
|
|
5
|
+
type Props = Required<ContractProps<typeof popoverContract, 'web'>>;
|
|
6
|
+
export type PopoverSide = Props['side'];
|
|
7
|
+
export type PopoverAlign = Props['align'];
|
|
8
|
+
/**
|
|
9
|
+
* Non-modal content anchored to a consumer-provided trigger. Trigger naming, trigger
|
|
10
|
+
* appearance and panel semantics are supplied by the consumer.
|
|
11
|
+
*
|
|
12
|
+
* @tag cosm-popover
|
|
13
|
+
* @slot trigger - Consumer-supplied keyboard-operable trigger.
|
|
14
|
+
* @slot - Consumer-supplied panel content and semantics.
|
|
15
|
+
* @csspart trigger - Container for the trigger slot.
|
|
16
|
+
* @csspart panel - Non-modal anchored surface.
|
|
17
|
+
* @csspart body - Scrollable content.
|
|
18
|
+
* @csspart close - Optional close IconButton.
|
|
19
|
+
* @csspart arrow - Decorative pointer matching the panel.
|
|
20
|
+
* @fires {CustomEvent<PopoverOpenChangeDetail>} cosm-open-change - Proposes a visibility change.
|
|
21
|
+
* @cssprop --cosm-popover-z-index - Stacking level of the panel.
|
|
22
|
+
* @cssprop --cosm-popover-padding - Panel padding.
|
|
23
|
+
* @cssprop --cosm-popover-radius - Panel corner radius.
|
|
24
|
+
* @cssprop --cosm-popover-shadow - Panel shadow.
|
|
25
|
+
* @remarks Uses the native manual Popover API to escape clipping and transformed ancestors when
|
|
26
|
+
* available. Without that API, it falls back to fixed positioning, which can still be clipped or
|
|
27
|
+
* displaced by ancestor overflow, transforms or containment.
|
|
28
|
+
*/
|
|
29
|
+
export declare class CosmPopover extends CosmElement {
|
|
30
|
+
#private;
|
|
31
|
+
static shadowRootOptions: ShadowRootInit;
|
|
32
|
+
static properties: {
|
|
33
|
+
open: {
|
|
34
|
+
type: BooleanConstructor;
|
|
35
|
+
reflect: boolean;
|
|
36
|
+
};
|
|
37
|
+
defaultOpen: {
|
|
38
|
+
type: BooleanConstructor;
|
|
39
|
+
attribute: string;
|
|
40
|
+
};
|
|
41
|
+
triggerMode: {
|
|
42
|
+
attribute: string;
|
|
43
|
+
};
|
|
44
|
+
closable: {
|
|
45
|
+
type: BooleanConstructor;
|
|
46
|
+
};
|
|
47
|
+
closeLabel: {
|
|
48
|
+
attribute: string;
|
|
49
|
+
};
|
|
50
|
+
gap: {
|
|
51
|
+
type: NumberConstructor;
|
|
52
|
+
};
|
|
53
|
+
arrow: {
|
|
54
|
+
type: BooleanConstructor;
|
|
55
|
+
};
|
|
56
|
+
closeOnEscape: {
|
|
57
|
+
type: BooleanConstructor;
|
|
58
|
+
attribute: string;
|
|
59
|
+
};
|
|
60
|
+
closeOnOutsidePress: {
|
|
61
|
+
type: BooleanConstructor;
|
|
62
|
+
attribute: string;
|
|
63
|
+
};
|
|
64
|
+
initialFocus: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
attribute: string;
|
|
67
|
+
};
|
|
68
|
+
restoreFocus: {
|
|
69
|
+
type: BooleanConstructor;
|
|
70
|
+
attribute: string;
|
|
71
|
+
};
|
|
72
|
+
side: {
|
|
73
|
+
reflect: boolean;
|
|
74
|
+
};
|
|
75
|
+
align: {
|
|
76
|
+
reflect: boolean;
|
|
77
|
+
};
|
|
78
|
+
flip: {
|
|
79
|
+
type: BooleanConstructor;
|
|
80
|
+
};
|
|
81
|
+
shift: {
|
|
82
|
+
type: BooleanConstructor;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
static styles: import("lit").CSSResult[];
|
|
86
|
+
defaultOpen: Props['defaultOpen'];
|
|
87
|
+
triggerMode: Props['triggerMode'];
|
|
88
|
+
closable: Props['closable'];
|
|
89
|
+
closeLabel: Props['closeLabel'];
|
|
90
|
+
gap: Props['gap'];
|
|
91
|
+
arrow: Props['arrow'];
|
|
92
|
+
closeOnEscape: Props['closeOnEscape'];
|
|
93
|
+
closeOnOutsidePress: Props['closeOnOutsidePress'];
|
|
94
|
+
initialFocus: Props['initialFocus'];
|
|
95
|
+
restoreFocus: Props['restoreFocus'];
|
|
96
|
+
side: PopoverSide;
|
|
97
|
+
align: PopoverAlign;
|
|
98
|
+
flip: Props['flip'];
|
|
99
|
+
shift: Props['shift'];
|
|
100
|
+
/** Set by adapters to distinguish a bound `open` value from autonomous state. */
|
|
101
|
+
openControlled: boolean;
|
|
102
|
+
get open(): boolean;
|
|
103
|
+
set open(value: boolean | undefined);
|
|
104
|
+
constructor();
|
|
105
|
+
connectedCallback(): void;
|
|
106
|
+
disconnectedCallback(): void;
|
|
107
|
+
protected willUpdate(): void;
|
|
108
|
+
protected updated(changed: Map<PropertyKey, unknown>): void;
|
|
109
|
+
/** Requests closure with reason `action` only while the panel is open. */
|
|
110
|
+
requestClose(): void;
|
|
111
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
112
|
+
}
|
|
113
|
+
declare global {
|
|
114
|
+
interface HTMLElementTagNameMap {
|
|
115
|
+
'cosm-popover': CosmPopover;
|
|
116
|
+
}
|
|
117
|
+
interface HTMLElementEventMap {
|
|
118
|
+
'cosm-open-change': CustomEvent<PopoverOpenChangeDetail>;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
export {};
|
|
122
|
+
//# sourceMappingURL=cosm-popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cosm-popover.d.ts","sourceRoot":"","sources":["../../../src/components/popover/cosm-popover.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,uBAAuB,EAC5B,eAAe,EAChB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,oCAAoC,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAI7D,KAAK,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,eAAe,EAAE,KAAK,CAAC,CAAC,CAAC;AACpE,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AACxC,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;AA+C1C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,WAAY,SAAQ,WAAW;;IAC1C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