@swiftwc/ui 0.0.0-dev.20 → 0.0.0-dev.21
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/generated/buses/alert-dialog.d.ts +2 -0
- package/generated/buses/alert-dialog.js +1 -0
- package/generated/buses/confirmation-dialog.d.ts +2 -0
- package/generated/buses/confirmation-dialog.js +1 -0
- package/generated/buses/index.d.ts +6 -0
- package/generated/buses/index.js +6 -0
- package/generated/buses/lifecycle-observer.d.ts +2 -0
- package/generated/buses/lifecycle-observer.js +1 -0
- package/generated/client/index.d.ts +17 -4
- package/generated/client/index.js +83 -32
- package/generated/components/alert-dialog.d.ts +8 -0
- package/generated/components/alert-dialog.js +94 -0
- package/generated/components/bordered-button.d.ts +2 -0
- package/generated/components/bordered-button.js +15 -1
- package/generated/components/bordered-prominent-button.d.ts +2 -0
- package/generated/components/bordered-prominent-button.js +15 -1
- package/generated/components/borderless-button.d.ts +1 -1
- package/generated/components/borderless-button.js +6 -7
- package/generated/components/confirmation-dialog.d.ts +1 -1
- package/generated/components/confirmation-dialog.js +26 -20
- package/generated/components/content-unavailable-view.js +2 -2
- package/generated/components/date-picker.js +14 -6
- package/generated/components/disclosure-group.js +4 -1
- package/generated/components/glass-button.d.ts +2 -0
- package/generated/components/glass-button.js +15 -1
- package/generated/components/glass-prominent-button.d.ts +2 -0
- package/generated/components/glass-prominent-button.js +15 -1
- package/generated/components/index.d.ts +1 -0
- package/generated/components/index.js +1 -0
- package/generated/components/label-view.js +3 -3
- package/generated/components/menu-view.js +12 -7
- package/generated/components/navigation-title.js +4 -4
- package/generated/components/picker-view.js +16 -10
- package/generated/components/scroll-view.js +19 -10
- package/generated/components/section-view.js +3 -3
- package/generated/components/sheet-view.d.ts +1 -1
- package/generated/components/sheet-view.js +21 -17
- package/generated/components/sidebar-toggle.js +5 -3
- package/generated/components/sidebar-view.js +10 -4
- package/generated/components/sticky-container.js +3 -1
- package/generated/components/tab-bar.js +10 -4
- package/generated/components/tab-item.js +3 -1
- package/generated/components/tab-view.js +4 -1
- package/generated/components/table-view.js +11 -5
- package/generated/components/text-field.js +28 -28
- package/generated/components/tool-bar-item-group.d.ts +2 -0
- package/generated/components/tool-bar-item-group.js +28 -0
- package/generated/components/tool-bar-item.d.ts +2 -0
- package/generated/components/tool-bar-item.js +32 -2
- package/generated/components/tool-bar.js +1 -1
- package/generated/components/v-stack.d.ts +5 -0
- package/generated/components/v-stack.js +5 -0
- package/generated/css/index.css +128 -37
- package/generated/events/alert-dialog.d.ts +8 -0
- package/generated/events/alert-dialog.js +1 -0
- package/generated/events/confirmation-dialog.d.ts +2 -2
- package/generated/events/index.d.ts +1 -0
- package/generated/events/index.js +1 -0
- package/generated/i18n/locales/el.d.ts +9 -0
- package/generated/i18n/locales/el.js +9 -0
- package/generated/i18n/locales/en.d.ts +9 -0
- package/generated/i18n/locales/en.js +9 -0
- package/generated/internal/class/form-associated-base.js +4 -1
- package/generated/internal/class/navigation-view.js +4 -4
- package/generated/internal/utils/button-role.d.ts +1 -0
- package/generated/internal/utils/button-role.js +19 -0
- package/generated/internal/utils/cash/index.d.ts +4 -3
- package/generated/internal/utils/cash/index.js +6 -4
- package/generated/internal/utils/index.d.ts +3 -0
- package/generated/internal/utils/index.js +3 -0
- package/generated/internal/utils/is-inside.d.ts +1 -0
- package/generated/internal/utils/is-inside.js +4 -0
- package/generated/internal/utils/list-active.js +15 -5
- package/generated/internal/utils/toolbar-repositioner.d.ts +1 -0
- package/generated/internal/utils/toolbar-repositioner.js +12 -0
- package/generated/snapshot/index.d.ts +2 -0
- package/generated/snapshot/index.js +21 -0
- package/package.json +7 -4
- package/scss/_components.scss +2 -0
- package/scss/_functions.scss +10 -0
- package/scss/_transitions.scss +1 -0
- package/scss/colors/_index.scss +2 -2
- package/scss/components/_alert-dialog.scss +106 -0
- package/scss/components/_confirmation-dialog.scss +39 -39
- package/scss/components/_h-stack.scss +3 -13
- package/scss/components/_index.scss +1 -0
- package/scss/components/_sheet-view.scss +11 -1
- package/scss/components/_v-stack.scss +3 -13
- package/scss/final/_touch-glass.scss +7 -0
- package/scss/mixins/_index.scss +17 -0
- package/scss/placeholders/_buttons.scss +42 -0
- package/scss/transitions/_alert-dialog.scss +19 -0
- package/scss/utils/_frame.scss +7 -0
- package/web-components.html-data/en.json +84 -7
- package/generated/confirmation-dialog/index.d.ts +0 -1
- package/generated/confirmation-dialog/index.js +0 -1
- package/generated/lifecycle-observer/index.d.ts +0 -1
- package/generated/lifecycle-observer/index.js +0 -1
- package/scss/components/_components.scss +0 -76
|
@@ -12,7 +12,10 @@ export function getInternals(instance) {
|
|
|
12
12
|
export function makeSlotchangeHandler(t) {
|
|
13
13
|
const handleSlotchange = (evt) => {
|
|
14
14
|
console.debug(`${makeSlotchangeHandler.name} ⚡️ ${evt?.type}`);
|
|
15
|
-
const slot = evt.target
|
|
15
|
+
const slot = evt.target instanceof HTMLSlotElement && evt.target;
|
|
16
|
+
if (!slot)
|
|
17
|
+
return;
|
|
18
|
+
const assigned = slot.assignedElements({ flatten: true });
|
|
16
19
|
observers.syncObservations(trackedElements.get(t) ?? new Set(), assigned, handleTagMutation, ['value', 'label']);
|
|
17
20
|
// for (const el of trackedElements.get(t) ?? [])
|
|
18
21
|
// if (!assigned.includes(el)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _a;
|
|
2
|
+
import { lifecycleObserver } from '../../buses';
|
|
2
3
|
import { CleanupRegistry } from '../../internal/class/cleanup-registry';
|
|
3
|
-
import { LifecycleObserver } from '../../lifecycle-observer';
|
|
4
4
|
import { frame, onoff } from '../utils';
|
|
5
5
|
export class NavigationView extends HTMLElement {
|
|
6
6
|
static get observedAttributes() {
|
|
@@ -16,7 +16,7 @@ export class NavigationView extends HTMLElement {
|
|
|
16
16
|
this.#recentBefore = undefined;
|
|
17
17
|
// this.removeEventListener('tabreveal', this.#handleTabReveal)
|
|
18
18
|
if (this.closest('tab-view'))
|
|
19
|
-
frame().then(() =>
|
|
19
|
+
frame().then(() => lifecycleObserver.dispatchEvent(new CustomEvent('tabhide', { detail: { tag: this.id }, bubbles: true, composed: true })));
|
|
20
20
|
}
|
|
21
21
|
connectedCallback() {
|
|
22
22
|
if (this.closest('tab-view')) {
|
|
@@ -32,7 +32,7 @@ export class NavigationView extends HTMLElement {
|
|
|
32
32
|
if (this.closest('tab-view'))
|
|
33
33
|
frame(this).then(() => {
|
|
34
34
|
// if (!r) return
|
|
35
|
-
|
|
35
|
+
lifecycleObserver.dispatchEvent(new CustomEvent('tabshow', { detail: { tag: this.id }, bubbles: true, composed: true }));
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
@@ -42,7 +42,7 @@ export class NavigationView extends HTMLElement {
|
|
|
42
42
|
break;
|
|
43
43
|
if (!this.closest('tab-view'))
|
|
44
44
|
break; // tabview stuff
|
|
45
|
-
let eventType = this.hasAttribute(name) ? 'tabhide' : 'tabshow', target =
|
|
45
|
+
let eventType = this.hasAttribute(name) ? 'tabhide' : 'tabshow', target = lifecycleObserver;
|
|
46
46
|
// isRecent by 100ms window
|
|
47
47
|
if (this.#recentBefore && performance.now() - this.#recentBefore.time <= 100) {
|
|
48
48
|
if (this.#recentBefore.type === 'beforetabreveal') {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (target: HTMLElement, attributeName: string | null): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { I18n } from '../../i18n';
|
|
2
|
+
import { CleanupRegistry } from '../class/cleanup-registry';
|
|
3
|
+
import { default as $ } from './cash';
|
|
4
|
+
import onoff from './onoff';
|
|
5
|
+
function renderPlaceholder(el, role) {
|
|
6
|
+
const label = el.querySelector(':scope>[slot=placeholder]') ?? el.appendChild($(`<label-view system-image="magnifying-glass" slot="placeholder"></label-view>`, '>1'));
|
|
7
|
+
if (role) {
|
|
8
|
+
label.setAttribute('title', I18n.t('ButtonRole').Default.Destructive);
|
|
9
|
+
}
|
|
10
|
+
else
|
|
11
|
+
label?.remove();
|
|
12
|
+
}
|
|
13
|
+
export default function (target, attributeName) {
|
|
14
|
+
renderPlaceholder(target, target.getAttribute(attributeName ?? ''));
|
|
15
|
+
CleanupRegistry.unregister(target, 'i18n');
|
|
16
|
+
CleanupRegistry.register(target, onoff('localechange', () => {
|
|
17
|
+
renderPlaceholder(target, target.getAttribute(attributeName ?? ''));
|
|
18
|
+
}, I18n.on).on(), 'i18n');
|
|
19
|
+
}
|
|
@@ -5,10 +5,11 @@ import prev from './prev';
|
|
|
5
5
|
import prevAll from './prev-all';
|
|
6
6
|
import prop from './prop';
|
|
7
7
|
import siblings from './siblings';
|
|
8
|
-
declare const DEFAULT: "
|
|
8
|
+
declare const DEFAULT: ">1";
|
|
9
9
|
interface CashFn {
|
|
10
|
-
(innerHTML: string
|
|
11
|
-
(innerHTML: string, selector:
|
|
10
|
+
(innerHTML: string): DocumentFragment;
|
|
11
|
+
<T extends Element = Element>(innerHTML: string, selector: typeof DEFAULT): T;
|
|
12
|
+
<T extends Element = Element>(innerHTML: string, selector: string): T;
|
|
12
13
|
prop: typeof prop;
|
|
13
14
|
nextAll: typeof nextAll;
|
|
14
15
|
prevAll: typeof prevAll;
|
|
@@ -5,12 +5,14 @@ import prev from './prev';
|
|
|
5
5
|
import prevAll from './prev-all';
|
|
6
6
|
import prop from './prop';
|
|
7
7
|
import siblings from './siblings';
|
|
8
|
-
const DEFAULT = '
|
|
9
|
-
const cash = ((innerHTML, selector
|
|
8
|
+
const DEFAULT = '>1';
|
|
9
|
+
const cash = ((innerHTML, selector) => {
|
|
10
10
|
const template = Object.assign(document.createElement('template'), { innerHTML });
|
|
11
|
+
if (!selector)
|
|
12
|
+
return template.content;
|
|
11
13
|
if (selector === DEFAULT)
|
|
12
|
-
return template.content.firstElementChild;
|
|
13
|
-
return template.content;
|
|
14
|
+
return template.content.firstElementChild; // OVERKILL
|
|
15
|
+
return template.content.querySelector('>1' === selector ? ':first-child' : selector);
|
|
14
16
|
});
|
|
15
17
|
cash.prop = prop;
|
|
16
18
|
cash.nextAll = nextAll;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import cash from './cash';
|
|
2
2
|
export { default as add } from './add';
|
|
3
|
+
export { default as buttonRole } from './button-role';
|
|
3
4
|
export { default as clamp } from './clamp';
|
|
4
5
|
export { default as compareBigDecimals } from './compare-big-decimals';
|
|
5
6
|
export { default as cssTime } from './css-time';
|
|
6
7
|
export { default as debounce } from './debounce';
|
|
7
8
|
export { default as frame } from './frame';
|
|
9
|
+
export { default as isInside } from './is-inside';
|
|
8
10
|
export { default as kebabCase } from './kebab-case';
|
|
9
11
|
export { default as listActive } from './list-active';
|
|
10
12
|
export { default as microtask } from './microtask';
|
|
@@ -14,4 +16,5 @@ export { default as sleep } from './sleep';
|
|
|
14
16
|
export { default as slowHideShow } from './slow-hide-show';
|
|
15
17
|
export { default as timeout } from './timeout';
|
|
16
18
|
export { default as touchGlass } from './touch-glass';
|
|
19
|
+
export { default as toolbarRepositioner } from './toolbar-repositioner';
|
|
17
20
|
export declare const $: typeof cash;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
// import * as _intl from './intl'
|
|
2
2
|
import cash from './cash';
|
|
3
3
|
export { default as add } from './add';
|
|
4
|
+
export { default as buttonRole } from './button-role';
|
|
4
5
|
export { default as clamp } from './clamp';
|
|
5
6
|
export { default as compareBigDecimals } from './compare-big-decimals';
|
|
6
7
|
export { default as cssTime } from './css-time';
|
|
7
8
|
export { default as debounce } from './debounce';
|
|
8
9
|
export { default as frame } from './frame';
|
|
10
|
+
export { default as isInside } from './is-inside';
|
|
9
11
|
export { default as kebabCase } from './kebab-case';
|
|
10
12
|
export { default as listActive } from './list-active';
|
|
11
13
|
export { default as microtask } from './microtask';
|
|
@@ -15,4 +17,5 @@ export { default as sleep } from './sleep';
|
|
|
15
17
|
export { default as slowHideShow } from './slow-hide-show';
|
|
16
18
|
export { default as timeout } from './timeout';
|
|
17
19
|
export { default as touchGlass } from './touch-glass';
|
|
20
|
+
export { default as toolbarRepositioner } from './toolbar-repositioner';
|
|
18
21
|
export const $ = cash;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (x: number, y: number, rect: DOMRect): boolean;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
const touchList = new WeakMap();
|
|
2
2
|
function onDown({ target }) {
|
|
3
|
-
|
|
3
|
+
if (!(target instanceof HTMLElement && target))
|
|
4
|
+
return;
|
|
5
|
+
const el = target.closest('button,summary');
|
|
4
6
|
if (!el)
|
|
5
7
|
return;
|
|
6
8
|
touchList.set(el, setTimeout(() => {
|
|
@@ -12,7 +14,9 @@ function onDown({ target }) {
|
|
|
12
14
|
el.closest('scroll-view')?.addEventListener('scroll', onScroll, { once: true, passive: true });
|
|
13
15
|
}
|
|
14
16
|
function onOver({ target, buttons }) {
|
|
15
|
-
|
|
17
|
+
if (!(target instanceof HTMLElement && target))
|
|
18
|
+
return;
|
|
19
|
+
const el = target.closest('button,summary');
|
|
16
20
|
if (!el)
|
|
17
21
|
return;
|
|
18
22
|
if (0 === buttons)
|
|
@@ -22,7 +26,9 @@ function onOver({ target, buttons }) {
|
|
|
22
26
|
el.addEventListener('pointerleave', onLeave, { once: true, passive: true });
|
|
23
27
|
}
|
|
24
28
|
function onLeave({ target }) {
|
|
25
|
-
|
|
29
|
+
if (!(target instanceof HTMLElement && target))
|
|
30
|
+
return;
|
|
31
|
+
const el = target.closest('button,summary');
|
|
26
32
|
if (!el)
|
|
27
33
|
return;
|
|
28
34
|
el.addEventListener('pointerover', onOver, { once: true, passive: true });
|
|
@@ -36,7 +42,9 @@ function onLeave({ target }) {
|
|
|
36
42
|
// })
|
|
37
43
|
}
|
|
38
44
|
function onCancel({ target }) {
|
|
39
|
-
|
|
45
|
+
if (!(target instanceof HTMLElement && target))
|
|
46
|
+
return;
|
|
47
|
+
const el = target.closest('button,summary');
|
|
40
48
|
if (!el)
|
|
41
49
|
return;
|
|
42
50
|
// self.requestAnimationFrame(() => {
|
|
@@ -50,7 +58,9 @@ function onCancel({ target }) {
|
|
|
50
58
|
// })
|
|
51
59
|
}
|
|
52
60
|
function onScroll({ target }) {
|
|
53
|
-
|
|
61
|
+
if (!(target instanceof HTMLElement && target))
|
|
62
|
+
return;
|
|
63
|
+
for (const el of target.querySelectorAll('button,summary') ?? []) {
|
|
54
64
|
el.classList.remove('active');
|
|
55
65
|
if (touchList.has(el))
|
|
56
66
|
clearTimeout(touchList.get(el));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (el: HTMLElement, evt: MediaQueryListEvent): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default function (el, evt) {
|
|
2
|
+
if (evt.matches) {
|
|
3
|
+
const newSlot = el.getAttribute('preferred-fine-modal-placement') ?? 'bottom-bar-trailing';
|
|
4
|
+
if (el.slot !== newSlot)
|
|
5
|
+
el.dataset.previousSlot = el.slot; // save for later restoration if diff
|
|
6
|
+
el.slot = el.getAttribute('preferred-fine-modal-placement') ?? 'bottom-bar-trailing';
|
|
7
|
+
}
|
|
8
|
+
else if (el.dataset.previousSlot) {
|
|
9
|
+
el.slot = el.dataset.previousSlot ?? '';
|
|
10
|
+
delete el.dataset.previousSlot;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare class Snapshot {
|
|
2
2
|
#private;
|
|
3
|
+
static get breakpoints(): ReadonlyMap<string, boolean> | undefined;
|
|
4
|
+
static on: EventTarget;
|
|
3
5
|
static readonly waitReady: Promise<[unknown, void]>;
|
|
4
6
|
static waitReadyFor<T extends HTMLElement>(element: T): Promise<T | null>;
|
|
5
7
|
static get config(): Record<string, string> | undefined;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import { onoff } from '../internal/utils';
|
|
1
2
|
export class Snapshot {
|
|
2
3
|
static #readyCalled = false;
|
|
3
4
|
static #config;
|
|
5
|
+
static #listeners;
|
|
6
|
+
static #breakpoints;
|
|
7
|
+
static get breakpoints() {
|
|
8
|
+
return this.#breakpoints;
|
|
9
|
+
}
|
|
10
|
+
static on = new EventTarget();
|
|
4
11
|
static waitReady = Promise.all([
|
|
5
12
|
'complete' === document.readyState ? Promise.resolve() : new Promise((r) => self.addEventListener('load', r, { once: true })),
|
|
6
13
|
(async () => {
|
|
@@ -32,6 +39,20 @@ export class Snapshot {
|
|
|
32
39
|
catch {
|
|
33
40
|
console.error('could-not-parse-config');
|
|
34
41
|
}
|
|
42
|
+
for (const off of this.#listeners ?? [])
|
|
43
|
+
off?.();
|
|
44
|
+
this.#listeners = new Set();
|
|
45
|
+
const mediaQueryList = self.matchMedia(`(pointer: fine) and (min-width: ${this.#config['ipad-sheet-view-inline-size']}) and (min-height: ${this.#config['ipad-sheet-view-height']})`);
|
|
46
|
+
this.#breakpoints = new Map([['fine_dialog_sheet', mediaQueryList.matches]]);
|
|
47
|
+
this.#listeners.add(onoff('change', (evt) => this.#handleMediaChange(evt, 'fine_dialog_sheet:change'), mediaQueryList).on());
|
|
35
48
|
console.debug(this.#config);
|
|
36
49
|
}
|
|
50
|
+
static #handleMediaChange = ({ type, matches, media }, kind) => {
|
|
51
|
+
console.debug(`${Snapshot.name} ⚡️ ${type}`);
|
|
52
|
+
this.#breakpoints?.set('fine_dialog_sheet', matches);
|
|
53
|
+
this.on.dispatchEvent(new MediaQueryListEvent(kind, {
|
|
54
|
+
matches,
|
|
55
|
+
media,
|
|
56
|
+
}));
|
|
57
|
+
};
|
|
37
58
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swiftwc/ui",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.21",
|
|
4
4
|
"description": "Elegant SwiftUI-inspired web components for standalone web apps and web extensions.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -57,19 +57,22 @@
|
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"prebuild": "rm -rf generated",
|
|
60
|
-
"build": "npm run build:ts && npm run build:scss && npm run build:manifest && npm run build:barrels
|
|
60
|
+
"build": "npm run build:ts && npm run build:scss && npm run build:manifest && npm run build:barrels",
|
|
61
61
|
"postbuild": "npm run format:write",
|
|
62
62
|
"build:ts:watch": "npm run prebuild && tsc --watch",
|
|
63
63
|
"build:ts": "tsc",
|
|
64
64
|
"build:scss": "sass --style=expanded --no-source-map scss/index.scss generated/css/index.css",
|
|
65
65
|
"build:manifest": "tsx scripts/make-manifest.ts",
|
|
66
|
-
"build:barrels": "
|
|
66
|
+
"build:barrels": "npm run build:barrels:components && npm run build:barrels:events && npm run build:barrels:buses && npm run build:barrels:i18n",
|
|
67
|
+
"build:barrels:components": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --directory ./js/components --exclude \".\\.test\\.ts\"",
|
|
68
|
+
"build:barrels:events": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --directory ./js/events --exclude \".\\.test\\.ts\"",
|
|
69
|
+
"build:barrels:buses": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --exportDefault --directory ./js/buses",
|
|
67
70
|
"build:barrels:i18n": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --exportDefault --fullPathname --directory ./js/i18n/locales",
|
|
68
71
|
"format:check": "prettier . --check",
|
|
69
72
|
"format:write": "prettier . --write",
|
|
70
73
|
"test": "vitest --dom",
|
|
71
74
|
"predeploy": "rm -rf generated",
|
|
72
|
-
"deploy":"npm run build:ts && npm run build:scss",
|
|
75
|
+
"deploy": "npm run build:ts && npm run build:scss",
|
|
73
76
|
"version:pkg": "npm version $npm_config_bump --no-git-tag-version --preid=dev"
|
|
74
77
|
},
|
|
75
78
|
"devDependencies": {
|
package/scss/_components.scss
CHANGED
|
@@ -18,12 +18,14 @@
|
|
|
18
18
|
@forward 'components/content-unavailable-view';
|
|
19
19
|
|
|
20
20
|
@forward 'components/confirmation-dialog';
|
|
21
|
+
@forward 'components/alert-dialog';
|
|
21
22
|
|
|
22
23
|
@forward 'components/scroll-view';
|
|
23
24
|
@forward 'components/scroll-view-proxy';
|
|
24
25
|
|
|
25
26
|
@forward 'components/h-stack';
|
|
26
27
|
@forward 'components/v-stack';
|
|
28
|
+
@forward 'components/h-flex-stack';
|
|
27
29
|
@forward 'components/v-flex-stack';
|
|
28
30
|
|
|
29
31
|
@forward 'components/scroll-view-toolbars';
|
package/scss/_functions.scss
CHANGED
|
@@ -19,3 +19,13 @@
|
|
|
19
19
|
}
|
|
20
20
|
@return string.slice($parts, 2);
|
|
21
21
|
}
|
|
22
|
+
|
|
23
|
+
@function str-replace($string, $search, $replace: '') {
|
|
24
|
+
$index: string.index($string, $search);
|
|
25
|
+
|
|
26
|
+
@if $index {
|
|
27
|
+
@return string.slice($string, 1, $index - 1) + $replace + str-replace(string.slice($string, $index + string.length($search)), $search, $replace);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@return $string;
|
|
31
|
+
}
|
package/scss/_transitions.scss
CHANGED
package/scss/colors/_index.scss
CHANGED
|
@@ -439,7 +439,7 @@ $colors: map.merge(
|
|
|
439
439
|
// --canvastext: light-dark(var(--primary-label), var(--primary-label-dark));
|
|
440
440
|
// }
|
|
441
441
|
|
|
442
|
-
:where([is='sheet-view'], [is='full-screen'], [is='confirmation-dialog']) {
|
|
442
|
+
:where([is='sheet-view'], [is='full-screen'], [is='confirmation-dialog'], [is='alert-dialog']) {
|
|
443
443
|
// modify background/secondarybg/tertiarybg etc for ELEVATED STYLES!!
|
|
444
444
|
// ANCHOR: level 1
|
|
445
445
|
--face: var(--background); // IMPORTANT: redeclare references scope or it WONT pick up!
|
|
@@ -536,7 +536,7 @@ $colors: map.merge(
|
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
538
|
|
|
539
|
-
:where([is='confirmation-dialog']) {
|
|
539
|
+
:where([is='confirmation-dialog'], [is='alert-dialog']) {
|
|
540
540
|
--dialogbtnface: light-dark(var(--toolbar-cell-bg), var(--toolbar-cell-bg-dark));
|
|
541
541
|
--dialogbtnhighlightface: light-dark(var(--toolbar-cell-focus-bg), var(--toolbar-cell-focus-bg-dark));
|
|
542
542
|
--dialogbtnactiveface: light-dark(var(--toolbar-cell-active-bg), var(--toolbar-cell-active-bg-dark));
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
@use '../vars';
|
|
2
|
+
@use '../mixins';
|
|
3
|
+
|
|
4
|
+
@layer #{vars.$components-layer} {
|
|
5
|
+
[is='alert-dialog'] {
|
|
6
|
+
:where(&) {
|
|
7
|
+
@include mixins.reset-dialog;
|
|
8
|
+
|
|
9
|
+
color: var(--text,);
|
|
10
|
+
|
|
11
|
+
touch-action: none;
|
|
12
|
+
|
|
13
|
+
position: fixed;
|
|
14
|
+
|
|
15
|
+
inline-size: fit-content;
|
|
16
|
+
block-size: fit-content;
|
|
17
|
+
height: auto; // safari
|
|
18
|
+
max-inline-size: min(20rem, 80vw);
|
|
19
|
+
max-block-size: 80vh;
|
|
20
|
+
|
|
21
|
+
margin-block: max(env(safe-area-inset-top), var(--menu-spacing)) max(env(safe-area-inset-bottom), var(--menu-spacing));
|
|
22
|
+
margin-inline: max(env(safe-area-inset-left), var(--menu-spacing)) max(env(safe-area-inset-right), var(--menu-spacing));
|
|
23
|
+
|
|
24
|
+
transform: var(--alert--dialog-scale,);
|
|
25
|
+
opacity: var(--alert--dialog-opacity,);
|
|
26
|
+
|
|
27
|
+
position-anchor: --alert-dialog; // overriden
|
|
28
|
+
position-area: center;
|
|
29
|
+
|
|
30
|
+
overflow: clip;
|
|
31
|
+
border-radius: 0.9rem;
|
|
32
|
+
|
|
33
|
+
backdrop-filter: var(--liquid-glass-backdrop-filter,);
|
|
34
|
+
box-shadow: var(--menu-popover-box-shadow,); //0 0 10px 10px black;
|
|
35
|
+
|
|
36
|
+
padding-block: 1rem;
|
|
37
|
+
padding-inline: 1em;
|
|
38
|
+
gap: 1rem;
|
|
39
|
+
|
|
40
|
+
// finally
|
|
41
|
+
--alert--dialog-scale: scale(1.2);
|
|
42
|
+
--alert--dialog-opacity: 0.8;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&[open] {
|
|
46
|
+
:where(&) {
|
|
47
|
+
--alert--dialog-scale: scale(1);
|
|
48
|
+
--alert--dialog-opacity: 1;
|
|
49
|
+
|
|
50
|
+
@starting-style {
|
|
51
|
+
--alert--dialog-scale: scale(1.2);
|
|
52
|
+
--alert--dialog-opacity: 0.8;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&[closing] {
|
|
58
|
+
:where(&) {
|
|
59
|
+
--alert--dialog-scale: scale(0.98);
|
|
60
|
+
--alert--dialog-opacity: 0;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// SECTION: componentize
|
|
65
|
+
// > button {
|
|
66
|
+
// :where(&) {
|
|
67
|
+
// @include mixins.componentize(dialogbtn);
|
|
68
|
+
// }
|
|
69
|
+
// }
|
|
70
|
+
|
|
71
|
+
// :where(&) {
|
|
72
|
+
// --dialogbtnpadistart: 0.6rem;
|
|
73
|
+
// --dialogbtnpadiend: 0.6rem;
|
|
74
|
+
// --dialogbtnpadbstart: 0.6rem;
|
|
75
|
+
// --dialogbtnpadbend: 0.6rem;
|
|
76
|
+
// --dialogbtnradiustl: 1rem;
|
|
77
|
+
// --dialogbtnradiustr: 1rem;
|
|
78
|
+
// --dialogbtnradiusbl: 1rem;
|
|
79
|
+
// --dialogbtnradiusbr: 1rem;
|
|
80
|
+
// }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// @layer #{vars.$colors-layer} {
|
|
85
|
+
// // SECTION: componentize
|
|
86
|
+
// [is='alert-dialog'] {
|
|
87
|
+
// > button {
|
|
88
|
+
// @include mixins.add-focus-visible-state {
|
|
89
|
+
// --dialogbtnface: var(--dialogbtnhighlightface,);
|
|
90
|
+
// --dialogbtntext: var(--dialogbtnhighlighttext,);
|
|
91
|
+
// }
|
|
92
|
+
// }
|
|
93
|
+
// }
|
|
94
|
+
// }
|
|
95
|
+
|
|
96
|
+
// @layer #{vars.$ui-layer} {
|
|
97
|
+
// // SECTION: componentize
|
|
98
|
+
// [is='alert-dialog'] {
|
|
99
|
+
// > button {
|
|
100
|
+
// @include mixins.add-active-state {
|
|
101
|
+
// --dialogbtnface: var(--dialogbtnactiveface,);
|
|
102
|
+
// --dialogbtntext: var(--dialogbtnactivetext,);
|
|
103
|
+
// }
|
|
104
|
+
// }
|
|
105
|
+
// }
|
|
106
|
+
// }
|
|
@@ -66,45 +66,45 @@
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
// SECTION: componentize
|
|
69
|
-
> button {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
:where(&) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
69
|
+
// > button {
|
|
70
|
+
// :where(&) {
|
|
71
|
+
// @include mixins.componentize(dialogbtn);
|
|
72
|
+
// }
|
|
73
|
+
// }
|
|
74
|
+
|
|
75
|
+
// :where(&) {
|
|
76
|
+
// --dialogbtnpadistart: 0.6rem;
|
|
77
|
+
// --dialogbtnpadiend: 0.6rem;
|
|
78
|
+
// --dialogbtnpadbstart: 0.6rem;
|
|
79
|
+
// --dialogbtnpadbend: 0.6rem;
|
|
80
|
+
// --dialogbtnradiustl: 1rem;
|
|
81
|
+
// --dialogbtnradiustr: 1rem;
|
|
82
|
+
// --dialogbtnradiusbl: 1rem;
|
|
83
|
+
// --dialogbtnradiusbr: 1rem;
|
|
84
|
+
// }
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
@layer #{vars.$colors-layer} {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
@layer #{vars.$ui-layer} {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
88
|
+
// @layer #{vars.$colors-layer} {
|
|
89
|
+
// // SECTION: componentize
|
|
90
|
+
// [is='confirmation-dialog'] {
|
|
91
|
+
// > button {
|
|
92
|
+
// @include mixins.add-focus-visible-state {
|
|
93
|
+
// --dialogbtnface: var(--dialogbtnhighlightface,);
|
|
94
|
+
// --dialogbtntext: var(--dialogbtnhighlighttext,);
|
|
95
|
+
// }
|
|
96
|
+
// }
|
|
97
|
+
// }
|
|
98
|
+
// }
|
|
99
|
+
|
|
100
|
+
// @layer #{vars.$ui-layer} {
|
|
101
|
+
// // SECTION: componentize
|
|
102
|
+
// [is='confirmation-dialog'] {
|
|
103
|
+
// > button {
|
|
104
|
+
// @include mixins.add-active-state {
|
|
105
|
+
// --dialogbtnface: var(--dialogbtnactiveface,);
|
|
106
|
+
// --dialogbtntext: var(--dialogbtnactivetext,);
|
|
107
|
+
// }
|
|
108
|
+
// }
|
|
109
|
+
// }
|
|
110
|
+
// }
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
@use '../vars';
|
|
2
|
+
@use '../mixins';
|
|
2
3
|
@use 'sass:string';
|
|
3
4
|
@use 'sass:list';
|
|
4
5
|
|
|
5
|
-
$h-stack-templates: ((minmax(0, 1fr) auto), (auto minmax(0, 1fr) auto auto), (repeat(4, minmax(0, 1fr))), (repeat(2, minmax(0, 1fr)) auto));
|
|
6
|
+
$h-stack-templates: ((minmax(0, 1fr) auto), (auto minmax(0, 1fr) auto auto), (auto minmax(0, 1fr) auto), (repeat(4, minmax(0, 1fr))), (repeat(2, minmax(0, 1fr)) auto));
|
|
6
7
|
|
|
7
8
|
@layer #{vars.$components-layer} {
|
|
8
9
|
h-stack {
|
|
@@ -23,17 +24,6 @@ $h-stack-templates: ((minmax(0, 1fr) auto), (auto minmax(0, 1fr) auto auto), (re
|
|
|
23
24
|
// }
|
|
24
25
|
// }
|
|
25
26
|
|
|
26
|
-
@
|
|
27
|
-
$parts: string.split('#{$template}', ', ');
|
|
28
|
-
$result: '';
|
|
29
|
-
@each $part in $parts {
|
|
30
|
-
$result: $result + '#{$part},';
|
|
31
|
-
}
|
|
32
|
-
$result: string.slice($result, 1, string.length($result) - 1);
|
|
33
|
-
@debug $result, $template;
|
|
34
|
-
:where(&[template='#{$result}']) {
|
|
35
|
-
grid-template-columns: $template;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
27
|
+
@include mixins.make-template($h-stack-templates, grid-template-columns);
|
|
38
28
|
}
|
|
39
29
|
}
|
|
@@ -15,10 +15,20 @@
|
|
|
15
15
|
|
|
16
16
|
--sheet-view-translate: translateY(var(--view-transition-dialog-offscreen-y));
|
|
17
17
|
|
|
18
|
-
:where(&[fine-presentation-large-adaptation='bottom-bar'] > tool-bar > [slot^='top-bar-']) {
|
|
18
|
+
// :where(&[fine-presentation-large-adaptation='bottom-bar'] > tool-bar > [slot^='top-bar-']) {
|
|
19
|
+
// FIXME: Add live tooltip
|
|
20
|
+
// NOTE: By default toolbars items dialogs have only icons, (except if they define/force w/ labelStyle)
|
|
21
|
+
:where(& > tool-bar > [slot='top-bar-leading'], & > tool-bar > [slot='top-bar-trailing']) {
|
|
19
22
|
--label-style: icon-only;
|
|
20
23
|
}
|
|
21
24
|
|
|
25
|
+
// NOTE: By default bottombar items dialogs on iphone have only icons, (except if they define/force w/ labelStyle)
|
|
26
|
+
@media (pointer: coarse) {
|
|
27
|
+
:where(& > tool-bar > [slot^='bottom-bar-']) {
|
|
28
|
+
--label-style: icon-only;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
22
32
|
@media (pointer: coarse) and (orientation: portrait) {
|
|
23
33
|
clip-path: inset(var(--safe-area-inset-top) 0 0 0 round 2rem 2rem 0 0);
|
|
24
34
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
@use '../vars';
|
|
2
2
|
@use 'sass:string';
|
|
3
3
|
@use 'sass:list';
|
|
4
|
+
@use '../mixins';
|
|
4
5
|
|
|
5
|
-
$v-stack-templates: ((auto auto minmax(0, 1fr)), (auto minmax(0, 1fr)), (auto auto
|
|
6
|
+
$v-stack-templates: ((auto minmax(0, 1fr)), (auto auto minmax(0, 1fr)), (auto auto auto minmax(0, 1fr)), (auto auto auto auto minmax(0, 1fr)));
|
|
6
7
|
|
|
7
8
|
@layer #{vars.$components-layer} {
|
|
8
9
|
v-stack {
|
|
@@ -19,17 +20,6 @@ $v-stack-templates: ((auto auto minmax(0, 1fr)), (auto minmax(0, 1fr)), (auto au
|
|
|
19
20
|
// max-width: 100%;
|
|
20
21
|
// }
|
|
21
22
|
|
|
22
|
-
@
|
|
23
|
-
$parts: string.split('#{$template}', ', ');
|
|
24
|
-
$result: '';
|
|
25
|
-
@each $part in $parts {
|
|
26
|
-
$result: $result + '#{$part},';
|
|
27
|
-
}
|
|
28
|
-
$result: string.slice($result, 1, string.length($result) - 1);
|
|
29
|
-
@debug $result, $template;
|
|
30
|
-
:where(&[template='#{$result}']) {
|
|
31
|
-
grid-template-rows: $template;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
23
|
+
@include mixins.make-template($v-stack-templates, grid-template-rows);
|
|
34
24
|
}
|
|
35
25
|
}
|