entasis 0.7.1 → 0.9.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/README.md +7 -1
- package/dist/components/AppShell/appShell.theme.js +2 -2
- package/dist/components/FloatingWindow/FloatingWindow.svelte +26 -2
- package/dist/components/FloatingWindow/floatingWindow.dock.svelte.js +11 -2
- package/dist/components/FloatingWindow/floatingWindow.mcp.d.ts +1 -1
- package/dist/components/FloatingWindow/floatingWindow.mcp.js +7 -4
- package/dist/components/FloatingWindow/floatingWindow.props.d.ts +6 -0
- package/dist/components/FloatingWindow/floatingWindow.state.svelte.d.ts +3 -0
- package/dist/components/FloatingWindow/floatingWindow.state.svelte.js +18 -4
- package/dist/components/FloatingWindow/floatingWindow.theme.d.ts +3 -0
- package/dist/components/FloatingWindow/floatingWindow.theme.js +20 -7
- package/dist/components/Form/File/FileInput.svelte +6 -42
- package/dist/components/Form/Form/form.state.svelte.d.ts +4 -0
- package/dist/components/Form/Form/visibility.d.ts +2 -0
- package/dist/components/Form/MultiStepForm/multiStepForm.state.svelte.d.ts +4 -0
- package/dist/components/Form/Select/Select.svelte +28 -2
- package/dist/components/Form/Select/select.align.d.ts +55 -0
- package/dist/components/Form/Select/select.align.js +41 -0
- package/dist/components/Form/Select/select.mcp.d.ts +1 -1
- package/dist/components/Form/Select/select.mcp.js +7 -3
- package/dist/components/Form/Select/select.props.d.ts +8 -0
- package/dist/components/Form/Select/select.state.svelte.d.ts +24 -0
- package/dist/components/Form/Select/select.state.svelte.js +111 -1
- package/dist/components/Popover/Popover.svelte +4 -0
- package/dist/components/Popover/popover.mcp.d.ts +1 -1
- package/dist/components/Popover/popover.mcp.js +1 -0
- package/dist/components/Popover/popover.props.d.ts +16 -0
- package/dist/components/Popover/popover.state.svelte.d.ts +1 -1
- package/dist/components/Popover/popover.state.svelte.js +13 -0
- package/dist/components/Sidebar/Sidebar.svelte +58 -10
- package/dist/components/Sidebar/Sidebar.svelte.d.ts +1 -1
- package/dist/components/Sidebar/SidebarMenuItem.svelte +19 -2
- package/dist/components/Sidebar/SidebarMenuItem.svelte.d.ts +4 -0
- package/dist/components/Sidebar/SidebarPanel.svelte +199 -88
- package/dist/components/Sidebar/SidebarPanel.svelte.d.ts +3 -0
- package/dist/components/Sidebar/SidebarViewStage.svelte +103 -0
- package/dist/components/Sidebar/SidebarViewStage.svelte.d.ts +18 -0
- package/dist/components/Sidebar/index.d.ts +1 -1
- package/dist/components/Sidebar/sidebar.mcp.d.ts +1 -1
- package/dist/components/Sidebar/sidebar.mcp.js +19 -2
- package/dist/components/Sidebar/sidebar.props.d.ts +56 -1
- package/dist/components/Sidebar/sidebar.state.svelte.d.ts +4 -0
- package/dist/components/Sidebar/sidebar.state.svelte.js +9 -1
- package/dist/components/Sidebar/sidebar.theme.d.ts +128 -5
- package/dist/components/Sidebar/sidebar.theme.js +69 -3
- package/dist/components/Sidebar/sidebar.views.svelte.d.ts +138 -0
- package/dist/components/Sidebar/sidebar.views.svelte.js +303 -0
- package/dist/components/Theme/theme.floatingWindows.d.ts +6 -1
- package/dist/components/Theme/theme.floatingWindows.js +7 -2
- package/dist/components/Theme/theme.mcp.d.ts +1 -1
- package/dist/components/Theme/theme.mcp.js +1 -0
- package/dist/generated/componentContract.d.ts +1 -1
- package/dist/generated/componentContract.js +1 -0
- package/dist/generated/componentMcpRegistry.d.ts +6 -6
- package/dist/tailwind/index.mcp.d.ts +1 -1
- package/dist/tailwind/index.mcp.js +4 -0
- package/dist/tailwind/scales.js +11 -3
- package/dist/tailwind/spacing.js +17 -0
- package/dist/utils/cva/merge.d.ts +7 -0
- package/dist/utils/cva/merge.js +6 -1
- package/dist/utils/pointerDrag.js +7 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const tailwindPluginDescription = "\n# Main Tailwind plugin\n\n`@plugin 'entasis/tailwind-plugin'`\n\nThis palette-agnostic plugin registers shared utilities, variants, keyframes, and spinner CSS.\nUse it when colors are defined separately instead of through the theme plugin.\n\n## Configuration\n\n`spinner`\n- **Type**: `Spinner` object\n- **Default**: Auto-generated\n- **Description**: Custom spinner configuration for the `.ui-spinner` class\n\n## Shared utilities\n\n### `.state-layer`\n- Composites `currentColor` at `--state-hover-opacity` on hover and `data-highlighted=\"true\"`\n- Composites `currentColor` at `--state-pressed-opacity` on `:active`\n- Does not activate for disabled, `data-disabled`, or `aria-disabled=\"true\"` elements\n- Theme plugin defaults the opacities to 5% and 10% in light themes, and 16% and 32% in dark themes\n\n### `bg-selected-muted` / `rounded-<step>-concentric`\n- `bg-selected-muted` composites `var(--color-selected, var(--color))` at\n `--state-selected-opacity` (0.07 light, 0.10 dark), so a persistent selection reads the same on\n `surface`, `surface-raised` and `surface-floating`. `bg-color-muted` stays opaque.\n- `rounded-<step>-concentric` (also `rounded-t-<step>-concentric` /\n `rounded-b-<step>-concentric`, with `<step>` one of `xs sm md lg xl 2xl 3xl 4xl`) keeps the\n child on its own design step but caps it at what concentricity allows inside a rounded padded\n container:\n `min(var(--radius-<step>), var(--radius-parent) - max(--pad-parent-x, --pad-parent-y))`. The\n container declares nothing: every `rounded-<step>` publishes `--radius-parent` to its\n children and `p` / `px` / `py` publish `--pad-parent-x/-y`, so the two boxes stay\n concentric at every `radius` preset. Outside any rounded container the parent radius is\n infinite, so the child is exactly its step; a negative difference clamps to 0, a square corner.\n Put it on a child that sits flush against the padding box; a floating child (an avatar, a\n Button, a Chip) keeps its own radius.\n\nConfigure spacing, radius, typography scale, and raised borders at runtime through\n`Theme.designTokens`.\n\nSemantic spacing utilities use the active theme's `xs`, `sm`, `md`, `lg`, and `xl`\nscale for gaps, padding, margins, and physical insets. For example, `gap-lg`, `p-lg`,\n`top-lg`, and `left-lg` use the same spacing value. Inset utilities support `top`,\n`right`, `bottom`, and `left`, including responsive variants.\n";
|
|
1
|
+
export declare const tailwindPluginDescription = "\n# Main Tailwind plugin\n\n`@plugin 'entasis/tailwind-plugin'`\n\nThis palette-agnostic plugin registers shared utilities, variants, keyframes, and spinner CSS.\nUse it when colors are defined separately instead of through the theme plugin.\n\n## Configuration\n\n`spinner`\n- **Type**: `Spinner` object\n- **Default**: Auto-generated\n- **Description**: Custom spinner configuration for the `.ui-spinner` class\n\n## Shared utilities\n\n### `.state-layer`\n- Composites `currentColor` at `--state-hover-opacity` on hover and `data-highlighted=\"true\"`\n- Composites `currentColor` at `--state-pressed-opacity` on `:active`\n- Does not activate for disabled, `data-disabled`, or `aria-disabled=\"true\"` elements\n- Theme plugin defaults the opacities to 5% and 10% in light themes, and 16% and 32% in dark themes\n\n### `bg-selected-muted` / `rounded-<step>-concentric`\n- `bg-selected-muted` composites `var(--color-selected, var(--color))` at\n `--state-selected-opacity` (0.07 light, 0.10 dark), so a persistent selection reads the same on\n `surface`, `surface-raised` and `surface-floating`. `bg-color-muted` stays opaque.\n- `rounded-<step>-concentric` (also `rounded-t-<step>-concentric` /\n `rounded-b-<step>-concentric`, with `<step>` one of `xs sm md lg xl 2xl 3xl 4xl`) keeps the\n child on its own design step but caps it at what concentricity allows inside a rounded padded\n container:\n `min(var(--radius-<step>), var(--radius-parent) - max(--pad-parent-x, --pad-parent-y))`. The\n container declares nothing: every `rounded-<step>` publishes `--radius-parent` to its\n children and `p` / `px` / `py` publish `--pad-parent-x/-y`, so the two boxes stay\n concentric at every `radius` preset. Outside any rounded container the parent radius is\n infinite, so the child is exactly its step; a negative difference clamps to 0, a square corner.\n Put it on a child that sits flush against the padding box; a floating child (an avatar, a\n Button, a Chip) keeps its own radius.\n The padding half reads the other way: `px|py-<step>-concentric` is\n `max(space-<step>, min(radius-parent / 2, space-<step> * 3))`, so a flush bar's content clears a\n large container corner (a very round theme over a compact title bar) and stays the plain step\n otherwise.\n\nConfigure spacing, radius, typography scale, and raised borders at runtime through\n`Theme.designTokens`.\n\nSemantic spacing utilities use the active theme's `xs`, `sm`, `md`, `lg`, and `xl`\nscale for gaps, padding, margins, and physical insets. For example, `gap-lg`, `p-lg`,\n`top-lg`, and `left-lg` use the same spacing value. Inset utilities support `top`,\n`right`, `bottom`, and `left`, including responsive variants.\n";
|
|
@@ -36,6 +36,10 @@ Use it when colors are defined separately instead of through the theme plugin.
|
|
|
36
36
|
infinite, so the child is exactly its step; a negative difference clamps to 0, a square corner.
|
|
37
37
|
Put it on a child that sits flush against the padding box; a floating child (an avatar, a
|
|
38
38
|
Button, a Chip) keeps its own radius.
|
|
39
|
+
The padding half reads the other way: \`px|py-<step>-concentric\` is
|
|
40
|
+
\`max(space-<step>, min(radius-parent / 2, space-<step> * 3))\`, so a flush bar's content clears a
|
|
41
|
+
large container corner (a very round theme over a compact title bar) and stays the plain step
|
|
42
|
+
otherwise.
|
|
39
43
|
|
|
40
44
|
Configure spacing, radius, typography scale, and raised borders at runtime through
|
|
41
45
|
\`Theme.designTokens\`.
|
package/dist/tailwind/scales.js
CHANGED
|
@@ -23,8 +23,8 @@ export const radiusSteps = {
|
|
|
23
23
|
xs: 0.125,
|
|
24
24
|
sm: 0.25,
|
|
25
25
|
md: 0.5, // controls (buttons, inputs) keep the radius they always had
|
|
26
|
-
lg: 0.75, // panels: cards, popovers, menus, alerts
|
|
27
|
-
xl: 1, // dialogs, drawers, large surfaces
|
|
26
|
+
lg: 0.75, // panels: cards, popovers, menus, alerts (factor capped, see radiusVariables)
|
|
27
|
+
xl: 1, // dialogs, drawers, large surfaces (factor capped)
|
|
28
28
|
'2xl': 1.25,
|
|
29
29
|
'3xl': 1.5,
|
|
30
30
|
'4xl': 2
|
|
@@ -111,9 +111,17 @@ export const spacingScaleVariables = (spacingScale) => {
|
|
|
111
111
|
});
|
|
112
112
|
return Object.fromEntries(entries.map(([step, multiplier]) => [`--space-${step}`, `calc(var(--spacing) * ${multiplier})`]));
|
|
113
113
|
};
|
|
114
|
+
// Surface steps (`lg` and up: cards, popovers, dialogs, windows) follow the factor only up to
|
|
115
|
+
// `large`. A round theme turns controls into pills; a panel rounder than ×1.5 stops reading as
|
|
116
|
+
// a panel. Radix Themes draws the same line: its `full` radius pills controls, not panels.
|
|
117
|
+
const SURFACE_RADIUS_STEPS = new Set(['lg', 'xl', '2xl', '3xl', '4xl']);
|
|
114
118
|
export const radiusVariables = (radius) => {
|
|
115
119
|
const factor = presetFactor(radius, radiusFactors, 'radius');
|
|
116
|
-
const
|
|
120
|
+
const surfaceFactor = Math.min(factor, radiusFactors.large);
|
|
121
|
+
const variables = Object.fromEntries(Object.entries(radiusSteps).map(([step, rem]) => [
|
|
122
|
+
`--radius-${step}`,
|
|
123
|
+
formatRem(rem * (SURFACE_RADIUS_STEPS.has(step) ? surfaceFactor : factor))
|
|
124
|
+
]));
|
|
117
125
|
return { '--radius': variables['--radius-md'], ...variables };
|
|
118
126
|
};
|
|
119
127
|
export const typeScaleVariables = (typeScale) => {
|
package/dist/tailwind/spacing.js
CHANGED
|
@@ -48,6 +48,22 @@ const paddingUtilities = {
|
|
|
48
48
|
ps: (value) => ({ 'padding-inline-start': value }),
|
|
49
49
|
pe: (value) => ({ 'padding-inline-end': value })
|
|
50
50
|
};
|
|
51
|
+
// `px-<step>-concentric` / `py-<step>-concentric`: the padding half of NESTED RADIUS (see
|
|
52
|
+
// `radius.ts`) read the other way. A flush bar's content sits in its container's corner, so its
|
|
53
|
+
// padding is the step, or half the container's corner radius when that is larger. A very round
|
|
54
|
+
// theme on a compact bar needs it: at `radius: 2.25` a 36px window corner sits over a 36px title
|
|
55
|
+
// bar, and `px-md` (8px) puts the title's first glyphs inside the curve. Capped at three steps,
|
|
56
|
+
// because a pill container publishes an infinite radius. It only departs from the plain step when
|
|
57
|
+
// the corner is more than twice the step. It publishes what it pads, like `px` / `py`.
|
|
58
|
+
const cornerClearance = (value) => `max(${value}, min(calc(var(--radius-parent, 0px) / 2), calc(${value} * 3)))`;
|
|
59
|
+
const concentricPaddingValues = Object.fromEntries(Object.entries(spacingValues).map(([step, value]) => [
|
|
60
|
+
`${step}-concentric`,
|
|
61
|
+
cornerClearance(value)
|
|
62
|
+
]));
|
|
63
|
+
const concentricPaddingUtilities = {
|
|
64
|
+
px: (value) => ({ 'padding-inline': value, '& > *': { '--pad-parent-x': value } }),
|
|
65
|
+
py: (value) => ({ 'padding-block': value, '& > *': { '--pad-parent-y': value } })
|
|
66
|
+
};
|
|
51
67
|
const marginUtilities = {
|
|
52
68
|
m: (value) => ({ margin: value }),
|
|
53
69
|
mx: (value) => ({ 'margin-inline': value }),
|
|
@@ -69,6 +85,7 @@ export const applySpacingEngine = ({ addBase, matchUtilities }) => {
|
|
|
69
85
|
addBase({ html: spacingVariables });
|
|
70
86
|
matchUtilities(gapUtilities, { values: spacingValues });
|
|
71
87
|
matchUtilities(paddingUtilities, { values: spacingValues });
|
|
88
|
+
matchUtilities(concentricPaddingUtilities, { values: concentricPaddingValues });
|
|
72
89
|
matchUtilities(marginUtilities, { values: spacingValues, supportsNegativeValues: true });
|
|
73
90
|
matchUtilities(insetUtilities, { values: spacingValues });
|
|
74
91
|
};
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* `reverse` are modifiers; `shimmer-color|duration|spread|angle-*` are scales)
|
|
19
19
|
* - `state-layer` / `state-layer-none` exclude each other
|
|
20
20
|
* - `rounded-<step>-concentric` / `rounded-t|b-<step>-concentric` (join the core corner groups), the container side
|
|
21
|
+
* - `px|py-<step>-concentric` (join the core `px` / `py` groups)
|
|
21
22
|
* needing nothing here — a `rounded-<step>` publishes its radius to its children by itself
|
|
22
23
|
* - `duration-*` / `ease-*` motion tokens
|
|
23
24
|
* - the semantic spacing scale (`p-md`, `gap-layout-lg`, ...) registered on
|
|
@@ -115,6 +116,12 @@ export declare const mergeConfig: {
|
|
|
115
116
|
'rounded-b': {
|
|
116
117
|
'rounded-b': ((value: string) => boolean)[];
|
|
117
118
|
}[];
|
|
119
|
+
px: {
|
|
120
|
+
px: ((value: string) => boolean)[];
|
|
121
|
+
}[];
|
|
122
|
+
py: {
|
|
123
|
+
py: ((value: string) => boolean)[];
|
|
124
|
+
}[];
|
|
118
125
|
};
|
|
119
126
|
conflictingClassGroups: {
|
|
120
127
|
raised: string[];
|
package/dist/utils/cva/merge.js
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* `reverse` are modifiers; `shimmer-color|duration|spread|angle-*` are scales)
|
|
19
19
|
* - `state-layer` / `state-layer-none` exclude each other
|
|
20
20
|
* - `rounded-<step>-concentric` / `rounded-t|b-<step>-concentric` (join the core corner groups), the container side
|
|
21
|
+
* - `px|py-<step>-concentric` (join the core `px` / `py` groups)
|
|
21
22
|
* needing nothing here — a `rounded-<step>` publishes its radius to its children by itself
|
|
22
23
|
* - `duration-*` / `ease-*` motion tokens
|
|
23
24
|
* - the semantic spacing scale (`p-md`, `gap-layout-lg`, ...) registered on
|
|
@@ -32,6 +33,7 @@
|
|
|
32
33
|
*/
|
|
33
34
|
import { createCn, validators } from 'cn/config';
|
|
34
35
|
const isConcentric = (value) => /^(?:xs|sm|md|lg|xl|2xl|3xl|4xl)-concentric$/.test(value);
|
|
36
|
+
const isSpacingConcentric = (value) => /^(?:micro|xs|sm|md|lg|xl|layout-sm|layout-md|layout-lg|layout-xl)-concentric$/.test(value);
|
|
35
37
|
/** Semantic spacing values usable wherever Tailwind accepts a spacing value. */
|
|
36
38
|
const SEMANTIC_SPACING = [
|
|
37
39
|
'micro',
|
|
@@ -85,7 +87,10 @@ export const mergeConfig = {
|
|
|
85
87
|
// and last-wins against `rounded-lg`.
|
|
86
88
|
rounded: [{ rounded: [isConcentric] }],
|
|
87
89
|
'rounded-t': [{ 'rounded-t': [isConcentric] }],
|
|
88
|
-
'rounded-b': [{ 'rounded-b': [isConcentric] }]
|
|
90
|
+
'rounded-b': [{ 'rounded-b': [isConcentric] }],
|
|
91
|
+
// `px-md-concentric` is a padding like any other, so it joins the core `px` / `py` groups.
|
|
92
|
+
px: [{ px: [isSpacingConcentric] }],
|
|
93
|
+
py: [{ py: [isSpacingConcentric] }]
|
|
89
94
|
},
|
|
90
95
|
conflictingClassGroups: {
|
|
91
96
|
// `raised-*`, `lift-*` and `shadow-*` all own the `--tw-shadow` slot.
|
|
@@ -225,7 +225,13 @@ export const createPointerDrag = (options) => {
|
|
|
225
225
|
const offPointerMove = on(node, 'pointermove', move);
|
|
226
226
|
const offPointerUp = on(node, 'pointerup', end);
|
|
227
227
|
const offPointerCancel = on(node, 'pointercancel', abort);
|
|
228
|
-
|
|
228
|
+
// Only the node's own capture counts. A touch is implicitly captured by the element under
|
|
229
|
+
// it, so when an `on-activate` session takes the capture over, that descendant's
|
|
230
|
+
// `lostpointercapture` bubbles up here and must not abort the drag it just started.
|
|
231
|
+
const offLostPointerCapture = on(node, 'lostpointercapture', (event) => {
|
|
232
|
+
if (event.target === node)
|
|
233
|
+
abort(event);
|
|
234
|
+
});
|
|
229
235
|
const offTouchMove = options.preventTouchMove === false
|
|
230
236
|
? () => { }
|
|
231
237
|
: on(node, 'touchmove', (event) => {
|