@threadlabs/looma 0.33.1 → 0.34.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/components/shared/overlay.js +8 -2
- package/components/shared/surface-material.js +21 -0
- package/components/ui-button/ui-button.html +63 -47
- package/components/ui-card/ui-card.html +44 -2
- package/components/ui-curve-editor/curve.js +10 -0
- package/components/ui-curve-editor/ui-curve-editor.html +181 -0
- package/components/ui-curve-editor/ui-curve-editor.js +51 -0
- package/components/ui-dialog/ui-dialog.html +62 -1
- package/components/ui-dialog/ui-dialog.js +9 -1
- package/components/ui-icon-button/ui-icon-button.html +75 -23
- package/components/ui-menu/ui-menu.html +60 -0
- package/components/ui-menu/ui-menu.js +1 -1
- package/components/ui-number-input/arithmetic.js +47 -0
- package/components/ui-number-input/ui-number-input.html +62 -0
- package/components/ui-number-input/ui-number-input.js +44 -0
- package/components/ui-popover/ui-popover.html +64 -1
- package/components/ui-popover/ui-popover.js +1 -1
- package/components/ui-slider/ui-slider.html +84 -0
- package/components/ui-slider/ui-slider.js +29 -0
- package/components/ui-tabs/ui-tabs.html +6 -1
- package/components/ui-text/ui-text.html +31 -6
- package/components/ui-tooltip/ui-tooltip.html +60 -0
- package/components/ui-tooltip/ui-tooltip.js +1 -1
- package/dist/index.js +46 -43
- package/docs/README.md +34 -4
- package/docs/card.html +16 -2
- package/docs/card.js +17 -2
- package/docs/catalog.json +1154 -144
- package/docs/customizer-render.mjs +35 -9
- package/docs/customizer.js +83 -20
- package/docs/documentation.css +9 -1
- package/docs/index.d.ts +4 -2
- package/docs/index.mjs +1 -1
- package/docs/preview.js +2 -0
- package/docs/render.mjs +15 -6
- package/docs/site.mjs +50 -9
- package/docs/theme-session.mjs +51 -0
- package/docs/theme.mjs +134 -15
- package/docs/value-editors.mjs +33 -0
- package/package.json +2 -2
- package/styles/ui-button.css +45 -45
- package/styles/ui-card.css +47 -0
- package/styles/ui-curve-editor.css +109 -0
- package/styles/ui-dialog.css +132 -0
- package/styles/ui-icon-button.css +63 -20
- package/styles/ui-menu.css +72 -0
- package/styles/ui-number-input.css +34 -0
- package/styles/ui-popover.css +74 -0
- package/styles/ui-slider.css +53 -0
- package/styles/ui-tabs.css +6 -1
- package/styles/ui-text.css +23 -1
- package/styles/ui-tooltip.css +72 -0
- package/theme-system.css +26 -10
- package/tokens.css +8 -2
- package/vanilla/UiButton.d.ts +1 -0
- package/vanilla/UiButton.js +195 -130
- package/vanilla/UiCard.d.ts +1 -1
- package/vanilla/UiCard.js +1 -1
- package/vanilla/UiCurveEditor.d.ts +28 -0
- package/vanilla/UiCurveEditor.js +134 -0
- package/vanilla/UiIconButton.d.ts +2 -1
- package/vanilla/UiIconButton.js +58 -31
- package/vanilla/UiNumberInput.d.ts +33 -0
- package/vanilla/UiNumberInput.js +79 -0
- package/vanilla/UiSlider.d.ts +33 -0
- package/vanilla/UiSlider.js +125 -0
- package/vanilla/UiText.d.ts +2 -2
- package/vanilla/UiText.js +45 -11
- package/vanilla/index.js +3 -0
- package/vue/UiButton.d.ts +6 -0
- package/vue/UiButton.vue +155 -56
- package/vue/UiCard.d.ts +2 -2
- package/vue/UiCard.vue +55 -5
- package/vue/UiCurveEditor.d.ts +53 -0
- package/vue/UiCurveEditor.js +2 -0
- package/vue/UiCurveEditor.vue +427 -0
- package/vue/UiDialog.vue +177 -1
- package/vue/UiIconButton.d.ts +8 -2
- package/vue/UiIconButton.vue +164 -34
- package/vue/UiMenu.vue +89 -0
- package/vue/UiNumberInput.d.ts +83 -0
- package/vue/UiNumberInput.js +2 -0
- package/vue/UiNumberInput.vue +370 -0
- package/vue/UiPopover.vue +92 -1
- package/vue/UiSlider.d.ts +83 -0
- package/vue/UiSlider.js +2 -0
- package/vue/UiSlider.vue +412 -0
- package/vue/UiTabs.vue +6 -1
- package/vue/UiText.d.ts +7 -5
- package/vue/UiText.vue +104 -22
- package/vue/UiTooltip.vue +89 -0
- package/vue/chunks/UiActionBar.js +1 -1
- package/vue/chunks/UiAffordanceScope.js +2 -2
- package/vue/chunks/UiAvatar.js +2 -2
- package/vue/chunks/UiAvatarGroup.js +2 -2
- package/vue/chunks/UiBadge.js +2 -2
- package/vue/chunks/UiBreadcrumbItem.js +2 -2
- package/vue/chunks/UiBreadcrumbs.js +2 -2
- package/vue/chunks/UiButton.js +94 -11
- package/vue/chunks/UiCallout.js +2 -2
- package/vue/chunks/UiCard.js +6 -5
- package/vue/chunks/UiCheckbox.js +2 -2
- package/vue/chunks/UiCluster.js +2 -2
- package/vue/chunks/UiColorPicker.js +2 -2
- package/vue/chunks/UiCombobox.js +2 -2
- package/vue/chunks/UiContainer.js +2 -2
- package/vue/chunks/UiContextMenu.js +2 -2
- package/vue/chunks/UiCover.js +2 -2
- package/vue/chunks/UiCurveEditor.js +413 -0
- package/vue/chunks/UiDescriptionItem.js +2 -2
- package/vue/chunks/UiDescriptionList.js +2 -2
- package/vue/chunks/UiDialog.js +4 -4
- package/vue/chunks/UiDisclosure.js +2 -2
- package/vue/chunks/UiEditable.js +2 -2
- package/vue/chunks/UiEditorBlockActions.js +2 -2
- package/vue/chunks/UiEditorChipEditor.js +2 -2
- package/vue/chunks/UiEditorCodeLanguage.js +2 -2
- package/vue/chunks/UiEditorFootnoteEditor.js +2 -2
- package/vue/chunks/UiEditorImageToolbar.js +3 -3
- package/vue/chunks/UiEditorInsertTableGrid.js +2 -2
- package/vue/chunks/UiEditorLinkCard.js +3 -3
- package/vue/chunks/UiEditorLinkForm.js +3 -3
- package/vue/chunks/UiEditorMentionMenu.js +2 -2
- package/vue/chunks/UiEditorMentionMenuItem.js +2 -2
- package/vue/chunks/UiEditorSlashMenu.js +2 -2
- package/vue/chunks/UiEditorSlashMenuGroup.js +2 -2
- package/vue/chunks/UiEditorSlashMenuItem.js +2 -2
- package/vue/chunks/UiEditorSurface.js +2 -2
- package/vue/chunks/UiEditorTableContextMenu.js +2 -2
- package/vue/chunks/UiEditorTableOverlay.js +2 -2
- package/vue/chunks/UiEditorTableToolbar.js +2 -2
- package/vue/chunks/UiEditorToolbar.js +2 -2
- package/vue/chunks/UiFloatingActionButton.js +2 -2
- package/vue/chunks/UiFormField.js +2 -2
- package/vue/chunks/UiGrid.js +2 -2
- package/vue/chunks/UiIcon.js +2 -2
- package/vue/chunks/UiIconButton.js +77 -11
- package/vue/chunks/UiImage.js +2 -2
- package/vue/chunks/UiInput.js +2 -2
- package/vue/chunks/UiInputGroup.js +2 -2
- package/vue/chunks/UiList.js +2 -2
- package/vue/chunks/UiListItem.js +2 -2
- package/vue/chunks/UiListbox.js +2 -2
- package/vue/chunks/UiMenu.js +3 -3
- package/vue/chunks/UiMenuGroup.js +2 -2
- package/vue/chunks/UiMenuItem.js +2 -2
- package/vue/chunks/UiMeter.js +2 -2
- package/vue/chunks/UiNavItem.js +2 -2
- package/vue/chunks/UiNumberInput.js +390 -0
- package/vue/chunks/UiPageHeader.js +2 -2
- package/vue/chunks/UiPopover.js +4 -4
- package/vue/chunks/UiRadio.js +2 -2
- package/vue/chunks/UiRadioGroup.js +2 -2
- package/vue/chunks/UiReel.js +2 -2
- package/vue/chunks/UiScrollArea.js +2 -2
- package/vue/chunks/UiSearchResultRow.js +2 -2
- package/vue/chunks/UiSearchShell.js +2 -2
- package/vue/chunks/UiSection.js +2 -2
- package/vue/chunks/UiSelect.js +2 -2
- package/vue/chunks/UiSeparator.js +2 -2
- package/vue/chunks/UiSidebar.js +2 -2
- package/vue/chunks/UiSlider.js +396 -0
- package/vue/chunks/UiSpinner.js +2 -2
- package/vue/chunks/UiStack.js +2 -2
- package/vue/chunks/UiStatusMessage.js +2 -2
- package/vue/chunks/UiSwatch.js +2 -2
- package/vue/chunks/UiSwitch.js +2 -2
- package/vue/chunks/UiSwitcher.js +2 -2
- package/vue/chunks/UiTable.js +2 -2
- package/vue/chunks/UiTabs.js +3 -3
- package/vue/chunks/UiText.js +53 -12
- package/vue/chunks/UiTextarea.js +2 -2
- package/vue/chunks/UiToast.js +2 -2
- package/vue/chunks/UiToastRegion.js +2 -2
- package/vue/chunks/UiTooltip.js +3 -3
- package/vue/chunks/UiTopBar.js +1 -1
- package/vue/chunks/UiTree.js +2 -2
- package/vue/chunks/UiTreeItem.js +2 -2
- package/vue/chunks/_plugin-vue_export-helper.js +68 -2
- package/vue/chunks/props.js +24 -1
- package/vue/components.css +2215 -1203
- package/vue/editor/index.js +623 -211
- package/vue/index.d.ts +3 -0
- package/vue/index.js +5 -2
package/styles/ui-popover.css
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
:scope:where([data-component~="ui-popover"]) {
|
|
41
|
+
--_ui-material-scale: 0.55;
|
|
41
42
|
--_ui-popover-surface: var(--ui-popover-surface);
|
|
42
43
|
--_ui-popover-border: var(--ui-popover-border);
|
|
43
44
|
--_ui-popover-radius: var(--ui-popover-radius);
|
|
@@ -70,6 +71,65 @@
|
|
|
70
71
|
box-shadow: var(--_ui-popover-shadow, var(--ui-overlay-shadow, var(--ui-elevation-overlay, var(--ui-shadow-lg))));
|
|
71
72
|
}
|
|
72
73
|
|
|
74
|
+
/* Purpose and measured size shape one shared separation lever. The content plane stays opaque;
|
|
75
|
+
transparency, saturation and edge light belong to the surrounding decorative material. */
|
|
76
|
+
.surface {
|
|
77
|
+
--_ui-material-glassiness: clamp(0, var(--ui-glassiness, 0), 1);
|
|
78
|
+
--_ui-material-separation: clamp(0, var(--ui-surface-separation, 0), 1);
|
|
79
|
+
--_ui-material-active: clamp(0, calc((var(--_ui-material-glassiness) + var(--_ui-material-separation)) * 100000), 1);
|
|
80
|
+
--_ui-material-rim: calc((var(--_ui-material-separation) + var(--_ui-material-glassiness) * 0.25) * var(--_ui-material-scale, 0.55) * 8px);
|
|
81
|
+
--_ui-material-content-color: var(--_ui-popover-surface, var(--ui-material-content, var(--ui-overlay-surface, var(--ui-surface-elevated))));
|
|
82
|
+
--_ui-material-rim-color: color-mix(in srgb, var(--ui-material-glass, var(--ui-surface-elevated)) calc(var(--_ui-material-active) * 100%), transparent);
|
|
83
|
+
background:
|
|
84
|
+
linear-gradient(var(--_ui-material-content-color), var(--_ui-material-content-color)) padding-box,
|
|
85
|
+
linear-gradient(var(--_ui-material-rim-color), var(--_ui-material-rim-color)) border-box,
|
|
86
|
+
var(--_ui-material-content-color) padding-box;
|
|
87
|
+
border-width: calc(var(--ui-border-width) + var(--_ui-material-rim));
|
|
88
|
+
border-color: var(
|
|
89
|
+
--_ui-popover-border,
|
|
90
|
+
color-mix(in oklab, var(--ui-overlay-border, var(--ui-border-strong)) calc((1 - var(--_ui-material-active)) * 100%), transparent)
|
|
91
|
+
);
|
|
92
|
+
box-shadow: var(
|
|
93
|
+
--_ui-popover-shadow,
|
|
94
|
+
var(
|
|
95
|
+
--ui-overlay-shadow,
|
|
96
|
+
0 calc(var(--_ui-material-separation) * var(--_ui-material-scale, 0.55) * 8px) calc(
|
|
97
|
+
var(--_ui-material-separation) * var(--_ui-material-scale, 0.55) * 24px
|
|
98
|
+
) color-mix(in oklab, var(--ui-text-primary) 15%, transparent),
|
|
99
|
+
inset 0 0 0 calc(var(--_ui-material-active) * var(--ui-border-width)) var(--ui-material-edge, var(--ui-border-strong)),
|
|
100
|
+
var(--ui-elevation-overlay, var(--ui-shadow-lg))
|
|
101
|
+
)
|
|
102
|
+
);
|
|
103
|
+
backdrop-filter: blur(calc(var(--_ui-material-glassiness) * var(--_ui-material-scale, 0.55) * 18px))
|
|
104
|
+
saturate(calc(1 + var(--_ui-material-glassiness) * var(--_ui-material-scale, 0.55) * 0.18));
|
|
105
|
+
-webkit-backdrop-filter: blur(calc(var(--_ui-material-glassiness) * var(--_ui-material-scale, 0.55) * 18px))
|
|
106
|
+
saturate(calc(1 + var(--_ui-material-glassiness) * var(--_ui-material-scale, 0.55) * 0.18));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
|
|
110
|
+
.surface {
|
|
111
|
+
background: var(--_ui-material-content-color);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@media (prefers-reduced-transparency: reduce) {
|
|
116
|
+
.surface {
|
|
117
|
+
background: var(--_ui-material-content-color);
|
|
118
|
+
backdrop-filter: none;
|
|
119
|
+
-webkit-backdrop-filter: none;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@media (forced-colors: active) {
|
|
124
|
+
.surface {
|
|
125
|
+
background: Canvas;
|
|
126
|
+
border-color: CanvasText;
|
|
127
|
+
box-shadow: none;
|
|
128
|
+
backdrop-filter: none;
|
|
129
|
+
-webkit-backdrop-filter: none;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
73
133
|
/* A toolbar or card can supply its own surface, including an unclipped shadow. */
|
|
74
134
|
:scope:where([data-component~="ui-popover"])[data-ui-popover-state~="bare"] .surface {
|
|
75
135
|
overflow: visible;
|
|
@@ -77,6 +137,8 @@
|
|
|
77
137
|
border: 0;
|
|
78
138
|
background: transparent;
|
|
79
139
|
box-shadow: none;
|
|
140
|
+
backdrop-filter: none;
|
|
141
|
+
-webkit-backdrop-filter: none;
|
|
80
142
|
}
|
|
81
143
|
|
|
82
144
|
:scope:where([data-component~="ui-popover"]):not([data-ui-popover-state~="internalOpen"]) {
|
|
@@ -134,6 +196,18 @@
|
|
|
134
196
|
@scope ([data-component~="ui-popover"]) to ([data-component]) {
|
|
135
197
|
/* This component's hooks style the element they are set on, and never a nested one. */
|
|
136
198
|
|
|
199
|
+
/* Purpose and measured size shape one shared separation lever. The content plane stays opaque;
|
|
200
|
+
transparency, saturation and edge light belong to the surrounding decorative material. */
|
|
201
|
+
|
|
202
|
+
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
@media (prefers-reduced-transparency: reduce) {
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
@media (forced-colors: active) {
|
|
209
|
+
}
|
|
210
|
+
|
|
137
211
|
/* A toolbar or card can supply its own surface, including an unclipped shadow. */
|
|
138
212
|
|
|
139
213
|
@starting-style {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/* Generated by HTML Next 1.0.0-alpha.69. Do not edit. */
|
|
2
|
+
@supports (-moz-appearance: none) {
|
|
3
|
+
:where([data-component], [data-slotted]) { --html-next-scope-owner: boundary; }
|
|
4
|
+
:where([data-slotted]:not([data-component])) { --html-next-scope-owner: projected !important; }
|
|
5
|
+
}
|
|
6
|
+
@supports (-moz-appearance: none) {
|
|
7
|
+
[data-component~="ui-slider"] { --html-next-scope-owner: "ui-slider" !important; }
|
|
8
|
+
}
|
|
9
|
+
@scope ([data-component~="ui-slider"]) to ([data-component], [data-slotted]) {
|
|
10
|
+
:scope:where([data-component~="ui-slider"]) {
|
|
11
|
+
display: grid !important;
|
|
12
|
+
grid-template-columns: minmax(4rem, 1fr) minmax(8rem, 1fr) !important;
|
|
13
|
+
align-items: center !important;
|
|
14
|
+
gap: var(--ui-space-2) !important;
|
|
15
|
+
margin: 0 !important;
|
|
16
|
+
padding: 0 !important;
|
|
17
|
+
min-inline-size: 0;
|
|
18
|
+
}
|
|
19
|
+
input {
|
|
20
|
+
inline-size: 100%;
|
|
21
|
+
min-inline-size: 0;
|
|
22
|
+
min-block-size: var(--ui-control-size-md);
|
|
23
|
+
margin: 0 !important;
|
|
24
|
+
accent-color: var(--ui-accent-solid);
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
}
|
|
27
|
+
:scope:where([data-component~="ui-slider"])[data-ui-slider-state~="size=sm"] input {
|
|
28
|
+
min-block-size: var(--ui-control-size-sm);
|
|
29
|
+
}
|
|
30
|
+
:scope:where([data-component~="ui-slider"])[data-ui-slider-state~="size=lg"] input {
|
|
31
|
+
min-block-size: var(--ui-control-size-lg);
|
|
32
|
+
}
|
|
33
|
+
input:focus-visible {
|
|
34
|
+
outline: var(--ui-focus-width) solid var(--ui-control-focus, var(--ui-accent-solid));
|
|
35
|
+
outline-offset: var(--ui-space-1);
|
|
36
|
+
border-radius: var(--ui-radius-sm);
|
|
37
|
+
}
|
|
38
|
+
input:disabled {
|
|
39
|
+
cursor: not-allowed;
|
|
40
|
+
}
|
|
41
|
+
@media (pointer: coarse) {
|
|
42
|
+
input {
|
|
43
|
+
min-block-size: max(var(--ui-control-size-md), var(--ui-control-min-block-size));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
:scope:where([data-component~="ui-slider"])[hidden] {
|
|
47
|
+
display: none !important;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
@scope ([data-component~="ui-slider"]) to ([data-component]) {
|
|
51
|
+
@media (pointer: coarse) {
|
|
52
|
+
}
|
|
53
|
+
}
|
package/styles/ui-tabs.css
CHANGED
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
syntax: "*";
|
|
21
21
|
inherits: false;
|
|
22
22
|
}
|
|
23
|
+
@property --ui-tabs-panel-padding {
|
|
24
|
+
syntax: "*";
|
|
25
|
+
inherits: false;
|
|
26
|
+
}
|
|
23
27
|
|
|
24
28
|
/* Density resolves into the tab row's own values; the public tokens still override them. */
|
|
25
29
|
:scope:where([data-component~="ui-tabs"]) {
|
|
@@ -27,6 +31,7 @@
|
|
|
27
31
|
--_ui-tabs-tab-min-block-size: var(--ui-tabs-tab-min-block-size);
|
|
28
32
|
--_ui-tabs-tab-padding-block: var(--ui-tabs-tab-padding-block);
|
|
29
33
|
--_ui-tabs-tab-padding-inline: var(--ui-tabs-tab-padding-inline);
|
|
34
|
+
--_ui-tabs-panel-padding: var(--ui-tabs-panel-padding);
|
|
30
35
|
|
|
31
36
|
--_tab-min-block-size: var(--ui-control-size);
|
|
32
37
|
--_tab-padding-block: var(--ui-space-2);
|
|
@@ -157,7 +162,7 @@
|
|
|
157
162
|
border-radius: var(--ui-radius-sm);
|
|
158
163
|
}
|
|
159
164
|
.panels > :where([data-slotted], [data-slotted] *):is(*) {
|
|
160
|
-
padding: var(--ui-space-4) !important;
|
|
165
|
+
padding: var(--_ui-tabs-panel-padding, var(--ui-space-4)) !important;
|
|
161
166
|
}
|
|
162
167
|
|
|
163
168
|
:scope:where([data-component~="ui-tabs"])[data-ui-tabs-state~="orientation=vertical"] .list button,
|
package/styles/ui-text.css
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
/* A heading drops the browser's heading size and weight, so size and weight set it as they set
|
|
25
25
|
any text, and inherit keeps the text around it. */
|
|
26
|
-
:scope:where([data-component~="ui-text"]):is(h2, h3, h4, h5, h6) {
|
|
26
|
+
:scope:where([data-component~="ui-text"]):is(h1, h2, h3, h4, h5, h6) {
|
|
27
27
|
font-family: var(--ui-font-display, inherit);
|
|
28
28
|
font-size: inherit;
|
|
29
29
|
font-weight: inherit;
|
|
@@ -86,10 +86,32 @@
|
|
|
86
86
|
font-weight: var(--ui-font-semibold);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
:scope:where([data-component~="ui-text"])[data-ui-text-state~="variant=display"], :scope:where([data-component~="ui-text"])[data-ui-text-state~="variant=heading"] {
|
|
90
|
+
font-family: var(--ui-font-display, var(--ui-font-family-sans));
|
|
91
|
+
font-weight: var(--ui-font-semibold);
|
|
92
|
+
line-height: var(--ui-line-height-tight);
|
|
93
|
+
}
|
|
94
|
+
:scope:where([data-component~="ui-text"])[data-ui-text-state~="variant=display"] {
|
|
95
|
+
font-size: var(--ui-font-size-2xl);
|
|
96
|
+
}
|
|
97
|
+
:scope:where([data-component~="ui-text"])[data-ui-text-state~="variant=heading"] {
|
|
98
|
+
font-size: var(--ui-font-size-xl);
|
|
99
|
+
}
|
|
100
|
+
:scope:where([data-component~="ui-text"])[data-ui-text-state~="variant=label"] {
|
|
101
|
+
font-size: var(--ui-font-size-sm);
|
|
102
|
+
font-weight: var(--ui-font-medium);
|
|
103
|
+
line-height: var(--ui-line-height);
|
|
104
|
+
}
|
|
105
|
+
:scope:where([data-component~="ui-text"])[data-ui-text-state~="variant=caption"] {
|
|
106
|
+
font-size: var(--ui-font-size-sm);
|
|
107
|
+
line-height: var(--ui-line-height);
|
|
108
|
+
}
|
|
109
|
+
|
|
89
110
|
:scope:where([data-component~="ui-text"])[data-ui-text-state~="variant=eyebrow"] {
|
|
90
111
|
font-size: var(--ui-font-size-xs);
|
|
91
112
|
font-weight: var(--ui-font-semibold);
|
|
92
113
|
letter-spacing: 0.06em;
|
|
114
|
+
line-height: var(--ui-line-height);
|
|
93
115
|
text-transform: uppercase;
|
|
94
116
|
}
|
|
95
117
|
:scope:where([data-component~="ui-text"])[data-ui-text-state~="variant=code"] {
|
package/styles/ui-tooltip.css
CHANGED
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
:scope:where([data-component~="ui-tooltip"]) {
|
|
53
|
+
--_ui-material-scale: 0.08;
|
|
53
54
|
/* Hooks do not inherit, so the parts below read them from the root. */
|
|
54
55
|
--_ui-tooltip-border: var(--ui-tooltip-border);
|
|
55
56
|
--_ui-tooltip-max-inline-size: var(--ui-tooltip-max-inline-size);
|
|
@@ -102,6 +103,65 @@
|
|
|
102
103
|
box-shadow: var(--_ui-tooltip-shadow, var(--ui-overlay-shadow, var(--ui-elevation-tooltip, var(--ui-shadow-md))));
|
|
103
104
|
}
|
|
104
105
|
|
|
106
|
+
/* Purpose and measured size shape one shared separation lever. The content plane stays opaque;
|
|
107
|
+
transparency, saturation and edge light belong to the surrounding decorative material. */
|
|
108
|
+
.surface {
|
|
109
|
+
--_ui-material-glassiness: clamp(0, var(--ui-glassiness, 0), 1);
|
|
110
|
+
--_ui-material-separation: clamp(0, var(--ui-surface-separation, 0), 1);
|
|
111
|
+
--_ui-material-active: clamp(0, calc((var(--_ui-material-glassiness) + var(--_ui-material-separation)) * 100000), 1);
|
|
112
|
+
--_ui-material-rim: calc((var(--_ui-material-separation) + var(--_ui-material-glassiness) * 0.25) * var(--_ui-material-scale, 0.08) * 8px);
|
|
113
|
+
--_ui-material-content-color: var(--_ui-tooltip-surface, var(--ui-material-content, var(--ui-overlay-surface, var(--ui-surface-elevated))));
|
|
114
|
+
--_ui-material-rim-color: color-mix(in srgb, var(--ui-material-glass, var(--ui-surface-elevated)) calc(var(--_ui-material-active) * 100%), transparent);
|
|
115
|
+
background:
|
|
116
|
+
linear-gradient(var(--_ui-material-content-color), var(--_ui-material-content-color)) padding-box,
|
|
117
|
+
linear-gradient(var(--_ui-material-rim-color), var(--_ui-material-rim-color)) border-box,
|
|
118
|
+
var(--_ui-material-content-color) padding-box;
|
|
119
|
+
border-width: calc(var(--ui-border-width) + var(--_ui-material-rim));
|
|
120
|
+
border-color: var(
|
|
121
|
+
--_ui-tooltip-border,
|
|
122
|
+
color-mix(in oklab, var(--ui-overlay-border, var(--ui-border-strong)) calc((1 - var(--_ui-material-active)) * 100%), transparent)
|
|
123
|
+
);
|
|
124
|
+
box-shadow: var(
|
|
125
|
+
--_ui-tooltip-shadow,
|
|
126
|
+
var(
|
|
127
|
+
--ui-overlay-shadow,
|
|
128
|
+
0 calc(var(--_ui-material-separation) * var(--_ui-material-scale, 0.08) * 8px) calc(
|
|
129
|
+
var(--_ui-material-separation) * var(--_ui-material-scale, 0.08) * 24px
|
|
130
|
+
) color-mix(in oklab, var(--ui-text-primary) 15%, transparent),
|
|
131
|
+
inset 0 0 0 calc(var(--_ui-material-active) * var(--ui-border-width)) var(--ui-material-edge, var(--ui-border-strong)),
|
|
132
|
+
var(--ui-elevation-tooltip, var(--ui-shadow-md))
|
|
133
|
+
)
|
|
134
|
+
);
|
|
135
|
+
backdrop-filter: blur(calc(var(--_ui-material-glassiness) * var(--_ui-material-scale, 0.08) * 18px))
|
|
136
|
+
saturate(calc(1 + var(--_ui-material-glassiness) * var(--_ui-material-scale, 0.08) * 0.18));
|
|
137
|
+
-webkit-backdrop-filter: blur(calc(var(--_ui-material-glassiness) * var(--_ui-material-scale, 0.08) * 18px))
|
|
138
|
+
saturate(calc(1 + var(--_ui-material-glassiness) * var(--_ui-material-scale, 0.08) * 0.18));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
|
|
142
|
+
.surface {
|
|
143
|
+
background: var(--_ui-material-content-color);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@media (prefers-reduced-transparency: reduce) {
|
|
148
|
+
.surface {
|
|
149
|
+
background: var(--_ui-material-content-color);
|
|
150
|
+
backdrop-filter: none;
|
|
151
|
+
-webkit-backdrop-filter: none;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
@media (forced-colors: active) {
|
|
156
|
+
.surface {
|
|
157
|
+
background: Canvas;
|
|
158
|
+
border-color: CanvasText;
|
|
159
|
+
box-shadow: none;
|
|
160
|
+
backdrop-filter: none;
|
|
161
|
+
-webkit-backdrop-filter: none;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
105
165
|
/* A keyboard shortcut follows the label after a thin divider, smaller and quieter, as menus show
|
|
106
166
|
it. The label stays first in the description, so a screen reader hears the name, then the keys. */
|
|
107
167
|
.shortcut {
|
|
@@ -226,6 +286,18 @@
|
|
|
226
286
|
|
|
227
287
|
/* The label and the shortcut sit side by side, a gap apart, with the label wrapping on its own. */
|
|
228
288
|
|
|
289
|
+
/* Purpose and measured size shape one shared separation lever. The content plane stays opaque;
|
|
290
|
+
transparency, saturation and edge light belong to the surrounding decorative material. */
|
|
291
|
+
|
|
292
|
+
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
@media (prefers-reduced-transparency: reduce) {
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
@media (forced-colors: active) {
|
|
299
|
+
}
|
|
300
|
+
|
|
229
301
|
/* A keyboard shortcut follows the label after a thin divider, smaller and quieter, as menus show
|
|
230
302
|
it. The label stays first in the description, so a screen reader hears the name, then the keys. */
|
|
231
303
|
|
package/theme-system.css
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/* Optional shared recipe. Load after tokens.css and the chosen palette.
|
|
2
2
|
Existing public roles remain the customization interface; no component selectors. */
|
|
3
|
+
/* Resolve shared geometry once where it is declared, rather than once per consuming
|
|
4
|
+
control's font. Palette roles remain unregistered so light-dark resolves locally. */
|
|
5
|
+
@property --ui-font-size { syntax: "<length>"; inherits: true; initial-value: 16px; }
|
|
6
|
+
@property --ui-control-size { syntax: "<length>"; inherits: true; initial-value: 40px; }
|
|
7
|
+
@property --ui-radius-md { syntax: "<length>"; inherits: true; initial-value: 8px; }
|
|
8
|
+
@property --ui-border-width { syntax: "<length>"; inherits: true; initial-value: 1px; }
|
|
9
|
+
|
|
3
10
|
@layer theme {
|
|
4
11
|
:root {
|
|
5
12
|
--ui-density: 1;
|
|
@@ -9,6 +16,8 @@
|
|
|
9
16
|
--ui-inner-depth: 0.3;
|
|
10
17
|
--ui-edge-light: 0;
|
|
11
18
|
--ui-overlay-translucency: 0;
|
|
19
|
+
--ui-glassiness: 0;
|
|
20
|
+
--ui-surface-separation: 0;
|
|
12
21
|
}
|
|
13
22
|
|
|
14
23
|
:where(:root, [data-theme], [data-contrast]) {
|
|
@@ -20,21 +29,23 @@
|
|
|
20
29
|
--ui-control-size-sm: calc(var(--ui-control-size) / var(--_ui-theme-ratio));
|
|
21
30
|
--ui-control-size-md: var(--ui-control-size);
|
|
22
31
|
--ui-control-size-lg: calc(var(--ui-control-size) * var(--_ui-theme-ratio));
|
|
32
|
+
/* Bend the interior of the family while keeping its endpoints stable. */
|
|
23
33
|
--ui-space-1: var(--_ui-theme-unit);
|
|
24
|
-
--ui-space-2: calc(var(--_ui-theme-unit) * pow(
|
|
25
|
-
--ui-space-3: calc(var(--_ui-theme-unit) * pow(
|
|
26
|
-
--ui-space-4: calc(var(--_ui-theme-unit) * pow(
|
|
34
|
+
--ui-space-2: calc(var(--_ui-theme-unit) * (1 + 7 * pow(1 / 7, var(--_ui-theme-curve))));
|
|
35
|
+
--ui-space-3: calc(var(--_ui-theme-unit) * (1 + 7 * pow(2 / 7, var(--_ui-theme-curve))));
|
|
36
|
+
--ui-space-4: calc(var(--_ui-theme-unit) * (1 + 7 * pow(3 / 7, var(--_ui-theme-curve))));
|
|
27
37
|
--ui-space-0-5: calc(var(--ui-space-1) * 0.5);
|
|
28
|
-
--ui-space-5: calc(var(--_ui-theme-unit) * pow(
|
|
29
|
-
--ui-space-6: calc(var(--_ui-theme-unit) * pow(
|
|
38
|
+
--ui-space-5: calc(var(--_ui-theme-unit) * (1 + 7 * pow(5 / 7, var(--_ui-theme-curve))));
|
|
39
|
+
--ui-space-6: calc(var(--_ui-theme-unit) * (1 + 7 * pow(7 / 7, var(--_ui-theme-curve))));
|
|
30
40
|
/* Vertical editing/action insets fit the shared box instead of growing with the
|
|
31
41
|
page spacing curve. Multi-line content can still grow intrinsically. */
|
|
32
42
|
--ui-control-inset-block-sm: max(0px, calc((var(--ui-control-size-sm) - var(--ui-font-size-sm) * var(--ui-line-height-tight) - 2 * var(--ui-border-width)) / 2));
|
|
33
43
|
--ui-control-inset-block-md: max(0px, calc((var(--ui-control-size-md) - var(--ui-font-size-md) * var(--ui-line-height-tight) - 2 * var(--ui-border-width)) / 2));
|
|
34
44
|
--ui-control-inset-block-lg: max(0px, calc((var(--ui-control-size-lg) - var(--ui-font-size-md) * var(--ui-line-height-tight) - 2 * var(--ui-border-width)) / 2));
|
|
35
|
-
--ui-
|
|
36
|
-
--ui-action-inset-
|
|
37
|
-
--ui-action-inset-
|
|
45
|
+
--ui-font-size-xs: max(12px, calc(var(--ui-font-size) * 0.75));
|
|
46
|
+
--ui-action-inset-sm: var(--ui-space-2);
|
|
47
|
+
--ui-action-inset-md: var(--ui-space-3);
|
|
48
|
+
--ui-action-inset-lg: var(--ui-space-4);
|
|
38
49
|
|
|
39
50
|
--ui-radius-sm: calc(var(--ui-radius-md) * 0.5);
|
|
40
51
|
--ui-radius-lg: calc(var(--ui-radius-md) * 1.5);
|
|
@@ -62,10 +73,15 @@
|
|
|
62
73
|
--ui-control-inset: inset 0 calc(1px * var(--_ui-theme-inner)) calc(3px * var(--_ui-theme-inner)) rgb(0 0 0 / 0.15), inset 0 -1px 0 rgb(255 255 255 / calc(var(--_ui-theme-edge) * 0.18));
|
|
63
74
|
--ui-pressed: inset 0 calc(2px * var(--_ui-theme-inner)) calc(4px * var(--_ui-theme-inner)) rgb(0 0 0 / 0.2);
|
|
64
75
|
--ui-overlay-surface: color-mix(in srgb, var(--ui-surface-raised) calc((1 - clamp(0, var(--ui-overlay-translucency), 1)) * 100%), transparent);
|
|
76
|
+
/* Decorative outer material is allowed to transmit the scene. Content keeps
|
|
77
|
+
its own opaque plane; changing the scene cannot undermine text contrast. */
|
|
78
|
+
--ui-material-content: var(--ui-surface-raised);
|
|
79
|
+
--ui-material-glass: color-mix(in srgb, var(--ui-surface-raised) calc((1 - clamp(0, var(--ui-overlay-translucency), 1)) * 35%), transparent);
|
|
80
|
+
--ui-material-edge: color-mix(in srgb, var(--ui-surface-raised) 80%, var(--ui-text));
|
|
65
81
|
|
|
66
82
|
/* Existing timing and easing names stay canonical. */
|
|
67
|
-
--ui-motion-press:
|
|
68
|
-
--ui-motion-base: calc(var(--ui-motion-fast) * 1.
|
|
83
|
+
--ui-motion-press: var(--ui-motion-fast);
|
|
84
|
+
--ui-motion-base: calc(var(--ui-motion-fast) * 1.5);
|
|
69
85
|
--ui-motion-ease-out: var(--ui-motion-ease);
|
|
70
86
|
--ui-press-scale: 0.98;
|
|
71
87
|
}
|
package/tokens.css
CHANGED
|
@@ -161,6 +161,12 @@
|
|
|
161
161
|
--ui-accent-active: color-mix(in oklab, var(--ui-accent) 74%, var(--ui-text));
|
|
162
162
|
--ui-accent-subtle: color-mix(in oklab, var(--ui-accent) 12%, var(--ui-surface));
|
|
163
163
|
--ui-danger-hover: color-mix(in oklab, var(--ui-danger) 86%, var(--ui-text));
|
|
164
|
+
--ui-danger-active: color-mix(in oklab, var(--ui-danger) 74%, var(--ui-text));
|
|
165
|
+
--ui-success-active: color-mix(in oklab, var(--ui-success) 74%, var(--ui-text));
|
|
166
|
+
--ui-warning-active: color-mix(in oklab, var(--ui-warning) 74%, var(--ui-text));
|
|
167
|
+
--ui-info-active: color-mix(in oklab, var(--ui-info) 74%, var(--ui-text));
|
|
168
|
+
--ui-warning-hover: color-mix(in oklab, var(--ui-warning) 86%, var(--ui-text));
|
|
169
|
+
--ui-info-hover: color-mix(in oklab, var(--ui-info) 86%, var(--ui-text));
|
|
164
170
|
|
|
165
171
|
/* Disabled is one decision, not a per-component one: the sunken surface and a pale ink, at
|
|
166
172
|
full opacity, so a disabled control reads as unavailable rather than as a faded variant.
|
|
@@ -340,7 +346,7 @@
|
|
|
340
346
|
|
|
341
347
|
[data-ui-choice-option]:is(:hover, .active) {
|
|
342
348
|
background: var(--ui-surface-muted);
|
|
343
|
-
outline: var(--ui-
|
|
349
|
+
outline: var(--ui-focus-width) solid var(--ui-focus-ring);
|
|
344
350
|
outline-offset: calc(-1 * var(--ui-border-width));
|
|
345
351
|
}
|
|
346
352
|
|
|
@@ -390,7 +396,7 @@
|
|
|
390
396
|
|
|
391
397
|
@media (forced-colors: active) {
|
|
392
398
|
[data-ui-choice-option][aria-selected="true"]:not([aria-disabled="true"]):not(.active) {
|
|
393
|
-
outline: var(--ui-
|
|
399
|
+
outline: var(--ui-focus-width) solid Highlight;
|
|
394
400
|
outline-offset: calc(-1 * var(--ui-border-width));
|
|
395
401
|
}
|
|
396
402
|
}
|
package/vanilla/UiButton.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export interface UiButtonProps {
|
|
|
16
16
|
href?: string | null;
|
|
17
17
|
loading?: boolean | null;
|
|
18
18
|
pending?: boolean | null;
|
|
19
|
+
preset?: "none" | "primary" | "standard" | "quiet" | "destructive" | null;
|
|
19
20
|
rel?: string | null;
|
|
20
21
|
shape?: "rounded" | "pill" | null;
|
|
21
22
|
size?: "xs" | "sm" | "md" | "lg" | null;
|