@alleninstitute/cortex-ui 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +101 -79
- package/dist/cjs/cortex-ui.cjs.js +3 -3
- package/dist/cjs/cui-divider.cjs.entry.js +49 -0
- package/dist/cjs/cui-icon.cjs.entry.js +100 -0
- package/dist/cjs/cui-progress.cjs.entry.js +46 -0
- package/dist/cjs/cui-tag.cjs.entry.js +4 -4
- package/dist/cjs/index-RBrlguTk.js +1565 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +4 -1
- package/dist/collection/components/cui-divider/cui-divider.css +100 -0
- package/dist/collection/components/cui-divider/cui-divider.js +150 -0
- package/dist/collection/components/cui-icon/cui-icon.css +134 -0
- package/dist/collection/components/cui-icon/cui-icon.js +239 -0
- package/dist/collection/components/cui-progress/cui-progress.css +102 -0
- package/dist/collection/components/cui-progress/cui-progress.js +187 -0
- package/dist/collection/components/cui-tag/cui-tag.css +19 -19
- package/dist/collection/components/cui-tag/cui-tag.js +5 -5
- package/dist/components/cui-divider.d.ts +11 -0
- package/dist/components/cui-divider.js +1 -0
- package/dist/components/cui-icon.d.ts +11 -0
- package/dist/components/cui-icon.js +1 -0
- package/dist/components/cui-progress.d.ts +11 -0
- package/dist/components/cui-progress.js +1 -0
- package/dist/components/cui-tag.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/cortex-ui/cortex-ui.css +1 -1
- package/dist/cortex-ui/cortex-ui.esm.js +1 -1
- package/dist/cortex-ui/p-0e66a721.entry.js +1 -0
- package/dist/cortex-ui/p-1af73c5a.entry.js +1 -0
- package/dist/cortex-ui/p-2d2004f0.entry.js +1 -0
- package/dist/cortex-ui/p-8925abbe.entry.js +1 -0
- package/dist/cortex-ui/p-BZmInLSX.js +3 -0
- package/dist/esm/cortex-ui.js +4 -4
- package/dist/esm/cui-divider.entry.js +47 -0
- package/dist/esm/cui-icon.entry.js +98 -0
- package/dist/esm/cui-progress.entry.js +44 -0
- package/dist/esm/cui-tag.entry.js +4 -4
- package/dist/esm/index-BZmInLSX.js +1557 -0
- package/dist/esm/loader.js +3 -3
- package/dist/fonts/AllenInstituteHeadline-Bold.woff2 +0 -0
- package/dist/fonts/AllenInstituteHeadline-BoldItalic.woff2 +0 -0
- package/dist/fonts/AllenInstituteHeadline-Italic.woff2 +0 -0
- package/dist/fonts/AllenInstituteHeadline-Light.woff2 +0 -0
- package/dist/fonts/AllenInstituteHeadline-LightItalic.woff2 +0 -0
- package/dist/fonts/AllenInstituteHeadline-Medium.woff2 +0 -0
- package/dist/fonts/AllenInstituteHeadline-MediumItalic.woff2 +0 -0
- package/dist/fonts/AllenInstituteHeadline-Regular.woff2 +0 -0
- package/dist/fonts/AllenInstituteHeadline-Semibold.woff2 +0 -0
- package/dist/fonts/AllenInstituteHeadline-SemiboldItalic.woff2 +0 -0
- package/dist/fonts/AllenInstituteText-Bold.woff2 +0 -0
- package/dist/fonts/AllenInstituteText-BoldItalic.woff2 +0 -0
- package/dist/fonts/AllenInstituteText-Italic.woff2 +0 -0
- package/dist/fonts/AllenInstituteText-Light.woff2 +0 -0
- package/dist/fonts/AllenInstituteText-LightItalic.woff2 +0 -0
- package/dist/fonts/AllenInstituteText-Medium.woff2 +0 -0
- package/dist/fonts/AllenInstituteText-MediumItalic.woff2 +0 -0
- package/dist/fonts/AllenInstituteText-Regular.woff2 +0 -0
- package/dist/fonts/AllenInstituteText-Semibold.woff2 +0 -0
- package/dist/fonts/AllenInstituteText-SemiboldItalic.woff2 +0 -0
- package/dist/fonts.css +186 -0
- package/dist/types/components/cui-divider/cui-divider.d.ts +38 -0
- package/dist/types/components/cui-icon/cui-icon.d.ts +76 -0
- package/dist/types/components/cui-progress/cui-progress.d.ts +40 -0
- package/dist/types/components/cui-tag/cui-tag.d.ts +1 -1
- package/dist/types/components.d.ts +343 -5
- package/dist/types/stencil-public-runtime.d.ts +11 -0
- package/package.json +31 -22
- package/dist/cjs/index-Rxdz0vyq.js +0 -1337
- package/dist/collection/stories/assets/accessibility.svg +0 -1
- package/dist/collection/stories/assets/discord.svg +0 -1
- package/dist/collection/stories/assets/github.svg +0 -1
- package/dist/collection/stories/assets/tutorials.svg +0 -1
- package/dist/collection/stories/assets/youtube.svg +0 -1
- package/dist/cortex-ui/p-054ebfa8.entry.js +0 -1
- package/dist/cortex-ui/p-C70YK15K.js +0 -2
- package/dist/esm/index-C70YK15K.js +0 -1330
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stencil reads the documented custom properties out of the stylesheet, not out of the
|
|
3
|
+
* component's JSDoc, so these are what reach readme.md and the generated AI docs.
|
|
4
|
+
*
|
|
5
|
+
* @prop --cui-progress-track-color: Colour of the unfilled track.
|
|
6
|
+
* @prop --cui-progress-indicator-color: Colour of the filled portion, for status bars in another intent.
|
|
7
|
+
*/
|
|
8
|
+
:host {
|
|
9
|
+
display: block;
|
|
10
|
+
--cui-progress-track-color: var(--cui-base-bg-level-2);
|
|
11
|
+
--cui-progress-indicator-color: var(--cui-accent-surface-primary-default);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host([hidden]) {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.cui-progress {
|
|
19
|
+
font-family: var(--cui-font-family-base);
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: var(--cui-spacing-s);
|
|
23
|
+
}
|
|
24
|
+
.cui-progress__bar {
|
|
25
|
+
flex: 1 1 auto;
|
|
26
|
+
display: block;
|
|
27
|
+
width: 100%;
|
|
28
|
+
border: none;
|
|
29
|
+
-webkit-appearance: none;
|
|
30
|
+
appearance: none;
|
|
31
|
+
border-radius: var(--cui-border-radius-full);
|
|
32
|
+
background-color: var(--cui-progress-track-color);
|
|
33
|
+
box-shadow: inset 0 0 0 var(--cui-border-width-s) var(--cui-base-border-secondary);
|
|
34
|
+
}
|
|
35
|
+
.cui-progress__bar::-webkit-progress-bar {
|
|
36
|
+
border-radius: var(--cui-border-radius-full);
|
|
37
|
+
background-color: var(--cui-progress-track-color);
|
|
38
|
+
box-shadow: inset 0 0 0 var(--cui-border-width-s) var(--cui-base-border-secondary);
|
|
39
|
+
}
|
|
40
|
+
.cui-progress__bar::-webkit-progress-value {
|
|
41
|
+
border-radius: var(--cui-border-radius-full);
|
|
42
|
+
background-color: var(--cui-progress-indicator-color);
|
|
43
|
+
transition: width var(--cui-transition-base);
|
|
44
|
+
}
|
|
45
|
+
.cui-progress__bar::-moz-progress-bar {
|
|
46
|
+
border-radius: var(--cui-border-radius-full);
|
|
47
|
+
background-color: var(--cui-progress-indicator-color);
|
|
48
|
+
}
|
|
49
|
+
.cui-progress__bar:indeterminate {
|
|
50
|
+
background-image: linear-gradient(to right, var(--cui-progress-indicator-color), var(--cui-progress-indicator-color));
|
|
51
|
+
background-repeat: no-repeat;
|
|
52
|
+
background-size: 40% 100%;
|
|
53
|
+
animation: cui-progress-sweep 1.5s linear infinite;
|
|
54
|
+
}
|
|
55
|
+
.cui-progress__bar:indeterminate::-webkit-progress-bar {
|
|
56
|
+
background-image: linear-gradient(to right, var(--cui-progress-indicator-color), var(--cui-progress-indicator-color));
|
|
57
|
+
background-repeat: no-repeat;
|
|
58
|
+
background-size: 40% 100%;
|
|
59
|
+
animation: cui-progress-sweep 1.5s linear infinite;
|
|
60
|
+
}
|
|
61
|
+
.cui-progress__bar:indeterminate::-webkit-progress-value {
|
|
62
|
+
display: none;
|
|
63
|
+
}
|
|
64
|
+
.cui-progress__bar:indeterminate::-moz-progress-bar {
|
|
65
|
+
background-color: transparent;
|
|
66
|
+
}
|
|
67
|
+
.cui-progress__value {
|
|
68
|
+
flex: 0 0 auto;
|
|
69
|
+
color: var(--cui-base-text-secondary);
|
|
70
|
+
font-size: var(--cui-font-size-s);
|
|
71
|
+
font-weight: var(--cui-font-weight-medium);
|
|
72
|
+
font-variant-numeric: tabular-nums;
|
|
73
|
+
}
|
|
74
|
+
.cui-progress--small .cui-progress__bar {
|
|
75
|
+
height: var(--cui-spacing-xs);
|
|
76
|
+
}
|
|
77
|
+
.cui-progress--medium .cui-progress__bar {
|
|
78
|
+
height: var(--cui-spacing-s);
|
|
79
|
+
}
|
|
80
|
+
.cui-progress--large .cui-progress__bar {
|
|
81
|
+
height: var(--cui-spacing-m);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@keyframes cui-progress-sweep {
|
|
85
|
+
from {
|
|
86
|
+
background-position-x: -66.67%;
|
|
87
|
+
}
|
|
88
|
+
to {
|
|
89
|
+
background-position-x: 166.67%;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
@media (prefers-reduced-motion: reduce) {
|
|
93
|
+
.cui-progress__bar::-webkit-progress-value {
|
|
94
|
+
transition: none;
|
|
95
|
+
}
|
|
96
|
+
.cui-progress__bar:indeterminate {
|
|
97
|
+
animation-duration: 3s;
|
|
98
|
+
}
|
|
99
|
+
.cui-progress__bar:indeterminate::-webkit-progress-bar {
|
|
100
|
+
animation-duration: 3s;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* A Progress component showing how far along a task is, as a bar with an accessible value.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* <cui-progress label="Uploading files" value="40" show-value="true"></cui-progress>
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <cui-progress label="Loading results" indeterminate="true"></cui-progress>
|
|
10
|
+
*
|
|
11
|
+
* @part base - The root element, for consumer-side style overrides.
|
|
12
|
+
* @part bar - The native progress element: the track, and the fill that grows across it.
|
|
13
|
+
* @part value - The percentage text rendered when `show-value` is set.
|
|
14
|
+
* @cssprop --cui-progress-track-color - Colour of the unfilled track.
|
|
15
|
+
* @cssprop --cui-progress-indicator-color - Colour of the filled portion, for status bars in another intent.
|
|
16
|
+
*/
|
|
17
|
+
export class CuiProgress {
|
|
18
|
+
constructor() {
|
|
19
|
+
/** How much of the task is done, clamped to the range `0`–`max`. */
|
|
20
|
+
this.value = 0;
|
|
21
|
+
/** The value that counts as complete. */
|
|
22
|
+
this.max = 100;
|
|
23
|
+
/**
|
|
24
|
+
* Animates continuously instead of showing a value. Use it only while the total amount
|
|
25
|
+
* of work is genuinely unknown — prefer a real `value` whenever the work reports one.
|
|
26
|
+
*/
|
|
27
|
+
this.indeterminate = false;
|
|
28
|
+
/** Thickness of the bar. */
|
|
29
|
+
this.size = 'medium';
|
|
30
|
+
/** Renders the completed percentage as text beside the bar. Ignored when indeterminate. */
|
|
31
|
+
this.showValue = false;
|
|
32
|
+
}
|
|
33
|
+
/** `max` is only meaningful above zero; anything else falls back to a percentage scale. */
|
|
34
|
+
get resolvedMax() {
|
|
35
|
+
return Number.isFinite(this.max) && this.max > 0 ? this.max : 100;
|
|
36
|
+
}
|
|
37
|
+
get clampedValue() {
|
|
38
|
+
if (!Number.isFinite(this.value))
|
|
39
|
+
return 0;
|
|
40
|
+
return Math.min(Math.max(this.value, 0), this.resolvedMax);
|
|
41
|
+
}
|
|
42
|
+
get percent() {
|
|
43
|
+
return (this.clampedValue / this.resolvedMax) * 100;
|
|
44
|
+
}
|
|
45
|
+
render() {
|
|
46
|
+
const { indeterminate, showValue } = this;
|
|
47
|
+
return (h("div", { key: '546c0fb27b6e91a1d153d01ae154c272be633b14', part: "base", class: {
|
|
48
|
+
'cui-progress': true,
|
|
49
|
+
[`cui-progress--${this.size}`]: true,
|
|
50
|
+
} }, h("progress", { key: '313a769b9ea6c2059816e40c744a74749a55c07b', part: "bar", class: "cui-progress__bar", "aria-label": this.label, max: this.resolvedMax, value: indeterminate ? undefined : this.clampedValue }), showValue && !indeterminate && (h("span", { key: '1a2edab01738734b397b426d826cfa2dcd4cf89b', part: "value", class: "cui-progress__value" }, Math.round(this.percent), "%"))));
|
|
51
|
+
}
|
|
52
|
+
static get is() { return "cui-progress"; }
|
|
53
|
+
static get encapsulation() { return "shadow"; }
|
|
54
|
+
static get originalStyleUrls() {
|
|
55
|
+
return {
|
|
56
|
+
"$": ["cui-progress.scss"]
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
static get styleUrls() {
|
|
60
|
+
return {
|
|
61
|
+
"$": ["cui-progress.css"]
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
static get properties() {
|
|
65
|
+
return {
|
|
66
|
+
"label": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"mutable": false,
|
|
69
|
+
"complexType": {
|
|
70
|
+
"original": "string",
|
|
71
|
+
"resolved": "string",
|
|
72
|
+
"references": {}
|
|
73
|
+
},
|
|
74
|
+
"required": true,
|
|
75
|
+
"optional": false,
|
|
76
|
+
"docs": {
|
|
77
|
+
"tags": [],
|
|
78
|
+
"text": "Accessible name for the bar, describing what is in progress (\"Uploading files\").\nRequired \u2014 a progress bar with no name fails the accessibility gate."
|
|
79
|
+
},
|
|
80
|
+
"getter": false,
|
|
81
|
+
"setter": false,
|
|
82
|
+
"reflect": false,
|
|
83
|
+
"attribute": "label"
|
|
84
|
+
},
|
|
85
|
+
"value": {
|
|
86
|
+
"type": "number",
|
|
87
|
+
"mutable": false,
|
|
88
|
+
"complexType": {
|
|
89
|
+
"original": "number",
|
|
90
|
+
"resolved": "number",
|
|
91
|
+
"references": {}
|
|
92
|
+
},
|
|
93
|
+
"required": false,
|
|
94
|
+
"optional": false,
|
|
95
|
+
"docs": {
|
|
96
|
+
"tags": [],
|
|
97
|
+
"text": "How much of the task is done, clamped to the range `0`\u2013`max`."
|
|
98
|
+
},
|
|
99
|
+
"getter": false,
|
|
100
|
+
"setter": false,
|
|
101
|
+
"reflect": false,
|
|
102
|
+
"attribute": "value",
|
|
103
|
+
"defaultValue": "0"
|
|
104
|
+
},
|
|
105
|
+
"max": {
|
|
106
|
+
"type": "number",
|
|
107
|
+
"mutable": false,
|
|
108
|
+
"complexType": {
|
|
109
|
+
"original": "number",
|
|
110
|
+
"resolved": "number",
|
|
111
|
+
"references": {}
|
|
112
|
+
},
|
|
113
|
+
"required": false,
|
|
114
|
+
"optional": false,
|
|
115
|
+
"docs": {
|
|
116
|
+
"tags": [],
|
|
117
|
+
"text": "The value that counts as complete."
|
|
118
|
+
},
|
|
119
|
+
"getter": false,
|
|
120
|
+
"setter": false,
|
|
121
|
+
"reflect": false,
|
|
122
|
+
"attribute": "max",
|
|
123
|
+
"defaultValue": "100"
|
|
124
|
+
},
|
|
125
|
+
"indeterminate": {
|
|
126
|
+
"type": "boolean",
|
|
127
|
+
"mutable": false,
|
|
128
|
+
"complexType": {
|
|
129
|
+
"original": "boolean",
|
|
130
|
+
"resolved": "boolean",
|
|
131
|
+
"references": {}
|
|
132
|
+
},
|
|
133
|
+
"required": false,
|
|
134
|
+
"optional": false,
|
|
135
|
+
"docs": {
|
|
136
|
+
"tags": [],
|
|
137
|
+
"text": "Animates continuously instead of showing a value. Use it only while the total amount\nof work is genuinely unknown \u2014 prefer a real `value` whenever the work reports one."
|
|
138
|
+
},
|
|
139
|
+
"getter": false,
|
|
140
|
+
"setter": false,
|
|
141
|
+
"reflect": false,
|
|
142
|
+
"attribute": "indeterminate",
|
|
143
|
+
"defaultValue": "false"
|
|
144
|
+
},
|
|
145
|
+
"size": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"mutable": false,
|
|
148
|
+
"complexType": {
|
|
149
|
+
"original": "'small' | 'medium' | 'large'",
|
|
150
|
+
"resolved": "\"large\" | \"medium\" | \"small\"",
|
|
151
|
+
"references": {}
|
|
152
|
+
},
|
|
153
|
+
"required": false,
|
|
154
|
+
"optional": false,
|
|
155
|
+
"docs": {
|
|
156
|
+
"tags": [],
|
|
157
|
+
"text": "Thickness of the bar."
|
|
158
|
+
},
|
|
159
|
+
"getter": false,
|
|
160
|
+
"setter": false,
|
|
161
|
+
"reflect": false,
|
|
162
|
+
"attribute": "size",
|
|
163
|
+
"defaultValue": "'medium'"
|
|
164
|
+
},
|
|
165
|
+
"showValue": {
|
|
166
|
+
"type": "boolean",
|
|
167
|
+
"mutable": false,
|
|
168
|
+
"complexType": {
|
|
169
|
+
"original": "boolean",
|
|
170
|
+
"resolved": "boolean",
|
|
171
|
+
"references": {}
|
|
172
|
+
},
|
|
173
|
+
"required": false,
|
|
174
|
+
"optional": false,
|
|
175
|
+
"docs": {
|
|
176
|
+
"tags": [],
|
|
177
|
+
"text": "Renders the completed percentage as text beside the bar. Ignored when indeterminate."
|
|
178
|
+
},
|
|
179
|
+
"getter": false,
|
|
180
|
+
"setter": false,
|
|
181
|
+
"reflect": false,
|
|
182
|
+
"attribute": "show-value",
|
|
183
|
+
"defaultValue": "false"
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}
|
|
@@ -7,43 +7,43 @@
|
|
|
7
7
|
display: inline-flex;
|
|
8
8
|
align-items: center;
|
|
9
9
|
justify-content: center;
|
|
10
|
-
border-radius: var(--cui-radius-
|
|
10
|
+
border-radius: var(--cui-border-radius-m);
|
|
11
11
|
font-weight: var(--cui-font-weight-semibold);
|
|
12
12
|
white-space: nowrap;
|
|
13
13
|
}
|
|
14
14
|
.cui-tag--small {
|
|
15
|
-
padding: var(--cui-spacing-xxs) var(--cui-spacing-
|
|
15
|
+
padding: var(--cui-spacing-xxs) var(--cui-spacing-s);
|
|
16
16
|
font-size: var(--cui-font-size-xs);
|
|
17
17
|
}
|
|
18
18
|
.cui-tag--medium {
|
|
19
|
-
padding: var(--cui-spacing-xs) var(--cui-spacing-
|
|
20
|
-
font-size: var(--cui-font-size-
|
|
19
|
+
padding: var(--cui-spacing-xs) var(--cui-spacing-m);
|
|
20
|
+
font-size: var(--cui-font-size-s);
|
|
21
21
|
}
|
|
22
|
-
.cui-tag--
|
|
23
|
-
background-color: var(--cui-accent-
|
|
24
|
-
color: var(--cui-accent-text);
|
|
22
|
+
.cui-tag--accent {
|
|
23
|
+
background-color: var(--cui-accent-surface-secondary-default);
|
|
24
|
+
color: var(--cui-accent-text-secondary-default);
|
|
25
25
|
}
|
|
26
26
|
.cui-tag--highlight {
|
|
27
|
-
background-color: var(--cui-highlight-
|
|
28
|
-
color: var(--cui-highlight-text);
|
|
27
|
+
background-color: var(--cui-highlight-surface-secondary-default);
|
|
28
|
+
color: var(--cui-highlight-text-secondary-default);
|
|
29
29
|
}
|
|
30
30
|
.cui-tag--info {
|
|
31
|
-
background-color: var(--cui-info-
|
|
32
|
-
color: var(--cui-info-text);
|
|
31
|
+
background-color: var(--cui-info-surface-secondary-default);
|
|
32
|
+
color: var(--cui-info-text-secondary-default);
|
|
33
33
|
}
|
|
34
34
|
.cui-tag--negative {
|
|
35
|
-
background-color: var(--cui-negative-
|
|
36
|
-
color: var(--cui-negative-text);
|
|
35
|
+
background-color: var(--cui-negative-surface-secondary-default);
|
|
36
|
+
color: var(--cui-negative-text-secondary-default);
|
|
37
37
|
}
|
|
38
38
|
.cui-tag--neutral {
|
|
39
|
-
background-color: var(--cui-neutral-
|
|
40
|
-
color: var(--cui-neutral-text);
|
|
39
|
+
background-color: var(--cui-neutral-surface-secondary-default);
|
|
40
|
+
color: var(--cui-neutral-text-secondary-default);
|
|
41
41
|
}
|
|
42
42
|
.cui-tag--positive {
|
|
43
|
-
background-color: var(--cui-positive-
|
|
44
|
-
color: var(--cui-positive-text);
|
|
43
|
+
background-color: var(--cui-positive-surface-secondary-default);
|
|
44
|
+
color: var(--cui-positive-text-secondary-default);
|
|
45
45
|
}
|
|
46
46
|
.cui-tag--warning {
|
|
47
|
-
background-color: var(--cui-warning-
|
|
48
|
-
color: var(--cui-warning-text);
|
|
47
|
+
background-color: var(--cui-warning-surface-secondary-default);
|
|
48
|
+
color: var(--cui-warning-text-secondary-default);
|
|
49
49
|
}
|
|
@@ -8,11 +8,11 @@ import { h } from "@stencil/core";
|
|
|
8
8
|
export class CuiTag {
|
|
9
9
|
constructor() {
|
|
10
10
|
this.label = '';
|
|
11
|
-
this.variant = '
|
|
11
|
+
this.variant = 'neutral';
|
|
12
12
|
this.size = 'medium';
|
|
13
13
|
}
|
|
14
14
|
render() {
|
|
15
|
-
return (h("span", { key: '
|
|
15
|
+
return (h("span", { key: '35b8ea2176d1923abcda801fee775a9cd46a2fec', class: {
|
|
16
16
|
'cui-tag': true,
|
|
17
17
|
[`cui-tag--${this.variant}`]: true,
|
|
18
18
|
[`cui-tag--${this.size}`]: true,
|
|
@@ -56,8 +56,8 @@ export class CuiTag {
|
|
|
56
56
|
"type": "string",
|
|
57
57
|
"mutable": false,
|
|
58
58
|
"complexType": {
|
|
59
|
-
"original": "'
|
|
60
|
-
"resolved": "\"
|
|
59
|
+
"original": "'accent' | 'highlight' | 'info' | 'negative' | 'neutral' | 'positive' | 'warning'",
|
|
60
|
+
"resolved": "\"accent\" | \"highlight\" | \"info\" | \"negative\" | \"neutral\" | \"positive\" | \"warning\"",
|
|
61
61
|
"references": {}
|
|
62
62
|
},
|
|
63
63
|
"required": false,
|
|
@@ -70,7 +70,7 @@ export class CuiTag {
|
|
|
70
70
|
"setter": false,
|
|
71
71
|
"reflect": false,
|
|
72
72
|
"attribute": "variant",
|
|
73
|
-
"defaultValue": "'
|
|
73
|
+
"defaultValue": "'neutral'"
|
|
74
74
|
},
|
|
75
75
|
"size": {
|
|
76
76
|
"type": "string",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface CuiDivider extends Components.CuiDivider, HTMLElement {}
|
|
4
|
+
export const CuiDivider: {
|
|
5
|
+
prototype: CuiDivider;
|
|
6
|
+
new (): CuiDivider;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as i,p as r,H as d,h as e}from"./index.js";const a=r(class extends d{constructor(i){super(),!1!==i&&this.__registerHost(),this.__attachShadow(),this.orientation="horizontal",this.spacing="medium",this.variant="base",this.importance="primary"}render(){return e("hr",{key:"d33f3260a5f708f379428a7d338e6329248f23ff",part:"base",class:{"cui-divider":!0,["cui-divider--"+this.orientation]:!0,["cui-divider--"+this.variant]:!0,["cui-divider--"+this.importance]:!0},"aria-orientation":"vertical"===this.orientation?"vertical":void 0})}static get style(){return":host{display:block;--cui-divider-gap:var(--cui-spacing-m);margin-block:var(--cui-divider-gap)}:host([hidden]){display:none}:host([spacing=none]){--cui-divider-gap:0}:host([spacing=small]){--cui-divider-gap:var(--cui-spacing-s)}:host([spacing=large]){--cui-divider-gap:var(--cui-spacing-l)}:host([orientation=vertical]){display:inline-flex;align-self:stretch;min-height:var(--cui-spacing-l);margin-block:0;margin-inline:var(--cui-divider-gap)}.cui-divider{box-sizing:border-box;margin:0;border:none}.cui-divider--horizontal{width:100%;height:var(--cui-border-width-s)}.cui-divider--vertical{width:var(--cui-border-width-s);height:auto;align-self:stretch}.cui-divider--base{background-color:var(--cui-base-divider-primary)}.cui-divider--base.cui-divider--secondary{background-color:var(--cui-base-divider-secondary)}.cui-divider--accent{background-color:var(--cui-accent-divider-primary-default)}.cui-divider--accent.cui-divider--secondary{background-color:var(--cui-accent-divider-secondary-default)}.cui-divider--highlight{background-color:var(--cui-highlight-divider-primary-default)}.cui-divider--highlight.cui-divider--secondary{background-color:var(--cui-highlight-divider-secondary-default)}.cui-divider--info{background-color:var(--cui-info-divider-primary-default)}.cui-divider--info.cui-divider--secondary{background-color:var(--cui-info-divider-secondary-default)}.cui-divider--negative{background-color:var(--cui-negative-divider-primary-default)}.cui-divider--negative.cui-divider--secondary{background-color:var(--cui-negative-divider-secondary-default)}.cui-divider--neutral{background-color:var(--cui-neutral-divider-primary-default)}.cui-divider--neutral.cui-divider--secondary{background-color:var(--cui-neutral-divider-secondary-default)}.cui-divider--positive{background-color:var(--cui-positive-divider-primary-default)}.cui-divider--positive.cui-divider--secondary{background-color:var(--cui-positive-divider-secondary-default)}.cui-divider--warning{background-color:var(--cui-warning-divider-primary-default)}.cui-divider--warning.cui-divider--secondary{background-color:var(--cui-warning-divider-secondary-default)}"}},[1,"cui-divider",{orientation:[513],spacing:[513],variant:[1],importance:[1]}]);function c(){"undefined"!=typeof customElements&&["cui-divider"].forEach((r=>{"cui-divider"===r&&(customElements.get(i(r))||customElements.define(i(r),a))}))}c();const o=a,n=c;export{o as CuiDivider,n as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface CuiIcon extends Components.CuiIcon, HTMLElement {}
|
|
4
|
+
export const CuiIcon: {
|
|
5
|
+
prototype: CuiIcon;
|
|
6
|
+
new (): CuiIcon;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as i,p as c,H as o,h as n}from"./index.js";const a=c(class extends o{constructor(i){super(),!1!==i&&this.__registerHost(),this.__attachShadow(),this.variant="base",this.importance="secondary",this.size="m"}connectedCallback(){this.syncGlyph(),this.syncAria()}onIconChange(){this.syncGlyph()}onLabelChange(){this.syncAria()}syncGlyph(){var i;const c=this.el.querySelector(":scope > [data-cui-icon-glyph]");c&&"I"!==c.tagName&&c.remove();let o=this.el.querySelector(":scope > i[data-cui-icon-glyph]");o||(o=document.createElement("i"),o.setAttribute("data-cui-icon-glyph",""),o.setAttribute("aria-hidden","true"),this.el.appendChild(o)),o.className=null!==(i=this.icon)&&void 0!==i?i:""}syncAria(){var i;const c=null===(i=this.label)||void 0===i?void 0:i.trim();if(c)return this.el.setAttribute("role","img"),this.el.setAttribute("aria-label",c),void this.el.removeAttribute("aria-hidden");this.el.setAttribute("aria-hidden","true"),this.el.removeAttribute("role"),this.el.removeAttribute("aria-label")}render(){return n("span",{key:"76b54ef28027419bfbb5500c5cf4a88a7d01131e",part:"base",class:{"cui-icon":!0,["cui-icon--"+this.variant]:!0,["cui-icon--"+this.importance]:!0,["cui-icon--"+this.size]:!0}},n("slot",{key:"8c4d13ffa3b1cfe3e4d7d47c29127784d62381ff"}))}get el(){return this}static get watchers(){return{icon:[{onIconChange:0}],label:[{onLabelChange:0}]}}static get style(){return'@charset "UTF-8";:host{display:inline-flex}:host([hidden]){display:none}.cui-icon{display:inline-flex;align-items:center;justify-content:center;line-height:1}::slotted(:not([data-cui-icon-glyph])){display:none}.cui-icon--xxs{font-size:var(--cui-icon-size, var(--cui-font-size-xxs))}.cui-icon--xs{font-size:var(--cui-icon-size, var(--cui-font-size-xs))}.cui-icon--s{font-size:var(--cui-icon-size, var(--cui-font-size-s))}.cui-icon--m{font-size:var(--cui-icon-size, var(--cui-font-size-m))}.cui-icon--l{font-size:var(--cui-icon-size, var(--cui-font-size-l))}.cui-icon--xl{font-size:var(--cui-icon-size, var(--cui-font-size-xl))}.cui-icon--xxl{font-size:var(--cui-icon-size, var(--cui-font-size-xxl))}.cui-icon--display-s{font-size:var(--cui-icon-size, var(--cui-font-size-display-s))}.cui-icon--display-m{font-size:var(--cui-icon-size, var(--cui-font-size-display-m))}.cui-icon--display-l{font-size:var(--cui-icon-size, var(--cui-font-size-display-l))}.cui-icon--base.cui-icon--primary{color:var(--cui-icon-color, var(--cui-base-text-primary))}.cui-icon--base.cui-icon--secondary{color:var(--cui-icon-color, var(--cui-base-text-secondary))}.cui-icon--accent.cui-icon--primary{color:var(--cui-icon-color, var(--cui-accent-text-primary-default))}.cui-icon--accent.cui-icon--secondary{color:var(--cui-icon-color, var(--cui-accent-text-secondary-default))}.cui-icon--highlight.cui-icon--primary{color:var(--cui-icon-color, var(--cui-highlight-text-primary-default))}.cui-icon--highlight.cui-icon--secondary{color:var(--cui-icon-color, var(--cui-highlight-text-secondary-default))}.cui-icon--info.cui-icon--primary{color:var(--cui-icon-color, var(--cui-info-text-primary-default))}.cui-icon--info.cui-icon--secondary{color:var(--cui-icon-color, var(--cui-info-text-secondary-default))}.cui-icon--negative.cui-icon--primary{color:var(--cui-icon-color, var(--cui-negative-text-primary-default))}.cui-icon--negative.cui-icon--secondary{color:var(--cui-icon-color, var(--cui-negative-text-secondary-default))}.cui-icon--neutral.cui-icon--primary{color:var(--cui-icon-color, var(--cui-neutral-text-primary-default))}.cui-icon--neutral.cui-icon--secondary{color:var(--cui-icon-color, var(--cui-neutral-text-secondary-default))}.cui-icon--positive.cui-icon--primary{color:var(--cui-icon-color, var(--cui-positive-text-primary-default))}.cui-icon--positive.cui-icon--secondary{color:var(--cui-icon-color, var(--cui-positive-text-secondary-default))}.cui-icon--warning.cui-icon--primary{color:var(--cui-icon-color, var(--cui-warning-text-primary-default))}.cui-icon--warning.cui-icon--secondary{color:var(--cui-icon-color, var(--cui-warning-text-secondary-default))}'}},[257,"cui-icon",{icon:[1],variant:[1],importance:[1],size:[1],label:[1]},void 0,{icon:[{onIconChange:0}],label:[{onLabelChange:0}]}]);function e(){"undefined"!=typeof customElements&&["cui-icon"].forEach((c=>{"cui-icon"===c&&(customElements.get(i(c))||customElements.define(i(c),a))}))}e();const r=a,t=e;export{r as CuiIcon,t as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface CuiProgress extends Components.CuiProgress, HTMLElement {}
|
|
4
|
+
export const CuiProgress: {
|
|
5
|
+
prototype: CuiProgress;
|
|
6
|
+
new (): CuiProgress;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as r,p as e,H as s,h as i}from"./index.js";const a=e(class extends s{constructor(r){super(),!1!==r&&this.__registerHost(),this.__attachShadow(),this.value=0,this.max=100,this.indeterminate=!1,this.size="medium",this.showValue=!1}get resolvedMax(){return Number.isFinite(this.max)&&this.max>0?this.max:100}get clampedValue(){return Number.isFinite(this.value)?Math.min(Math.max(this.value,0),this.resolvedMax):0}get percent(){return this.clampedValue/this.resolvedMax*100}render(){const{indeterminate:r,showValue:e}=this;return i("div",{key:"546c0fb27b6e91a1d153d01ae154c272be633b14",part:"base",class:{"cui-progress":!0,["cui-progress--"+this.size]:!0}},i("progress",{key:"313a769b9ea6c2059816e40c744a74749a55c07b",part:"bar",class:"cui-progress__bar","aria-label":this.label,max:this.resolvedMax,value:r?void 0:this.clampedValue}),e&&!r&&i("span",{key:"1a2edab01738734b397b426d826cfa2dcd4cf89b",part:"value",class:"cui-progress__value"},Math.round(this.percent),"%"))}static get style(){return":host{display:block;--cui-progress-track-color:var(--cui-base-bg-level-2);--cui-progress-indicator-color:var(--cui-accent-surface-primary-default)}:host([hidden]){display:none}.cui-progress{font-family:var(--cui-font-family-base);display:flex;align-items:center;gap:var(--cui-spacing-s)}.cui-progress__bar{flex:1 1 auto;display:block;width:100%;border:none;-webkit-appearance:none;appearance:none;border-radius:var(--cui-border-radius-full);background-color:var(--cui-progress-track-color);box-shadow:inset 0 0 0 var(--cui-border-width-s) var(--cui-base-border-secondary)}.cui-progress__bar::-webkit-progress-bar{border-radius:var(--cui-border-radius-full);background-color:var(--cui-progress-track-color);box-shadow:inset 0 0 0 var(--cui-border-width-s) var(--cui-base-border-secondary)}.cui-progress__bar::-webkit-progress-value{border-radius:var(--cui-border-radius-full);background-color:var(--cui-progress-indicator-color);transition:width var(--cui-transition-base)}.cui-progress__bar::-moz-progress-bar{border-radius:var(--cui-border-radius-full);background-color:var(--cui-progress-indicator-color)}.cui-progress__bar:indeterminate{background-image:linear-gradient(to right, var(--cui-progress-indicator-color), var(--cui-progress-indicator-color));background-repeat:no-repeat;background-size:40% 100%;animation:cui-progress-sweep 1.5s linear infinite}.cui-progress__bar:indeterminate::-webkit-progress-bar{background-image:linear-gradient(to right, var(--cui-progress-indicator-color), var(--cui-progress-indicator-color));background-repeat:no-repeat;background-size:40% 100%;animation:cui-progress-sweep 1.5s linear infinite}.cui-progress__bar:indeterminate::-webkit-progress-value{display:none}.cui-progress__bar:indeterminate::-moz-progress-bar{background-color:transparent}.cui-progress__value{flex:0 0 auto;color:var(--cui-base-text-secondary);font-size:var(--cui-font-size-s);font-weight:var(--cui-font-weight-medium);font-variant-numeric:tabular-nums}.cui-progress--small .cui-progress__bar{height:var(--cui-spacing-xs)}.cui-progress--medium .cui-progress__bar{height:var(--cui-spacing-s)}.cui-progress--large .cui-progress__bar{height:var(--cui-spacing-m)}@keyframes cui-progress-sweep{from{background-position-x:-66.67%}to{background-position-x:166.67%}}@media (prefers-reduced-motion: reduce){.cui-progress__bar::-webkit-progress-value{transition:none}.cui-progress__bar:indeterminate{animation-duration:3s}.cui-progress__bar:indeterminate::-webkit-progress-bar{animation-duration:3s}}"}},[1,"cui-progress",{label:[1],value:[2],max:[2],indeterminate:[4],size:[1],showValue:[4,"show-value"]}]);function o(){"undefined"!=typeof customElements&&["cui-progress"].forEach((e=>{"cui-progress"===e&&(customElements.get(r(e))||customElements.define(r(e),a))}))}o();const t=a,c=o;export{t as CuiProgress,c as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as
|
|
1
|
+
import{t as a,p as c,H as t,h as e}from"./index.js";const i=c(class extends t{constructor(a){super(),!1!==a&&this.__registerHost(),this.__attachShadow(),this.label="",this.variant="neutral",this.size="medium"}render(){return e("span",{key:"35b8ea2176d1923abcda801fee775a9cd46a2fec",class:{"cui-tag":!0,["cui-tag--"+this.variant]:!0,["cui-tag--"+this.size]:!0}},this.label)}static get style(){return":host{display:inline-block}.cui-tag{font-family:var(--cui-font-family-base);display:inline-flex;align-items:center;justify-content:center;border-radius:var(--cui-border-radius-m);font-weight:var(--cui-font-weight-semibold);white-space:nowrap}.cui-tag--small{padding:var(--cui-spacing-xxs) var(--cui-spacing-s);font-size:var(--cui-font-size-xs)}.cui-tag--medium{padding:var(--cui-spacing-xs) var(--cui-spacing-m);font-size:var(--cui-font-size-s)}.cui-tag--accent{background-color:var(--cui-accent-surface-secondary-default);color:var(--cui-accent-text-secondary-default)}.cui-tag--highlight{background-color:var(--cui-highlight-surface-secondary-default);color:var(--cui-highlight-text-secondary-default)}.cui-tag--info{background-color:var(--cui-info-surface-secondary-default);color:var(--cui-info-text-secondary-default)}.cui-tag--negative{background-color:var(--cui-negative-surface-secondary-default);color:var(--cui-negative-text-secondary-default)}.cui-tag--neutral{background-color:var(--cui-neutral-surface-secondary-default);color:var(--cui-neutral-text-secondary-default)}.cui-tag--positive{background-color:var(--cui-positive-surface-secondary-default);color:var(--cui-positive-text-secondary-default)}.cui-tag--warning{background-color:var(--cui-warning-surface-secondary-default);color:var(--cui-warning-text-secondary-default)}"}},[1,"cui-tag",{label:[1],variant:[1],size:[1]}]);function r(){"undefined"!=typeof customElements&&["cui-tag"].forEach((c=>{"cui-tag"===c&&(customElements.get(a(c))||customElements.define(a(c),i))}))}r();const u=i,o=r;export{u as CuiTag,o as defineCustomElement}
|