@threadlabs/looma 0.42.0 → 0.43.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/ui-action-bar/ui-action-bar.html +1 -7
- package/components/ui-affordance-scope/ui-affordance-scope.html +4 -4
- package/components/ui-avatar/ui-avatar.html +0 -22
- package/components/ui-avatar-group/ui-avatar-group.html +1 -11
- package/components/ui-badge/ui-badge.html +57 -78
- package/components/ui-button/ui-button.html +36 -81
- package/components/ui-callout/ui-callout.html +30 -68
- package/components/ui-card/ui-card.html +41 -15
- package/components/ui-checkbox/ui-checkbox.html +1 -15
- package/components/ui-cluster/ui-cluster.html +1 -7
- package/components/ui-combobox/ui-combobox.html +7 -70
- package/components/ui-container/ui-container.html +2 -12
- package/components/ui-context-menu/ui-context-menu.html +1 -23
- package/components/ui-dialog/ui-dialog.html +1 -31
- package/components/ui-disclosure/ui-disclosure.html +1 -15
- package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +2 -2
- package/components/ui-floating-action-button/ui-floating-action-button.html +0 -14
- package/components/ui-form-field/ui-form-field.html +2 -32
- package/components/ui-grid/ui-grid.html +1 -11
- package/components/ui-icon/ui-icon.html +1 -12
- package/components/ui-icon-button/ui-icon-button.html +52 -87
- package/components/ui-input/ui-input.html +5 -55
- package/components/ui-input-group/ui-input-group.html +1 -13
- package/components/ui-list/ui-list.html +0 -10
- package/components/ui-list-item/ui-list-item.html +1 -19
- package/components/ui-listbox/ui-listbox.html +0 -21
- package/components/ui-menu/ui-menu.html +0 -22
- package/components/ui-menu-item/ui-menu-item.html +0 -26
- package/components/ui-meter/ui-meter.html +11 -6
- package/components/ui-nav-item/ui-nav-item.html +0 -18
- package/components/ui-popover/ui-popover.html +0 -30
- package/components/ui-radio/ui-radio.html +7 -13
- package/components/ui-radio-group/ui-radio-group.html +0 -5
- package/components/ui-reel/ui-reel.html +1 -11
- package/components/ui-search-result-row/ui-search-result-row.html +0 -34
- package/components/ui-search-shell/ui-search-shell.html +1 -43
- package/components/ui-select/ui-select.html +0 -42
- package/components/ui-separator/ui-separator.html +0 -6
- package/components/ui-sidebar/ui-sidebar.html +2 -24
- package/components/ui-site-header/ui-site-header.html +0 -25
- package/components/ui-skeleton/ui-skeleton.html +0 -9
- package/components/ui-stack/ui-stack.html +6 -11
- package/components/ui-swatch/ui-swatch.html +0 -5
- package/components/ui-switch/ui-switch.html +1 -15
- package/components/ui-switcher/ui-switcher.html +1 -11
- package/components/ui-tabs/ui-tabs.html +1 -19
- package/components/ui-text/ui-text.html +19 -6
- package/components/ui-textarea/ui-textarea.html +0 -50
- package/components/ui-toast/ui-toast.html +12 -27
- package/components/ui-toast-region/ui-toast-region.html +13 -34
- package/components/ui-tooltip/ui-tooltip.html +1 -43
- package/components/ui-top-bar/ui-top-bar.html +1 -31
- package/components/ui-tree/ui-tree.html +1 -16
- package/components/ui-tree-item/ui-tree-item.html +1 -23
- package/components/ui-tree-item/ui-tree-item.js +0 -1
- package/dist/index.js +1 -1
- package/docs/README.md +11 -9
- package/docs/catalog.json +606 -191
- package/docs/customizer-render.mjs +20 -8
- package/docs/customizer.js +40 -2
- package/docs/palette.mjs +5 -4
- package/docs/theme.mjs +97 -35
- package/docs/value-editors.mjs +2 -1
- package/package.json +2 -2
- package/styles/ui-action-bar.css +3 -11
- package/styles/ui-affordance-scope.css +4 -4
- package/styles/ui-avatar-group.css +3 -15
- package/styles/ui-avatar.css +2 -26
- package/styles/ui-badge.css +56 -80
- package/styles/ui-button.css +35 -83
- package/styles/ui-callout.css +32 -72
- package/styles/ui-card.css +36 -12
- package/styles/ui-checkbox.css +3 -19
- package/styles/ui-cluster.css +2 -10
- package/styles/ui-combobox.css +7 -140
- package/styles/ui-container.css +2 -14
- package/styles/ui-context-menu.css +3 -27
- package/styles/ui-dialog.css +5 -67
- package/styles/ui-disclosure.css +3 -19
- package/styles/ui-editor-table-overlay.css +2 -2
- package/styles/ui-floating-action-button.css +2 -18
- package/styles/ui-form-field.css +4 -36
- package/styles/ui-grid.css +2 -14
- package/styles/ui-icon-button.css +51 -89
- package/styles/ui-icon.css +3 -16
- package/styles/ui-input-group.css +2 -14
- package/styles/ui-input.css +6 -57
- package/styles/ui-list-item.css +3 -23
- package/styles/ui-list.css +2 -14
- package/styles/ui-listbox.css +2 -44
- package/styles/ui-menu-item.css +2 -30
- package/styles/ui-menu.css +2 -26
- package/styles/ui-meter.css +8 -4
- package/styles/ui-nav-item.css +2 -22
- package/styles/ui-popover.css +2 -34
- package/styles/ui-radio-group.css +1 -6
- package/styles/ui-radio.css +9 -17
- package/styles/ui-reel.css +2 -14
- package/styles/ui-search-result-row.css +2 -38
- package/styles/ui-search-shell.css +3 -47
- package/styles/ui-select.css +2 -46
- package/styles/ui-separator.css +2 -10
- package/styles/ui-sidebar.css +4 -28
- package/styles/ui-site-header.css +1 -26
- package/styles/ui-skeleton.css +2 -12
- package/styles/ui-stack.css +4 -12
- package/styles/ui-swatch.css +1 -6
- package/styles/ui-switch.css +3 -19
- package/styles/ui-switcher.css +2 -14
- package/styles/ui-tabs.css +3 -23
- package/styles/ui-text.css +10 -2
- package/styles/ui-textarea.css +2 -54
- package/styles/ui-toast-region.css +29 -73
- package/styles/ui-toast.css +24 -54
- package/styles/ui-tooltip.css +3 -47
- package/styles/ui-top-bar.css +3 -35
- package/styles/ui-tree-item.css +5 -51
- package/styles/ui-tree.css +3 -20
- package/theme-system.css +6 -2
- package/tokens.css +55 -21
- package/vanilla/UiBadge.d.ts +1 -1
- package/vanilla/UiBadge.js +1 -1
- package/vanilla/UiButton.d.ts +1 -1
- package/vanilla/UiButton.js +1 -1
- package/vanilla/UiCard.d.ts +1 -1
- package/vanilla/UiCard.js +1 -1
- package/vanilla/UiIconButton.d.ts +1 -1
- package/vanilla/UiIconButton.js +1 -1
- package/vanilla/UiMeter.d.ts +1 -1
- package/vanilla/UiMeter.js +1 -1
- package/vanilla/UiStack.js +1 -1
- package/vanilla/UiText.d.ts +1 -1
- package/vanilla/UiText.js +1 -1
- package/vue/UiActionBar.vue +3 -9
- package/vue/UiAffordanceScope.vue +4 -4
- package/vue/UiAvatar.vue +1 -28
- package/vue/UiAvatarGroup.vue +1 -11
- package/vue/UiBadge.d.ts +2 -2
- package/vue/UiBadge.vue +84 -81
- package/vue/UiButton.d.ts +2 -2
- package/vue/UiButton.vue +78 -97
- package/vue/UiCallout.vue +30 -71
- package/vue/UiCard.d.ts +2 -2
- package/vue/UiCard.vue +71 -20
- package/vue/UiCheckbox.vue +1 -15
- package/vue/UiCluster.vue +1 -10
- package/vue/UiCombobox.vue +13 -72
- package/vue/UiContainer.vue +1 -13
- package/vue/UiContextMenu.vue +1 -30
- package/vue/UiDialog.vue +3 -33
- package/vue/UiDisclosure.vue +1 -15
- package/vue/UiEditorTableOverlay.vue +2 -2
- package/vue/UiFloatingActionButton.vue +0 -22
- package/vue/UiFormField.vue +6 -33
- package/vue/UiGrid.vue +1 -13
- package/vue/UiIcon.vue +1 -16
- package/vue/UiIconButton.d.ts +2 -2
- package/vue/UiIconButton.vue +103 -99
- package/vue/UiInput.vue +1 -54
- package/vue/UiInputGroup.vue +8 -20
- package/vue/UiList.vue +2 -12
- package/vue/UiListItem.vue +8 -26
- package/vue/UiListbox.vue +0 -23
- package/vue/UiMenu.vue +1 -23
- package/vue/UiMenuItem.vue +0 -26
- package/vue/UiMeter.d.ts +2 -2
- package/vue/UiMeter.vue +47 -12
- package/vue/UiNavItem.vue +3 -21
- package/vue/UiPopover.vue +1 -32
- package/vue/UiRadio.vue +1 -11
- package/vue/UiRadioGroup.vue +0 -11
- package/vue/UiReel.vue +1 -11
- package/vue/UiSearchResultRow.vue +0 -35
- package/vue/UiSearchShell.vue +1 -53
- package/vue/UiSelect.vue +0 -42
- package/vue/UiSeparator.vue +0 -7
- package/vue/UiSidebar.vue +3 -26
- package/vue/UiSiteHeader.vue +0 -24
- package/vue/UiSkeleton.vue +0 -9
- package/vue/UiStack.vue +6 -11
- package/vue/UiSwatch.vue +1 -6
- package/vue/UiSwitch.vue +1 -15
- package/vue/UiSwitcher.vue +1 -14
- package/vue/UiTabs.vue +1 -19
- package/vue/UiText.d.ts +2 -2
- package/vue/UiText.vue +29 -4
- package/vue/UiTextarea.vue +0 -50
- package/vue/UiToast.vue +26 -34
- package/vue/UiToastRegion.vue +26 -55
- package/vue/UiTooltip.vue +1 -43
- package/vue/UiTopBar.vue +1 -34
- package/vue/UiTree.vue +2 -17
- package/vue/UiTreeItem.vue +2 -28
- package/vue/chunks/UiActionBar.js +1 -1
- package/vue/chunks/UiAffordanceScope.js +1 -1
- package/vue/chunks/UiAvatar.js +1 -1
- package/vue/chunks/UiAvatarGroup.js +1 -1
- package/vue/chunks/UiBadge.js +4 -2
- package/vue/chunks/UiButton.js +4 -2
- package/vue/chunks/UiCallout.js +1 -1
- package/vue/chunks/UiCard.js +5 -3
- package/vue/chunks/UiCheckbox.js +1 -1
- package/vue/chunks/UiCluster.js +2 -2
- package/vue/chunks/UiCombobox.js +3 -3
- package/vue/chunks/UiContainer.js +2 -2
- package/vue/chunks/UiContextMenu.js +1 -1
- package/vue/chunks/UiDialog.js +1 -1
- package/vue/chunks/UiDisclosure.js +1 -1
- package/vue/chunks/UiEditorTableOverlay.js +1 -1
- package/vue/chunks/UiFloatingActionButton.js +1 -1
- package/vue/chunks/UiFormField.js +1 -1
- package/vue/chunks/UiGrid.js +2 -2
- package/vue/chunks/UiIcon.js +1 -1
- package/vue/chunks/UiIconButton.js +4 -2
- package/vue/chunks/UiInput.js +1 -1
- package/vue/chunks/UiInputGroup.js +1 -1
- package/vue/chunks/UiList.js +1 -1
- package/vue/chunks/UiListItem.js +1 -1
- package/vue/chunks/UiListbox.js +1 -1
- package/vue/chunks/UiMenu.js +1 -1
- package/vue/chunks/UiMenuItem.js +1 -1
- package/vue/chunks/UiMeter.js +4 -2
- package/vue/chunks/UiNavItem.js +1 -1
- package/vue/chunks/UiPopover.js +1 -1
- package/vue/chunks/UiRadio.js +1 -1
- package/vue/chunks/UiRadioGroup.js +1 -1
- package/vue/chunks/UiReel.js +2 -2
- package/vue/chunks/UiSearchResultRow.js +1 -1
- package/vue/chunks/UiSearchShell.js +1 -1
- package/vue/chunks/UiSelect.js +1 -1
- package/vue/chunks/UiSeparator.js +1 -1
- package/vue/chunks/UiSidebar.js +1 -1
- package/vue/chunks/UiSiteHeader.js +1 -1
- package/vue/chunks/UiSkeleton.js +1 -1
- package/vue/chunks/UiStack.js +3 -3
- package/vue/chunks/UiSwatch.js +1 -1
- package/vue/chunks/UiSwitch.js +1 -1
- package/vue/chunks/UiSwitcher.js +2 -2
- package/vue/chunks/UiTabs.js +1 -1
- package/vue/chunks/UiText.js +4 -2
- package/vue/chunks/UiTextarea.js +1 -1
- package/vue/chunks/UiToast.js +1 -1
- package/vue/chunks/UiToastRegion.js +1 -1
- package/vue/chunks/UiTooltip.js +1 -1
- package/vue/chunks/UiTopBar.js +1 -1
- package/vue/chunks/UiTree.js +1 -1
- package/vue/chunks/UiTreeItem.js +1 -1
- package/vue/components.css +581 -2017
- package/vue/editor/index.js +7 -1
|
@@ -16,7 +16,17 @@ export function customizerResource(site, input = defaultRecipe()) {
|
|
|
16
16
|
return example ? `<looma-example-card ${previewOnly ? 'preview-only' : ''} ${cardFields.filter(key => key !== 'id').map(key => `${key.replace(/[A-Z]/g, letter => '-' + letter.toLowerCase())}="${escape(String(example[key]))}"`).join(' ')} identity="${escape(example.id)}" loading="lazy"></looma-example-card>` : '';
|
|
17
17
|
};
|
|
18
18
|
const renderField = field => {
|
|
19
|
-
const value = recipe.values[field.id]
|
|
19
|
+
const value = recipe.values[field.id];
|
|
20
|
+
if (field.id === 'label-size') {
|
|
21
|
+
const inherited = value === 'inherit', size = inherited ? recipe.values['text-size'] : value;
|
|
22
|
+
return `<ui-form-field><label slot="label" for="theme-label-source">Field label size</label><span slot="help">${escape(field.description)}</span><ui-stack gap="xs"><ui-select id="theme-label-source" size="sm" data-label-size-source value="${inherited ? 'inherit' : 'custom'}"><option value="inherit">Follow body text</option><option value="custom">Set a separate size</option></ui-select><ui-number-input id="theme-label-size" size="sm" data-label-size-value label="Independent field label size" value="${escape(size)}" unit="${size.match(/[a-z]+$/i)?.[0] ?? 'px'}" min="0.1" step="1"${inherited ? ' hidden' : ''}></ui-number-input></ui-stack></ui-form-field>`;
|
|
23
|
+
}
|
|
24
|
+
if (field.type === 'optional-colour') {
|
|
25
|
+
const custom = value !== field.defaultValue;
|
|
26
|
+
const fallback = recipe.values.action;
|
|
27
|
+
return `<ui-form-field><label slot="label" for="theme-${field.id}-source">${escape(field.label)}</label><span slot="help">${escape(field.description)}</span><ui-stack gap="xs"><ui-select id="theme-${field.id}-source" size="sm" data-color-source="${field.id}" value="${custom ? 'custom' : 'default'}"><option value="default">Not used</option><option value="custom">Choose a color</option></ui-select><ui-color-picker id="theme-${field.id}" data-token="${field.id}" data-optional-color="${field.id}" value="${escape(custom ? value : fallback)}" label="${escape(field.label)} colour picker"${custom ? '' : ' hidden'}></ui-color-picker></ui-stack></ui-form-field>`;
|
|
28
|
+
}
|
|
29
|
+
const editor = valueEditor(field, value, { remPixels: parseFloat(recipe.values['text-size']) });
|
|
20
30
|
const common = `size="sm" data-token="${field.id}" label="${escape(field.label)}"`;
|
|
21
31
|
let control;
|
|
22
32
|
if (field.type === 'font') {
|
|
@@ -47,33 +57,35 @@ export function customizerResource(site, input = defaultRecipe()) {
|
|
|
47
57
|
const preview = family === 'palette' ? `<span slot="start" data-selected-palette>${swatches()}</span><template slot="option"><span class="palette-option">${Object.keys(presets).map(id => `<template $if="$option.value = '${id}'">${swatches(deriveTheme(applyRefinement(recipe, 'palette', id), { mode: 'light' }).tokens)}</template>`).join('')}<span>{$option.label}</span></span></template>` : '';
|
|
48
58
|
return choice(`id="${location}-${family}" data-refinement-preset="${family}"${muted ? ' muted' : ''}`, `${label} preset`, state.id, options, preview);
|
|
49
59
|
};
|
|
50
|
-
const paletteDetails = `<ui-grid columns="2"
|
|
60
|
+
const paletteDetails = `<ui-grid columns="2" min="md" gap="s">${['light', 'dark'].map(mode => `<ui-card data-theme="${mode}" padding="sm"><ui-stack gap="s"><ui-text variant="eyebrow">${mode === 'light' ? 'Light' : 'Dark'}</ui-text><div class="palette-range" role="img" aria-label="${mode} canvas, content and action range"><span class="palette-canvas"></span><span class="palette-content"></span><span class="palette-action"></span></div><ui-text variant="heading" as="h3">Fellowship</ui-text><ui-text>There and back.</ui-text><ui-text variant="caption">Second breakfast at nine.</ui-text><ui-input size="sm" aria-label="${mode} neutral field" value="Shared neutral boundary"></ui-input><ui-action-bar><ui-button slot="tertiary" size="sm" variant="outline" tone="accent">Outline</ui-button><ui-button slot="secondary" size="sm" preset="standard">Neutral</ui-button><ui-button slot="primary" size="sm" preset="primary">Accent</ui-button></ui-action-bar><ui-cluster><ui-button size="sm" variant="outline" tone="neutral">Neutral outline</ui-button><ui-badge tone="accent-secondary" data-extra-accent="secondary-action">Secondary accent</ui-badge><ui-badge tone="accent-tertiary" data-extra-accent="tertiary-action">Tertiary accent</ui-badge></ui-cluster><ui-card tone="accent-secondary" data-extra-accent="secondary-action"><ui-stack gap="s"><ui-text weight="medium">A supporting highlight</ui-text><ui-text variant="caption">A category or feature can carry another accent while the main action stays primary.</ui-text></ui-stack></ui-card><ui-cluster>${[['success','Success','circle-check'],['danger','Error','circle-x'],['warning','Warning','triangle-alert'],['info','Info','info']].map(([tone,label,icon]) => `<ui-badge tone="${tone}"><ui-icon name="${icon}" slot="icon"></ui-icon>${label}</ui-badge>`).join('')}</ui-cluster><ui-callout tone="info">A status surface shares the Info badge’s colors.</ui-callout><ui-list><ui-list-item current><a href="#palette">Selected collection</a></ui-list-item></ui-list><ui-text><a href="#palette">Read the guide</a></ui-text><ui-text variant="caption" data-palette-roles="${mode}"></ui-text></ui-stack></ui-card>`).join('')}</ui-grid><ui-text variant="caption" data-palette-adjustments role="status" aria-live="polite"></ui-text><ui-disclosure summary="Resolved palette values"><ui-text variant="caption" data-palette-adjustment-details></ui-text></ui-disclosure>`;
|
|
51
61
|
const paletteRelationships = `<ui-stack gap="s"><ui-text variant="heading" as="h3">How should the colors work together?</ui-text>${[
|
|
52
62
|
['preserve', 'Keep my colors', 'Keep the base colors as chosen. Warmth and intensity still refine the result.'],
|
|
53
63
|
['neighboring', 'Related colors', 'Tint neutral surfaces with a neighboring hue for a closely coordinated palette.'],
|
|
54
64
|
['complementary', 'Contrasting colors', 'Tint neutral surfaces toward the opposite hue for warm–cool contrast.'],
|
|
55
65
|
].map(([id,label,description]) => `<ui-button variant="card" tone="neutral" data-action="palette-relationship" data-relationship="${id}" aria-pressed="${recipe.values['palette-relationship'] === id}"><ui-stack gap="xs"><ui-text variant="label">${label}</ui-text><span class="palette-range" data-relationship-preview="${id}" aria-hidden="true"><span class="palette-canvas"></span><span class="palette-content"></span><span class="palette-action"></span></span><ui-text variant="caption">${description}</ui-text></ui-stack><span slot="action" data-relationship-selected="${id}"${recipe.values['palette-relationship'] === id ? '' : ' hidden'}><ui-icon name="check"></ui-icon></span></ui-button>`).join('')}</ui-stack>`;
|
|
56
|
-
const sizePreview = `<ui-text
|
|
66
|
+
const sizePreview = `<ui-stack gap="l"><ui-text size="md">Compare the same actions and fields at each size. Rhythm separates these groups and opens the lines of text; spacing adjusts the room between controls.</ui-text><ui-stack gap="xl" data-size-groups>${['sm','md','lg'].map((size,index) => `<ui-stack gap="s" data-size-sample="${size}"><ui-text weight="medium" size="md">${['Small','Medium','Large'][index]}<span data-size-readout></span></ui-text><ui-cluster data-size-actions><ui-button size="${size}" variant="solid" tone="accent">Create</ui-button><ui-button size="${size}" variant="outline" tone="accent">Save</ui-button><ui-button size="${size}" variant="outline" tone="neutral">Archive</ui-button></ui-cluster><ui-cluster><ui-input size="${size}" style="--ui-input-inline-size: 10ch" aria-label="${size} size sample" value="Frodo"></ui-input><ui-color-picker size="${size}" label="${size} swatch sample"></ui-color-picker></ui-cluster></ui-stack>`).join('')}</ui-stack><ui-card><ui-stack gap="s"><ui-text weight="medium" size="md">Grouped content</ui-text><ui-text size="md">Frodo plans the journey. Sam brings lunch. A longer paragraph makes the line rhythm visible alongside the space between groups.</ui-text></ui-stack></ui-card><div class="spacing-samples" data-spacing-samples role="img" aria-label="Spacing progression"><span></span><span></span><span></span><span></span></div></ui-stack>`;
|
|
57
67
|
const fieldsFor = ids => ids.map(id => renderField(themeFields.find(field => field.id === id))).join('');
|
|
58
68
|
const viewTitles = { material: 'Material & light', palette: 'Palette', typography: 'Typography', layout: 'Size & spacing', motion: 'Motion', themes: 'Starting theme', export: 'Export & save', components: 'Component library' };
|
|
59
69
|
const refinement = (family, content) => `<section id="${family}" data-refinement-view="${family}" hidden tabindex="-1" aria-label="${viewTitles[family]} editor"><ui-stack gap="l"><ui-cluster><ui-button data-action="back"><ui-icon name="arrow-left"></ui-icon>Overview</ui-button><ui-text variant="heading" as="h2">${viewTitles[family]}</ui-text></ui-cluster>${content}</ui-stack></section>`;
|
|
60
70
|
const editor = (family, preview, controls) => refinement(family, `<div class="refinement-layout"><div class="editor-preview" data-editor-preview="${family}">${preview}</div><ui-stack>${controls}</ui-stack></div>`);
|
|
61
|
-
const typographyView = editor('typography', `<ui-card><ui-stack><ui-text variant="heading" as="h2">There and back again.</ui-text><ui-text>Frodo plans the journey. Sam brings lunch. Clear notes keep the Fellowship moving.</ui-text><ui-
|
|
71
|
+
const typographyView = editor('typography', `<ui-card><ui-stack><ui-text variant="heading" as="h2">There and back again.</ui-text><ui-text>Frodo plans the journey. Sam brings lunch. Clear notes keep the Fellowship moving.</ui-text><ui-form-field><label slot="label" for="type-sample-name">Memo title</label><ui-input id="type-sample-name" value="There and back again"></ui-input><span slot="help">Shown above your notes.</span></ui-form-field><ui-text variant="caption">Notes by Sméagol · Updated today</ui-text></ui-stack></ui-card>`, `${fieldsFor(['body-font','text-size','label-size'])}<ui-disclosure summary="Heading font"><ui-stack>${fieldsFor(['display-font'])}</ui-stack></ui-disclosure><ui-disclosure summary="Label emphasis"><ui-stack>${fieldsFor(['text-weight'])}</ui-stack></ui-disclosure>`);
|
|
62
72
|
const layoutView = editor('layout', `<ui-stack>${sizePreview}</ui-stack>`, `${fieldsFor(['control-roominess','rhythm','spacing','corner-roundness'])}<ui-disclosure summary="Scale & edges"><ui-stack>${fieldsFor(['scale-contrast','space-curve','line-weight'])}</ui-stack></ui-disclosure>`);
|
|
63
73
|
const motionView = editor('motion', `<ui-stack><ui-card><ui-stack><ui-text variant="eyebrow">Motion study</ui-text><div class="motion-track"><span data-motion-object aria-hidden="true"></span></div><ui-cluster><ui-button data-action="replay-motion"><ui-icon name="play"></ui-icon>Replay motion</ui-button><ui-text variant="caption" data-motion-readout></ui-text></ui-cluster><ui-text variant="caption" data-motion-preference></ui-text></ui-stack></ui-card></ui-stack>`, `${fieldsFor(['response-time'])}<ui-disclosure summary="Shape the curve"><ui-stack>${fieldsFor(['response-curve'])}</ui-stack></ui-disclosure><ui-text variant="caption">Replay shows the shared curve. Try the popover to feel it in a real component. System reduced-motion preferences are respected.</ui-text><ui-disclosure summary="Try a popover">${documentationCard('ui-popover', null, true)}</ui-disclosure>`);
|
|
74
|
+
const materialSurfaces = `<ui-grid columns="2" min="sm"><ui-card variant="elevated" data-material-standard><ui-stack gap="s"><ui-text weight="medium" size="md">Everyday surface</ui-text><ui-text variant="caption">A restrained lift for ordinary content.</ui-text><ui-button variant="outline" tone="neutral">Read memo</ui-button></ui-stack></ui-card><ui-card variant="elevated" treatment="expressive" data-material-expressive><ui-stack gap="s"><ui-text weight="medium" size="md">Expressive surface</ui-text><ui-text variant="caption">Finish, edge light, glow and the decorative rim.</ui-text><ui-button variant="solid" tone="accent">Join briefing</ui-button></ui-stack></ui-card></ui-grid><ui-cluster><ui-button id="material-popover-trigger" variant="outline" tone="accent">Open popover</ui-button><ui-popover for="material-popover-trigger"><ui-stack gap="s"><ui-text size="md">Floating material</ui-text><ui-text variant="caption">Adjust glass, separation and translucency with this open.</ui-text></ui-stack></ui-popover><ui-button id="material-dialog-trigger" variant="outline" tone="neutral">Open dialog</ui-button><ui-dialog id="material-preview-dialog" for="material-dialog-trigger" label="Surface and light"><ui-text size="md">Compare the backdrop, content plane and frame as the material changes.</ui-text><ui-button slot="actions" variant="solid" commandfor="material-preview-dialog" command="close">Done</ui-button></ui-dialog></ui-cluster>`;
|
|
64
75
|
const materialSample = `<ui-card treatment="expressive"><ui-stack gap="m"><ui-text variant="heading" as="h3">Fellowship briefing</ui-text><ui-text>Readable content stays on an opaque plate while the decorative rim catches the scene.</ui-text><ui-input label="Office search" placeholder="Search the Fellowship office"></ui-input><ui-action-bar><ui-button slot="secondary" preset="standard">Keep draft</ui-button><ui-button slot="primary" preset="primary">Send briefing</ui-button></ui-action-bar></ui-stack></ui-card>`;
|
|
65
76
|
const lightEditor = `<ui-light-editor data-light-editor x="${recipe.values['light-x']}" y="${recipe.values['light-y']}" label="Theme light position"><ui-stack gap="s"><ui-text variant="heading">Move the light</ui-text><ui-button preset="primary">Material response</ui-button></ui-stack></ui-light-editor>`;
|
|
66
|
-
const materialView = editor('material', materialSample
|
|
67
|
-
const
|
|
77
|
+
const materialView = editor('material', `<ui-stack>${materialSample}${materialSurfaces}</ui-stack>`, `<ui-cluster>${renderPreset('material', 'refinement')}<ui-button data-action="restore-material">Reset material</ui-button></ui-cluster>${fieldsFor(['finish','translucency','glassiness'])}<ui-text variant="caption" data-material-dependencies role="status"></ui-text><ui-stack gap="s" data-glass-hint hidden><ui-text variant="caption">Frosting needs some transparency to reveal the scene behind the decorative rim.</ui-text><ui-button size="sm" data-action="use-glass">Use frosted glass</ui-button></ui-stack><ui-disclosure summary="Advanced material" data-advanced="material"><ui-stack>${lightEditor}${fieldsFor(['light-color','light-spread','light-strength','edge-light','glow','outer-depth','inner-depth','surface-separation'])}</ui-stack></ui-disclosure><ui-disclosure summary="Try floating surfaces"><ui-stack>${documentationCard('ui-card','/04-expressive-surface')}${documentationCard('ui-tooltip')}${documentationCard('ui-popover')}${documentationCard('ui-dialog')}</ui-stack></ui-disclosure>`);
|
|
78
|
+
const statusControls = ['success','danger','warning','info'].map(role => fieldsFor([role + '-source'])).join('');
|
|
79
|
+
const paletteView = refinement('palette', `<ui-cluster>${renderPreset('palette', 'refinement')}<ui-button data-action="restore-palette">Reset palette</ui-button></ui-cluster><div class="refinement-layout"><div class="palette-preview"><ui-stack>${paletteDetails}</ui-stack></div><ui-stack><ui-text variant="heading" as="h3">Base colors</ui-text><ui-text variant="caption">Primary is the main voice. Add supporting accents where they help; status colors keep their own meanings.</ui-text>${fieldsFor(['action','canvas','surface','text'])}<ui-disclosure summary="Supporting accents"><ui-stack>${fieldsFor(['secondary-action','tertiary-action'])}</ui-stack></ui-disclosure><ui-disclosure summary="Neutrals & shared borders" data-advanced="neutrals"><ui-stack>${fieldsFor(['neutral-source','neutral-strength','neutral-border-contrast'])}<ui-text variant="caption">Neutral solid and outline buttons and form fields use this same border. Raising the minimum changes the whole family.</ui-text></ui-stack></ui-disclosure><ui-disclosure summary="Status colors" data-advanced="status"><ui-stack>${statusControls}${fieldsFor(['status-chroma'])}<ui-text variant="caption">Keep semantic hues, harmonize them with your brand, or use an accent family. Looma derives readable fills and text; labels and icons keep states identifiable when colors are shared. Supporting accents follow primary until enabled.</ui-text></ui-stack></ui-disclosure><ui-disclosure summary="Accent assignments" data-advanced="assignments"><ui-stack>${fieldsFor(['selection-accent','focus-accent','link-accent'])}</ui-stack></ui-disclosure><ui-disclosure summary="Adjust color character"><ui-stack>${fieldsFor(['warmth','color-intensity'])}</ui-stack></ui-disclosure><ui-disclosure summary="Color relationships">${paletteRelationships}</ui-disclosure></ui-stack></div>`);
|
|
68
80
|
const options = site.catalog.groups.map(group => `<optgroup label="${escape(group.label)}">${examples.filter(example => example.category === group.id).map(example => `<option value="${escape(example.id)}" data-description="${escape(example.category + ' · ' + example.tag)}" data-example="${escape(JSON.stringify(example))}" data-search="${escape(`${example.title} ${example.tag} ${example.description} ${example.exampleTitle}`.toLocaleLowerCase())}">${escape(example.title)} · ${escape(example.exampleTitle)}</option>`).join('')}</optgroup>`).join('');
|
|
69
|
-
const links = ['ui-action-bar','ui-stack','ui-grid','ui-cluster','ui-form-field','ui-input','ui-select','ui-color-picker','ui-button','ui-disclosure','ui-textarea','ui-number-input','ui-slider','ui-curve-editor','ui-card','ui-text','ui-light-editor','ui-combobox','ui-checkbox','ui-list','ui-list-item'].map(tag => `<link rel="component" href="@threadlabs/looma/components/${tag}/${tag}.html">`).join('\n');
|
|
81
|
+
const links = ['ui-action-bar','ui-stack','ui-grid','ui-cluster','ui-form-field','ui-input','ui-select','ui-color-picker','ui-button','ui-disclosure','ui-textarea','ui-number-input','ui-slider','ui-curve-editor','ui-card','ui-text','ui-light-editor','ui-combobox','ui-checkbox','ui-badge','ui-icon','ui-callout','ui-popover','ui-dialog','ui-list','ui-list-item'].map(tag => `<link rel="component" href="@threadlabs/looma/components/${tag}/${tag}.html">`).join('\n');
|
|
70
82
|
return `${links}\n<link rel="component" href="./card.html">\n<template component="looma-customizer" module="./customizer.js"><defs>
|
|
71
83
|
<state name="previews" type="list" value="${escape(JSON.stringify(initial))}"><prop type="object">${cardFields.map(name => `<prop name="${name}" required type="${name === 'resizable' ? 'boolean' : 'string'}"></prop>`).join('')}</prop></state>
|
|
72
84
|
<state name="cards" type="list" value="${escape(JSON.stringify(initial))}"><prop type="object">${cardFields.map(name => `<prop name="${name}" required type="${name === 'resizable' ? 'boolean' : 'string'}"></prop>`).join('')}</prop></state>
|
|
73
85
|
</defs>
|
|
74
86
|
<div data-looma-customizer data-recipe="${escape(JSON.stringify(recipe))}" data-base="${escape(site.base)}" data-mode="${site.config.local ? 'local' : 'public'}" data-revision="${escape(site.config.revision ?? '')}">
|
|
75
87
|
<ui-stack gap="l">
|
|
76
|
-
<ui-text
|
|
88
|
+
<ui-text size="md" role="status" aria-live="polite" data-message></ui-text>
|
|
77
89
|
<ui-stack gap="xs"><ui-text variant="eyebrow">Theme changes</ui-text><ui-cluster><ui-button size="sm" data-action="undo" disabled>Undo</ui-button><ui-button size="sm" data-action="redo" disabled>Redo</ui-button><ui-button size="sm" data-action="reset" title="Restore this theme’s starting values">Reset</ui-button></ui-cluster></ui-stack>
|
|
78
90
|
${materialView}${paletteView}${typographyView}${layoutView}${motionView}
|
|
79
91
|
${refinement('themes', `<ui-stack>${choice('id="theme-start" data-preset', 'Starting point', startingPointFor(recipe), `<option value="custom" disabled>Your theme</option>${Object.entries(startingPointLabels).map(([id,label]) => `<option value="${id}">${label}</option>`).join('')}`)}<ui-text variant="caption">A starting theme coordinates color, typography, space, material, and motion. Refine any of them from the overview.</ui-text>${documentationCard('ui-cluster', '/99-theme-sampler', true)}</ui-stack>`)}
|
package/docs/customizer.js
CHANGED
|
@@ -33,10 +33,12 @@ export function connect(host) {
|
|
|
33
33
|
const fields = new Map(themeFields.map(field => [field.id, field]));
|
|
34
34
|
const unitContext = () => ({ remPixels: parseFloat(view.getComputedStyle(document.documentElement).fontSize) });
|
|
35
35
|
const editorFor = (field, value) => valueEditor(field, value, { remPixels: parseFloat(recipe.values['text-size']) });
|
|
36
|
-
let boundsBase;
|
|
36
|
+
let boundsBase, lastLabelSize;
|
|
37
|
+
const optionalColors = new Map();
|
|
37
38
|
const updateControl = (element, value) => {
|
|
38
39
|
if (element.matches('[data-choice]')) element.dataset.selectedValue = value;
|
|
39
40
|
const field = fields.get(element.dataset.token);
|
|
41
|
+
if (field?.type === 'optional-colour' && value === field.defaultValue) return;
|
|
40
42
|
if (!field || !element.dataset.editorKind) { componentRegistry.update(element, { value }); return; }
|
|
41
43
|
const editor = editorFor(field, value);
|
|
42
44
|
if (element.dataset.editorKind === 'curve') {
|
|
@@ -91,6 +93,25 @@ export function connect(host) {
|
|
|
91
93
|
};
|
|
92
94
|
const paint = () => {
|
|
93
95
|
const values = recipe.values;
|
|
96
|
+
for (const field of themeFields.filter(field => field.type === 'optional-colour')) {
|
|
97
|
+
const value = values[field.id], custom = value !== field.defaultValue;
|
|
98
|
+
if (custom) optionalColors.set(field.id, value);
|
|
99
|
+
const picker = root.querySelector(`[data-optional-color="${field.id}"]`);
|
|
100
|
+
picker.hidden = !custom;
|
|
101
|
+
componentRegistry.update(root.querySelector(`[data-color-source="${field.id}"]`), { value: custom ? 'custom' : 'default' });
|
|
102
|
+
}
|
|
103
|
+
for (const sample of root.querySelectorAll('[data-extra-accent]')) sample.hidden = values[sample.dataset.extraAccent] === 'none';
|
|
104
|
+
for (const readout of root.querySelectorAll('[data-palette-roles]')) {
|
|
105
|
+
const { tokens } = deriveTheme(recipe, { mode: readout.dataset.paletteRoles });
|
|
106
|
+
readout.textContent = `Shared border ${tokens['--ui-control-border']} · minimum ${values['neutral-border-contrast']}:1. `;
|
|
107
|
+
}
|
|
108
|
+
const followsBody = values['label-size'] === 'inherit';
|
|
109
|
+
if (!followsBody) lastLabelSize = values['label-size'];
|
|
110
|
+
const labelSize = root.querySelector('[data-label-size-value]');
|
|
111
|
+
labelSize.hidden = followsBody;
|
|
112
|
+
const labelValue = followsBody ? lastLabelSize ?? values['text-size'] : values['label-size'];
|
|
113
|
+
componentRegistry.update(labelSize, { value: labelValue, unit: labelValue.match(/[a-z]+$/i)?.[0] ?? 'px' });
|
|
114
|
+
componentRegistry.update(root.querySelector('[data-label-size-source]'), { value: followsBody ? 'inherit' : 'custom' });
|
|
94
115
|
root.querySelector('[data-theme-summary]').textContent = startingPointLabels[recipe.origin ?? startingPointFor(recipe)] ?? 'Your theme';
|
|
95
116
|
const summaries = {
|
|
96
117
|
palette: `${themePalettes[refinementState(recipe, 'palette').id]?.label ?? 'Custom colors'} · Light & dark`,
|
|
@@ -221,6 +242,11 @@ export function connect(host) {
|
|
|
221
242
|
return { ...recipe, fonts, ...(origin ? { origin } : {}), presets, values };
|
|
222
243
|
};
|
|
223
244
|
const input = event => {
|
|
245
|
+
if (event.target.matches('[data-label-size-value]')) {
|
|
246
|
+
try { preview(refinedRecipe({ ...recipe.values, 'label-size': String(event.detail?.value ?? event.target.value) })); }
|
|
247
|
+
catch (error) { say(error.message, true); }
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
224
250
|
if (event.target.matches('[data-example-query]')) { filterExamples(); return; }
|
|
225
251
|
if (event.target.matches('[data-light-editor]')) {
|
|
226
252
|
try {
|
|
@@ -336,10 +362,22 @@ export function connect(host) {
|
|
|
336
362
|
};
|
|
337
363
|
const change = async event => {
|
|
338
364
|
const value = event.detail?.value ?? event.target.value;
|
|
339
|
-
if (event.target.matches('[data-light-editor]') || event.target.closest?.('[data-token]')) {
|
|
365
|
+
if (event.target.matches('[data-light-editor], [data-label-size-value]') || event.target.closest?.('[data-token]')) {
|
|
340
366
|
input(event); flush(); sayApplied('Theme remembered in this browser. Undo restores the previous decision.'); return;
|
|
341
367
|
}
|
|
342
368
|
flush();
|
|
369
|
+
if (event.target.matches('[data-color-source]')) {
|
|
370
|
+
const field = fields.get(event.target.dataset.colorSource);
|
|
371
|
+
const fallback = recipe.values.action;
|
|
372
|
+
show(refinedRecipe({ ...recipe.values, [field.id]: value === 'default' ? field.defaultValue : optionalColors.get(field.id) ?? fallback }));
|
|
373
|
+
sayApplied(`${field.label} updated and remembered in this browser.`);
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
if (event.target.matches('[data-label-size-source]')) {
|
|
377
|
+
show(refinedRecipe({ ...recipe.values, 'label-size': value === 'inherit' ? 'inherit' : lastLabelSize ?? recipe.values['text-size'] }));
|
|
378
|
+
sayApplied('Field label size updated and remembered in this browser.');
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
343
381
|
if (event.target.matches('[data-unit-for]')) {
|
|
344
382
|
const field = fields.get(event.target.dataset.unitFor);
|
|
345
383
|
try {
|
package/docs/palette.mjs
CHANGED
|
@@ -43,10 +43,11 @@ export function paletteSeeds(values) {
|
|
|
43
43
|
const intensity = Number(values['color-intensity']) * 2, warmth = (Number(values.warmth) - .5) * 2;
|
|
44
44
|
const relationship = values['palette-relationship'];
|
|
45
45
|
const brandHue = toLch(values.action)[2];
|
|
46
|
-
return Object.fromEntries(['action', 'canvas', 'surface', 'text'].map(key => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
return Object.fromEntries(['action', 'secondary-action', 'tertiary-action', 'canvas', 'surface', 'text'].map(key => {
|
|
47
|
+
const seed = values[key] === 'none' ? values.action : values[key];
|
|
48
|
+
if (intensity === 1 && warmth === 0 && relationship === 'preserve') return [key, seed];
|
|
49
|
+
let [l, c, h] = toLch(seed);
|
|
50
|
+
if (!['action','secondary-action','tertiary-action'].includes(key)) {
|
|
50
51
|
const tint = Math.max(Math.abs(warmth), relationship === 'preserve' ? 0 : .5);
|
|
51
52
|
if (tint) l = clamp(l, .08 * tint, 1 - .03 * tint);
|
|
52
53
|
if (relationship !== 'preserve') { h = brandHue + (relationship === 'neighboring' ? 30 : 180); c = Math.max(c, .018); }
|
package/docs/theme.mjs
CHANGED
|
@@ -5,12 +5,32 @@ const bounds = {
|
|
|
5
5
|
'text-size': [14, 24], 'control-roominess': [2, 4], 'corner-roundness': [0, 32],
|
|
6
6
|
'line-weight': [.5, 3], rhythm: [.75, 1.5], spacing: [.75, 1.5], 'scale-contrast': [1, 1.5],
|
|
7
7
|
'space-curve': [.5, 2], 'text-weight': [400, 700], 'outer-depth': [0, 2], 'inner-depth': [0, 2],
|
|
8
|
-
'response-time': [0, 600],
|
|
8
|
+
'response-time': [0, 600], 'neutral-border-contrast': [1, 4.5],
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
const brandChoices = { primary: 'Primary accent', secondary: 'Secondary accent', tertiary: 'Tertiary accent' };
|
|
12
|
+
const statusChoices = { derived: 'Semantic hue', related: 'Harmonize with primary', ...brandChoices };
|
|
13
|
+
const neutralChoices = { text: 'Derive from text', ...brandChoices, gray: 'Untinted gray' };
|
|
14
|
+
const relationshipChoices = { preserve: 'Preserve seed hues', neighboring: 'Neighboring hues', complementary: 'Complementary hues' };
|
|
15
|
+
const choicesFor = id => id === 'neutral-source' ? neutralChoices : id.endsWith('-source') ? statusChoices : id.endsWith('-accent') ? brandChoices : relationshipChoices;
|
|
16
|
+
const statusSeeds = { danger: '#c92d1e', success: '#007a33', warning: '#ba5b0b', info: '#0066cc' };
|
|
17
|
+
|
|
11
18
|
/** The shared authoring schema; ids remain stable in saved recipes. */
|
|
12
19
|
export const themeFields = [
|
|
13
20
|
['Colour', 'action', 'Action', '--ui-accent', 'colour', '#5b55d6', 'Primary fill; readable labels and contextual action text are derived separately.'],
|
|
21
|
+
['Colour', 'secondary-action', 'Secondary accent', null, 'optional-colour', 'none', 'An optional supporting brand color for selected components. Primary actions keep the primary accent.'],
|
|
22
|
+
['Colour', 'tertiary-action', 'Tertiary accent', null, 'optional-colour', 'none', 'An optional third accent for categories, highlights and supporting content.'],
|
|
23
|
+
['Colour', 'neutral-source', 'Neutral relationship', null, 'choice', 'text', 'Derive restrained neutrals from text, an accent family or an untinted gray. Shared border contrast and readable labels stay governed.'],
|
|
24
|
+
['Colour', 'neutral-strength', 'Neutral fill strength', null, 'fraction', '0.25', 'How much neutral pigment appears in quiet filled controls. Borders remain shared with fields.'],
|
|
25
|
+
['Colour', 'neutral-border-contrast', 'Neutral border contrast', null, 'ratio', '2', 'Minimum border-to-surface contrast for neutral buttons and form fields. 2:1 is the balanced default; raise it for stronger boundaries.'],
|
|
26
|
+
['Colour', 'status-chroma', 'Derived status saturation', null, 'fraction', '0.5', 'Perceptual saturation of derived status colors, coordinated with the primary accent. Brand mappings keep the chosen family intact.'],
|
|
27
|
+
['Colour', 'success-source', 'Success relationship', null, 'choice', 'derived', 'Choose a semantic hue, harmonize it with primary, or use a governed brand-accent family.'],
|
|
28
|
+
['Colour', 'danger-source', 'Error relationship', null, 'choice', 'derived', 'Choose a semantic hue, harmonize it with primary, or use a governed brand-accent family.'],
|
|
29
|
+
['Colour', 'warning-source', 'Warning relationship', null, 'choice', 'derived', 'Choose a semantic hue, harmonize it with primary, or use a governed brand-accent family.'],
|
|
30
|
+
['Colour', 'info-source', 'Info relationship', null, 'choice', 'derived', 'Choose a semantic hue, harmonize it with primary, or use a governed brand-accent family.'],
|
|
31
|
+
['Colour', 'selection-accent', 'Selection accent', null, 'choice', 'primary', 'Choose the accent for selected rows and choices.'],
|
|
32
|
+
['Colour', 'focus-accent', 'Focus accent', null, 'choice', 'primary', 'Choose the accent for keyboard focus rings.'],
|
|
33
|
+
['Colour', 'link-accent', 'Link accent', null, 'choice', 'primary', 'Choose the accent for inline Text links and editor links.'],
|
|
14
34
|
['Colour', 'canvas', 'Canvas', '--ui-surface', 'colour', '#f6f6f8', 'The ground behind surfaces.'],
|
|
15
35
|
['Colour', 'surface', 'Surface', '--ui-surface-raised', 'colour', '#ffffff', 'Fields, cards and floating surfaces.'],
|
|
16
36
|
['Colour', 'text', 'Text', '--ui-text', 'colour', '#1a1a1a', 'Readable content; supporting text follows this and Surface.'],
|
|
@@ -20,10 +40,11 @@ export const themeFields = [
|
|
|
20
40
|
['Type', 'body-font', 'Font', '--ui-font-sans', 'font', 'system-ui, sans-serif', 'The shared interface typeface.'],
|
|
21
41
|
['Type', 'display-font', 'Heading font', '--ui-font-display', 'font', 'system-ui, sans-serif', 'The heading typeface.'],
|
|
22
42
|
['Type', 'text-size', 'Base text size', '--ui-font-size', 'positive-length', '16px', 'Sets the document root in px. Type, spacing and layout use rem relationships and scale from this base once.'],
|
|
43
|
+
['Type', 'label-size', 'Field label size', '--ui-field-label-font-size', 'inherited-length', 'inherit', 'Follows body text unless you choose a separate size for field labels. Help text keeps its supporting size.'],
|
|
23
44
|
['Type', 'text-weight', 'Emphasis weight', '--ui-font-medium', 'weight', '500', 'Control-label emphasis; body and headings keep their roles.'],
|
|
24
45
|
['Size & spacing', 'control-roominess', 'Control roominess', '--ui-control-roominess', 'positive', '2.5', 'Shared control height as a multiple of base text size; buttons, fields and swatches stay aligned.'],
|
|
25
|
-
['Size & spacing', 'rhythm', 'Rhythm', '--ui-rhythm', 'positive', '1', '
|
|
26
|
-
['Size & spacing', 'spacing', 'Spacing', '--ui-spacing', 'positive', '1', '
|
|
46
|
+
['Size & spacing', 'rhythm', 'Rhythm', '--ui-rhythm', 'positive', '1', 'Vertical breathing room: opens text lines and the gaps between stacked groups without spreading navigation or button rows.'],
|
|
47
|
+
['Size & spacing', 'spacing', 'Spacing', '--ui-spacing', 'positive', '1', 'Space between controls and around content. Changes gaps and padding independently of vertical rhythm.'],
|
|
27
48
|
['Size & spacing', 'scale-contrast', 'Size ratio', '--ui-scale-ratio', 'ratio', '1.2', 'The multiplier between small, medium and large controls. At 1 the sizes are equal; higher values separate them.'],
|
|
28
49
|
['Size & spacing', 'space-curve', 'Spacing curve', '--ui-space-curve', 'nonnegative', '1', 'Spacing growth: 1 is linear, 2 is quadratic. Independent of control sizes.'],
|
|
29
50
|
['Size & spacing', 'corner-roundness', 'Corner roundness', '--ui-radius-md', 'length', '8px', 'One corner family across controls and surfaces.'],
|
|
@@ -43,12 +64,12 @@ export const themeFields = [
|
|
|
43
64
|
['Material', 'light-strength', 'Light strength', '--ui-light-strength', 'fraction', '0.65', 'Shared illumination; each material and component role determines its response.'],
|
|
44
65
|
['Motion', 'response-time', 'Response time', '--ui-motion-fast', 'time', '120ms', 'Shared feedback pace; floating transitions take proportionally longer.'],
|
|
45
66
|
['Motion', 'response-curve', 'Response curve', '--ui-motion-ease', 'easing', 'cubic-bezier(0.2,0,0.2,1)', 'How movement accelerates and settles.'],
|
|
46
|
-
].map(([family, id, label, property, type, defaultValue, description]) => Object.freeze({ family, id, label, property, type, defaultValue, description, ...(type === 'choice' ? { choices:
|
|
67
|
+
].map(([family, id, label, property, type, defaultValue, description]) => Object.freeze({ family, id, label, property, type, defaultValue, description, ...(type === 'choice' ? { choices: choicesFor(id) } : {}), ...(bounds[id] ? { min: bounds[id][0], max: bounds[id][1] } : type === 'fraction' ? { min: 0, max: 1 } : {}) }));
|
|
47
68
|
|
|
48
69
|
const baseRecipe = () => ({ schemaVersion: 1, values: Object.fromEntries(themeFields.map(field => [field.id, field.defaultValue])) });
|
|
49
70
|
const starting = values => ({ schemaVersion: 1, values: { ...baseRecipe().values, ...values } });
|
|
50
71
|
/** The documentation starts with Looma's coordinated identity; Clear keeps the neutral baseline. */
|
|
51
|
-
export const defaultRecipe = () => ({ ...starting({ action: '#7658d6', canvas: '#fbf9f4', surface: '#
|
|
72
|
+
export const defaultRecipe = () => ({ ...starting({ action: '#7658d6', canvas: '#fbf9f4', surface: '#ffffff', text: '#2b2538', 'body-font': googleFontStack('Manrope'), 'display-font': googleFontStack('Manrope'), 'text-size': '17px' }), fonts: { 'body-font': 'Manrope', 'display-font': 'Manrope' } });
|
|
52
73
|
export const startingPoints = {
|
|
53
74
|
looma: defaultRecipe(),
|
|
54
75
|
clear: baseRecipe(),
|
|
@@ -136,9 +157,11 @@ export function validateRecipe(input) {
|
|
|
136
157
|
let valid = typeof value === 'string' && value.length > 0;
|
|
137
158
|
if (valid) switch (field.type) {
|
|
138
159
|
case 'choice': valid = Object.hasOwn(field.choices, value); break;
|
|
160
|
+
case 'optional-colour': valid = value === field.defaultValue || /^#[\da-f]{6}$/i.test(value); break;
|
|
139
161
|
case 'colour': valid = /^#[\da-f]{6}$/i.test(value); break;
|
|
140
162
|
case 'font': valid = font.test(value); break;
|
|
141
163
|
case 'length': valid = length.test(value) && Number.isFinite(parseFloat(value)); break;
|
|
164
|
+
case 'inherited-length': valid = value === 'inherit' || (length.test(value) && Number.isFinite(parseFloat(value)) && parseFloat(value) > 0); break;
|
|
142
165
|
case 'positive-length': valid = length.test(value) && Number.isFinite(parseFloat(value)) && parseFloat(value) > 0; break;
|
|
143
166
|
case 'time': valid = time.test(value) && Number.isFinite(parseFloat(value)); break;
|
|
144
167
|
case 'easing': valid = easing(value); break;
|
|
@@ -271,13 +294,34 @@ export function deriveTheme(input, { mode } = {}) {
|
|
|
271
294
|
const surface = seed => readableColour(nativeInk === ink ? seed : companionSurface(seed, mode ?? (ink === '#000000' ? 'light' : 'dark')), [ink], 7, paper);
|
|
272
295
|
tokens['--ui-surface'] = surface(seeds.canvas);
|
|
273
296
|
tokens['--ui-surface-raised'] = surface(seeds.surface);
|
|
274
|
-
|
|
297
|
+
const dark = ink === '#ffffff';
|
|
298
|
+
if (dark) {
|
|
299
|
+
// Dark plates need a positive elevation step; independently flipping near-white
|
|
300
|
+
// seeds otherwise collapses both canvas and content to almost the same black.
|
|
301
|
+
const [canvasL, canvasC, canvasH] = toLch(tokens['--ui-surface']);
|
|
302
|
+
tokens['--ui-surface'] = fromLch([Math.min(canvasL, .38), canvasC, canvasH]);
|
|
303
|
+
const [raisedL, raisedC, raisedH] = toLch(tokens['--ui-surface-raised']);
|
|
304
|
+
tokens['--ui-surface-raised'] = readableColour(fromLch([Math.max(raisedL, Math.min(canvasL, .38) + .08), raisedC, raisedH]), [ink], 7, paper);
|
|
305
|
+
tokens['--ui-surface-sunken'] = fromLch([Math.max(0, Math.min(canvasL, .38) - .035), canvasC, canvasH]);
|
|
306
|
+
} else tokens['--ui-surface-sunken'] = surface(mix(tokens['--ui-surface-raised'], tokens['--ui-surface'], .92));
|
|
275
307
|
const surfaces = ['--ui-surface', '--ui-surface-raised', '--ui-surface-sunken'].map(name => tokens[name]);
|
|
276
|
-
const
|
|
308
|
+
const accents = { primary: seeds.action, secondary: seeds['secondary-action'], tertiary: seeds['tertiary-action'] };
|
|
309
|
+
const tones = { accent: accents.primary, 'accent-secondary': accents.secondary, 'accent-tertiary': accents.tertiary };
|
|
310
|
+
const brandChroma = Math.min(.20, Math.max(.08, toLch(accents.primary)[1]));
|
|
311
|
+
for (const role of ['danger','success','warning','info']) {
|
|
312
|
+
const source = values[role + '-source'];
|
|
313
|
+
if (source === 'derived' || source === 'related') {
|
|
314
|
+
let [l, , h] = toLch(statusSeeds[role]);
|
|
315
|
+
if (source === 'related') {
|
|
316
|
+
const brandHue = toLch(accents.primary)[2];
|
|
317
|
+
const delta = ((brandHue - h + 540) % 360) - 180;
|
|
318
|
+
h += Math.max(-15, Math.min(15, delta));
|
|
319
|
+
}
|
|
320
|
+
tones[role] = fromLch([l, brandChroma * (.5 + Number(values['status-chroma'])) * (.6 + Number(values['color-intensity']) * .8), h]);
|
|
321
|
+
} else tones[role] = accents[source];
|
|
322
|
+
}
|
|
277
323
|
for (const [tone, original] of Object.entries(tones)) {
|
|
278
|
-
const
|
|
279
|
-
const seed = tone === 'accent' ? original : fromLch([l, c * (.6 + Number(values['color-intensity']) * .8), h]);
|
|
280
|
-
const fill = seed;
|
|
324
|
+
const fill = original;
|
|
281
325
|
const onFill = foreground(fill, '#ffffff', '#000000');
|
|
282
326
|
tokens[`--ui-${tone}`] = fill;
|
|
283
327
|
tokens[`--ui-on-${tone}`] = onFill;
|
|
@@ -286,20 +330,29 @@ export function deriveTheme(input, { mode } = {}) {
|
|
|
286
330
|
const stateTarget = onFill === '#000000' ? '#ffffff' : '#000000';
|
|
287
331
|
tokens[`--ui-${tone}-hover`] = mix(fill, stateTarget, .86);
|
|
288
332
|
tokens[`--ui-${tone}-active`] = mix(fill, stateTarget, .74);
|
|
289
|
-
|
|
333
|
+
const contextual = readableColour(fill, surfaces, 4.5, ink);
|
|
334
|
+
const quiet = mix(contextual, tokens['--ui-surface-raised'], .20);
|
|
335
|
+
const [quietL] = toLch(quiet);
|
|
336
|
+
const [, pigmentC, pigmentH] = toLch(fill);
|
|
337
|
+
const plateL = toLch(tokens['--ui-surface-raised'])[0];
|
|
338
|
+
const quietC = dark ? Math.min(pigmentC, .035) : Math.min(pigmentC, .02 + .03 * Math.max(0, Math.cos((pigmentH - 140) * Math.PI / 180)));
|
|
339
|
+
tokens[`--ui-${tone}-soft`] = readableColour(fromLch([dark ? Math.max(quietL, plateL + .07) : Math.max(.92, plateL - .04), quietC, pigmentH]), [ink], 4.5, paper);
|
|
290
340
|
}
|
|
291
341
|
// Quiet fills are actual alpha composites. At an extreme light/dark flip,
|
|
292
342
|
// reduce their shared tint before it would leave no readable contextual ink.
|
|
293
|
-
const quietSurfaces = strength => [...surfaces, ...Object.keys(tones).flatMap(tone => surfaces.flatMap(background => [
|
|
343
|
+
const quietSurfaces = strength => [...surfaces, ...(dark ? [readableColour(mix(ink, tokens['--ui-surface-raised'], .22), [ink], 4.5, paper)] : []), ...Object.keys(tones).map(tone => tokens[`--ui-${tone}-soft`]), ...Object.keys(tones).flatMap(tone => surfaces.flatMap(background => [
|
|
294
344
|
mix(tokens[`--ui-${tone}`], background, .12 * strength),
|
|
295
|
-
...[.05, .12, .18].map(alpha => alphaSurface(tokens[`--ui-${tone}`], background, alpha * strength)),
|
|
345
|
+
...[.05, .12, .18, .19].map(alpha => alphaSurface(tokens[`--ui-${tone}`], background, alpha * strength)),
|
|
296
346
|
]))];
|
|
297
347
|
let tonalOpacity = 1;
|
|
298
348
|
while (tonalOpacity > 0 && quietSurfaces(tonalOpacity).some(background => contrast(ink, background) < 4.5)) tonalOpacity = Math.max(0, tonalOpacity - .01);
|
|
299
349
|
tokens['--ui-tonal-opacity'] = String(Number(tonalOpacity.toFixed(2)));
|
|
300
350
|
const readingSurfaces = quietSurfaces(tonalOpacity);
|
|
301
351
|
for (const tone of Object.keys(tones)) {
|
|
302
|
-
|
|
352
|
+
const [l, c, h] = toLch(tokens[`--ui-${tone}`]);
|
|
353
|
+
const foregroundSeed = fromLch([dark ? Math.max(l, .80) : Math.min(l, .50), Math.min(c, dark ? .16 : .18), h]);
|
|
354
|
+
tokens[`--ui-${tone}-subtle-text`] = readableColour(foregroundSeed, readingSurfaces, 4.5, ink);
|
|
355
|
+
tokens[`--ui-${tone}-soft-border`] = alphaSurface(tokens[`--ui-${tone}-subtle-text`], tokens[`--ui-${tone}-soft`], .25);
|
|
303
356
|
}
|
|
304
357
|
// Existing validation/editor hooks must receive a contextual text role, never
|
|
305
358
|
// a pressed fill. Preserve consumer overrides at their established boundaries.
|
|
@@ -309,27 +362,32 @@ export function deriveTheme(input, { mode } = {}) {
|
|
|
309
362
|
tokens['--ui-text'] = readableColour(textSeed, readingSurfaces, 4.5, ink);
|
|
310
363
|
tokens['--ui-text-secondary'] = readableColour(mix(tokens['--ui-text'], tokens['--ui-surface-raised'], .72), readingSurfaces, 4.5, ink);
|
|
311
364
|
tokens['--ui-text-muted'] = tokens['--ui-text-secondary'];
|
|
312
|
-
//
|
|
313
|
-
//
|
|
314
|
-
// empirical attention score. A floor preserves near-surface action boundaries.
|
|
365
|
+
// Colored action edges keep a boundary when their pigment approaches a surface.
|
|
366
|
+
// Neutral controls use their own shared contrast decision below.
|
|
315
367
|
const separation = Math.min(...surfaces.map(surface => colourDistance(tokens['--ui-accent'], surface)));
|
|
316
368
|
const amplitude = .10 + .16 * separation / (separation + .20);
|
|
317
369
|
for (const tone of Object.keys(tones)) for (const state of ['', '-hover', '-active']) {
|
|
318
370
|
tokens[`--ui-${tone}${state}-border`] = actionBoundary(tokens[`--ui-${tone}${state}`], surfaces, ink, amplitude);
|
|
319
371
|
}
|
|
320
|
-
//
|
|
321
|
-
//
|
|
322
|
-
const
|
|
323
|
-
|
|
324
|
-
)));
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
372
|
+
// Neutral pigment governs fills; a shared contrast floor governs every neutral
|
|
373
|
+
// control boundary independently of how close the brand pigment is to its canvas.
|
|
374
|
+
const neutralSource = values['neutral-source'];
|
|
375
|
+
const [, neutralC, neutralH] = toLch(neutralSource === 'text' || neutralSource === 'gray' ? tokens['--ui-text'] : accents[neutralSource]);
|
|
376
|
+
const neutral = fromLch([toLch(tokens['--ui-text'])[0], neutralSource === 'gray' ? 0 : Math.min(.04, neutralC), neutralH]);
|
|
377
|
+
const fillAmount = .02 + Number(values['neutral-strength']) * .16;
|
|
378
|
+
for (const [state, amount] of [['surface', fillAmount], ['hover', fillAmount + .04], ['active', fillAmount + .08]]) {
|
|
379
|
+
const tinted = mix(neutral, tokens['--ui-surface-raised'], amount * (dark ? 2.25 : 1));
|
|
380
|
+
const [l, c, h] = toLch(tinted);
|
|
381
|
+
const fill = dark ? fromLch([Math.max(l, toLch(tokens['--ui-surface-raised'])[0] + amount * 1.5), c, h]) : tinted;
|
|
382
|
+
tokens[`--ui-neutral-${state}`] = readableColour(fill, [tokens['--ui-text']], 4.5, paper);
|
|
328
383
|
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
tokens['--ui-border
|
|
384
|
+
const borderSurfaces = [...surfaces, tokens['--ui-neutral-surface']];
|
|
385
|
+
const engagedSurfaces = [...surfaces, tokens['--ui-neutral-hover'], tokens['--ui-neutral-active']];
|
|
386
|
+
const borderMinimum = Math.min(4.5, Number(values['neutral-border-contrast']) * (dark ? 1.15 : 1));
|
|
387
|
+
tokens['--ui-control-border'] = readableColour(mix(neutral, tokens['--ui-surface-raised'], .14), borderSurfaces, borderMinimum, ink);
|
|
388
|
+
tokens['--ui-control-border-hover'] = readableColour(tokens['--ui-control-border'], engagedSurfaces, Math.min(4.5, borderMinimum + .3), ink);
|
|
389
|
+
tokens['--ui-border'] = mix(neutral, tokens['--ui-surface-raised'], .10);
|
|
390
|
+
tokens['--ui-border-strong'] = mix(neutral, tokens['--ui-surface-raised'], .18);
|
|
333
391
|
for (const [role, fill, labels] of [
|
|
334
392
|
['surface', tokens['--ui-surface-raised'], [tokens['--ui-text'], tokens['--ui-text-secondary'], ...Object.keys(tones).map(tone => tokens[`--ui-${tone}-subtle-text`])]],
|
|
335
393
|
['neutral', tokens['--ui-neutral-surface'], tokens['--ui-text']],
|
|
@@ -344,18 +402,22 @@ export function deriveTheme(input, { mode } = {}) {
|
|
|
344
402
|
const range = [Math.min(low, luminance(trackFill)), Math.max(high, luminance(trackFill), luminance(tokens[`--ui-${track}-specular`]))];
|
|
345
403
|
for (const [part, colour] of Object.entries(materialColours(fill, range, values['light-color'], 3.05))) tokens[`--ui-${role}-${part}`] = colour;
|
|
346
404
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
tokens['--ui-
|
|
405
|
+
const selection = values['selection-accent'] === 'primary' ? 'accent' : 'accent-' + values['selection-accent'];
|
|
406
|
+
const link = values['link-accent'] === 'primary' ? 'accent' : 'accent-' + values['link-accent'];
|
|
407
|
+
tokens['--ui-link-color'] = tokens[`--ui-${link}-subtle-text`];
|
|
408
|
+
tokens['--ui-editor-link-color'] = tokens['--ui-link-color'];
|
|
409
|
+
// Contextual pigment keeps even deep brand colors visible over a dark plate.
|
|
410
|
+
const selectionPigment = tokens[`--ui-${selection}${dark ? '-subtle-text' : ''}`];
|
|
411
|
+
tokens['--ui-selection-surface'] = readableColour(mix(selectionPigment, tokens['--ui-surface-raised'], dark ? .22 : .1), [ink], dark ? 7 : 4.5, paper);
|
|
412
|
+
tokens['--ui-selection-text'] = readableColour(tokens[`--ui-${selection}-subtle-text`], [...surfaces, tokens['--ui-selection-surface']], dark ? 7 : 4.5, ink);
|
|
413
|
+
tokens['--ui-selection-border'] = mix(selectionPigment, tokens['--ui-surface-raised'], dark ? .44 : .2);
|
|
350
414
|
tokens['--ui-control-surface'] = tokens['--ui-surface-raised'];
|
|
351
415
|
// A hint is quieter than body copy; resolve it against its field, not every tinted content surface.
|
|
352
416
|
tokens['--ui-control-placeholder'] = readableColour(mix(tokens['--ui-text'], tokens['--ui-control-surface'], .5), [tokens['--ui-control-surface']], 4.5, ink);
|
|
353
|
-
tokens['--ui-control-border'] = readableColour(mix(tokens['--ui-text'], tokens['--ui-surface-raised'], .43), readingSurfaces, 3, ink);
|
|
354
|
-
tokens['--ui-control-border-hover'] = tokens['--ui-control-border'];
|
|
355
417
|
tokens['--ui-disabled-text'] = mix(tokens['--ui-text'], tokens['--ui-surface-raised'], .45);
|
|
356
418
|
tokens['--ui-disabled-surface'] = tokens['--ui-surface-sunken'];
|
|
357
419
|
tokens['--ui-disabled-border'] = mix(tokens['--ui-text'], tokens['--ui-surface-raised'], .2);
|
|
358
|
-
tokens['--ui-focus-ring'] = readableColour(
|
|
420
|
+
tokens['--ui-focus-ring'] = readableColour(accents[values['focus-accent']], readingSurfaces, 3, ink);
|
|
359
421
|
tokens['--ui-focus-width'] = 'max(2px, calc(var(--ui-border-width) * 2))';
|
|
360
422
|
tokens['color-scheme'] = ink === '#000000' ? 'light' : 'dark';
|
|
361
423
|
for (const [id, property] of [['canvas', '--ui-surface'], ['surface', '--ui-surface-raised'], ['text', '--ui-text']]) {
|
package/docs/value-editors.mjs
CHANGED
|
@@ -4,10 +4,11 @@ const timeUnits = { ms: 1, s: 1000 };
|
|
|
4
4
|
const rounded = value => String(Number(Number(value).toFixed(6)));
|
|
5
5
|
|
|
6
6
|
export function valueEditor(field, value, { remPixels = 16 } = {}) {
|
|
7
|
+
if (field.type === 'inherited-length') return { kind: 'inherited-size', value };
|
|
7
8
|
if (field.id === 'text-size') return { kind: 'number', value, unit: 'px', min: field.min, max: field.max, step: 1 };
|
|
8
9
|
if (field.type === 'choice') return { kind: 'choice', value };
|
|
9
10
|
if (field.type === 'easing') return { kind: /^step-/.test(value) ? 'text' : 'curve', value };
|
|
10
|
-
if (['colour', 'font'].includes(field.type)) return { kind: 'text', value };
|
|
11
|
+
if (['colour', 'optional-colour', 'font'].includes(field.type)) return { kind: 'text', value };
|
|
11
12
|
if (field.type.includes('length') || field.type === 'time') {
|
|
12
13
|
const unit = value.match(/[a-z]+$/i)?.[0] ?? 'px';
|
|
13
14
|
// Convert authoring limits against the same root as the displayed quantity.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threadlabs/looma",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Looma components as HTML, Vue, and plain DOM, with design tokens.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"@tiptap/pm": ">=2 <3",
|
|
128
128
|
"@tiptap/vue-3": ">=2 <3",
|
|
129
129
|
"vue": "^3.5.43",
|
|
130
|
-
"markupress": ">=0.10.
|
|
130
|
+
"markupress": ">=0.10.2 <1",
|
|
131
131
|
"@threadlabs/markupkit": ">=0.2.0 <1",
|
|
132
132
|
"vite": ">=7.2.7 <9"
|
|
133
133
|
},
|
package/styles/ui-action-bar.css
CHANGED
|
@@ -7,17 +7,11 @@
|
|
|
7
7
|
[data-component~="ui-action-bar"] { --html-next-scope-owner: "ui-action-bar" !important; }
|
|
8
8
|
}
|
|
9
9
|
@scope ([data-component~="ui-action-bar"]) to ([data-component], [data-slotted]) {
|
|
10
|
-
/*
|
|
11
|
-
@property --ui-action-bar-gap {
|
|
12
|
-
syntax: "*";
|
|
13
|
-
inherits: false;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/* The action row of a form or dialog. Tertiary actions (Back, Cancel, Discard) sit at the start
|
|
10
|
+
/* The action row of a form or dialog. Tertiary actions (Back, Cancel, Discard) sit at the start
|
|
17
11
|
edge; secondary actions (Save as draft, Preview) sit just before the primary one, which ends the
|
|
18
12
|
row. The bar arranges its actions and leaves their look to them. */
|
|
19
13
|
:scope:where([data-component~="ui-action-bar"]) {
|
|
20
|
-
/*
|
|
14
|
+
/* Resolve shared part values at the component root. */
|
|
21
15
|
--_ui-action-bar-gap: var(--ui-action-bar-gap);
|
|
22
16
|
|
|
23
17
|
--_gap: var(--ui-space-2);
|
|
@@ -77,9 +71,7 @@
|
|
|
77
71
|
}
|
|
78
72
|
}
|
|
79
73
|
@scope ([data-component~="ui-action-bar"]) to ([data-component]) {
|
|
80
|
-
/*
|
|
81
|
-
|
|
82
|
-
/* The action row of a form or dialog. Tertiary actions (Back, Cancel, Discard) sit at the start
|
|
74
|
+
/* The action row of a form or dialog. Tertiary actions (Back, Cancel, Discard) sit at the start
|
|
83
75
|
edge; secondary actions (Save as draft, Preview) sit just before the primary one, which ends the
|
|
84
76
|
row. The bar arranges its actions and leaves their look to them. */
|
|
85
77
|
|
|
@@ -9,17 +9,17 @@
|
|
|
9
9
|
@scope ([data-component~="ui-affordance-scope"]) to ([data-component], [data-slotted]) {
|
|
10
10
|
:scope:where([data-component~="ui-affordance-scope"]) {
|
|
11
11
|
display: contents !important;
|
|
12
|
-
--
|
|
13
|
-
--
|
|
12
|
+
--_ui-affordance-scope-engaged: 0;
|
|
13
|
+
--_ui-affordance-scope-guide: 1;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
:scope:where([data-component~="ui-affordance-scope"])[data-ui-affordance-scope-state~="engaged"] {
|
|
17
|
-
--
|
|
17
|
+
--_ui-affordance-scope-engaged: 1;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/* Published to descendants: each guide multiplies its opacity by it, so none reaches them all. */
|
|
21
21
|
:scope:where([data-component~="ui-affordance-scope"])[data-ui-affordance-scope-state~="guide=none"] {
|
|
22
|
-
--
|
|
22
|
+
--_ui-affordance-scope-guide: 0;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/* A component that sets its display still honours the hidden attribute on its root. */
|
|
@@ -7,18 +7,8 @@
|
|
|
7
7
|
[data-component~="ui-avatar-group"] { --html-next-scope-owner: "ui-avatar-group" !important; }
|
|
8
8
|
}
|
|
9
9
|
@scope ([data-component~="ui-avatar-group"]) to ([data-component], [data-slotted]) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
syntax: "*";
|
|
13
|
-
inherits: false;
|
|
14
|
-
}
|
|
15
|
-
@property --ui-avatar-group-overlap-shadow {
|
|
16
|
-
syntax: "*";
|
|
17
|
-
inherits: false;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
:scope:where([data-component~="ui-avatar-group"]) {
|
|
21
|
-
/* Hooks do not inherit, so the parts below read them from the root. */
|
|
10
|
+
:scope:where([data-component~="ui-avatar-group"]) {
|
|
11
|
+
/* Resolve shared part values at the component root. */
|
|
22
12
|
--_ui-avatar-group-overlap-shadow: var(--ui-avatar-group-overlap-shadow);
|
|
23
13
|
--_ui-avatar-group-edge-ring: var(--ui-avatar-group-edge-ring);
|
|
24
14
|
|
|
@@ -84,9 +74,7 @@
|
|
|
84
74
|
}
|
|
85
75
|
}
|
|
86
76
|
@scope ([data-component~="ui-avatar-group"]) to ([data-component]) {
|
|
87
|
-
/*
|
|
88
|
-
|
|
89
|
-
/* Overlap and the separating shadow are applied by the controller: slotted avatars are nested
|
|
77
|
+
/* Overlap and the separating shadow are applied by the controller: slotted avatars are nested
|
|
90
78
|
* component roots outside this style scope. */
|
|
91
79
|
:where([data-slotted], [data-slotted] *):is(*) {
|
|
92
80
|
margin-inline-start: -0.5rem !important;
|