tyrell-components 1.0.0-TC52 → 1.0.0-TC53

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 (105) hide show
  1. package/css/tyrell-theme.css +25 -2
  2. package/css/tyrell.css +4 -0
  3. package/dist/tyrell-colors-static.css +1 -316
  4. package/dist/tyrell-theme.css +1 -1443
  5. package/dist/tyrell.css +1 -1390
  6. package/dist/tyrell.js +1 -1
  7. package/lib/base/ty-component.js +196 -196
  8. package/lib/components/button.d.ts +1 -1
  9. package/lib/components/button.js +260 -259
  10. package/lib/components/calendar-month.d.ts +2 -2
  11. package/lib/components/calendar-month.js +426 -416
  12. package/lib/components/calendar-navigation.js +238 -238
  13. package/lib/components/calendar.js +605 -602
  14. package/lib/components/checkbox.d.ts +1 -1
  15. package/lib/components/checkbox.js +273 -272
  16. package/lib/components/copy.d.ts +1 -1
  17. package/lib/components/copy.js +279 -278
  18. package/lib/components/date-picker.d.ts +1 -1
  19. package/lib/components/date-picker.js +1103 -1108
  20. package/lib/components/file-upload.js +404 -404
  21. package/lib/components/icon.js +141 -141
  22. package/lib/components/input.d.ts +1 -1
  23. package/lib/components/input.js +593 -596
  24. package/lib/components/modal.js +319 -319
  25. package/lib/components/option.js +167 -167
  26. package/lib/components/popup.js +233 -233
  27. package/lib/components/radio.d.ts +2 -2
  28. package/lib/components/radio.js +407 -406
  29. package/lib/components/resize-observer.js +67 -67
  30. package/lib/components/scroll-container.js +294 -294
  31. package/lib/components/select.d.ts +1 -1
  32. package/lib/components/select.js +1524 -1532
  33. package/lib/components/selected-tags.js +184 -184
  34. package/lib/components/step.js +62 -62
  35. package/lib/components/switch.d.ts +1 -1
  36. package/lib/components/switch.js +214 -213
  37. package/lib/components/tab.js +62 -62
  38. package/lib/components/tabs.js +507 -507
  39. package/lib/components/tag.d.ts +1 -1
  40. package/lib/components/tag.js +236 -235
  41. package/lib/components/textarea.d.ts +1 -1
  42. package/lib/components/textarea.js +457 -456
  43. package/lib/components/tooltip.js +283 -283
  44. package/lib/components/wizard.js +384 -384
  45. package/lib/icons/heroicons/micro.js +392 -392
  46. package/lib/icons/heroicons/mini.js +382 -382
  47. package/lib/icons/heroicons/outline.js +337 -337
  48. package/lib/icons/heroicons/solid.js +407 -407
  49. package/lib/icons/lucide.js +22843 -22843
  50. package/lib/icons/material/filled.js +9653 -9653
  51. package/lib/icons/material/outlined.js +10271 -10271
  52. package/lib/icons/material/round.js +10495 -10495
  53. package/lib/icons/material/sharp.js +9905 -9905
  54. package/lib/icons/material/two-tone.js +12792 -12792
  55. package/lib/index.js +21 -21
  56. package/lib/styles/button.js +176 -288
  57. package/lib/styles/calendar-month.js +123 -183
  58. package/lib/styles/calendar-navigation.js +60 -79
  59. package/lib/styles/calendar.js +8 -9
  60. package/lib/styles/checkbox.js +45 -72
  61. package/lib/styles/copy.js +67 -91
  62. package/lib/styles/custom-scrollbar.js +80 -100
  63. package/lib/styles/date-picker.js +261 -331
  64. package/lib/styles/field-size.d.ts +6 -0
  65. package/lib/styles/field-size.js +91 -0
  66. package/lib/styles/file-upload.js +139 -169
  67. package/lib/styles/icon.js +92 -156
  68. package/lib/styles/input.js +125 -241
  69. package/lib/styles/modal.js +67 -102
  70. package/lib/styles/option.d.ts +1 -1
  71. package/lib/styles/option.js +47 -67
  72. package/lib/styles/popup.js +34 -65
  73. package/lib/styles/radio.js +69 -96
  74. package/lib/styles/resize-observer.js +2 -5
  75. package/lib/styles/scroll-container.js +100 -130
  76. package/lib/styles/select-base.js +525 -778
  77. package/lib/styles/select.js +140 -228
  78. package/lib/styles/step.js +22 -29
  79. package/lib/styles/switch.js +34 -55
  80. package/lib/styles/tab.js +22 -29
  81. package/lib/styles/tabs.js +171 -252
  82. package/lib/styles/tag.js +135 -188
  83. package/lib/styles/textarea.d.ts +1 -1
  84. package/lib/styles/textarea.js +205 -271
  85. package/lib/styles/tooltip.js +3 -3
  86. package/lib/styles/wizard.js +170 -226
  87. package/lib/types/common.d.ts +2 -0
  88. package/lib/types/common.js +6 -5
  89. package/lib/utils/calendar-utils.js +100 -100
  90. package/lib/utils/custom-scrollbar.js +272 -272
  91. package/lib/utils/flavor-sheet.js +14 -14
  92. package/lib/utils/icon-registry.js +127 -127
  93. package/lib/utils/loader-registry.js +3 -3
  94. package/lib/utils/locale.js +34 -34
  95. package/lib/utils/mobile.js +1 -1
  96. package/lib/utils/number-format.js +54 -54
  97. package/lib/utils/positioning.js +212 -212
  98. package/lib/utils/property-capture.js +36 -36
  99. package/lib/utils/property-manager.js +125 -125
  100. package/lib/utils/resize-observer.js +23 -23
  101. package/lib/utils/scroll-lock.js +57 -57
  102. package/lib/utils/styles.js +17 -17
  103. package/lib/version.d.ts +1 -1
  104. package/lib/version.js +1 -1
  105. package/package.json +4 -4
