Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/theme/dist/v4/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,9 @@
--spacing-sm: 0.75rem;
--spacing-xs: 0.5rem;
--spacing-xxs: 0.25rem;
--z-input-field: 1;
--z-input-popup: 10;
--z-input-overlay: 1100;
--text-big-number-md-font-size: 1.25rem;
--text-big-number-md-line-height: 1.25;
--text-big-number-md-font-weight: 400;
Expand Down
3 changes: 3 additions & 0 deletions packages/theme/dist/v4/globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,9 @@
--spacing-sm: 0.75rem;
--spacing-xs: 0.5rem;
--spacing-xxs: 0.25rem;
--z-input-field: 1;
--z-input-popup: 10;
--z-input-overlay: 1100;
--text-big-number-md-font-size: 1.25rem;
--text-big-number-md-line-height: 1.25;
--text-big-number-md-font-weight: 400;
Expand Down
4 changes: 4 additions & 0 deletions packages/theme/src/scripts/build-tokens.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { compileThemeCss, compileThemeVars } from './compile-theme.js';
import { containersData } from '../tokens/semantic/containers.data.js';
import { spacingsData } from '../tokens/semantic/spacings.data.js';
import { textsData } from '../tokens/semantic/texts.data.js';
import { zIndicesData } from '../tokens/semantic/z-indices.data.js';

const BREAKPOINT_ORDER = ['sm', 'md', 'lg', 'xl', '2xl'];

Expand Down Expand Up @@ -91,6 +92,7 @@ const buildFlatModel = () => ({
primitives: flattenPrimitives(),
containers: flattenSingleValue(containersData, (k) => `--container-${k}`),
spacings: flattenSingleValue(spacingsData, (k) => `--${k}`),
zIndices: flattenSingleValue(zIndicesData, (k) => `--${k}`),
texts: flattenBundle(textsData),
});

Expand Down Expand Up @@ -295,6 +297,7 @@ const emitCssV4 = () => {
...rootPrimitiveVars,
...(m.containers._ || {}),
...(m.spacings._ || {}),
...(m.zIndices._ || {}),
...(m.texts._ || {}),
};

