@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,140 @@
|
|
|
1
|
+
import { type ContractProps, type ListboxItem, type ListboxSelectionChangeDetail, listboxContract } from '@joralvmel/cosmos-core';
|
|
2
|
+
import { type IconDefinition } from '@joralvmel/cosmos-icons';
|
|
3
|
+
import { CosmElement } from '../../internal/cosm-element.js';
|
|
4
|
+
import '../icon/cosm-icon.js';
|
|
5
|
+
type Props = ContractProps<typeof listboxContract, 'web', {
|
|
6
|
+
ListboxItems: readonly ListboxItem<IconDefinition>[];
|
|
7
|
+
ListboxValues: readonly string[];
|
|
8
|
+
}>;
|
|
9
|
+
export type ListboxSize = NonNullable<Props['size']>;
|
|
10
|
+
export type ListboxVariant = NonNullable<Props['variant']>;
|
|
11
|
+
/**
|
|
12
|
+
* Renders a named, keyboard-navigable single- or multiple-selection listbox.
|
|
13
|
+
*
|
|
14
|
+
* @tag cosm-listbox
|
|
15
|
+
* @slot - No content slot; options are supplied through the `items` property.
|
|
16
|
+
* @csspart base - Outer listbox container.
|
|
17
|
+
* @csspart label - Visible or visually hidden accessible label.
|
|
18
|
+
* @csspart list - Scrollable listbox element.
|
|
19
|
+
* @csspart group - Named, noninteractive option group.
|
|
20
|
+
* @csspart group-label - Noninteractive group heading.
|
|
21
|
+
* @csspart option - Selectable row with data-active, data-selected and data-disabled states.
|
|
22
|
+
* @csspart icon - Decorative option icon.
|
|
23
|
+
* @csspart content - Option text content wrapper.
|
|
24
|
+
* @csspart option-label - Primary option text.
|
|
25
|
+
* @csspart description - Supporting option text.
|
|
26
|
+
* @csspart indicator - Decorative selected-state indicator.
|
|
27
|
+
* @fires {CustomEvent<ListboxSelectionChangeDetail>} cosm-selection-change - Proposes a selection update.
|
|
28
|
+
* @cssprop --cosm-listbox-background - Container background.
|
|
29
|
+
* @cssprop --cosm-listbox-color - Primary foreground.
|
|
30
|
+
* @cssprop --cosm-listbox-border - Outlined container border color.
|
|
31
|
+
* @cssprop --cosm-listbox-radius - Container and option corner radius.
|
|
32
|
+
* @cssprop --cosm-listbox-option-height - Minimum option height.
|
|
33
|
+
* @cssprop --cosm-listbox-option-padding - Option padding.
|
|
34
|
+
* @cssprop --cosm-listbox-gap - Space between icon, content and selection indicator.
|
|
35
|
+
* @cssprop --cosm-listbox-font-size - Primary option text size.
|
|
36
|
+
* @cssprop --cosm-listbox-description-color - Supporting text color.
|
|
37
|
+
* @cssprop --cosm-listbox-selected-background - Selected option background.
|
|
38
|
+
* @cssprop --cosm-listbox-selected-color - Selected option foreground.
|
|
39
|
+
* @cssprop --cosm-listbox-focus - Visible keyboard focus outline color.
|
|
40
|
+
* @cssprop --cosm-listbox-max-height - Maximum scrollable list height.
|
|
41
|
+
*/
|
|
42
|
+
export declare class CosmListbox extends CosmElement {
|
|
43
|
+
#private;
|
|
44
|
+
static shadowRootOptions: ShadowRootInit;
|
|
45
|
+
static properties: {
|
|
46
|
+
label: {
|
|
47
|
+
type: StringConstructor;
|
|
48
|
+
};
|
|
49
|
+
labelHidden: {
|
|
50
|
+
type: BooleanConstructor;
|
|
51
|
+
reflect: boolean;
|
|
52
|
+
attribute: string;
|
|
53
|
+
};
|
|
54
|
+
items: {
|
|
55
|
+
attribute: boolean;
|
|
56
|
+
};
|
|
57
|
+
selectionMode: {
|
|
58
|
+
reflect: boolean;
|
|
59
|
+
attribute: string;
|
|
60
|
+
};
|
|
61
|
+
selectedValues: {
|
|
62
|
+
attribute: boolean;
|
|
63
|
+
noAccessor: boolean;
|
|
64
|
+
};
|
|
65
|
+
defaultSelectedValues: {
|
|
66
|
+
attribute: boolean;
|
|
67
|
+
};
|
|
68
|
+
variant: {
|
|
69
|
+
reflect: boolean;
|
|
70
|
+
};
|
|
71
|
+
size: {
|
|
72
|
+
reflect: boolean;
|
|
73
|
+
converter: {
|
|
74
|
+
fromAttribute(value: string | null): ListboxSize;
|
|
75
|
+
toAttribute(value: ListboxSize): string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
disabled: {
|
|
79
|
+
type: BooleanConstructor;
|
|
80
|
+
reflect: boolean;
|
|
81
|
+
};
|
|
82
|
+
readOnly: {
|
|
83
|
+
type: BooleanConstructor;
|
|
84
|
+
reflect: boolean;
|
|
85
|
+
attribute: string;
|
|
86
|
+
};
|
|
87
|
+
locale: {
|
|
88
|
+
type: StringConstructor;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
static styles: import("lit").CSSResult[];
|
|
92
|
+
/** Required, nonempty accessible name for the listbox. */
|
|
93
|
+
label: Props['label'];
|
|
94
|
+
/** Visually hides the label while retaining it as the listbox accessible name. */
|
|
95
|
+
labelHidden: Props['labelHidden'];
|
|
96
|
+
/** Ordered readonly options and named groups to render. */
|
|
97
|
+
items: Props['items'];
|
|
98
|
+
/** Permits one selected value or toggling multiple values. */
|
|
99
|
+
selectionMode: Props['selectionMode'];
|
|
100
|
+
/** Values used for the initial autonomous selection; later changes do not reset it. */
|
|
101
|
+
defaultSelectedValues: Props['defaultSelectedValues'];
|
|
102
|
+
/** Plain or outlined container presentation. */
|
|
103
|
+
variant: Props['variant'];
|
|
104
|
+
/** Semantic size or a positive finite minimum option height in CSS pixels. */
|
|
105
|
+
size: ListboxSize;
|
|
106
|
+
/** Prevents focus and selection interaction for the whole list. */
|
|
107
|
+
disabled: Props['disabled'];
|
|
108
|
+
/** Allows exploration while preventing selection proposals. */
|
|
109
|
+
readOnly: Props['readOnly'];
|
|
110
|
+
/** Locale override for typeahead; otherwise inherits the nearest `lang`. */
|
|
111
|
+
locale: Props['locale'];
|
|
112
|
+
/** Set by adapters or imperative callers to override binding inference for `selectedValues`. */
|
|
113
|
+
get selectedValuesControlled(): boolean;
|
|
114
|
+
set selectedValuesControlled(value: boolean);
|
|
115
|
+
/** Controlled selected values; setting a defined array marks the state controlled. */
|
|
116
|
+
get selectedValues(): Props['selectedValues'];
|
|
117
|
+
set selectedValues(value: Props['selectedValues']);
|
|
118
|
+
/** The current committed selection, regardless of whether it is autonomous or controlled. */
|
|
119
|
+
get currentSelectedValues(): readonly string[];
|
|
120
|
+
/** The current roving option value, or `null` when every option is disabled or absent. */
|
|
121
|
+
get activeValue(): string | null;
|
|
122
|
+
constructor();
|
|
123
|
+
connectedCallback(): void;
|
|
124
|
+
disconnectedCallback(): void;
|
|
125
|
+
/** Focuses the active enabled option, or the initially selected enabled option. */
|
|
126
|
+
focus(options?: FocusOptions): void;
|
|
127
|
+
protected willUpdate(changed: Map<PropertyKey, unknown>): void;
|
|
128
|
+
protected updated(): void;
|
|
129
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
130
|
+
}
|
|
131
|
+
declare global {
|
|
132
|
+
interface HTMLElementTagNameMap {
|
|
133
|
+
'cosm-listbox': CosmListbox;
|
|
134
|
+
}
|
|
135
|
+
interface HTMLElementEventMap {
|
|
136
|
+
'cosm-selection-change': CustomEvent<ListboxSelectionChangeDetail>;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
export {};
|
|
140
|
+
//# sourceMappingURL=cosm-listbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cosm-listbox.d.ts","sourceRoot":"","sources":["../../../src/components/listbox/cosm-listbox.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAKlB,KAAK,WAAW,EAEhB,KAAK,4BAA4B,EACjC,eAAe,EAIhB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,cAAc,EAAoB,MAAM,yBAAyB,CAAC;AAGhF,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,sBAAsB,CAAC;AAE9B,KAAK,KAAK,GAAG,aAAa,CACxB,OAAO,eAAe,EACtB,KAAK,EACL;IAAE,YAAY,EAAE,SAAS,WAAW,CAAC,cAAc,CAAC,EAAE,CAAC;IAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAC3F,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AACrD,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AA+J3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,WAAY,SAAQ,WAAW;;IAC1C,OAAgB,iBAAiB,EAAE,cAAc,CAG/C;IAEF,OAAgB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCA/LL,MA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