@haiilo/catalyst 0.0.11

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 (38) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +76 -0
  3. package/dist/catalyst/app-globals-54573336.js +716 -0
  4. package/dist/catalyst/cat-button.entry.js +621 -0
  5. package/dist/catalyst/cat-icon-registry-59da2e37.js +43 -0
  6. package/dist/catalyst/cat-icon.entry.js +27 -0
  7. package/dist/catalyst/cat-spinner.entry.js +21 -0
  8. package/dist/catalyst/catalyst.css +1403 -0
  9. package/dist/catalyst/catalyst.esm.js +126 -0
  10. package/dist/catalyst/css-shim-20dbffa5.js +4 -0
  11. package/dist/catalyst/dom-c5ed0ba5.js +73 -0
  12. package/dist/catalyst/index-6672be93.js +3031 -0
  13. package/dist/catalyst/index.cdn.js +21 -0
  14. package/dist/catalyst/index.esm.js +1 -0
  15. package/dist/catalyst/shadow-css-8c625855.js +388 -0
  16. package/dist/components/cat-button.d.ts +11 -0
  17. package/dist/components/cat-icon.d.ts +11 -0
  18. package/dist/components/cat-spinner.d.ts +11 -0
  19. package/dist/components/index.d.ts +26 -0
  20. package/dist/types/components/cat-button/cat-button.d.ts +123 -0
  21. package/dist/types/components/cat-icon/cat-icon-registry.d.ts +15 -0
  22. package/dist/types/components/cat-icon/cat-icon.d.ts +23 -0
  23. package/dist/types/components/cat-spinner/cat-spinner.d.ts +15 -0
  24. package/dist/types/components.d.ts +253 -0
  25. package/dist/types/index.d.ts +1 -0
  26. package/dist/types/init.d.ts +1 -0
  27. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  28. package/dist/types/utils/breakpoints.d.ts +7 -0
  29. package/dist/types/utils/media-matcher.d.ts +13 -0
  30. package/dist/types/utils/platform.d.ts +18 -0
  31. package/dist/types/utils/utils.d.ts +1 -0
  32. package/loader/cdn.js +3 -0
  33. package/loader/index.cjs.js +3 -0
  34. package/loader/index.d.ts +12 -0
  35. package/loader/index.es2017.js +3 -0
  36. package/loader/index.js +4 -0
  37. package/loader/package.json +10 -0
  38. package/package.json +78 -0