Expand All @@ -303,6 +306,7 @@ const emitCssV4 = () => {
const merged = {
...(m.containers[bp] || {}),
...(m.spacings[bp] || {}),
...(m.zIndices[bp] || {}),
...(m.texts[bp] || {}),
};
if (Object.keys(merged).length === 0) continue;
Expand Down
30 changes: 30 additions & 0 deletions packages/theme/src/tokens/semantic/z-indices.data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Declarative z-index tokens.
*
* Intra-input stacking:
*
* - `z-input-field` → native field / interactive foreground (e.g. an
* `<input>` or trigger button) sitting above the
* input's own background surface, icons, and
* adornments so keyboard/mouse focus is never
* hijacked by a decorative sibling.
* - `z-input-popup` → inline (non-teleported) overlays anchored to the
* input — dropdown menus, option lists, popovers —
* that must sit above surrounding form content but
* within the current stacking context.
* - `z-input-overlay` → teleported overlays (rendered under `<body>` via
* `<Teleport>`) that must clear application chrome
* such as drawers, modals, and fixed headers.
*
* Values are intentionally small and well-spaced to make future additions
* obvious. Consume as `z-[var(--z-input-*)]` in components — do not
* introduce ad-hoc numeric z-index in input `.vue` files.
*/

export const zIndicesData = {
'z-input-field': { _: '1' },
'z-input-popup': { _: '10' },
'z-input-overlay': { _: '1100' },
};

export default { zIndicesData };
10 changes: 9 additions & 1 deletion packages/webkit/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,10 @@
"--width-md",
"--width-sm",
"--width-xl",
"--width-xs"
"--width-xs",
"--z-input-field",
"--z-input-overlay",
"--z-input-popup"
],
"typography": [
"text-big-number-lg",
Expand Down Expand Up @@ -1408,6 +1411,11 @@
"--width-sm",
"--width-xl",
"--width-xs"
],
"z": [
"--z-input-field",
"--z-input-overlay",
"--z-input-popup"
]
},
"animations": [
Expand Down
4 changes: 3 additions & 1 deletion packages/webkit/src/components/inputs/chip/chip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@
@click="onClick"
@keydown="onKeydown"
>
<span class="relative z-[1] inline-flex items-center justify-center gap-[var(--spacing-xxs)]">
<span
class="relative z-[var(--z-input-field)] inline-flex items-center justify-center gap-[var(--spacing-xxs)]"
>
<slot v-if="$slots['default']" />
<span
v-else-if="label"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
>
<span
v-if="$slots['prefix']"
class="relative z-[1] flex items-center pl-[var(--spacing-md)] text-[var(--text-muted)]"
class="relative z-[var(--z-input-field)] flex items-center pl-[var(--spacing-md)] text-[var(--text-muted)]"
>
<slot name="prefix" />
</span>
Expand All @@ -145,29 +145,29 @@
:aria-required="required || undefined"
:data-testid="testId"
v-bind="passthroughAttrs"
class="relative z-[1] w-full min-w-0 border-0 bg-transparent outline-none px-[var(--spacing-md)] text-label-sm text-[var(--text-default)] placeholder:text-[var(--text-muted)] disabled:cursor-not-allowed disabled:text-[var(--text-disabled)] read-only:cursor-default [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"
class="relative z-[var(--z-input-field)] w-full min-w-0 border-0 bg-transparent outline-none px-[var(--spacing-md)] text-label-sm text-[var(--text-default)] placeholder:text-[var(--text-muted)] disabled:cursor-not-allowed disabled:text-[var(--text-disabled)] read-only:cursor-default [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"
@input="handleInput"
@change="handleChange"
/>

<span
v-if="$slots['suffix']"
class="relative z-[1] flex items-center pr-[var(--spacing-md)] text-[var(--text-muted)]"
class="relative z-[var(--z-input-field)] flex items-center pr-[var(--spacing-md)] text-[var(--text-muted)]"
>
<slot name="suffix" />
</span>

<span
v-if="disabled"
class="relative z-[1] flex items-center pr-[var(--spacing-md)] text-[var(--text-disabled)]"
class="relative z-[var(--z-input-field)] flex items-center pr-[var(--spacing-md)] text-[var(--text-disabled)]"
aria-hidden="true"
>
<i class="pi pi-lock text-label-sm leading-none" />
</span>

<span
v-if="showButtons"
class="relative z-[1] flex h-full w-12 shrink-0 flex-col self-stretch border-l border-[var(--border-default)]"
class="relative z-[var(--z-input-field)] flex h-full w-12 shrink-0 flex-col self-stretch border-l border-[var(--border-default)]"
>
<button
type="button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
:aria-invalid="invalid || undefined"
:aria-required="required || undefined"
:data-testid="testId"
class="relative z-[1] w-full min-w-0 border-0 bg-transparent p-0 outline-none text-label-sm text-[var(--text-default)] placeholder:text-[var(--text-muted)] disabled:cursor-not-allowed disabled:text-[var(--text-disabled)] read-only:cursor-default transition-opacity duration-150 ease-out motion-reduce:transition-none"
class="relative z-[var(--z-input-field)] w-full min-w-0 border-0 bg-transparent p-0 outline-none text-label-sm text-[var(--text-default)] placeholder:text-[var(--text-muted)] disabled:cursor-not-allowed disabled:text-[var(--text-disabled)] read-only:cursor-default transition-opacity duration-150 ease-out motion-reduce:transition-none"
v-bind="passthroughAttrs"
@input="handleInput"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
:aria-invalid="invalid || undefined"
:aria-required="required || undefined"
:data-testid="testId"
class="relative z-[1] w-full min-w-0 border-0 bg-transparent p-0 outline-none text-label-sm text-[var(--text-default)] placeholder:text-[var(--text-muted)] disabled:cursor-not-allowed disabled:text-[var(--text-disabled)] read-only:cursor-default"
class="relative z-[var(--z-input-field)] w-full min-w-0 border-0 bg-transparent p-0 outline-none text-label-sm text-[var(--text-default)] placeholder:text-[var(--text-muted)] disabled:cursor-not-allowed disabled:text-[var(--text-disabled)] read-only:cursor-default"
v-bind="passthroughAttrs"
@input="handleInput"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
:data-state="ctx.open.value ? 'open' : 'closed'"
:class="attrs.class"
:style="positionStyle"
class="fixed z-50 flex max-h-[20rem] flex-col overflow-hidden rounded-[var(--shape-elements)] border border-[var(--border-default)] bg-[var(--bg-surface-raised)] shadow-[var(--shadow-xs)]"
class="fixed z-[var(--z-input-overlay)] flex max-h-[20rem] flex-col overflow-hidden rounded-[var(--shape-elements)] border border-[var(--border-default)] bg-[var(--bg-surface-raised)] shadow-[var(--shadow-xs)]"
@keydown="onKeydown"
>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
:data-mode="ctx.multiple.value ? 'multiple' : 'single'"
:class="attrs.class"
:style="positionStyle"
class="fixed z-50 flex max-h-[20rem] flex-col overflow-hidden rounded-[var(--shape-elements)] border border-[var(--border-default)] bg-[var(--bg-surface-raised)] shadow-[var(--shadow-xs)]"
class="fixed z-[var(--z-input-overlay)] flex max-h-[20rem] flex-col overflow-hidden rounded-[var(--shape-elements)] border border-[var(--border-default)] bg-[var(--bg-surface-raised)] shadow-[var(--shadow-xs)]"
@keydown="onKeydown"
>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
'relative inline-flex h-7 w-fit items-center gap-[var(--spacing-xxs)] p-[var(--spacing-xxs)] rounded-full border-solid border-[length:var(--border-width-default)] border-[var(--border-default)] bg-[var(--bg-surface)]'

const SEGMENT_CLASS =
'relative z-[1] inline-flex h-5 w-7 shrink-0 items-center justify-center rounded-full cursor-pointer text-label-sm text-[var(--text-default)] transition-colors duration-fast-02 ease-productive-entrance motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring-color)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--bg-canvas)] [&:not([data-state=active])]:hover:bg-[var(--bg-hover)] disabled:cursor-not-allowed disabled:text-[var(--text-disabled)]'
'relative z-[var(--z-input-field)] inline-flex h-5 w-7 shrink-0 items-center justify-center rounded-full cursor-pointer text-label-sm text-[var(--text-default)] transition-colors duration-fast-02 ease-productive-entrance motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring-color)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--bg-canvas)] [&:not([data-state=active])]:hover:bg-[var(--bg-hover)] disabled:cursor-not-allowed disabled:text-[var(--text-disabled)]'
</script>

<template>
Expand Down
Loading