@krumio/trailhand-ui 1.8.0 → 1.9.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 +13 -13
- package/dist/components/action-menu/action-menu.js +12 -12
- package/dist/components/button/button.d.ts +4 -0
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +38 -22
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/checkbox/checkbox.d.ts +31 -0
- package/dist/components/checkbox/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.js +234 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/index.d.ts.map +1 -0
- package/dist/components/checkbox/index.js +2 -0
- package/dist/components/checkbox/index.js.map +1 -0
- package/dist/components/data-table/data-table.js +30 -30
- package/dist/components/icon/icon.d.ts +3 -3
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/icon.js +5 -15
- package/dist/components/icon/icon.js.map +1 -1
- package/dist/components/progress-bar/progress-bar.js +12 -12
- package/dist/components/selector/index.d.ts +2 -0
- package/dist/components/selector/index.d.ts.map +1 -0
- package/dist/components/selector/index.js +2 -0
- package/dist/components/selector/index.js.map +1 -0
- package/dist/components/selector/selector.d.ts +33 -0
- package/dist/components/selector/selector.d.ts.map +1 -0
- package/dist/components/selector/selector.js +225 -0
- package/dist/components/selector/selector.js.map +1 -0
- package/dist/components/text-input/index.d.ts +2 -0
- package/dist/components/text-input/index.d.ts.map +1 -0
- package/dist/components/text-input/index.js +2 -0
- package/dist/components/text-input/index.js.map +1 -0
- package/dist/components/text-input/text-input.d.ts +36 -0
- package/dist/components/text-input/text-input.d.ts.map +1 -0
- package/dist/components/text-input/text-input.js +216 -0
- package/dist/components/text-input/text-input.js.map +1 -0
- package/dist/components/th-tag/th-tag.js +15 -15
- package/dist/components/toggle-switch/toggle-switch.js +3 -3
- package/dist/styles/colors.css +160 -103
- package/package.json +2 -3
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html, css } from 'lit';
|
|
8
|
+
import { property } from 'lit/decorators.js';
|
|
9
|
+
export class TextInput extends LitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.name = '';
|
|
13
|
+
this.value = '';
|
|
14
|
+
this.placeholder = '';
|
|
15
|
+
this.disabled = false;
|
|
16
|
+
this.size = 'medium';
|
|
17
|
+
this.label = '';
|
|
18
|
+
this.required = false;
|
|
19
|
+
this.invalid = false;
|
|
20
|
+
this.internals = this.attachInternals();
|
|
21
|
+
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
super.connectedCallback();
|
|
24
|
+
// Check if we're in a disabled fieldset on initial connection
|
|
25
|
+
const fieldset = this.closest('fieldset');
|
|
26
|
+
if (fieldset?.disabled) {
|
|
27
|
+
this.disabled = true;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
emitChangeEvent() {
|
|
31
|
+
// emit native change event for form integration
|
|
32
|
+
this.dispatchEvent(new Event('change', { bubbles: true, composed: true }));
|
|
33
|
+
// emit a custom event with the current value of the input
|
|
34
|
+
this.dispatchEvent(new CustomEvent('text-input-change', {
|
|
35
|
+
detail: { value: this.value, name: this.name },
|
|
36
|
+
bubbles: true,
|
|
37
|
+
composed: true,
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
handleInput(e) {
|
|
41
|
+
const target = e.target;
|
|
42
|
+
this.value = target.value;
|
|
43
|
+
if (this.value) {
|
|
44
|
+
this.internals.setFormValue(this.value);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.internals.setFormValue(null);
|
|
48
|
+
}
|
|
49
|
+
this.emitChangeEvent();
|
|
50
|
+
}
|
|
51
|
+
firstUpdated() {
|
|
52
|
+
this._input = this.shadowRoot.querySelector('input');
|
|
53
|
+
this._input.addEventListener('input', () => {
|
|
54
|
+
this._updateValidity();
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
_updateValidity() {
|
|
58
|
+
const isValid = this._input.validity.valid;
|
|
59
|
+
this.invalid = !isValid;
|
|
60
|
+
if (isValid) {
|
|
61
|
+
this.internals.setValidity({});
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
this.internals.setValidity(this._input.validity, this._input.validationMessage, this._input);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
formResetCallback() {
|
|
68
|
+
this.value = '';
|
|
69
|
+
this.internals.setFormValue(this.value);
|
|
70
|
+
}
|
|
71
|
+
formDisableCallback(disabled) {
|
|
72
|
+
this.disabled = disabled;
|
|
73
|
+
}
|
|
74
|
+
formAssociatedCallback(form) {
|
|
75
|
+
form?.addEventListener('submit', () => {
|
|
76
|
+
this._updateValidity();
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
render() {
|
|
80
|
+
return html `
|
|
81
|
+
<div class="wrapper">
|
|
82
|
+
<label for=${this.name} class="input-label"
|
|
83
|
+
>${this.label}
|
|
84
|
+
<span class="required-indicator"
|
|
85
|
+
>${this.required ? '*' : ''}</span
|
|
86
|
+
></label
|
|
87
|
+
>
|
|
88
|
+
<div class="input-wrapper">
|
|
89
|
+
<input
|
|
90
|
+
type="text"
|
|
91
|
+
name=${this.name}
|
|
92
|
+
.value=${this.value}
|
|
93
|
+
placeholder=${this.placeholder}
|
|
94
|
+
?disabled=${this.disabled}
|
|
95
|
+
?required=${this.required}
|
|
96
|
+
@input=${this.handleInput}
|
|
97
|
+
/>
|
|
98
|
+
<span class="icon"><slot name="icon"></slot></span>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
`;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
TextInput.formAssociated = true;
|
|
105
|
+
TextInput.styles = css `
|
|
106
|
+
:host {
|
|
107
|
+
display: inline-block;
|
|
108
|
+
font-family: 'Montserrat', system-ui, sans-serif;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.wrapper {
|
|
112
|
+
display: flex;
|
|
113
|
+
flex-direction: column;
|
|
114
|
+
gap: 0.25rem;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
label {
|
|
118
|
+
font-size: 11px;
|
|
119
|
+
color: var(--th-input-label, #000000);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
label .required-indicator {
|
|
123
|
+
color: var(--th-color-red, #bf1e1e);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.input-wrapper {
|
|
127
|
+
position: relative;
|
|
128
|
+
display: flex;
|
|
129
|
+
align-items: center;
|
|
130
|
+
font-size: 14px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
input {
|
|
134
|
+
width: 100%;
|
|
135
|
+
padding: 0.75em 3em 0.75em 16px;
|
|
136
|
+
border-radius: 8px;
|
|
137
|
+
border: 1px solid var(--th-input-border, #d7d7d7);
|
|
138
|
+
outline: none;
|
|
139
|
+
background: transparent;
|
|
140
|
+
transition: 0.2s ease;
|
|
141
|
+
font-size: 14px;
|
|
142
|
+
color: var(--th-input-text, #333);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
input:disabled {
|
|
146
|
+
background-color: var(--th-input-bg, transparent);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
input::placeholder {
|
|
150
|
+
color: var(--th-input-placeholder, #d7d7d7);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
input:focus {
|
|
154
|
+
border-color: var(--th-input-focus-border, #005cb9);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.icon {
|
|
158
|
+
position: absolute;
|
|
159
|
+
right: 1em;
|
|
160
|
+
pointer-events: none;
|
|
161
|
+
color: var(--th-input-icon-color, #d7d7d7);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* Sizes */
|
|
165
|
+
:host([size='small']) .input-wrapper {
|
|
166
|
+
font-size: 12px;
|
|
167
|
+
}
|
|
168
|
+
:host([size='small']) input {
|
|
169
|
+
font-size: 12px;
|
|
170
|
+
}
|
|
171
|
+
:host([size='large']) .input-wrapper {
|
|
172
|
+
font-size: 16px;
|
|
173
|
+
}
|
|
174
|
+
:host([size='large']) input {
|
|
175
|
+
font-size: 16px;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* Disabled */
|
|
179
|
+
input:disabled {
|
|
180
|
+
cursor: not-allowed;
|
|
181
|
+
}
|
|
182
|
+
:host([disabled]) label {
|
|
183
|
+
color: var(--th-input-label-disabled, #999);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* Invalid */
|
|
187
|
+
:host([invalid]) input {
|
|
188
|
+
border-color: var(--th-input-border-invalid, #9f3a3a);
|
|
189
|
+
}
|
|
190
|
+
`;
|
|
191
|
+
__decorate([
|
|
192
|
+
property({ type: String })
|
|
193
|
+
], TextInput.prototype, "name", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
property({ type: String })
|
|
196
|
+
], TextInput.prototype, "value", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
property({ type: String })
|
|
199
|
+
], TextInput.prototype, "placeholder", void 0);
|
|
200
|
+
__decorate([
|
|
201
|
+
property({ type: Boolean, reflect: true })
|
|
202
|
+
], TextInput.prototype, "disabled", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
property({ type: String, reflect: true })
|
|
205
|
+
], TextInput.prototype, "size", void 0);
|
|
206
|
+
__decorate([
|
|
207
|
+
property({ type: String })
|
|
208
|
+
], TextInput.prototype, "label", void 0);
|
|
209
|
+
__decorate([
|
|
210
|
+
property({ type: Boolean })
|
|
211
|
+
], TextInput.prototype, "required", void 0);
|
|
212
|
+
__decorate([
|
|
213
|
+
property({ type: Boolean, reflect: true })
|
|
214
|
+
], TextInput.prototype, "invalid", void 0);
|
|
215
|
+
customElements.define('trailhand-text-input', TextInput);
|
|
216
|
+
//# sourceMappingURL=text-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-input.js","sourceRoot":"","sources":["../../../src/components/text-input/text-input.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAa7C,MAAM,OAAO,SAAU,SAAQ,UAAU;IA8BvC;QACE,KAAK,EAAE,CAAC;QA3BV,SAAI,GAAG,EAAE,CAAC;QAGV,UAAK,GAAG,EAAE,CAAC;QAGX,gBAAW,GAAG,EAAE,CAAC;QAGjB,aAAQ,GAAG,KAAK,CAAC;QAGjB,SAAI,GAAiC,QAAQ,CAAC;QAG9C,UAAK,GAAG,EAAE,CAAC;QAGX,aAAQ,GAAG,KAAK,CAAC;QAGjB,YAAO,GAAG,KAAK,CAAC;QAOd,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;IAC1C,CAAC;IAyFD,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,8DAA8D;QAC9D,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC1C,IAAI,QAAQ,EAAE,QAAQ,EAAE,CAAC;YACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACvB,CAAC;IACH,CAAC;IAEO,eAAe;QACrB,gDAAgD;QAChD,IAAI,CAAC,aA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C;wCAChB;AAGX;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CACV;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAC1B;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCACI;AAG9C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCAChB;AAGX;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CACX;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CAC3B;AAkMlB,cAAc,CAAC,MAAM,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC"}
|
|
@@ -154,28 +154,28 @@ ThTag.styles = css `
|
|
|
154
154
|
|
|
155
155
|
/* Color variants - soft pastel backgrounds with colored text */
|
|
156
156
|
.tag--default {
|
|
157
|
-
background-color: var(--color-background-hover, var(--color-grey-200, #EBEBEB));
|
|
158
|
-
color: var(--color-text-secondary, var(--color-grey-600, #636363));
|
|
157
|
+
background-color: var(--th-color-background-hover, var(--th-color-grey-200, #EBEBEB));
|
|
158
|
+
color: var(--th-color-text-secondary, var(--th-color-grey-600, #636363));
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
.tag--info {
|
|
162
|
-
background-color: var(--color-info-fill, var(--color-light-blue, #e6f3ff));
|
|
163
|
-
color: var(--color-info-outline, var(--color-blue, #0085ff));
|
|
162
|
+
background-color: var(--th-color-info-fill, var(--th-color-light-blue, #e6f3ff));
|
|
163
|
+
color: var(--th-color-info-outline, var(--th-color-blue, #0085ff));
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
.tag--success {
|
|
167
|
-
background-color: var(--color-success-fill, var(--color-light-green, #d2fdd2));
|
|
168
|
-
color: var(--color-success-outline, var(--color-green, #097409));
|
|
167
|
+
background-color: var(--th-color-success-fill, var(--th-color-light-green, #d2fdd2));
|
|
168
|
+
color: var(--th-color-success-outline, var(--th-color-green, #097409));
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
.tag--warning {
|
|
172
|
-
background-color: var(--color-warning-fill, var(--color-light-yellow, #fffeb4));
|
|
173
|
-
color: var(--color-warning-outline, var(--color-dark-yellow, #a89939));
|
|
172
|
+
background-color: var(--th-color-warning-fill, var(--th-color-light-yellow, #fffeb4));
|
|
173
|
+
color: var(--th-color-warning-outline, var(--th-color-dark-yellow, #a89939));
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
.tag--error {
|
|
177
|
-
background-color: var(--color-error-fill, var(--color-light-red, #fee2e2));
|
|
178
|
-
color: var(--color-error-outline, var(--color-red, #9F3A3A));
|
|
177
|
+
background-color: var(--th-color-error-fill, var(--th-color-light-red, #fee2e2));
|
|
178
|
+
color: var(--th-color-error-outline, var(--th-color-red, #9F3A3A));
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
/* Outlined variants */
|
|
@@ -186,27 +186,27 @@ ThTag.styles = css `
|
|
|
186
186
|
|
|
187
187
|
.tag--outlined.tag--default {
|
|
188
188
|
background-color: transparent;
|
|
189
|
-
color: var(--color-text-secondary, var(--color-grey-600, #4b5563));
|
|
189
|
+
color: var(--th-color-text-secondary, var(--th-color-grey-600, #4b5563));
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
.tag--outlined.tag--info {
|
|
193
193
|
background-color: transparent;
|
|
194
|
-
color: var(--color-info-outline, var(--color-blue, #0085ff));
|
|
194
|
+
color: var(--th-color-info-outline, var(--th-color-blue, #0085ff));
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
.tag--outlined.tag--success {
|
|
198
198
|
background-color: transparent;
|
|
199
|
-
color: var(--color-success-outline, var(--color-green, #097409));
|
|
199
|
+
color: var(--th-color-success-outline, var(--th-color-green, #097409));
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
.tag--outlined.tag--warning {
|
|
203
203
|
background-color: transparent;
|
|
204
|
-
color: var(--color-warning-outline, var(--color-dark-yellow, #a89939));
|
|
204
|
+
color: var(--th-color-warning-outline, var(--th-color-dark-yellow, #a89939));
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
.tag--outlined.tag--error {
|
|
208
208
|
background-color: transparent;
|
|
209
|
-
color: var(--color-error-outline, var(--color-red, #9F3A3A));
|
|
209
|
+
color: var(--th-color-error-outline, var(--th-color-red, #9F3A3A));
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
/* Icon styling */
|
|
@@ -127,7 +127,7 @@ ToggleSwitch.styles = css `
|
|
|
127
127
|
left: 0;
|
|
128
128
|
right: 0;
|
|
129
129
|
bottom: 0;
|
|
130
|
-
background-color: var(--color-grey-500, #8D8D8D);
|
|
130
|
+
background-color: var(--th-color-grey-500, #8D8D8D);
|
|
131
131
|
transition: 0.3s;
|
|
132
132
|
border-radius: 24px;
|
|
133
133
|
}
|
|
@@ -139,13 +139,13 @@ ToggleSwitch.styles = css `
|
|
|
139
139
|
width: 18px;
|
|
140
140
|
left: 3px;
|
|
141
141
|
bottom: 3px;
|
|
142
|
-
background-color: var(--color-white, #FFFFFF);
|
|
142
|
+
background-color: var(--th-color-white, #FFFFFF);
|
|
143
143
|
transition: 0.3s;
|
|
144
144
|
border-radius: 50%;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
input:checked + .slider {
|
|
148
|
-
background-color: var(--color-primary, #3d98d3);
|
|
148
|
+
background-color: var(--th-color-primary, #3d98d3);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
input:checked + .slider:before {
|
package/dist/styles/colors.css
CHANGED
|
@@ -3,160 +3,217 @@
|
|
|
3
3
|
* Based on Figma Design System Color Palette
|
|
4
4
|
*
|
|
5
5
|
* Usage: Import this file in your application root, then use CSS variables
|
|
6
|
-
* Example: color: var(--color-primary);
|
|
6
|
+
* Example: color: var(--th-color-primary);
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
:root {
|
|
10
10
|
/* Color Palette */
|
|
11
11
|
/* Primary Blues */
|
|
12
|
-
--color-primary: #0086FF; /* Primary brand color */
|
|
13
|
-
--color-light-primary: #e6f3ff; /* Light variant for backgrounds */
|
|
14
|
-
--color-dark-primary: #005cb9; /* Dark variant for buttons/links */
|
|
12
|
+
--th-color-primary: #0086FF; /* Primary brand color */
|
|
13
|
+
--th-color-light-primary: #e6f3ff; /* Light variant for backgrounds */
|
|
14
|
+
--th-color-dark-primary: #005cb9; /* Dark variant for buttons/links */
|
|
15
15
|
|
|
16
16
|
/* Black + White */
|
|
17
|
-
--color-black: #000000;
|
|
18
|
-
--color-white: #ffffff;
|
|
17
|
+
--th-color-black: #000000;
|
|
18
|
+
--th-color-white: #ffffff;
|
|
19
19
|
|
|
20
20
|
/* Greyscale */
|
|
21
|
-
--color-grey-100: #fafafa;
|
|
22
|
-
--color-grey-200: #ebebeb;
|
|
23
|
-
--color-grey-300: #d7d7d7;
|
|
24
|
-
--color-grey-400: #bababa;
|
|
25
|
-
--color-grey-500: #8d8d8d;
|
|
26
|
-
--color-grey-600: #636363;
|
|
27
|
-
--color-grey-700: #303131;
|
|
28
|
-
--color-grey-800: #212121;
|
|
21
|
+
--th-color-grey-100: #fafafa;
|
|
22
|
+
--th-color-grey-200: #ebebeb;
|
|
23
|
+
--th-color-grey-300: #d7d7d7;
|
|
24
|
+
--th-color-grey-400: #bababa;
|
|
25
|
+
--th-color-grey-500: #8d8d8d;
|
|
26
|
+
--th-color-grey-600: #636363;
|
|
27
|
+
--th-color-grey-700: #303131;
|
|
28
|
+
--th-color-grey-800: #212121;
|
|
29
29
|
|
|
30
30
|
/* Status Colors */
|
|
31
|
-
--color-light-red: #fee2e2;
|
|
32
|
-
--color-red: #9f3a3a;
|
|
33
|
-
--color-dark-red: #731616;
|
|
31
|
+
--th-color-light-red: #fee2e2;
|
|
32
|
+
--th-color-red: #9f3a3a;
|
|
33
|
+
--th-color-dark-red: #731616;
|
|
34
34
|
|
|
35
|
-
--color-light-green: #d2fdd2;
|
|
36
|
-
--color-green: #30ac66;
|
|
37
|
-
--color-dark-green: #0f8240;
|
|
35
|
+
--th-color-light-green: #d2fdd2;
|
|
36
|
+
--th-color-green: #30ac66;
|
|
37
|
+
--th-color-dark-green: #0f8240;
|
|
38
38
|
|
|
39
|
-
--color-light-yellow: #fffeb4;
|
|
40
|
-
--color-yellow: #D3C255;
|
|
41
|
-
--color-dark-yellow: #a89939;
|
|
39
|
+
--th-color-light-yellow: #fffeb4;
|
|
40
|
+
--th-color-yellow: #D3C255;
|
|
41
|
+
--th-color-dark-yellow: #a89939;
|
|
42
42
|
|
|
43
|
-
--color-light-blue: #e6f3ff;
|
|
44
|
-
--color-blue: #0085ff;
|
|
45
|
-
--color-dark-blue: #005cb9;
|
|
43
|
+
--th-color-light-blue: #e6f3ff;
|
|
44
|
+
--th-color-blue: #0085ff;
|
|
45
|
+
--th-color-dark-blue: #005cb9;
|
|
46
46
|
|
|
47
47
|
/* Semantic Aliases - for common use cases */
|
|
48
48
|
/* Text */
|
|
49
|
-
--color-text-primary: var(--color-grey-800);
|
|
50
|
-
--color-text-secondary: var(--color-grey-600);
|
|
51
|
-
--color-text-muted: var(--color-grey-500);
|
|
52
|
-
--color-text-inverse: var(--color-white);
|
|
49
|
+
--th-color-text-primary: var(--th-color-grey-800);
|
|
50
|
+
--th-color-text-secondary: var(--th-color-grey-600);
|
|
51
|
+
--th-color-text-muted: var(--th-color-grey-500);
|
|
52
|
+
--th-color-text-inverse: var(--th-color-white);
|
|
53
53
|
|
|
54
54
|
/* Backgrounds */
|
|
55
|
-
--color-background: var(--color-white);
|
|
56
|
-
--color-background-muted: var(--color-grey-100);
|
|
57
|
-
--color-background-hover: var(--color-grey-200);
|
|
55
|
+
--th-color-background: var(--th-color-white);
|
|
56
|
+
--th-color-background-muted: var(--th-color-grey-100);
|
|
57
|
+
--th-color-background-hover: var(--th-color-grey-200);
|
|
58
58
|
|
|
59
59
|
/* Borders */
|
|
60
|
-
--color-border: var(--color-grey-300);
|
|
61
|
-
--color-border-light: var(--color-grey-200);
|
|
60
|
+
--th-color-border: var(--th-color-grey-300);
|
|
61
|
+
--th-color-border-light: var(--th-color-grey-200);
|
|
62
62
|
|
|
63
|
-
--color-error-outline: var(--color-red);
|
|
64
|
-
--color-success-outline: var(--color-green);
|
|
65
|
-
--color-warning-outline: var(--color-yellow);
|
|
66
|
-
--color-info-outline: var(--color-blue);
|
|
63
|
+
--th-color-error-outline: var(--th-color-red);
|
|
64
|
+
--th-color-success-outline: var(--th-color-green);
|
|
65
|
+
--th-color-warning-outline: var(--th-color-yellow);
|
|
66
|
+
--th-color-info-outline: var(--th-color-blue);
|
|
67
67
|
|
|
68
|
-
--color-error-fill: var(--color-light-red);
|
|
69
|
-
--color-success-fill: var(--color-light-green);
|
|
70
|
-
--color-warning-fill: var(--color-light-yellow);
|
|
71
|
-
--color-info-fill: var(--color-light-blue);
|
|
68
|
+
--th-color-error-fill: var(--th-color-light-red);
|
|
69
|
+
--th-color-success-fill: var(--th-color-light-green);
|
|
70
|
+
--th-color-warning-fill: var(--th-color-light-yellow);
|
|
71
|
+
--th-color-info-fill: var(--th-color-light-blue);
|
|
72
72
|
|
|
73
73
|
/* Component-specific variables (mapped to palette) */
|
|
74
74
|
/* Links */
|
|
75
|
-
--color-link: var(--color-primary);
|
|
76
|
-
--color-link-hover: var(--color-primary);
|
|
75
|
+
--th-color-link: var(--th-color-primary);
|
|
76
|
+
--th-color-link-hover: var(--th-color-primary);
|
|
77
77
|
/* Buttons */
|
|
78
|
-
--button-disabled-bg: var(--color-grey-200);
|
|
79
|
-
--button-disabled-color: var(--color-grey-500);
|
|
78
|
+
--th-button-disabled-bg: var(--th-color-grey-200);
|
|
79
|
+
--th-button-disabled-color: var(--th-color-grey-500);
|
|
80
80
|
|
|
81
|
-
--button-primary-bg: var(--color-primary);
|
|
82
|
-
--button-primary-bg-hover: var(--color-dark-primary);
|
|
83
|
-
--button-primary-color: var(--color-white);
|
|
81
|
+
--th-button-primary-bg: var(--th-color-primary);
|
|
82
|
+
--th-button-primary-bg-hover: var(--th-color-dark-primary);
|
|
83
|
+
--th-button-primary-color: var(--th-color-white);
|
|
84
84
|
|
|
85
|
-
--button-secondary-bg: var(--color-white);
|
|
86
|
-
--button-secondary-bg-hover: var(--color-light-primary);
|
|
87
|
-
--button-secondary-color: var(--color-primary);
|
|
88
|
-
--button-secondary-border: var(--color-primary);
|
|
85
|
+
--th-button-secondary-bg: var(--th-color-white);
|
|
86
|
+
--th-button-secondary-bg-hover: var(--th-color-light-primary);
|
|
87
|
+
--th-button-secondary-color: var(--th-color-primary);
|
|
88
|
+
--th-button-secondary-border: var(--th-color-primary);
|
|
89
89
|
|
|
90
|
-
--button-alternate-bg: var(--color-blue);
|
|
91
|
-
--button-alternate-bg-hover: var(--color-dark-blue);
|
|
92
|
-
--button-alternate-color: var(--color-white);
|
|
90
|
+
--th-button-alternate-bg: var(--th-color-blue);
|
|
91
|
+
--th-button-alternate-bg-hover: var(--th-color-dark-blue);
|
|
92
|
+
--th-button-alternate-color: var(--th-color-white);
|
|
93
93
|
|
|
94
|
-
--button-destructive-bg: var(--color-red);
|
|
95
|
-
--button-destructive-bg-hover: var(--color-dark-red);
|
|
96
|
-
--button-destructive-color: var(--color-white);
|
|
94
|
+
--th-button-destructive-bg: var(--th-color-red);
|
|
95
|
+
--th-button-destructive-bg-hover: var(--th-color-dark-red);
|
|
96
|
+
--th-button-destructive-color: var(--th-color-white);
|
|
97
97
|
|
|
98
|
-
--button-confirmation-bg: var(--color-green);
|
|
99
|
-
--button-confirmation-bg-hover: var(--color-dark-green);
|
|
100
|
-
--button-confirmation-color: var(--color-white);
|
|
98
|
+
--th-button-confirmation-bg: var(--th-color-green);
|
|
99
|
+
--th-button-confirmation-bg-hover: var(--th-color-dark-green);
|
|
100
|
+
--th-button-confirmation-color: var(--th-color-white);
|
|
101
101
|
|
|
102
102
|
/* Cards */
|
|
103
|
-
--th-card-bg: var(--color-white);
|
|
104
|
-
--th-card-border: var(--color-border);
|
|
105
|
-
--th-card-title-color: var(--color-text-primary);
|
|
106
|
-
--th-card-subtitle-color: var(--color-text-secondary);
|
|
107
|
-
--th-card-text-color: var(--color-text-secondary);
|
|
108
|
-
--th-card-icon-color: var(--color-text-primary);
|
|
109
|
-
--th-card-dismiss-color: var(--color-text-muted);
|
|
103
|
+
--th-card-bg: var(--th-color-white);
|
|
104
|
+
--th-card-border: var(--th-color-border);
|
|
105
|
+
--th-card-title-color: var(--th-color-text-primary);
|
|
106
|
+
--th-card-subtitle-color: var(--th-color-text-secondary);
|
|
107
|
+
--th-card-text-color: var(--th-color-text-secondary);
|
|
108
|
+
--th-card-icon-color: var(--th-color-text-primary);
|
|
109
|
+
--th-card-dismiss-color: var(--th-color-text-muted);
|
|
110
110
|
|
|
111
111
|
/* Progress Bar */
|
|
112
|
-
--progress-bar-fill-color: var(--color-primary);
|
|
113
|
-
--progress-bar-track-color: var(--color-grey-200);
|
|
114
|
-
--progress-bar-title-color: var(--color-text-primary);
|
|
115
|
-
--progress-bar-label-color: var(--color-text-secondary);
|
|
112
|
+
--th-progress-bar-fill-color: var(--th-color-primary);
|
|
113
|
+
--th-progress-bar-track-color: var(--th-color-grey-200);
|
|
114
|
+
--th-progress-bar-title-color: var(--th-color-text-primary);
|
|
115
|
+
--th-progress-bar-label-color: var(--th-color-text-secondary);
|
|
116
|
+
|
|
117
|
+
/* Checkbox */
|
|
118
|
+
--th-checkbox-border: var(--th-color-grey-300);
|
|
119
|
+
--th-checkbox-checked-bg: var(--th-color-dark-primary);
|
|
120
|
+
--th-checkbox-disabled-bg: var(--th-color-grey-300);
|
|
121
|
+
--th-checkbox-disabled-border: var(--th-color-grey-300);
|
|
122
|
+
--th-checkbox-disabled-check: var(--th-color-grey-500);
|
|
123
|
+
|
|
124
|
+
/* Text Input */
|
|
125
|
+
--th-input-border: var(--th-color-grey-300);
|
|
126
|
+
--th-input-focus-border: var(--th-color-dark-primary);
|
|
127
|
+
--th-input-border-invalid: var(--th-color-red);
|
|
128
|
+
--th-input-label: var(--th-color-grey-700);
|
|
129
|
+
--th-input-label-disabled: var(--th-color-grey-500);
|
|
130
|
+
--th-input-placeholder: var(--th-color-grey-400);
|
|
131
|
+
--th-input-text: var(--th-color-black);
|
|
132
|
+
--th-input-bg: 'transparent';
|
|
133
|
+
--th-input-icon-color: var(--th-color-grey-400);
|
|
134
|
+
|
|
135
|
+
/* Selector */
|
|
136
|
+
--th-selector-border: var(--th-color-grey-300);
|
|
137
|
+
--th-selector-text-color: var(--th-color-text-primary);
|
|
138
|
+
--th-selector-subtext-color: var(--th-color-primary);
|
|
139
|
+
--th-selector-description-color: var(--th-color-text-secondary);
|
|
140
|
+
--th-selector-icon-color: var(--th-color-dark-primary);
|
|
141
|
+
--th-selector-checked-border: var(--th-color-dark-primary);
|
|
142
|
+
--th-selector-checked-bg: var(--th-color-primary);
|
|
143
|
+
--th-selector-disabled-color: var(--th-color-grey-500);
|
|
144
|
+
--th-selector-disabled-bg: transparent;
|
|
116
145
|
|
|
117
146
|
/* Shadow colors using opacity */
|
|
118
|
-
--color-shadow: rgba(0, 0, 0, 0.1);
|
|
119
|
-
--color-shadow-medium: rgba(0, 0, 0, 0.15);
|
|
147
|
+
--th-color-shadow: rgba(0, 0, 0, 0.1);
|
|
148
|
+
--th-color-shadow-medium: rgba(0, 0, 0, 0.15);
|
|
120
149
|
}
|
|
121
150
|
|
|
122
151
|
/* Dark Theme Overrides */
|
|
123
152
|
[data-theme='dark'] {
|
|
124
153
|
/* Text */
|
|
125
|
-
--color-text-primary: var(--color-grey-100);
|
|
126
|
-
--color-text-secondary: var(--color-grey-300);
|
|
127
|
-
--color-text-muted: var(--color-grey-500);
|
|
154
|
+
--th-color-text-primary: var(--th-color-grey-100);
|
|
155
|
+
--th-color-text-secondary: var(--th-color-grey-300);
|
|
156
|
+
--th-color-text-muted: var(--th-color-grey-500);
|
|
128
157
|
|
|
129
158
|
/* Backgrounds */
|
|
130
|
-
--color-background: var(--color-grey-800);
|
|
131
|
-
--color-background-muted: var(--color-grey-700);
|
|
132
|
-
--color-background-hover: var(--color-grey-600);
|
|
159
|
+
--th-color-background: var(--th-color-grey-800);
|
|
160
|
+
--th-color-background-muted: var(--th-color-grey-700);
|
|
161
|
+
--th-color-background-hover: var(--th-color-grey-600);
|
|
133
162
|
|
|
134
163
|
/* Borders */
|
|
135
|
-
--color-border: var(--color-grey-700);
|
|
164
|
+
--th-color-border: var(--th-color-grey-700);
|
|
136
165
|
|
|
137
166
|
/* Buttons */
|
|
138
|
-
--button-primary-bg: var(--color-dark-primary);
|
|
139
|
-
--button-primary-bg-hover: var(--color-primary);
|
|
140
|
-
|
|
141
|
-
--button-secondary-bg: var(--color-grey-800);
|
|
142
|
-
--button-secondary-bg-hover: var(--color-grey-700);
|
|
143
|
-
--button-secondary-color: var(--color-primary);
|
|
144
|
-
|
|
145
|
-
--button-disabled-bg: var(--color-grey-700);
|
|
146
|
-
--button-disabled-color: var(--color-grey-500);
|
|
167
|
+
--th-button-primary-bg: var(--th-color-dark-primary);
|
|
168
|
+
--th-button-primary-bg-hover: var(--th-color-primary);
|
|
169
|
+
|
|
170
|
+
--th-button-secondary-bg: var(--th-color-grey-800);
|
|
171
|
+
--th-button-secondary-bg-hover: var(--th-color-grey-700);
|
|
172
|
+
--th-button-secondary-color: var(--th-color-primary);
|
|
173
|
+
|
|
174
|
+
--th-button-disabled-bg: var(--th-color-grey-700);
|
|
175
|
+
--th-button-disabled-color: var(--th-color-grey-500);
|
|
176
|
+
|
|
177
|
+
/* Checkbox */
|
|
178
|
+
--th-checkbox-border: var(--th-color-grey-600);
|
|
179
|
+
--th-checkbox-checked-bg: var(--th-color-primary);
|
|
180
|
+
--th-checkbox-disabled-bg: var(--th-color-grey-600);
|
|
181
|
+
--th-checkbox-disabled-border: var(--th-color-grey-600);
|
|
182
|
+
--th-checkbox-disabled-check: var(--th-color-grey-300);
|
|
183
|
+
|
|
184
|
+
/* Text Input */
|
|
185
|
+
--th-input-border: var(--th-color-grey-600);
|
|
186
|
+
--th-input-focus-border: var(--th-color-primary);
|
|
187
|
+
--th-input-label: var(--th-color-white);
|
|
188
|
+
--th-input-label-disabled: var(--th-color-grey-500);
|
|
189
|
+
--th-input-placeholder: var(--th-color-grey-300);
|
|
190
|
+
--th-input-text: var(--th-color-white);
|
|
191
|
+
--th-input-bg: var(--th-color-grey-700);
|
|
192
|
+
--th-input-icon-color: var(--th-color-grey-300);
|
|
193
|
+
|
|
194
|
+
/* Selector */
|
|
195
|
+
--th-selector-border: var(--th-color-grey-600);
|
|
196
|
+
--th-selector-text-color: var(--th-color-text-primary);
|
|
197
|
+
--th-selector-subtext-color: var(--th-color-primary);
|
|
198
|
+
--th-selector-description-color: var(--th-color-text-secondary);
|
|
199
|
+
--th-selector-icon-color: var(--th-color-primary);
|
|
200
|
+
--th-selector-checked-border: var(--th-color-primary);
|
|
201
|
+
--th-selector-checked-bg: var(--th-color-primary);
|
|
202
|
+
--th-selector-disabled-color: var(--th-color-grey-500);
|
|
203
|
+
--th-selector-disabled-bg: var(--th-color-grey-100);
|
|
147
204
|
|
|
148
205
|
/* Cards */
|
|
149
|
-
--th-card-bg: var(--color-grey-700);
|
|
150
|
-
--th-card-border: var(--color-grey-600);
|
|
151
|
-
--th-card-title-color: var(--color-grey-100);
|
|
152
|
-
--th-card-subtitle-color: var(--color-grey-300);
|
|
153
|
-
--th-card-text-color: var(--color-grey-300);
|
|
154
|
-
--th-card-icon-color: var(--color-grey-100);
|
|
155
|
-
--th-card-dismiss-color: var(--color-grey-500);
|
|
206
|
+
--th-card-bg: var(--th-color-grey-700);
|
|
207
|
+
--th-card-border: var(--th-color-grey-600);
|
|
208
|
+
--th-card-title-color: var(--th-color-grey-100);
|
|
209
|
+
--th-card-subtitle-color: var(--th-color-grey-300);
|
|
210
|
+
--th-card-text-color: var(--th-color-grey-300);
|
|
211
|
+
--th-card-icon-color: var(--th-color-grey-100);
|
|
212
|
+
--th-card-dismiss-color: var(--th-color-grey-500);
|
|
156
213
|
|
|
157
214
|
/* Progress Bar */
|
|
158
|
-
--progress-bar-fill-color: var(--color-primary);
|
|
159
|
-
--progress-bar-track-color: var(--color-grey-600);
|
|
160
|
-
--progress-bar-title-color: var(--color-grey-100);
|
|
161
|
-
--progress-bar-label-color: var(--color-grey-300);
|
|
215
|
+
--th-progress-bar-fill-color: var(--th-color-primary);
|
|
216
|
+
--th-progress-bar-track-color: var(--th-color-grey-600);
|
|
217
|
+
--th-progress-bar-title-color: var(--th-color-grey-100);
|
|
218
|
+
--th-progress-bar-label-color: var(--th-color-grey-300);
|
|
162
219
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krumio/trailhand-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Reusable web components built with Lit Element",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -55,7 +55,6 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@fortawesome/fontawesome-svg-core": "^7.1.0",
|
|
57
57
|
"@fortawesome/free-solid-svg-icons": "^7.1.0",
|
|
58
|
-
"@fortawesome/pro-duotone-svg-icons": "^7.1.0",
|
|
59
58
|
"@iconify/icons-heroicons": "^1.2.9",
|
|
60
59
|
"iconify-icon": "^3.0.2",
|
|
61
60
|
"lit": "^3.3.1"
|
|
@@ -76,4 +75,4 @@
|
|
|
76
75
|
"vite": "^6.4.1",
|
|
77
76
|
"vitest": "^4.0.17"
|
|
78
77
|
}
|
|
79
|
-
}
|
|
78
|
+
}
|