@joralvmel/cosmos-elements 0.2.0 → 0.4.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 +15 -0
- package/dist/components/badge/cosm-badge.d.ts +64 -0
- package/dist/components/badge/cosm-badge.d.ts.map +1 -0
- package/dist/components/badge/cosm-badge.js +162 -0
- package/dist/components/badge/cosm-badge.js.map +1 -0
- package/dist/components/button/cosm-button.d.ts.map +1 -1
- package/dist/components/button/cosm-button.js +2 -0
- package/dist/components/button/cosm-button.js.map +1 -1
- package/dist/components/calendar/cosm-calendar.d.ts +77 -0
- package/dist/components/calendar/cosm-calendar.d.ts.map +1 -0
- package/dist/components/calendar/cosm-calendar.js +696 -0
- package/dist/components/calendar/cosm-calendar.js.map +1 -0
- package/dist/components/checkbox/cosm-checkbox.d.ts +122 -0
- package/dist/components/checkbox/cosm-checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/cosm-checkbox.js +433 -0
- package/dist/components/checkbox/cosm-checkbox.js.map +1 -0
- package/dist/components/dialog/cosm-dialog.d.ts +103 -0
- package/dist/components/dialog/cosm-dialog.d.ts.map +1 -0
- package/dist/components/dialog/cosm-dialog.js +497 -0
- package/dist/components/dialog/cosm-dialog.js.map +1 -0
- package/dist/components/icon/cosm-icon.d.ts +7 -15
- package/dist/components/icon/cosm-icon.d.ts.map +1 -1
- package/dist/components/icon/cosm-icon.js +29 -30
- package/dist/components/icon/cosm-icon.js.map +1 -1
- 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 +212 -0
- package/dist/components/icon-button/cosm-icon-button.js.map +1 -0
- package/dist/components/listbox/cosm-listbox.d.ts +136 -0
- package/dist/components/listbox/cosm-listbox.d.ts.map +1 -0
- package/dist/components/listbox/cosm-listbox.js +565 -0
- package/dist/components/listbox/cosm-listbox.js.map +1 -0
- package/dist/components/pagination/cosm-pagination.d.ts +118 -0
- package/dist/components/pagination/cosm-pagination.d.ts.map +1 -0
- package/dist/components/pagination/cosm-pagination.js +315 -0
- package/dist/components/pagination/cosm-pagination.js.map +1 -0
- package/dist/components/popover/cosm-popover.d.ts +100 -0
- package/dist/components/popover/cosm-popover.d.ts.map +1 -0
- package/dist/components/popover/cosm-popover.js +776 -0
- package/dist/components/popover/cosm-popover.js.map +1 -0
- package/dist/components/radio-group/cosm-radio-group.d.ts +111 -0
- package/dist/components/radio-group/cosm-radio-group.d.ts.map +1 -0
- package/dist/components/radio-group/cosm-radio-group.js +478 -0
- package/dist/components/radio-group/cosm-radio-group.js.map +1 -0
- package/dist/components/select/cosm-select.d.ts +126 -0
- package/dist/components/select/cosm-select.d.ts.map +1 -0
- package/dist/components/select/cosm-select.js +682 -0
- package/dist/components/select/cosm-select.js.map +1 -0
- package/dist/components/switch/cosm-switch.d.ts +103 -0
- package/dist/components/switch/cosm-switch.d.ts.map +1 -0
- package/dist/components/switch/cosm-switch.js +359 -0
- package/dist/components/switch/cosm-switch.js.map +1 -0
- package/dist/components/text-field/cosm-text-field.d.ts +193 -0
- package/dist/components/text-field/cosm-text-field.d.ts.map +1 -0
- package/dist/components/text-field/cosm-text-field.js +642 -0
- package/dist/components/text-field/cosm-text-field.js.map +1 -0
- package/dist/components/textarea/cosm-textarea.d.ts +131 -0
- package/dist/components/textarea/cosm-textarea.d.ts.map +1 -0
- package/dist/components/textarea/cosm-textarea.js +445 -0
- package/dist/components/textarea/cosm-textarea.js.map +1 -0
- package/dist/custom-elements.json +7605 -78
- package/dist/index.d.ts +14 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/current-page.d.ts +7 -0
- package/dist/internal/current-page.d.ts.map +1 -0
- package/dist/internal/current-page.js +18 -0
- package/dist/internal/current-page.js.map +1 -0
- package/llms.md +455 -7
- package/package.json +55 -3
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { type ContractProps, type TextFieldChangeDetail, type TextFieldSubmitDetail, textFieldContract } 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 textFieldContract, 'web', {
|
|
6
|
+
IconDefinition: IconDefinition;
|
|
7
|
+
}>;
|
|
8
|
+
export type TextFieldType = NonNullable<Props['type']>;
|
|
9
|
+
export type TextFieldSize = NonNullable<Props['size']>;
|
|
10
|
+
export type TextFieldVariant = NonNullable<Props['variant']>;
|
|
11
|
+
/**
|
|
12
|
+
* Labeled, single-line text entry with native browser constraints and form association.
|
|
13
|
+
*
|
|
14
|
+
* @tag cosm-text-field
|
|
15
|
+
* @slot - No content slot; use `label`, `helperText` and `errorText` text properties.
|
|
16
|
+
* @csspart label - The visible or visually hidden label.
|
|
17
|
+
* @csspart control - The visual input control.
|
|
18
|
+
* @csspart input - The editable native input.
|
|
19
|
+
* @csspart start - Start icon or prefix decoration.
|
|
20
|
+
* @csspart end - End icon, suffix or action region.
|
|
21
|
+
* @csspart help - Supporting helper text.
|
|
22
|
+
* @csspart error - External or browser constraint error text.
|
|
23
|
+
* @csspart clear-button - Optional accessible clear action.
|
|
24
|
+
* @csspart reveal-button - Optional accessible password visibility action.
|
|
25
|
+
* @fires {CustomEvent<TextFieldChangeDetail>} cosm-change - A value edit or clear proposal.
|
|
26
|
+
* @fires {CustomEvent<TextFieldSubmitDetail>} cosm-submit - The user invoked the submit action.
|
|
27
|
+
* @cssprop --cosm-text-field-background - Control background.
|
|
28
|
+
* @cssprop --cosm-text-field-color - Editable and decoration text color.
|
|
29
|
+
* @cssprop --cosm-text-field-placeholder - Placeholder text color.
|
|
30
|
+
* @cssprop --cosm-text-field-border - Control boundary color.
|
|
31
|
+
* @cssprop --cosm-text-field-focus - Focus indicator color.
|
|
32
|
+
* @cssprop --cosm-text-field-radius - Control corner radius.
|
|
33
|
+
* @cssprop --cosm-text-field-start-icon-color - Start icon color.
|
|
34
|
+
* @cssprop --cosm-text-field-end-icon-color - End icon color.
|
|
35
|
+
*/
|
|
36
|
+
export declare class CosmTextField extends CosmElement {
|
|
37
|
+
#private;
|
|
38
|
+
static formAssociated: boolean;
|
|
39
|
+
static shadowRootOptions: ShadowRootInit;
|
|
40
|
+
static properties: {
|
|
41
|
+
label: {};
|
|
42
|
+
labelHidden: {
|
|
43
|
+
type: BooleanConstructor;
|
|
44
|
+
reflect: boolean;
|
|
45
|
+
attribute: string;
|
|
46
|
+
};
|
|
47
|
+
value: {};
|
|
48
|
+
defaultValue: {
|
|
49
|
+
attribute: string;
|
|
50
|
+
};
|
|
51
|
+
type: {
|
|
52
|
+
reflect: boolean;
|
|
53
|
+
};
|
|
54
|
+
variant: {
|
|
55
|
+
reflect: boolean;
|
|
56
|
+
};
|
|
57
|
+
size: {
|
|
58
|
+
reflect: boolean;
|
|
59
|
+
};
|
|
60
|
+
placeholder: {};
|
|
61
|
+
helperText: {
|
|
62
|
+
attribute: string;
|
|
63
|
+
};
|
|
64
|
+
errorText: {
|
|
65
|
+
attribute: string;
|
|
66
|
+
};
|
|
67
|
+
invalid: {
|
|
68
|
+
type: BooleanConstructor;
|
|
69
|
+
reflect: boolean;
|
|
70
|
+
};
|
|
71
|
+
required: {
|
|
72
|
+
type: BooleanConstructor;
|
|
73
|
+
reflect: boolean;
|
|
74
|
+
};
|
|
75
|
+
disabled: {
|
|
76
|
+
type: BooleanConstructor;
|
|
77
|
+
reflect: boolean;
|
|
78
|
+
};
|
|
79
|
+
readOnly: {
|
|
80
|
+
type: BooleanConstructor;
|
|
81
|
+
reflect: boolean;
|
|
82
|
+
attribute: string;
|
|
83
|
+
};
|
|
84
|
+
minLength: {
|
|
85
|
+
type: NumberConstructor;
|
|
86
|
+
attribute: string;
|
|
87
|
+
};
|
|
88
|
+
maxLength: {
|
|
89
|
+
type: NumberConstructor;
|
|
90
|
+
attribute: string;
|
|
91
|
+
};
|
|
92
|
+
pattern: {};
|
|
93
|
+
name: {
|
|
94
|
+
reflect: boolean;
|
|
95
|
+
};
|
|
96
|
+
autoComplete: {
|
|
97
|
+
attribute: string;
|
|
98
|
+
};
|
|
99
|
+
inputMode: {
|
|
100
|
+
attribute: string;
|
|
101
|
+
};
|
|
102
|
+
startIcon: {
|
|
103
|
+
attribute: boolean;
|
|
104
|
+
};
|
|
105
|
+
endIcon: {
|
|
106
|
+
attribute: boolean;
|
|
107
|
+
};
|
|
108
|
+
prefix: {};
|
|
109
|
+
suffix: {};
|
|
110
|
+
clearable: {
|
|
111
|
+
type: BooleanConstructor;
|
|
112
|
+
reflect: boolean;
|
|
113
|
+
};
|
|
114
|
+
clearLabel: {
|
|
115
|
+
attribute: string;
|
|
116
|
+
};
|
|
117
|
+
passwordReveal: {
|
|
118
|
+
type: BooleanConstructor;
|
|
119
|
+
reflect: boolean;
|
|
120
|
+
attribute: string;
|
|
121
|
+
};
|
|
122
|
+
revealPasswordLabel: {
|
|
123
|
+
attribute: string;
|
|
124
|
+
};
|
|
125
|
+
hidePasswordLabel: {
|
|
126
|
+
attribute: string;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
static styles: import("lit").CSSResult[];
|
|
130
|
+
label: Props['label'];
|
|
131
|
+
labelHidden: boolean;
|
|
132
|
+
value: Props['value'];
|
|
133
|
+
defaultValue: Props['defaultValue'];
|
|
134
|
+
type: Props['type'];
|
|
135
|
+
variant: Props['variant'];
|
|
136
|
+
size: Props['size'];
|
|
137
|
+
placeholder: Props['placeholder'];
|
|
138
|
+
helperText: Props['helperText'];
|
|
139
|
+
errorText: Props['errorText'];
|
|
140
|
+
invalid: Props['invalid'];
|
|
141
|
+
required: Props['required'];
|
|
142
|
+
disabled: Props['disabled'];
|
|
143
|
+
readOnly: Props['readOnly'];
|
|
144
|
+
minLength: Props['minLength'];
|
|
145
|
+
maxLength: Props['maxLength'];
|
|
146
|
+
pattern: Props['pattern'];
|
|
147
|
+
name: Props['name'];
|
|
148
|
+
autoComplete: Props['autoComplete'];
|
|
149
|
+
inputMode: string;
|
|
150
|
+
startIcon: Props['startIcon'];
|
|
151
|
+
endIcon: Props['endIcon'];
|
|
152
|
+
prefix: string | null;
|
|
153
|
+
suffix: Props['suffix'];
|
|
154
|
+
clearable: Props['clearable'];
|
|
155
|
+
clearLabel: Props['clearLabel'];
|
|
156
|
+
passwordReveal: Props['passwordReveal'];
|
|
157
|
+
revealPasswordLabel: Props['revealPasswordLabel'];
|
|
158
|
+
hidePasswordLabel: Props['hidePasswordLabel'];
|
|
159
|
+
/** Framework adapters set this metadata when `value` is actually bound. */
|
|
160
|
+
valueControlled: boolean;
|
|
161
|
+
constructor();
|
|
162
|
+
connectedCallback(): void;
|
|
163
|
+
disconnectedCallback(): void;
|
|
164
|
+
/** The associated form, if any. */
|
|
165
|
+
get form(): HTMLFormElement | null;
|
|
166
|
+
/** Focuses the native editable control. */
|
|
167
|
+
focus(options?: FocusOptions): void;
|
|
168
|
+
/** Returns the native validity state of the inner input. */
|
|
169
|
+
get validity(): ValidityState | undefined;
|
|
170
|
+
/** Returns the browser's constraint-validation message. */
|
|
171
|
+
get validationMessage(): string;
|
|
172
|
+
/** Returns whether the input satisfies its native constraints. */
|
|
173
|
+
checkValidity(): boolean;
|
|
174
|
+
/** Checks validity and asks the browser to present its localized message. */
|
|
175
|
+
reportValidity(): boolean;
|
|
176
|
+
formDisabledCallback(disabled: boolean): void;
|
|
177
|
+
formResetCallback(): void;
|
|
178
|
+
formStateRestoreCallback(state: string | File | FormData): void;
|
|
179
|
+
protected willUpdate(changed: Map<PropertyKey, unknown>): void;
|
|
180
|
+
protected updated(changed: Map<PropertyKey, unknown>): void;
|
|
181
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
182
|
+
}
|
|
183
|
+
declare global {
|
|
184
|
+
interface HTMLElementTagNameMap {
|
|
185
|
+
'cosm-text-field': CosmTextField;
|
|
186
|
+
}
|
|
187
|
+
interface HTMLElementEventMap {
|
|
188
|
+
'cosm-change': CustomEvent<TextFieldChangeDetail>;
|
|
189
|
+
'cosm-submit': CustomEvent<TextFieldSubmitDetail>;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
export {};
|
|
193
|
+
//# sourceMappingURL=cosm-text-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cosm-text-field.d.ts","sourceRoot":"","sources":["../../../src/components/text-field/cosm-text-field.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,cAAc,EAAoB,MAAM,yBAAyB,CAAC;AAKhF,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,sBAAsB,CAAC;AAE9B,KAAK,KAAK,GAAG,aAAa,CAAC,OAAO,iBAAiB,EAAE,KAAK,EAAE;IAAE,cAAc,EAAE,cAAc,CAAA;CAAE,CAAC,CAAC;AAChG,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AACvD,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AACvD,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AA2K7D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,aAAc,SAAQ,WAAW;;IAC5C,MAAM,CAAC,cAAc,UAAQ;IAE7B,OAAgB,iBAAiB,EAAE,cAAc,CAG/C;IAEF,OAAgB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA8BxB;IAEF,OAAgB,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