@xmesh/system-design 0.0.1
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 +472 -0
- package/assets/brand-lockup-dark.svg +9 -0
- package/assets/brand-lockup-light.svg +9 -0
- package/assets/brand-mark.svg +9 -0
- package/colors_and_type.css +11 -0
- package/dist/lit/components/alert/index.css +201 -0
- package/dist/lit/components/alert/index.d.ts +25 -0
- package/dist/lit/components/alert/index.js +191 -0
- package/dist/lit/components/app-bar/index.css +80 -0
- package/dist/lit/components/app-bar/index.d.ts +19 -0
- package/dist/lit/components/app-bar/index.js +120 -0
- package/dist/lit/components/artifact/index.css +166 -0
- package/dist/lit/components/artifact/index.d.ts +37 -0
- package/dist/lit/components/artifact/index.js +294 -0
- package/dist/lit/components/autocomplete/index.css +171 -0
- package/dist/lit/components/autocomplete/index.d.ts +47 -0
- package/dist/lit/components/autocomplete/index.js +404 -0
- package/dist/lit/components/avatar/index.css +62 -0
- package/dist/lit/components/avatar/index.d.ts +19 -0
- package/dist/lit/components/avatar/index.js +112 -0
- package/dist/lit/components/avatar-group/index.css +60 -0
- package/dist/lit/components/avatar-group/index.d.ts +19 -0
- package/dist/lit/components/avatar-group/index.js +97 -0
- package/dist/lit/components/badge/index.css +72 -0
- package/dist/lit/components/badge/index.d.ts +18 -0
- package/dist/lit/components/badge/index.js +115 -0
- package/dist/lit/components/brand-mark/index.css +109 -0
- package/dist/lit/components/brand-mark/index.d.ts +24 -0
- package/dist/lit/components/brand-mark/index.js +116 -0
- package/dist/lit/components/breadcrumbs/index.css +91 -0
- package/dist/lit/components/breadcrumbs/index.d.ts +19 -0
- package/dist/lit/components/breadcrumbs/index.js +104 -0
- package/dist/lit/components/bubble/index.css +182 -0
- package/dist/lit/components/bubble/index.d.ts +72 -0
- package/dist/lit/components/bubble/index.js +617 -0
- package/dist/lit/components/button/index.css +342 -0
- package/dist/lit/components/button/index.d.ts +32 -0
- package/dist/lit/components/button/index.js +202 -0
- package/dist/lit/components/card/index.css +99 -0
- package/dist/lit/components/card/index.d.ts +20 -0
- package/dist/lit/components/card/index.js +133 -0
- package/dist/lit/components/chat/index.css +292 -0
- package/dist/lit/components/chat/index.d.ts +74 -0
- package/dist/lit/components/chat/index.js +589 -0
- package/dist/lit/components/checkbox/index.css +126 -0
- package/dist/lit/components/checkbox/index.d.ts +21 -0
- package/dist/lit/components/checkbox/index.js +138 -0
- package/dist/lit/components/chip/index.css +145 -0
- package/dist/lit/components/chip/index.d.ts +30 -0
- package/dist/lit/components/chip/index.js +230 -0
- package/dist/lit/components/chip-group/index.css +19 -0
- package/dist/lit/components/chip-group/index.d.ts +24 -0
- package/dist/lit/components/chip-group/index.js +171 -0
- package/dist/lit/components/code/index.css +42 -0
- package/dist/lit/components/code/index.d.ts +12 -0
- package/dist/lit/components/code/index.js +68 -0
- package/dist/lit/components/composer/index.css +548 -0
- package/dist/lit/components/composer/index.d.ts +67 -0
- package/dist/lit/components/composer/index.js +713 -0
- package/dist/lit/components/data-table/index.css +166 -0
- package/dist/lit/components/data-table/index.d.ts +55 -0
- package/dist/lit/components/data-table/index.js +390 -0
- package/dist/lit/components/dialog/index.css +124 -0
- package/dist/lit/components/dialog/index.d.ts +24 -0
- package/dist/lit/components/dialog/index.js +199 -0
- package/dist/lit/components/divider/index.css +27 -0
- package/dist/lit/components/divider/index.d.ts +13 -0
- package/dist/lit/components/divider/index.js +67 -0
- package/dist/lit/components/empty-state/index.css +69 -0
- package/dist/lit/components/empty-state/index.d.ts +21 -0
- package/dist/lit/components/empty-state/index.js +123 -0
- package/dist/lit/components/expansion-panel/index.css +120 -0
- package/dist/lit/components/expansion-panel/index.d.ts +22 -0
- package/dist/lit/components/expansion-panel/index.js +174 -0
- package/dist/lit/components/field/index.css +223 -0
- package/dist/lit/components/field/index.d.ts +106 -0
- package/dist/lit/components/field/index.js +388 -0
- package/dist/lit/components/file-input/index.css +257 -0
- package/dist/lit/components/file-input/index.d.ts +30 -0
- package/dist/lit/components/file-input/index.js +298 -0
- package/dist/lit/components/form/index.css +29 -0
- package/dist/lit/components/form/index.d.ts +38 -0
- package/dist/lit/components/form/index.js +192 -0
- package/dist/lit/components/grid/index.css +53 -0
- package/dist/lit/components/grid/index.d.ts +14 -0
- package/dist/lit/components/grid/index.js +82 -0
- package/dist/lit/components/kbd/index.css +35 -0
- package/dist/lit/components/kbd/index.d.ts +11 -0
- package/dist/lit/components/kbd/index.js +43 -0
- package/dist/lit/components/list/index.css +15 -0
- package/dist/lit/components/list/index.d.ts +28 -0
- package/dist/lit/components/list/index.js +188 -0
- package/dist/lit/components/list-item/index.css +119 -0
- package/dist/lit/components/list-item/index.d.ts +20 -0
- package/dist/lit/components/list-item/index.js +127 -0
- package/dist/lit/components/menu/index.css +94 -0
- package/dist/lit/components/menu/index.d.ts +47 -0
- package/dist/lit/components/menu/index.js +386 -0
- package/dist/lit/components/navigation-drawer/index.css +114 -0
- package/dist/lit/components/navigation-drawer/index.d.ts +29 -0
- package/dist/lit/components/navigation-drawer/index.js +218 -0
- package/dist/lit/components/overlay/index.css +171 -0
- package/dist/lit/components/overlay/index.d.ts +65 -0
- package/dist/lit/components/overlay/index.js +566 -0
- package/dist/lit/components/pagination/index.css +102 -0
- package/dist/lit/components/pagination/index.d.ts +22 -0
- package/dist/lit/components/pagination/index.js +184 -0
- package/dist/lit/components/primitives/index.css +504 -0
- package/dist/lit/components/primitives/index.d.ts +25 -0
- package/dist/lit/components/primitives/index.js +283 -0
- package/dist/lit/components/progress/index.css +143 -0
- package/dist/lit/components/progress/index.d.ts +23 -0
- package/dist/lit/components/progress/index.js +180 -0
- package/dist/lit/components/radio-group/index.css +178 -0
- package/dist/lit/components/radio-group/index.d.ts +35 -0
- package/dist/lit/components/radio-group/index.js +292 -0
- package/dist/lit/components/select/index.css +151 -0
- package/dist/lit/components/select/index.d.ts +50 -0
- package/dist/lit/components/select/index.js +390 -0
- package/dist/lit/components/sidebar-item/index.css +133 -0
- package/dist/lit/components/sidebar-item/index.d.ts +20 -0
- package/dist/lit/components/sidebar-item/index.js +105 -0
- package/dist/lit/components/skeleton/index.css +81 -0
- package/dist/lit/components/skeleton/index.d.ts +19 -0
- package/dist/lit/components/skeleton/index.js +119 -0
- package/dist/lit/components/slider/index.css +171 -0
- package/dist/lit/components/slider/index.d.ts +36 -0
- package/dist/lit/components/slider/index.js +302 -0
- package/dist/lit/components/snackbar/index.css +279 -0
- package/dist/lit/components/snackbar/index.d.ts +33 -0
- package/dist/lit/components/snackbar/index.js +195 -0
- package/dist/lit/components/stack/index.css +41 -0
- package/dist/lit/components/stack/index.d.ts +20 -0
- package/dist/lit/components/stack/index.js +103 -0
- package/dist/lit/components/switch/index.css +126 -0
- package/dist/lit/components/switch/index.d.ts +17 -0
- package/dist/lit/components/switch/index.js +116 -0
- package/dist/lit/components/table/index.css +85 -0
- package/dist/lit/components/table/index.d.ts +25 -0
- package/dist/lit/components/table/index.js +139 -0
- package/dist/lit/components/tabs/index.css +116 -0
- package/dist/lit/components/tabs/index.d.ts +49 -0
- package/dist/lit/components/tabs/index.js +320 -0
- package/dist/lit/components/text-field/index.css +90 -0
- package/dist/lit/components/text-field/index.d.ts +17 -0
- package/dist/lit/components/text-field/index.js +101 -0
- package/dist/lit/components/textarea/index.css +55 -0
- package/dist/lit/components/textarea/index.d.ts +26 -0
- package/dist/lit/components/textarea/index.js +124 -0
- package/dist/lit/components/tooltip/index.css +37 -0
- package/dist/lit/components/tooltip/index.d.ts +31 -0
- package/dist/lit/components/tooltip/index.js +196 -0
- package/dist/lit/components/validation/index.css +386 -0
- package/dist/lit/components/validation/index.d.ts +45 -0
- package/dist/lit/components/validation/index.js +318 -0
- package/dist/lit/index.d.ts +50 -0
- package/dist/lit/index.js +59 -0
- package/package.json +81 -0
- package/styles/README.md +346 -0
- package/styles/_elevation.css +24 -0
- package/styles/_fonts.css +6 -0
- package/styles/_layout.css +37 -0
- package/styles/_primitives.css +154 -0
- package/styles/_scroll.css +75 -0
- package/styles/_semantic.css +146 -0
- package/styles/_space.css +61 -0
- package/styles/_type.css +139 -0
- package/styles/_xmesh-extensions.css +232 -0
- package/styles/index.css +44 -0
- package/styles/md3/_color.css +102 -0
- package/styles/md3/_elevation.css +26 -0
- package/styles/md3/_motion.css +35 -0
- package/styles/md3/_shape.css +22 -0
- package/styles/md3/_state.css +22 -0
- package/styles/md3/_type.css +111 -0
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
primitives.css — design system base components
|
|
3
|
+
|
|
4
|
+
Visual chrome for the primitives in components/primitives/index.jsx. Every
|
|
5
|
+
selector here references MD3 system tokens (`var(--md-sys-*)`) or xmesh
|
|
6
|
+
extensions (`var(--xm-*)`) only — never primitives, never raw colors.
|
|
7
|
+
Theme flipping (dark/light) happens automatically through the token layer.
|
|
8
|
+
|
|
9
|
+
Naming: the `ds-` prefix scopes these primitives so they don't collide
|
|
10
|
+
with the legacy class names that still live in styles.css and
|
|
11
|
+
chat-shell.jsx (e.g. `.text-input`, `.icon-btn`, `.chip`). The legacy
|
|
12
|
+
classes keep working; new code reaches for `<Input />`, `<IconButton />`
|
|
13
|
+
etc. instead.
|
|
14
|
+
============================================ */
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/* ---------- Icon ----------
|
|
18
|
+
Just a marker class; sizing is handled inline via width/height on the
|
|
19
|
+
svg so it stays predictable regardless of the surrounding font-size. */
|
|
20
|
+
.ds-icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
/* ---------- Spinner ---------- */
|
|
24
|
+
.ds-spinner {
|
|
25
|
+
display: inline-block;
|
|
26
|
+
border: 2px solid currentColor;
|
|
27
|
+
border-right-color: transparent;
|
|
28
|
+
border-radius: 50%;
|
|
29
|
+
animation: ds-spin 0.7s linear infinite;
|
|
30
|
+
opacity: 0.85;
|
|
31
|
+
vertical-align: middle;
|
|
32
|
+
}
|
|
33
|
+
@keyframes ds-spin { to { transform: rotate(360deg); } }
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/* ---------- Label / Hint / Field ---------- */
|
|
37
|
+
.ds-label {
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
gap: var(--s-1-5);
|
|
41
|
+
font-size: 13px;
|
|
42
|
+
font-weight: 600;
|
|
43
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
44
|
+
line-height: 1.4;
|
|
45
|
+
}
|
|
46
|
+
.ds-label__req {
|
|
47
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
48
|
+
font-weight: 700;
|
|
49
|
+
margin-left: var(--s-0-5);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.ds-hint {
|
|
53
|
+
margin: 0;
|
|
54
|
+
font-size: 12.5px;
|
|
55
|
+
line-height: 1.5;
|
|
56
|
+
}
|
|
57
|
+
.ds-hint--muted { color: var(--xm-color-inverse-on-surface-muted); }
|
|
58
|
+
|
|
59
|
+
.ds-field { display: flex; flex-direction: column; gap: var(--s-1-5); }
|
|
60
|
+
.ds-field__control { display: flex; flex-direction: column; gap: var(--s-1-5); }
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
/* ---------- Input / Textarea ----------
|
|
64
|
+
`ds-input` is the WRAPPER that owns the border + affix layout. The inner
|
|
65
|
+
<input>/<textarea> is borderless and inherits color so left/right adornments
|
|
66
|
+
sit flush. Two tones: `card` for light surfaces, `on-canvas` for the dark
|
|
67
|
+
sidebar/canvas surface. */
|
|
68
|
+
.ds-input {
|
|
69
|
+
position: relative;
|
|
70
|
+
display: inline-flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
width: 100%;
|
|
73
|
+
border: 1.5px solid var(--md-sys-color-outline);
|
|
74
|
+
border-radius: var(--md-sys-shape-corner-button);
|
|
75
|
+
background: var(--md-sys-color-inverse-surface);
|
|
76
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
77
|
+
transition:
|
|
78
|
+
border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
|
|
79
|
+
box-shadow var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
|
|
80
|
+
background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
|
|
81
|
+
}
|
|
82
|
+
.ds-input--ta { align-items: flex-start; }
|
|
83
|
+
.ds-input:focus-within {
|
|
84
|
+
border-color: var(--md-sys-color-primary);
|
|
85
|
+
box-shadow: var(--xm-state-focus-ring);
|
|
86
|
+
}
|
|
87
|
+
.ds-input.is-invalid,
|
|
88
|
+
.ds-input.is-invalid:focus-within {
|
|
89
|
+
border-color: var(--md-sys-color-inverse-on-surface);
|
|
90
|
+
border-width: 2px;
|
|
91
|
+
box-shadow: var(--xm-state-focus-ring);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.ds-input__el {
|
|
95
|
+
flex: 1;
|
|
96
|
+
min-width: 0;
|
|
97
|
+
appearance: none;
|
|
98
|
+
background: transparent;
|
|
99
|
+
border: none;
|
|
100
|
+
outline: none;
|
|
101
|
+
font: inherit;
|
|
102
|
+
font-size: 13.5px;
|
|
103
|
+
color: inherit;
|
|
104
|
+
padding: 9px var(--s-3);
|
|
105
|
+
}
|
|
106
|
+
.ds-input__el::placeholder { color: var(--xm-color-inverse-on-surface-muted); }
|
|
107
|
+
.ds-input__el.mono { font-family: var(--xm-typescale-mono-font); letter-spacing: 0; }
|
|
108
|
+
|
|
109
|
+
.ds-input__el--ta {
|
|
110
|
+
resize: vertical;
|
|
111
|
+
min-height: 78px;
|
|
112
|
+
max-height: 220px;
|
|
113
|
+
line-height: 1.5;
|
|
114
|
+
word-break: break-word;
|
|
115
|
+
white-space: pre-wrap;
|
|
116
|
+
padding: var(--s-2-5) var(--s-3);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* Affix slots — left/right buttons or icons inside the input chrome.
|
|
120
|
+
Padding is removed from the side that has an affix so the inner element
|
|
121
|
+
sits flush. */
|
|
122
|
+
.ds-input__affix {
|
|
123
|
+
display: inline-flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
justify-content: center;
|
|
126
|
+
color: var(--xm-color-inverse-on-surface-muted);
|
|
127
|
+
flex-shrink: 0;
|
|
128
|
+
}
|
|
129
|
+
.ds-input__affix--left { padding-left: var(--s-2-5); }
|
|
130
|
+
.ds-input__affix--right { padding-right: var(--s-1-5); }
|
|
131
|
+
.ds-input__affix--ta { align-self: flex-start; padding-top: var(--s-1-5); }
|
|
132
|
+
.ds-input__affix > button {
|
|
133
|
+
appearance: none;
|
|
134
|
+
border: none;
|
|
135
|
+
background: transparent;
|
|
136
|
+
color: inherit;
|
|
137
|
+
width: 28px; height: 28px;
|
|
138
|
+
border-radius: 6px;
|
|
139
|
+
cursor: pointer;
|
|
140
|
+
display: inline-flex;
|
|
141
|
+
align-items: center;
|
|
142
|
+
justify-content: center;
|
|
143
|
+
}
|
|
144
|
+
.ds-input__affix > button:hover { background: var(--md-sys-color-outline-variant); }
|
|
145
|
+
|
|
146
|
+
/* on-canvas tone — for the dark sidebar/canvas */
|
|
147
|
+
.ds-input--on-canvas {
|
|
148
|
+
background: var(--md-sys-color-surface-container-lowest);
|
|
149
|
+
border-color: var(--md-sys-color-outline);
|
|
150
|
+
color: var(--md-sys-color-on-surface);
|
|
151
|
+
}
|
|
152
|
+
.ds-input--on-canvas .ds-input__el::placeholder { color: var(--xm-color-on-surface-soft); }
|
|
153
|
+
.ds-input--on-canvas:focus-within { border-color: var(--md-sys-color-primary); box-shadow: none; }
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
/* ---------- SearchInput ----------
|
|
157
|
+
Visual sibling of `.detail-search` in styles.css but reusable. The default
|
|
158
|
+
`card` tone matches the inspector's bordered card; `on-canvas` matches the
|
|
159
|
+
sidebar. */
|
|
160
|
+
.ds-search {
|
|
161
|
+
position: relative;
|
|
162
|
+
display: inline-flex;
|
|
163
|
+
align-items: center;
|
|
164
|
+
gap: var(--s-2);
|
|
165
|
+
width: 100%;
|
|
166
|
+
padding: var(--s-1-5) var(--s-2-5);
|
|
167
|
+
border-radius: 8px;
|
|
168
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
169
|
+
background: var(--md-sys-color-inverse-surface);
|
|
170
|
+
color: var(--xm-color-inverse-on-surface-muted);
|
|
171
|
+
transition:
|
|
172
|
+
border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
|
|
173
|
+
box-shadow var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
|
|
174
|
+
}
|
|
175
|
+
.ds-search:focus-within {
|
|
176
|
+
border-color: var(--md-sys-color-primary);
|
|
177
|
+
box-shadow: var(--xm-state-focus-ring);
|
|
178
|
+
}
|
|
179
|
+
.ds-search__icon { display: inline-flex; align-items: center; }
|
|
180
|
+
.ds-search__input {
|
|
181
|
+
flex: 1;
|
|
182
|
+
min-width: 0;
|
|
183
|
+
appearance: none;
|
|
184
|
+
border: none;
|
|
185
|
+
outline: none;
|
|
186
|
+
background: transparent;
|
|
187
|
+
font-size: 13px;
|
|
188
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
189
|
+
}
|
|
190
|
+
.ds-search__input::placeholder { color: var(--xm-color-inverse-on-surface-muted); }
|
|
191
|
+
.ds-search__clear {
|
|
192
|
+
appearance: none;
|
|
193
|
+
border: none;
|
|
194
|
+
background: transparent;
|
|
195
|
+
color: var(--xm-color-inverse-on-surface-muted);
|
|
196
|
+
cursor: pointer;
|
|
197
|
+
padding: var(--s-0-5) var(--s-1);
|
|
198
|
+
border-radius: 4px;
|
|
199
|
+
display: inline-flex;
|
|
200
|
+
align-items: center;
|
|
201
|
+
justify-content: center;
|
|
202
|
+
}
|
|
203
|
+
.ds-search__clear:hover { color: var(--md-sys-color-inverse-on-surface); background: var(--md-sys-color-outline-variant); }
|
|
204
|
+
|
|
205
|
+
.ds-search--on-canvas {
|
|
206
|
+
background: var(--md-sys-color-surface-container-lowest);
|
|
207
|
+
border-color: var(--md-sys-color-outline);
|
|
208
|
+
color: var(--xm-color-on-surface-soft);
|
|
209
|
+
}
|
|
210
|
+
.ds-search--on-canvas .ds-search__input { color: var(--md-sys-color-on-surface); }
|
|
211
|
+
.ds-search--on-canvas .ds-search__input::placeholder { color: var(--xm-color-on-surface-soft); }
|
|
212
|
+
.ds-search--on-canvas:focus-within { border-color: var(--md-sys-color-primary); box-shadow: none; }
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
/* ---------- Link ---------- */
|
|
216
|
+
.ds-link {
|
|
217
|
+
color: var(--xm-color-primary-pressed);
|
|
218
|
+
text-decoration: underline;
|
|
219
|
+
text-decoration-thickness: 1px;
|
|
220
|
+
text-underline-offset: 3px;
|
|
221
|
+
text-decoration-skip-ink: auto;
|
|
222
|
+
transition:
|
|
223
|
+
color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
|
|
224
|
+
text-decoration-thickness var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
|
|
225
|
+
}
|
|
226
|
+
.ds-link:hover { color: var(--md-sys-color-on-primary); text-decoration-thickness: 2px; }
|
|
227
|
+
.ds-link:focus-visible { outline: 2px solid var(--md-sys-color-primary); outline-offset: 2px; border-radius: 2px; }
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
/* ---------- IconButton ---------- */
|
|
231
|
+
.ds-icon-btn {
|
|
232
|
+
appearance: none;
|
|
233
|
+
border: none;
|
|
234
|
+
background: transparent;
|
|
235
|
+
cursor: pointer;
|
|
236
|
+
border-radius: 8px;
|
|
237
|
+
display: inline-flex;
|
|
238
|
+
align-items: center;
|
|
239
|
+
justify-content: center;
|
|
240
|
+
color: var(--xm-color-inverse-on-surface-muted);
|
|
241
|
+
transition:
|
|
242
|
+
background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
|
|
243
|
+
color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
|
|
244
|
+
border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
|
|
245
|
+
flex-shrink: 0;
|
|
246
|
+
}
|
|
247
|
+
.ds-icon-btn--sm { width: 24px; height: 24px; border-radius: 6px; }
|
|
248
|
+
.ds-icon-btn--md { width: 32px; height: 32px; }
|
|
249
|
+
.ds-icon-btn--lg { width: 34px; height: 34px; }
|
|
250
|
+
|
|
251
|
+
.ds-icon-btn--ghost:hover { background: var(--md-sys-color-outline-variant); color: var(--md-sys-color-inverse-on-surface); }
|
|
252
|
+
|
|
253
|
+
.ds-icon-btn--raised {
|
|
254
|
+
border: 1px solid var(--md-sys-color-outline);
|
|
255
|
+
background: var(--md-sys-color-surface-container-low);
|
|
256
|
+
color: var(--md-sys-color-on-surface);
|
|
257
|
+
}
|
|
258
|
+
.ds-icon-btn--raised:hover {
|
|
259
|
+
background: var(--md-sys-color-surface-container-highest);
|
|
260
|
+
color: var(--md-sys-color-on-surface);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.ds-icon-btn--soft-danger { color: var(--xm-color-on-surface-soft); }
|
|
264
|
+
.ds-icon-btn--soft-danger:hover { background: var(--md-sys-color-outline-variant); color: var(--md-sys-color-inverse-on-surface); }
|
|
265
|
+
|
|
266
|
+
.ds-icon-btn[disabled] { cursor: not-allowed; opacity: 0.6; }
|
|
267
|
+
.ds-icon-btn:focus-visible { outline: 2px solid var(--md-sys-color-primary); outline-offset: 2px; }
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
/* ---------- Switch ---------- */
|
|
271
|
+
.ds-switch {
|
|
272
|
+
display: inline-flex;
|
|
273
|
+
align-items: center;
|
|
274
|
+
gap: var(--s-2-5);
|
|
275
|
+
cursor: pointer;
|
|
276
|
+
user-select: none;
|
|
277
|
+
}
|
|
278
|
+
.ds-switch input { display: none; }
|
|
279
|
+
.ds-switch__track {
|
|
280
|
+
width: 38px; height: 22px;
|
|
281
|
+
border-radius: 999px;
|
|
282
|
+
background: var(--md-sys-color-outline);
|
|
283
|
+
position: relative;
|
|
284
|
+
transition: background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
|
|
285
|
+
flex-shrink: 0;
|
|
286
|
+
}
|
|
287
|
+
.ds-switch__thumb {
|
|
288
|
+
position: absolute;
|
|
289
|
+
top: 2px; left: 2px;
|
|
290
|
+
width: 18px; height: 18px;
|
|
291
|
+
border-radius: 50%;
|
|
292
|
+
background: var(--md-sys-color-inverse-surface);
|
|
293
|
+
box-shadow: var(--md-sys-elevation-level1);
|
|
294
|
+
transition: transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
|
|
295
|
+
}
|
|
296
|
+
.ds-switch input:checked + .ds-switch__track { background: var(--md-sys-color-primary); }
|
|
297
|
+
.ds-switch input:checked + .ds-switch__track .ds-switch__thumb { transform: translateX(16px); }
|
|
298
|
+
.ds-switch__label {
|
|
299
|
+
font-size: 13px;
|
|
300
|
+
font-weight: 500;
|
|
301
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
302
|
+
}
|
|
303
|
+
.ds-switch:focus-within .ds-switch__track { box-shadow: 0 0 0 3px var(--md-sys-color-primary-container); }
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
/* ---------- Pill ---------- */
|
|
307
|
+
.ds-pill {
|
|
308
|
+
appearance: none;
|
|
309
|
+
display: inline-flex;
|
|
310
|
+
align-items: center;
|
|
311
|
+
gap: var(--s-1-5);
|
|
312
|
+
border: 1px solid transparent;
|
|
313
|
+
background: transparent;
|
|
314
|
+
color: var(--md-sys-color-on-surface);
|
|
315
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
316
|
+
cursor: pointer;
|
|
317
|
+
font: inherit;
|
|
318
|
+
line-height: 1;
|
|
319
|
+
white-space: nowrap;
|
|
320
|
+
transition:
|
|
321
|
+
background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
|
|
322
|
+
color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
|
|
323
|
+
border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
|
|
324
|
+
}
|
|
325
|
+
.ds-pill--sm { font-size: 11.5px; padding: 5px var(--s-2-5); }
|
|
326
|
+
.ds-pill--md { font-size: 13px; padding: var(--s-2) var(--s-3-5); }
|
|
327
|
+
|
|
328
|
+
.ds-pill--neutral {
|
|
329
|
+
border-color: var(--md-sys-color-outline);
|
|
330
|
+
background: var(--md-sys-color-surface-container-lowest);
|
|
331
|
+
color: var(--md-sys-color-on-surface);
|
|
332
|
+
}
|
|
333
|
+
.ds-pill--neutral:hover {
|
|
334
|
+
background: var(--md-sys-color-surface-container-low);
|
|
335
|
+
border-color: var(--md-sys-color-outline);
|
|
336
|
+
}
|
|
337
|
+
.ds-pill--neutral.is-selected,
|
|
338
|
+
.ds-pill--accent {
|
|
339
|
+
border-color: var(--xm-color-primary-pressed);
|
|
340
|
+
background: var(--md-sys-color-primary-container);
|
|
341
|
+
color: var(--md-sys-color-on-primary);
|
|
342
|
+
}
|
|
343
|
+
.ds-pill--accent:hover { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
|
|
344
|
+
|
|
345
|
+
.ds-pill[disabled] { cursor: not-allowed; opacity: 0.55; }
|
|
346
|
+
.ds-pill:focus-visible { outline: 2px solid var(--md-sys-color-primary); outline-offset: 2px; }
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
/* ---------- Badge ----------
|
|
350
|
+
Variant `soft` is the default tinted background, `solid` fills with the
|
|
351
|
+
tone color. `method` and `ext` use the existing method/ext token sets. */
|
|
352
|
+
.ds-badge {
|
|
353
|
+
display: inline-flex;
|
|
354
|
+
align-items: center;
|
|
355
|
+
gap: var(--s-1);
|
|
356
|
+
font-size: 10px;
|
|
357
|
+
font-weight: 600;
|
|
358
|
+
padding: var(--s-0-5) 7px;
|
|
359
|
+
border-radius: 4px;
|
|
360
|
+
letter-spacing: 0.04em;
|
|
361
|
+
flex-shrink: 0;
|
|
362
|
+
line-height: 1.4;
|
|
363
|
+
font-feature-settings: "tnum";
|
|
364
|
+
}
|
|
365
|
+
.ds-badge--sm { font-size: 9.5px; padding: var(--s-0-5) 5px; letter-spacing: 0.05em; }
|
|
366
|
+
.ds-badge--md { /* default */ }
|
|
367
|
+
.ds-badge--lg { font-size: 11.5px; padding: 3px var(--s-2); }
|
|
368
|
+
|
|
369
|
+
.ds-badge.mono { font-family: var(--xm-typescale-mono-font); }
|
|
370
|
+
|
|
371
|
+
/* soft variant */
|
|
372
|
+
.ds-badge--soft.ds-badge--neutral { background: var(--md-sys-color-outline-variant); color: var(--xm-color-inverse-on-surface-muted); }
|
|
373
|
+
.ds-badge--soft.ds-badge--accent { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary); }
|
|
374
|
+
|
|
375
|
+
/* solid variant */
|
|
376
|
+
.ds-badge--solid.ds-badge--neutral { background: var(--xm-color-inverse-on-surface-muted); color: var(--md-sys-color-inverse-surface); }
|
|
377
|
+
.ds-badge--solid.ds-badge--accent { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
|
|
378
|
+
|
|
379
|
+
/* method variant — children carry the lowercased method name; consumers
|
|
380
|
+
pass `tone` matching: get / post / put / delete / patch */
|
|
381
|
+
.ds-badge--method { font-family: var(--xm-typescale-mono-font); text-transform: uppercase; }
|
|
382
|
+
.ds-badge--method.ds-badge--get { background: var(--xm-method-get-bg); color: var(--xm-method-get-ink); }
|
|
383
|
+
.ds-badge--method.ds-badge--post { background: var(--xm-method-post-bg); color: var(--xm-method-post-ink); }
|
|
384
|
+
.ds-badge--method.ds-badge--put { background: var(--xm-method-put-bg); color: var(--xm-method-put-ink); }
|
|
385
|
+
.ds-badge--method.ds-badge--delete { background: var(--xm-method-delete-bg); color: var(--xm-method-delete-ink); }
|
|
386
|
+
.ds-badge--method.ds-badge--patch { background: var(--xm-method-patch-bg); color: var(--xm-method-patch-ink); }
|
|
387
|
+
|
|
388
|
+
/* ext variant */
|
|
389
|
+
.ds-badge--ext { font-family: var(--xm-typescale-mono-font); text-transform: uppercase; font-size: 9.5px; padding: 3px var(--s-1-5); letter-spacing: 0.05em; font-weight: 700; }
|
|
390
|
+
.ds-badge--ext.ds-badge--yml,
|
|
391
|
+
.ds-badge--ext.ds-badge--yaml { background: var(--xm-ext-yml-bg); color: var(--xm-ext-yml-ink); }
|
|
392
|
+
.ds-badge--ext.ds-badge--json { background: var(--xm-ext-json-bg); color: var(--xm-ext-json-ink); }
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
/* ---------- Kbd ---------- */
|
|
396
|
+
.ds-kbd {
|
|
397
|
+
display: inline-flex;
|
|
398
|
+
align-items: center;
|
|
399
|
+
font-family: var(--xm-typescale-mono-font);
|
|
400
|
+
font-size: 11px;
|
|
401
|
+
padding: var(--s-0-5) var(--s-1-5);
|
|
402
|
+
border-radius: 4px;
|
|
403
|
+
background: var(--md-sys-color-surface-container-high);
|
|
404
|
+
color: var(--xm-color-inverse-on-surface-muted);
|
|
405
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
406
|
+
font-feature-settings: "tnum";
|
|
407
|
+
}
|
|
408
|
+
.ds-kbd--accent {
|
|
409
|
+
background: color-mix(in oklch, var(--md-sys-color-primary-container) 50%, transparent);
|
|
410
|
+
color: var(--md-sys-color-on-primary);
|
|
411
|
+
border-color: transparent;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
/* ---------- Divider ---------- */
|
|
416
|
+
.ds-divider { height: 1px; width: 100%; }
|
|
417
|
+
.ds-divider--card { background: var(--md-sys-color-outline-variant); }
|
|
418
|
+
.ds-divider--canvas { background: var(--md-sys-color-outline); }
|
|
419
|
+
.ds-divider--strong { background: var(--md-sys-color-outline); }
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
/* ---------- Dot ---------- */
|
|
423
|
+
.ds-dot { display: inline-block; border-radius: 50%; flex-shrink: 0; }
|
|
424
|
+
.ds-dot--accent { background: var(--md-sys-color-primary); }
|
|
425
|
+
.ds-dot--muted { background: var(--xm-color-inverse-on-surface-muted); }
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
/* ---------- Sep — middot inline metadata divider ----------
|
|
429
|
+
Used between inline metadata fragments, e.g. "Document · MD" or
|
|
430
|
+
"12:30 · 4 KB". The element renders as a styled middot character;
|
|
431
|
+
pass it the literal "·" as children. Opacity is applied so the
|
|
432
|
+
ink reads softer than its surrounding text on either surface. */
|
|
433
|
+
.ds-sep { opacity: 0.5; }
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
/* ---------- TabBar ---------- */
|
|
437
|
+
.ds-tabs {
|
|
438
|
+
display: flex;
|
|
439
|
+
gap: var(--s-0-5);
|
|
440
|
+
border-bottom: 1px solid var(--md-sys-color-outline-variant);
|
|
441
|
+
}
|
|
442
|
+
.ds-tab {
|
|
443
|
+
appearance: none;
|
|
444
|
+
background: transparent;
|
|
445
|
+
border: none;
|
|
446
|
+
padding: var(--s-2) var(--s-3) var(--s-2-5);
|
|
447
|
+
font-size: 13px;
|
|
448
|
+
font-weight: 500;
|
|
449
|
+
color: var(--xm-color-inverse-on-surface-muted);
|
|
450
|
+
cursor: pointer;
|
|
451
|
+
border-bottom: 2px solid transparent;
|
|
452
|
+
margin-bottom: -1px;
|
|
453
|
+
display: inline-flex;
|
|
454
|
+
align-items: center;
|
|
455
|
+
gap: var(--s-1-5);
|
|
456
|
+
transition:
|
|
457
|
+
color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
|
|
458
|
+
border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
|
|
459
|
+
}
|
|
460
|
+
.ds-tab:hover { color: var(--md-sys-color-inverse-on-surface); }
|
|
461
|
+
.ds-tab.is-active {
|
|
462
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
463
|
+
border-bottom-color: var(--xm-color-primary-pressed);
|
|
464
|
+
}
|
|
465
|
+
.ds-tab__count {
|
|
466
|
+
font-size: 11px;
|
|
467
|
+
background: var(--md-sys-color-outline-variant);
|
|
468
|
+
color: var(--xm-color-inverse-on-surface-muted);
|
|
469
|
+
padding: 1px var(--s-1-5);
|
|
470
|
+
border-radius: 99px;
|
|
471
|
+
font-feature-settings: "tnum";
|
|
472
|
+
}
|
|
473
|
+
.ds-tab.is-active .ds-tab__count { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary); }
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
/* ---------- Drawer / on-canvas overrides (applied where a primitive
|
|
477
|
+
lives on a dark surface — sidebar or settings drawer) ----------
|
|
478
|
+
Mirrors the existing drawer overrides in styles.css for the legacy
|
|
479
|
+
classes, so a `<Field>` or `<Switch>` dropped into the drawer reads
|
|
480
|
+
correctly in the dark theme. */
|
|
481
|
+
:root[data-theme="dark"] .drawer .ds-label,
|
|
482
|
+
:root[data-theme="dark"] .drawer .ds-hint--muted {
|
|
483
|
+
color: var(--md-sys-color-on-surface);
|
|
484
|
+
}
|
|
485
|
+
:root[data-theme="dark"] .drawer .ds-input--card {
|
|
486
|
+
background: var(--md-sys-color-surface-container-low);
|
|
487
|
+
border-color: var(--md-sys-color-outline);
|
|
488
|
+
color: var(--md-sys-color-on-surface);
|
|
489
|
+
}
|
|
490
|
+
:root[data-theme="dark"] .drawer .ds-input--card .ds-input__el::placeholder {
|
|
491
|
+
color: var(--xm-color-on-surface-soft);
|
|
492
|
+
}
|
|
493
|
+
:root[data-theme="dark"] .drawer .ds-input--card:focus-within {
|
|
494
|
+
border-color: var(--md-sys-color-primary);
|
|
495
|
+
box-shadow: none;
|
|
496
|
+
}
|
|
497
|
+
:root[data-theme="dark"] .drawer .ds-input__affix > button { color: var(--xm-color-on-surface-soft); }
|
|
498
|
+
:root[data-theme="dark"] .drawer .ds-input__affix > button:hover {
|
|
499
|
+
background: var(--md-sys-color-surface-container-highest);
|
|
500
|
+
color: var(--md-sys-color-on-surface);
|
|
501
|
+
}
|
|
502
|
+
:root[data-theme="dark"] .drawer .ds-switch__track { background: var(--md-sys-color-surface-container-highest); }
|
|
503
|
+
:root[data-theme="dark"] .drawer .ds-switch__label { color: var(--md-sys-color-on-surface); }
|
|
504
|
+
:root[data-theme="dark"] .drawer .ds-divider--card { background: var(--md-sys-color-outline); }
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import type { TemplateResult } from "lit";
|
|
3
|
+
declare class LightElement extends LitElement {
|
|
4
|
+
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
5
|
+
}
|
|
6
|
+
declare class XmIcon extends LightElement {
|
|
7
|
+
size: number;
|
|
8
|
+
viewBox: string;
|
|
9
|
+
strokeWidth: number;
|
|
10
|
+
fill: string;
|
|
11
|
+
title: string;
|
|
12
|
+
render(): TemplateResult;
|
|
13
|
+
}
|
|
14
|
+
declare class XmSpinner extends LightElement {
|
|
15
|
+
size: number;
|
|
16
|
+
className: string;
|
|
17
|
+
render(): TemplateResult;
|
|
18
|
+
}
|
|
19
|
+
declare global {
|
|
20
|
+
interface HTMLElementTagNameMap {
|
|
21
|
+
"xm-icon": XmIcon;
|
|
22
|
+
"xm-spinner": XmSpinner;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export {};
|