@@ -0,0 +1,21 @@
1
+ (function (doc) {
2
+ var scriptElm = doc.scripts[doc.scripts.length - 1];
3
+ var warn = ['Discouraged script use, please remove: ' + scriptElm.outerHTML];
4
+
5
+ warn.push('To improve performance it is recommended to set the script in the head as follows:');
6
+
7
+ var parts = scriptElm.src.split('/');
8
+ parts.pop();
9
+ // add subfolder(s) here
10
+ // parts.push('...');
11
+ var url = parts.join('/');
12
+
13
+ scriptElm = doc.createElement('script');
14
+ scriptElm.setAttribute('type', 'module');
15
+ scriptElm.src = url + '/catalyst.esm.js';
16
+ warn.push(scriptElm.outerHTML);
17
+ scriptElm.setAttribute('data-stencil-namespace', 'catalyst');
18
+ doc.head.appendChild(scriptElm);
19
+
20
+ console.warn(warn.join('\n'));
21
+ })(document);
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,388 @@
1
+ /*
2
+ Stencil Client Platform v2.13.0 | MIT Licensed | https://stenciljs.com
3
+ */
4
+ /**
5
+ * @license
6
+ * Copyright Google Inc. All Rights Reserved.
7
+ *
8
+ * Use of this source code is governed by an MIT-style license that can be
9
+ * found in the LICENSE file at https://angular.io/license
10
+ *
11
+ * This file is a port of shadowCSS from webcomponents.js to TypeScript.
12
+ * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
13
+ * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts
14
+ */
15
+ const safeSelector = (selector) => {
16
+ const placeholders = [];
17
+ let index = 0;
18
+ let content;
19
+ // Replaces attribute selectors with placeholders.
20
+ // The WS in [attr="va lue"] would otherwise be interpreted as a selector separator.
21
+ selector = selector.replace(/(\[[^\]]*\])/g, (_, keep) => {
22
+ const replaceBy = `__ph-${index}__`;
23
+ placeholders.push(keep);
24
+ index++;
25
+ return replaceBy;
26
+ });
27
+ // Replaces the expression in `:nth-child(2n + 1)` with a placeholder.
28
+ // WS and "+" would otherwise be interpreted as selector separators.
29
+ content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => {
30
+ const replaceBy = `__ph-${index}__`;
31
+ placeholders.push(exp);
32
+ index++;
33
+ return pseudo + replaceBy;
34
+ });
35
+ const ss = {
36
+ content,
37
+ placeholders,
38
+ };
39
+ return ss;
40
+ };
41
+ const restoreSafeSelector = (placeholders, content) => {
42
+ return content.replace(/__ph-(\d+)__/g, (_, index) => placeholders[+index]);
43
+ };
44
+ const _polyfillHost = '-shadowcsshost';
45
+ const _polyfillSlotted = '-shadowcssslotted';
46
+ // note: :host-context pre-processed to -shadowcsshostcontext.
47
+ const _polyfillHostContext = '-shadowcsscontext';
48
+ const _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)';
49
+ const _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim');
50
+ const _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim');
51
+ const _cssColonSlottedRe = new RegExp('(' + _polyfillSlotted + _parenSuffix, 'gim');
52
+ const _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';
53
+ const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
54
+ const _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];
55
+ const _selectorReSuffix = '([>\\s~+[.,{:][\\s\\S]*)?$';
56
+ const _polyfillHostRe = /-shadowcsshost/gim;
57
+ const _colonHostRe = /:host/gim;
58
+ const _colonSlottedRe = /::slotted/gim;
59
+ const _colonHostContextRe = /:host-context/gim;
60
+ const _commentRe = /\/\*\s*[\s\S]*?\*\//g;
61
+ const stripComments = (input) => {
62
+ return input.replace(_commentRe, '');
63
+ };
64
+ const _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g;
65
+ const extractCommentsWithHash = (input) => {
66
+ return input.match(_commentWithHashRe) || [];
67
+ };
68
+ const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
69
+ const _curlyRe = /([{}])/g;
70
+ const _selectorPartsRe = /(^.*?[^\\])??((:+)(.*)|$)/;
71
+ const OPEN_CURLY = '{';
72
+ const CLOSE_CURLY = '}';
73
+ const BLOCK_PLACEHOLDER = '%BLOCK%';
74
+ const processRules = (input, ruleCallback) => {
75
+ const inputWithEscapedBlocks = escapeBlocks(input);
76
+ let nextBlockIndex = 0;
77
+ return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {
78
+ const selector = m[2];
79
+ let content = '';
80
+ let suffix = m[4];
81
+ let contentPrefix = '';
82
+ if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) {
83
+ content = inputWithEscapedBlocks.blocks[nextBlockIndex++];
84
+ suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);
85
+ contentPrefix = '{';
86
+ }
87
+ const cssRule = {
88
+ selector,
89
+ content,
90
+ };
91
+ const rule = ruleCallback(cssRule);
92
+ return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;
93
+ });
94
+ };
95
+ const escapeBlocks = (input) => {
96
+ const inputParts = input.split(_curlyRe);
97
+ const resultParts = [];
98
+ const escapedBlocks = [];
99
+ let bracketCount = 0;
100
+ let currentBlockParts = [];
101
+ for (let partIndex = 0; partIndex < inputParts.length; partIndex++) {
102
+ const part = inputParts[partIndex];
103
+ if (part === CLOSE_CURLY) {
104
+ bracketCount--;
105
+ }
106
+ if (bracketCount > 0) {
107
+ currentBlockParts.push(part);
108
+ }
109
+ else {
110
+ if (currentBlockParts.length > 0) {
111
+ escapedBlocks.push(currentBlockParts.join(''));
112
+ resultParts.push(BLOCK_PLACEHOLDER);
113
+ currentBlockParts = [];
114
+ }
115
+ resultParts.push(part);
116
+ }
117
+ if (part === OPEN_CURLY) {
118
+ bracketCount++;
119
+ }
120
+ }
121
+ if (currentBlockParts.length > 0) {
122
+ escapedBlocks.push(currentBlockParts.join(''));
123
+ resultParts.push(BLOCK_PLACEHOLDER);
124
+ }
125
+ const strEscapedBlocks = {
126
+ escapedString: resultParts.join(''),
127
+ blocks: escapedBlocks,
128
+ };
129
+ return strEscapedBlocks;
130
+ };
131
+ const insertPolyfillHostInCssText = (selector) => {
132
+ selector = selector
133
+ .replace(_colonHostContextRe, _polyfillHostContext)
134
+ .replace(_colonHostRe, _polyfillHost)
135
+ .replace(_colonSlottedRe, _polyfillSlotted);
136
+ return selector;
137
+ };
138
+ const convertColonRule = (cssText, regExp, partReplacer) => {
139
+ // m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule
140
+ return cssText.replace(regExp, (...m) => {
141
+ if (m[2]) {
142
+ const parts = m[2].split(',');
143
+ const r = [];
144
+ for (let i = 0; i < parts.length; i++) {
145
+ const p = parts[i].trim();
146
+ if (!p)
147
+ break;
148
+ r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));
149
+ }
150
+ return r.join(',');
151
+ }
152
+ else {
153
+ return _polyfillHostNoCombinator + m[3];
154
+ }
155
+ });
156
+ };
157
+ const colonHostPartReplacer = (host, part, suffix) => {
158
+ return host + part.replace(_polyfillHost, '') + suffix;
159
+ };
160
+ const convertColonHost = (cssText) => {
161
+ return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer);
162
+ };
163
+ const colonHostContextPartReplacer = (host, part, suffix) => {
164
+ if (part.indexOf(_polyfillHost) > -1) {
165
+ return colonHostPartReplacer(host, part, suffix);
166
+ }
167
+ else {
168
+ return host + part + suffix + ', ' + part + ' ' + host + suffix;
169
+ }
170
+ };
171
+ const convertColonSlotted = (cssText, slotScopeId) => {
172
+ const slotClass = '.' + slotScopeId + ' > ';
173
+ const selectors = [];
174
+ cssText = cssText.replace(_cssColonSlottedRe, (...m) => {
175
+ if (m[2]) {
176
+ const compound = m[2].trim();
177
+ const suffix = m[3];
178
+ const slottedSelector = slotClass + compound + suffix;
179
+ let prefixSelector = '';
180
+ for (let i = m[4] - 1; i >= 0; i--) {
181
+ const char = m[5][i];
182
+ if (char === '}' || char === ',') {
183
+ break;
184
+ }
185
+ prefixSelector = char + prefixSelector;
186
+ }
187
+ const orgSelector = prefixSelector + slottedSelector;
188
+ const addedSelector = `${prefixSelector.trimRight()}${slottedSelector.trim()}`;
189
+ if (orgSelector.trim() !== addedSelector.trim()) {
190
+ const updatedSelector = `${addedSelector}, ${orgSelector}`;
191
+ selectors.push({
192
+ orgSelector,
193
+ updatedSelector,
194
+ });
195
+ }
196
+ return slottedSelector;
197
+ }
198
+ else {
199
+ return _polyfillHostNoCombinator + m[3];
200
+ }
201
+ });
202
+ return {
203
+ selectors,
204
+ cssText,
205
+ };
206
+ };
207
+ const convertColonHostContext = (cssText) => {
208
+ return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer);
209
+ };
210
+ const convertShadowDOMSelectors = (cssText) => {
211
+ return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, ' '), cssText);
212
+ };
213
+ const makeScopeMatcher = (scopeSelector) => {
214
+ const lre = /\[/g;
215
+ const rre = /\]/g;
216
+ scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]');
217
+ return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');
218
+ };
219
+ const selectorNeedsScoping = (selector, scopeSelector) => {
220
+ const re = makeScopeMatcher(scopeSelector);
221
+ return !re.test(selector);
222
+ };
223
+ const injectScopingSelector = (selector, scopingSelector) => {
224
+ return selector.replace(_selectorPartsRe, (_, before = '', _colonGroup, colon = '', after = '') => {
225
+ return before + scopingSelector + colon + after;
226
+ });
227
+ };
228
+ const applySimpleSelectorScope = (selector, scopeSelector, hostSelector) => {
229
+ // In Android browser, the lastIndex is not reset when the regex is used in String.replace()
230
+ _polyfillHostRe.lastIndex = 0;
231
+ if (_polyfillHostRe.test(selector)) {
232
+ const replaceBy = `.${hostSelector}`;
233
+ return selector
234
+ .replace(_polyfillHostNoCombinatorRe, (_, selector) => injectScopingSelector(selector, replaceBy))
235
+ .replace(_polyfillHostRe, replaceBy + ' ');
236
+ }
237
+ return scopeSelector + ' ' + selector;
238
+ };
239
+ const applyStrictSelectorScope = (selector, scopeSelector, hostSelector) => {
240
+ const isRe = /\[is=([^\]]*)\]/g;
241
+ scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]);
242
+ const className = '.' + scopeSelector;
243
+ const _scopeSelectorPart = (p) => {
244
+ let scopedP = p.trim();
245
+ if (!scopedP) {
246
+ return '';
247
+ }
248
+ if (p.indexOf(_polyfillHostNoCombinator) > -1) {
249
+ scopedP = applySimpleSelectorScope(p, scopeSelector, hostSelector);
250
+ }
251
+ else {
252
+ // remove :host since it should be unnecessary
253
+ const t = p.replace(_polyfillHostRe, '');
254
+ if (t.length > 0) {
255
+ scopedP = injectScopingSelector(t, className);
256
+ }
257
+ }
258
+ return scopedP;
259
+ };
260
+ const safeContent = safeSelector(selector);
261
+ selector = safeContent.content;
262
+ let scopedSelector = '';
263
+ let startIndex = 0;
264
+ let res;
265
+ const sep = /( |>|\+|~(?!=))\s*/g;
266
+ // If a selector appears before :host it should not be shimmed as it
267
+ // matches on ancestor elements and not on elements in the host's shadow
268
+ // `:host-context(div)` is transformed to
269
+ // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator`
270
+ // the `div` is not part of the component in the 2nd selectors and should not be scoped.
271
+ // Historically `component-tag:host` was matching the component so we also want to preserve
272
+ // this behavior to avoid breaking legacy apps (it should not match).
273
+ // The behavior should be:
274
+ // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything)
275
+ // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a
276
+ // `:host-context(tag)`)
277
+ const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;
278
+ // Only scope parts after the first `-shadowcsshost-no-combinator` when it is present
279
+ let shouldScope = !hasHost;
280
+ while ((res = sep.exec(selector)) !== null) {
281
+ const separator = res[1];
282
+ const part = selector.slice(startIndex, res.index).trim();
283
+ shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
284
+ const scopedPart = shouldScope ? _scopeSelectorPart(part) : part;
285
+ scopedSelector += `${scopedPart} ${separator} `;
286
+ startIndex = sep.lastIndex;
287
+ }
288
+ const part = selector.substring(startIndex);
289
+ shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
290
+ scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
291
+ // replace the placeholders with their original values
292
+ return restoreSafeSelector(safeContent.placeholders, scopedSelector);
293
+ };
294
+ const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => {
295
+ return selector
296
+ .split(',')
297
+ .map((shallowPart) => {
298
+ if (slotSelector && shallowPart.indexOf('.' + slotSelector) > -1) {
299
+ return shallowPart.trim();
300
+ }
301
+ if (selectorNeedsScoping(shallowPart, scopeSelectorText)) {
302
+ return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim();
303
+ }
304
+ else {
305
+ return shallowPart.trim();
306
+ }
307
+ })
308
+ .join(', ');
309
+ };
310
+ const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
311
+ return processRules(cssText, (rule) => {
312
+ let selector = rule.selector;
313
+ let content = rule.content;
314
+ if (rule.selector[0] !== '@') {
315
+ selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector);
316
+ }
317
+ else if (rule.selector.startsWith('@media') ||
318
+ rule.selector.startsWith('@supports') ||
319
+ rule.selector.startsWith('@page') ||
320
+ rule.selector.startsWith('@document')) {
321
+ content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector);
322
+ }
323
+ const cssRule = {
324
+ selector: selector.replace(/\s{2,}/g, ' ').trim(),
325
+ content,
326
+ };
327
+ return cssRule;
328
+ });
329
+ };
330
+ const scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) => {
331
+ cssText = insertPolyfillHostInCssText(cssText);
332
+ cssText = convertColonHost(cssText);
333
+ cssText = convertColonHostContext(cssText);
334
+ const slotted = convertColonSlotted(cssText, slotScopeId);
335
+ cssText = slotted.cssText;
336
+ cssText = convertShadowDOMSelectors(cssText);
337
+ if (scopeId) {
338
+ cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId);
339
+ }
340
+ cssText = cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`);
341
+ cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, ' $1 ');
342
+ return {
343
+ cssText: cssText.trim(),
344
+ slottedSelectors: slotted.selectors,
345
+ };
346
+ };
347
+ const scopeCss = (cssText, scopeId, commentOriginalSelector) => {
348
+ const hostScopeId = scopeId + '-h';
349
+ const slotScopeId = scopeId + '-s';
350
+ const commentsWithHash = extractCommentsWithHash(cssText);
351
+ cssText = stripComments(cssText);
352
+ const orgSelectors = [];
353
+ if (commentOriginalSelector) {
354
+ const processCommentedSelector = (rule) => {
355
+ const placeholder = `/*!@___${orgSelectors.length}___*/`;
356
+ const comment = `/*!@${rule.selector}*/`;
357
+ orgSelectors.push({ placeholder, comment });
358
+ rule.selector = placeholder + rule.selector;
359
+ return rule;
360
+ };
361
+ cssText = processRules(cssText, (rule) => {
362
+ if (rule.selector[0] !== '@') {
363
+ return processCommentedSelector(rule);
364
+ }
365
+ else if (rule.selector.startsWith('@media') ||
366
+ rule.selector.startsWith('@supports') ||
367
+ rule.selector.startsWith('@page') ||
368
+ rule.selector.startsWith('@document')) {
369
+ rule.content = processRules(rule.content, processCommentedSelector);
370
+ return rule;
371
+ }
372
+ return rule;
373
+ });
374
+ }
375
+ const scoped = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId);
376
+ cssText = [scoped.cssText, ...commentsWithHash].join('\n');
377
+ if (commentOriginalSelector) {
378
+ orgSelectors.forEach(({ placeholder, comment }) => {
379
+ cssText = cssText.replace(placeholder, comment);
380
+ });
381
+ }
382
+ scoped.slottedSelectors.forEach((slottedSelector) => {
383
+ cssText = cssText.replace(slottedSelector.orgSelector, slottedSelector.updatedSelector);
384
+ });
385
+ return cssText;
386
+ };
387
+
388
+ export { scopeCss };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface CatButton extends Components.CatButton, HTMLElement {}
4
+ export const CatButton: {
5
+ prototype: CatButton;
6
+ new (): CatButton;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface CatIcon extends Components.CatIcon, HTMLElement {}
4
+ export const CatIcon: {
5
+ prototype: CatIcon;
6
+ new (): CatIcon;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface CatSpinner extends Components.CatSpinner, HTMLElement {}
4
+ export const CatSpinner: {
5
+ prototype: CatSpinner;
6
+ new (): CatSpinner;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,26 @@
1
+ /* catalyst custom elements */
2
+
3
+ import type { Components, JSX } from "../types/components";
4
+
5
+ /**
6
+ * Used to manually set the base path where assets can be found.
7
+ * If the script is used as "module", it's recommended to use "import.meta.url",
8
+ * such as "setAssetPath(import.meta.url)". Other options include
9
+ * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
10
+ * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
11
+ * But do note that this configuration depends on how your script is bundled, or lack of
12
+ * bunding, and where your assets can be loaded from. Additionally custom bundling
13
+ * will have to ensure the static assets are copied to its build directory.
14
+ */
15
+ export declare const setAssetPath: (path: string) => void;
16
+
17
+ export interface SetPlatformOptions {
18
+ raf?: (c: FrameRequestCallback) => number;
19
+ ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
20
+ rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
21
+ }
22
+ export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
23
+
24
+ export type { Components, JSX };
25
+
26
+ export * from '../types';
@@ -0,0 +1,123 @@
1
+ import { EventEmitter } from '../../stencil-public-runtime';
2
+ import { Breakpoint } from '../../utils/breakpoints';
3
+ /**
4
+ * Buttons are used for interface actions.
5
+ *
6
+ * @part button - The native anchor or button element.
7
+ * @part content - The textual content of the button.
8
+ * @part prefix - The prefix icon.
9
+ * @part suffix - The suffix icon.
10
+ */
11
+ export declare class CatButton {
12
+ private button;
13
+ private mediaMatcher?;
14
+ private mediaQueryList?;
15
+ private mediaQueryListener?;
16
+ _iconOnly: boolean;
17
+ /**
18
+ * The rendering style of the button.
19
+ */
20
+ variant: 'filled' | 'outlined' | 'text';
21
+ /**
22
+ * The color palette of the button.
23
+ */
24
+ color: 'primary' | 'secondary' | 'danger' | 'success' | 'warning';
25
+ /**
26
+ * The size of the button.
27
+ */
28
+ size: 'xs' | 's' | 'm' | 'l' | 'xl';
29
+ /**
30
+ * The name of the button, which gets paired with the button's value when
31
+ * submitted as part of a form. Corresponds with the native HTML name
32
+ * attribute.
33
+ */
34
+ name?: string;
35
+ /**
36
+ * The value of the button, which gets paired with the button's name when
37
+ * submitted as part of a form. Corresponds with the native HTML value
38
+ * attribute.
39
+ */
40
+ value?: string;
41
+ /**
42
+ * Specifies that the button should be disabled. A disabled button is unusable
43
+ * and un-clickable. Corresponds with the native HTML disabled attribute.
44
+ */
45
+ disabled: boolean;
46
+ /**
47
+ * Displays the button in a loading state with a spinner. Just like a disabled
48
+ * button, an inactive button is unusable and un-clickable. However, it
49
+ * retains the current focus state.
50
+ */
51
+ loading: boolean;
52
+ /**
53
+ * Allows the button to submit a form.
54
+ */
55
+ submit: boolean;
56
+ /**
57
+ * Ellipse overflowing button content.
58
+ */
59
+ ellipsed: boolean;
60
+ /**
61
+ * Use round button edges.
62
+ */
63
+ round: boolean;
64
+ /**
65
+ * A destination to link to, rendered in the href attribute of a link.
66
+ */
67
+ url?: string;
68
+ /**
69
+ * Specifies where to open the linked document.
70
+ */
71
+ urlTarget?: '_blank' | '_self';
72
+ /**
73
+ * The name of an icon to be displayed in the button.
74
+ */
75
+ icon?: string;
76
+ /**
77
+ * Hide the actual button content and only display the icon.
78
+ */
79
+ iconOnly: boolean | Breakpoint;
80
+ /**
81
+ * Display the icon as a suffix.
82
+ */
83
+ iconSuffix: boolean;
84
+ /**
85
+ * Adds a unique identifier for the button. Please note that with this
86
+ * particular component this ID is added inside the web component. If you need
87
+ * an ID on the HTML element, use the regular `id` attribute instead.
88
+ */
89
+ buttonId?: string;
90
+ /**
91
+ * Adds accessible label for the button that is only shown for screen
92
+ * readers. Typically, this label text replaces the visible text on the
93
+ * button for users who use assistive technology.
94
+ */
95
+ a11yLabel?: string;
96
+ onIconOnlyChanged(value: boolean | Breakpoint): void;
97
+ /**
98
+ * Emitted when the button received focus.
99
+ */
100
+ catFocus: EventEmitter<FocusEvent>;
101
+ /**
102
+ * Emitted when the button loses focus.
103
+ */
104
+ catBlur: EventEmitter<FocusEvent>;
105
+ componentWillLoad(): void;
106
+ componentWillRender(): void;
107
+ haltDisabledEvents(event: Event): void;
108
+ /**
109
+ * Sets focus on the button. Use this method instead of `button.focus()`.
110
+ *
111
+ * @param options An optional object providing options to control aspects of
112
+ * the focusing process.
113
+ */
114
+ setFocus(options?: FocusOptions): Promise<void>;
115
+ render(): any;
116
+ private get iconSize();
117
+ private get isIconButton();
118
+ private get hasPrefixIcon();
119
+ private get hasSuffixIcon();
120
+ private get content();
121
+ private onFocus;
122
+ private onBlur;
123
+ }
@@ -0,0 +1,15 @@
1
+ export declare class CatIconRegistry {
2
+ private static instance;
3
+ private readonly icons;
4
+ private constructor();
5
+ static getInstance(): CatIconRegistry;
6
+ getIcon(name: string, setName?: string): string | undefined;
7
+ addIcon(name: string, data: string, setName?: string): void;
8
+ addIcons(icons: {
9
+ [name: string]: string;
10
+ }, setName?: string): void;
11
+ removeIcon(name: string, setName?: string): void;
12
+ removeIcons(names: string[], setName?: string): void;
13
+ private buildName;
14
+ private buildEvent;
15
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Icons are used to provide additional meaning or in places where text label
3
+ * doesn't fit.
4
+ *
5
+ * @part icon - The native span element wrapping the SVG icon.
6
+ */
7
+ export declare class CatIcon {
8
+ private readonly iconRegistry;
9
+ /**
10
+ * The name of the icon.
11
+ */
12
+ icon: string;
13
+ /**
14
+ * The size of the icon.
15
+ */
16
+ size: 'xs' | 's' | 'm' | 'l' | 'xl' | 'inline';
17
+ /**
18
+ * Adds accessible label for the icon that is only shown for screen
19
+ * readers. The `aria-hidden` attribute will be set if no label is present.
20
+ */
21
+ a11yLabel?: string;
22
+ render(): any;
23
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Spinners are used to indicate users that their action is being processed.
3
+ */
4
+ export declare class CatSpinner {
5
+ /**
6
+ * The size of the spinner.
7
+ */
8
+ size: 'xs' | 's' | 'm' | 'l' | 'xl' | 'inline';
9
+ /**
10
+ * Adds accessible label for the spinner that is only shown for screen
11
+ * readers. The `aria-hidden` attribute will be set if no label is present.
12
+ */
13
+ a11yLabel?: string;
14
+ render(): any;
15
+ }