@@ -1,3 +1,4 @@
1
+ import { DEFAULT_SIZE } from '../types/common.js';
1
2
  import { TyComponent } from '../base/ty-component.js';
2
3
  import { ensureStyles } from '../utils/styles.js';
3
4
  import { syncCustomFlavorSheet } from '../utils/flavor-sheet.js';
@@ -8,289 +9,289 @@ const CHECK_ICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" width="24" heigh
8
9
  const ERROR_ICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>`;
9
10
  import { REQUIRED_ICON_SVG } from '../utils/icons.js';
10
11
  export class TyCopy extends TyComponent {
11
- constructor() {
12
- super();
13
- this._copyTimeout = null;
14
- this._showingSuccess = false;
15
- this._customFlavorSheet = null;
16
- ensureStyles(this.shadowRoot, { css: inputStyles, id: 'ty-input' });
17
- ensureStyles(this.shadowRoot, { css: copyStyles, id: 'ty-copy' });
18
- }
19
- onConnect() {
20
- this._syncCustomFlavor();
21
- }
22
- _syncCustomFlavor() {
23
- this._customFlavorSheet = syncCustomFlavorSheet(this.shadowRoot, this._customFlavorSheet, this.flavor, ({ base }) => copyCustomFlavorCss(base));
24
- }
25
- onDisconnect() {
26
- if (this._copyTimeout !== null) {
27
- clearTimeout(this._copyTimeout);
28
- this._copyTimeout = null;
29
- }
30
- }
31
- onPropertiesChanged(changes) {
32
- if (changes.some((c) => c.name === 'flavor')) {
33
- this._syncCustomFlavor();
34
- }
35
- }
36
- buildClassList() {
37
- const classes = [this.size];
38
- if (this.disabled)
39
- classes.push('disabled');
40
- if (this.required)
41
- classes.push('required');
42
- return classes.join(' ');
43
- }
44
- async copyToClipboard() {
45
- if (this.disabled || !this.value)
46
- return;
47
- try {
48
- await navigator.clipboard.writeText(this.value);
49
- this.dispatchEvent(new CustomEvent('copy-success', {
50
- detail: { value: this.value },
51
- bubbles: true,
52
- composed: true
53
- }));
54
- }
55
- catch (err) {
56
- try {
57
- const textarea = document.createElement('textarea');
58
- textarea.value = this.value;
59
- textarea.style.position = 'fixed';
60
- textarea.style.opacity = '0';
61
- document.body.appendChild(textarea);
62
- textarea.select();
63
- document.execCommand('copy');
64
- document.body.removeChild(textarea);
65
- this.dispatchEvent(new CustomEvent('copy-success', {
66
- detail: { value: this.value },
67
- bubbles: true,
68
- composed: true
69
- }));
70
- }
71
- catch (fallbackErr) {
72
- console.error('[ty-copy] Failed to copy:', fallbackErr);
73
- this.dispatchEvent(new CustomEvent('copy-error', {
74
- detail: { error: fallbackErr },
75
- bubbles: true,
76
- composed: true
77
- }));
78
- this.showCopyError();
79
- return;
80
- }
81
- }
82
- this.showCopySuccess();
83
- }
84
- showCopySuccess() {
85
- if (this._copyTimeout !== null) {
86
- clearTimeout(this._copyTimeout);
87
- }
88
- this._showingSuccess = true;
89
- const copyButton = this.shadowRoot.querySelector('.copy-button');
90
- if (copyButton) {
91
- copyButton.classList.add('success');
92
- copyButton.innerHTML = CHECK_ICON_SVG;
93
- copyButton.setAttribute('aria-label', 'Copied!');
94
- }
95
- this._copyTimeout = window.setTimeout(() => {
96
- this._showingSuccess = false;
97
- const btn = this.shadowRoot.querySelector('.copy-button');
98
- if (btn) {
99
- btn.classList.remove('success');
100
- btn.innerHTML = COPY_ICON_SVG;
101
- btn.setAttribute('aria-label', 'Copy to clipboard');
102
- }
103
- this._copyTimeout = null;
104
- }, 2000);
105
- }
106
- showCopyError() {
107
- if (this._copyTimeout !== null) {
108
- clearTimeout(this._copyTimeout);
109
- }
110
- this._showingSuccess = false;
111
- const copyButton = this.shadowRoot.querySelector('.copy-button');
112
- if (copyButton) {
113
- copyButton.classList.add('error');
114
- copyButton.innerHTML = ERROR_ICON_SVG;
115
- copyButton.setAttribute('aria-label', 'Copy failed');
116
- }
117
- this._copyTimeout = window.setTimeout(() => {
118
- const btn = this.shadowRoot.querySelector('.copy-button');
119
- if (btn) {
120
- btn.classList.remove('error');
121
- btn.innerHTML = COPY_ICON_SVG;
122
- btn.setAttribute('aria-label', 'Copy to clipboard');
123
- }
124
- this._copyTimeout = null;
125
- }, 2000);
126
- }
127
- setupEventListeners() {
128
- const shadow = this.shadowRoot;
129
- const inputWrapper = shadow.querySelector('.input-wrapper');
130
- const copyButton = shadow.querySelector('.copy-button');
131
- if (inputWrapper && !this.disabled) {
132
- const wrapperEl = inputWrapper;
133
- wrapperEl.addEventListener('click', (e) => {
134
- if (e.target === copyButton || e.target.closest('.copy-button')) {
135
- return;
136
- }
137
- this.copyToClipboard();
138
- });
139
- wrapperEl.style.cursor = 'pointer';
140
- }
141
- if (copyButton) {
142
- copyButton.addEventListener('click', () => {
143
- this.copyToClipboard();
144
- });
145
- }
146
- }
147
- render() {
148
- const shadow = this.shadowRoot;
149
- const classes = this.buildClassList();
150
- const valueClass = [
151
- 'copy-field-value',
152
- this.multiline ? 'multiline' : '',
153
- this.horizontalScroll ? 'horizontal-scroll' : '',
154
- ].filter(Boolean).join(' ');
155
- const displayElement = this.format === 'code'
156
- ? `<code class="${valueClass}">${this.value || ''}</code>`
157
- : `<div class="${valueClass}">${this.value || ''}</div>`;
158
- const labelHtml = this.label ? `
159
- <label class="ty-field-label">
160
- ${this.label}
161
- ${this.required ? `<span class="required-icon">${REQUIRED_ICON_SVG}</span>` : ''}
162
- </label>
163
- ` : '';
164
- shadow.innerHTML = `
165
- <div class="input-container">
166
- ${labelHtml}
167
- <div class="input-wrapper ${classes}">
168
- ${displayElement}
169
- <button class="copy-button${this._showingSuccess ? ' success' : ''}" type="button" aria-label="${this._showingSuccess ? 'Copied!' : 'Copy to clipboard'}" ${this.disabled ? 'disabled' : ''}>
170
- ${this._showingSuccess ? CHECK_ICON_SVG : COPY_ICON_SVG}
171
- </button>
172
- </div>
173
- </div>
174
- `;
175
- this.setupEventListeners();
176
- }
177
- get value() {
178
- return this.getProperty('value');
179
- }
180
- set value(val) {
181
- this.setProperty('value', val);
182
- }
183
- get label() {
184
- return this.getProperty('label');
185
- }
186
- set label(val) {
187
- this.setProperty('label', val);
188
- }
189
- get size() {
190
- return this.getProperty('size');
191
- }
192
- set size(value) {
193
- this.setProperty('size', value);
194
- }
195
- get flavor() {
196
- return this.getProperty('flavor');
197
- }
198
- set flavor(value) {
199
- this.setProperty('flavor', value);
200
- }
201
- get format() {
202
- return this.getProperty('format');
203
- }
204
- set format(value) {
205
- this.setProperty('format', value);
206
- }
207
- get multiline() {
208
- return this.getProperty('multiline');
209
- }
210
- set multiline(value) {
211
- this.setProperty('multiline', value);
212
- }
213
- get horizontalScroll() {
214
- return this.getProperty('horizontalScroll');
215
- }
216
- set horizontalScroll(value) {
217
- this.setProperty('horizontalScroll', value);
218
- }
219
- get disabled() {
220
- return this.getProperty('disabled');
221
- }
222
- set disabled(value) {
223
- this.setProperty('disabled', value);
224
- }
225
- get required() {
226
- return this.getProperty('required');
227
- }
228
- set required(value) {
229
- this.setProperty('required', value);
230
- }
12
+ constructor() {
13
+ super();
14
+ this._copyTimeout = null;
15
+ this._showingSuccess = false;
16
+ this._customFlavorSheet = null;
17
+ ensureStyles(this.shadowRoot, { css: inputStyles, id: 'ty-input' });
18
+ ensureStyles(this.shadowRoot, { css: copyStyles, id: 'ty-copy' });
19
+ }
20
+ onConnect() {
21
+ this._syncCustomFlavor();
22
+ }
23
+ _syncCustomFlavor() {
24
+ this._customFlavorSheet = syncCustomFlavorSheet(this.shadowRoot, this._customFlavorSheet, this.flavor, ({ base }) => copyCustomFlavorCss(base));
25
+ }
26
+ onDisconnect() {
27
+ if (this._copyTimeout !== null) {
28
+ clearTimeout(this._copyTimeout);
29
+ this._copyTimeout = null;
30
+ }
31
+ }
32
+ onPropertiesChanged(changes) {
33
+ if (changes.some((c) => c.name === 'flavor')) {
34
+ this._syncCustomFlavor();
35
+ }
36
+ }
37
+ buildClassList() {
38
+ const classes = [];
39
+ if (this.disabled)
40
+ classes.push('disabled');
41
+ if (this.required)
42
+ classes.push('required');
43
+ return classes.join(' ');
44
+ }
45
+ async copyToClipboard() {
46
+ if (this.disabled || !this.value)
47
+ return;
48
+ try {
49
+ await navigator.clipboard.writeText(this.value);
50
+ this.dispatchEvent(new CustomEvent('copy-success', {
51
+ detail: { value: this.value },
52
+ bubbles: true,
53
+ composed: true
54
+ }));
55
+ }
56
+ catch (err) {
57
+ try {
58
+ const textarea = document.createElement('textarea');
59
+ textarea.value = this.value;
60
+ textarea.style.position = 'fixed';
61
+ textarea.style.opacity = '0';
62
+ document.body.appendChild(textarea);
63
+ textarea.select();
64
+ document.execCommand('copy');
65
+ document.body.removeChild(textarea);
66
+ this.dispatchEvent(new CustomEvent('copy-success', {
67
+ detail: { value: this.value },
68
+ bubbles: true,
69
+ composed: true
70
+ }));
71
+ }
72
+ catch (fallbackErr) {
73
+ console.error('[ty-copy] Failed to copy:', fallbackErr);
74
+ this.dispatchEvent(new CustomEvent('copy-error', {
75
+ detail: { error: fallbackErr },
76
+ bubbles: true,
77
+ composed: true
78
+ }));
79
+ this.showCopyError();
80
+ return;
81
+ }
82
+ }
83
+ this.showCopySuccess();
84
+ }
85
+ showCopySuccess() {
86
+ if (this._copyTimeout !== null) {
87
+ clearTimeout(this._copyTimeout);
88
+ }
89
+ this._showingSuccess = true;
90
+ const copyButton = this.shadowRoot.querySelector('.copy-button');
91
+ if (copyButton) {
92
+ copyButton.classList.add('success');
93
+ copyButton.innerHTML = CHECK_ICON_SVG;
94
+ copyButton.setAttribute('aria-label', 'Copied!');
95
+ }
96
+ this._copyTimeout = window.setTimeout(() => {
97
+ this._showingSuccess = false;
98
+ const btn = this.shadowRoot.querySelector('.copy-button');
99
+ if (btn) {
100
+ btn.classList.remove('success');
101
+ btn.innerHTML = COPY_ICON_SVG;
102
+ btn.setAttribute('aria-label', 'Copy to clipboard');
103
+ }
104
+ this._copyTimeout = null;
105
+ }, 2000);
106
+ }
107
+ showCopyError() {
108
+ if (this._copyTimeout !== null) {
109
+ clearTimeout(this._copyTimeout);
110
+ }
111
+ this._showingSuccess = false;
112
+ const copyButton = this.shadowRoot.querySelector('.copy-button');
113
+ if (copyButton) {
114
+ copyButton.classList.add('error');
115
+ copyButton.innerHTML = ERROR_ICON_SVG;
116
+ copyButton.setAttribute('aria-label', 'Copy failed');
117
+ }
118
+ this._copyTimeout = window.setTimeout(() => {
119
+ const btn = this.shadowRoot.querySelector('.copy-button');
120
+ if (btn) {
121
+ btn.classList.remove('error');
122
+ btn.innerHTML = COPY_ICON_SVG;
123
+ btn.setAttribute('aria-label', 'Copy to clipboard');
124
+ }
125
+ this._copyTimeout = null;
126
+ }, 2000);
127
+ }
128
+ setupEventListeners() {
129
+ const shadow = this.shadowRoot;
130
+ const inputWrapper = shadow.querySelector('.input-wrapper');
131
+ const copyButton = shadow.querySelector('.copy-button');
132
+ if (inputWrapper && !this.disabled) {
133
+ const wrapperEl = inputWrapper;
134
+ wrapperEl.addEventListener('click', (e) => {
135
+ if (e.target === copyButton || e.target.closest('.copy-button')) {
136
+ return;
137
+ }
138
+ this.copyToClipboard();
139
+ });
140
+ wrapperEl.style.cursor = 'pointer';
141
+ }
142
+ if (copyButton) {
143
+ copyButton.addEventListener('click', () => {
144
+ this.copyToClipboard();
145
+ });
146
+ }
147
+ }
148
+ render() {
149
+ const shadow = this.shadowRoot;
150
+ const classes = this.buildClassList();
151
+ const valueClass = [
152
+ 'copy-field-value',
153
+ this.multiline ? 'multiline' : '',
154
+ this.horizontalScroll ? 'horizontal-scroll' : '',
155
+ ].filter(Boolean).join(' ');
156
+ const displayElement = this.format === 'code'
157
+ ? `<code class="${valueClass}">${this.value || ''}</code>`
158
+ : `<div class="${valueClass}">${this.value || ''}</div>`;
159
+ const labelHtml = this.label ? `
160
+ <label class="ty-field-label">
161
+ ${this.label}
162
+ ${this.required ? `<span class="required-icon">${REQUIRED_ICON_SVG}</span>` : ''}
163
+ </label>
164
+ ` : '';
165
+ shadow.innerHTML = `
166
+ <div class="input-container">
167
+ ${labelHtml}
168
+ <div class="input-wrapper ${classes}">
169
+ ${displayElement}
170
+ <button class="copy-button${this._showingSuccess ? ' success' : ''}" type="button" aria-label="${this._showingSuccess ? 'Copied!' : 'Copy to clipboard'}" ${this.disabled ? 'disabled' : ''}>
171
+ ${this._showingSuccess ? CHECK_ICON_SVG : COPY_ICON_SVG}
172
+ </button>
173
+ </div>
174
+ </div>
175
+ `;
176
+ this.setupEventListeners();
177
+ }
178
+ get value() {
179
+ return this.getProperty('value');
180
+ }
181
+ set value(val) {
182
+ this.setProperty('value', val);
183
+ }
184
+ get label() {
185
+ return this.getProperty('label');
186
+ }
187
+ set label(val) {
188
+ this.setProperty('label', val);
189
+ }
190
+ get size() {
191
+ return this.getProperty('size');
192
+ }
193
+ set size(value) {
194
+ this.setProperty('size', value);
195
+ }
196
+ get flavor() {
197
+ return this.getProperty('flavor');
198
+ }
199
+ set flavor(value) {
200
+ this.setProperty('flavor', value);
201
+ }
202
+ get format() {
203
+ return this.getProperty('format');
204
+ }
205
+ set format(value) {
206
+ this.setProperty('format', value);
207
+ }
208
+ get multiline() {
209
+ return this.getProperty('multiline');
210
+ }
211
+ set multiline(value) {
212
+ this.setProperty('multiline', value);
213
+ }
214
+ get horizontalScroll() {
215
+ return this.getProperty('horizontalScroll');
216
+ }
217
+ set horizontalScroll(value) {
218
+ this.setProperty('horizontalScroll', value);
219
+ }
220
+ get disabled() {
221
+ return this.getProperty('disabled');
222
+ }
223
+ set disabled(value) {
224
+ this.setProperty('disabled', value);
225
+ }
226
+ get required() {
227
+ return this.getProperty('required');
228
+ }
229
+ set required(value) {
230
+ this.setProperty('required', value);
231
+ }
231
232
  }
232
233
  TyCopy.formAssociated = true;
233
234
  TyCopy.properties = {
234
- value: {
235
- type: 'string',
236
- visual: true,
237
- formValue: true,
238
- default: '',
239
- },
240
- label: {
241
- type: 'string',
242
- visual: true,
243
- default: '',
244
- },
245
- size: {
246
- type: 'string',
247
- visual: true,
248
- default: 'md',
249
- validate: (v) => ['xs', 'sm', 'md', 'lg', 'xl'].includes(v),
250
- coerce: (v) => {
251
- if (!['xs', 'sm', 'md', 'lg', 'xl'].includes(v)) {
252
- console.warn(`[ty-copy] Invalid size '${v}'. Using 'md'.`);
253
- return 'md';
254
- }
255
- return v;
256
- },
257
- },
258
- flavor: {
259
- type: 'string',
260
- visual: true,
261
- default: 'neutral',
262
- },
263
- format: {
264
- type: 'string',
265
- visual: true,
266
- default: 'text',
267
- coerce: (v) => (v === 'code' ? 'code' : 'text'),
268
- },
269
- multiline: {
270
- type: 'boolean',
271
- visual: true,
272
- default: false,
273
- },
274
- horizontalScroll: {
275
- type: 'boolean',
276
- visual: true,
277
- default: false,
278
- },
279
- disabled: {
280
- type: 'boolean',
281
- visual: true,
282
- default: false,
283
- },
284
- required: {
285
- type: 'boolean',
286
- visual: true,
287
- default: false,
288
- },
235
+ value: {
236
+ type: 'string',
237
+ visual: true,
238
+ formValue: true,
239
+ default: '',
240
+ },
241
+ label: {
242
+ type: 'string',
243
+ visual: true,
244
+ default: '',
245
+ },
246
+ size: {
247
+ type: 'string',
248
+ visual: true,
249
+ default: DEFAULT_SIZE,
250
+ validate: (v) => ['xs', 'sm', 'md', 'lg', 'xl'].includes(v),
251
+ coerce: (v) => {
252
+ if (!['xs', 'sm', 'md', 'lg', 'xl'].includes(v)) {
253
+ console.warn(`[ty-copy] Invalid size '${v}'. Using '${DEFAULT_SIZE}'.`);
254
+ return DEFAULT_SIZE;
255
+ }
256
+ return v;
257
+ },
258
+ },
259
+ flavor: {
260
+ type: 'string',
261
+ visual: true,
262
+ default: 'neutral',
263
+ },
264
+ format: {
265
+ type: 'string',
266
+ visual: true,
267
+ default: 'text',
268
+ coerce: (v) => (v === 'code' ? 'code' : 'text'),
269
+ },
270
+ multiline: {
271
+ type: 'boolean',
272
+ visual: true,
273
+ default: false,
274
+ },
275
+ horizontalScroll: {
276
+ type: 'boolean',
277
+ visual: true,
278
+ default: false,
279
+ },
280
+ disabled: {
281
+ type: 'boolean',
282
+ visual: true,
283
+ default: false,
284
+ },
285
+ required: {
286
+ type: 'boolean',
287
+ visual: true,
288
+ default: false,
289
+ },
289
290
  };
290
291
  if (!customElements.get('ty-copy')) {
291
- customElements.define('ty-copy', TyCopy);
292
+ customElements.define('ty-copy', TyCopy);
292
293
  }
293
294
  if (!customElements.get('ty-copy-field')) {
294
- customElements.define('ty-copy-field', class TyCopyField extends TyCopy {
295
- });
295
+ customElements.define('ty-copy-field', class TyCopyField extends TyCopy {
296
+ });
296
297
  }
@@ -50,7 +50,7 @@ export declare class TyDatePicker extends TyComponent<DatePickerState> {
50
50
  size: {
51
51
  type: "string";
52
52
  visual: boolean;
53
- default: string;
53
+ default: import("../types/common.js").Size;
54
54
  validate: (v: any) => boolean;
55
55
  coerce: (v: any) => any;
56
56
  };