@vireo-ai/trellis-ui 0.1.12 → 0.1.14
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/package.json +5 -2
- package/packages/client/src/components/select/styles.css +69 -0
- package/packages/client/src/styles/components.css +1 -0
- package/packages/client/src/styles/generated-sources.css +1 -1
- package/packages/client/types/components/app/contract.d.ts +7 -7
- package/packages/client/types/components/box/contract.d.ts +3 -3
- package/packages/client/types/components/card/contract.d.ts +2 -2
- package/packages/client/types/components/container/contract.d.ts +2 -2
- package/packages/client/types/components/date-picker/contract.d.ts +2 -2
- package/packages/client/types/components/date-picker/machine.d.ts +16 -16
- package/packages/client/types/components/flex/contract.d.ts +3 -3
- package/packages/client/types/components/frame/contract.d.ts +2 -2
- package/packages/client/types/components/grid/contract.d.ts +5 -5
- package/packages/client/types/components/layout.d.ts +3 -3
- package/packages/client/types/components/menu/contract.d.ts +2 -2
- package/packages/client/types/components/modal/contract.d.ts +2 -2
- package/packages/client/types/components/modal/machine.d.ts +8 -8
- package/packages/client/types/components/section/contract.d.ts +2 -2
- package/packages/client/types/components/select/contract.d.ts +2 -2
- package/packages/client/types/components/select/machine.d.ts +16 -16
- package/packages/client/types/components/select/presentation.d.ts +25 -0
- package/packages/client/types/components/sidebar/contract.d.ts +3 -3
- package/packages/client/types/components/stack/contract.d.ts +3 -3
- package/packages/client/types/directives/index.d.ts +1 -0
- package/packages/client/types/directives/sortable.d.ts +29 -0
- package/packages/client/types/index.d.ts +3 -3
- package/packages/client/types/motion/index.d.ts +5 -1
- package/packages/client/types/motion/recipe.d.ts +2 -2
- package/packages/client/types/runtime/drag-and-drop/index.d.ts +2 -0
- package/packages/client/types/runtime/drag-and-drop/pdd.d.ts +11 -0
- package/packages/client/types/runtime/drag-and-drop/sortable/contract.d.ts +133 -0
- package/packages/client/types/runtime/drag-and-drop/sortable/cursor.d.ts +2 -0
- package/packages/client/types/runtime/drag-and-drop/sortable/feedback.d.ts +36 -0
- package/packages/client/types/runtime/drag-and-drop/sortable/ghost.d.ts +26 -0
- package/packages/client/types/runtime/drag-and-drop/sortable/index.d.ts +13 -0
- package/packages/client/types/runtime/drag-and-drop/sortable/placement.d.ts +34 -0
- package/packages/client/types/runtime/drag-and-drop/sortable/registry.d.ts +25 -0
- package/packages/client/types/runtime/drag-and-drop/sortable/source-machine.d.ts +23 -0
- package/packages/client/types/runtime/index.d.ts +1 -1
- package/packages/client/types/runtime/ui.d.ts +2 -0
- package/packages/client/types/utils/dom.d.ts +2 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.css +65 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.min.css +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js +7126 -5258
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js.map +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.js +9 -8
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.min.js +9 -8
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SortableInput } from './contract';
|
|
2
|
+
type ManagedGhostFrame = Readonly<{
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}>;
|
|
8
|
+
type SortableGhost = Readonly<{
|
|
9
|
+
positioner: HTMLElement;
|
|
10
|
+
visual: HTMLElement;
|
|
11
|
+
frame(): ManagedGhostFrame;
|
|
12
|
+
projectedFrame(input: SortableInput): ManagedGhostFrame;
|
|
13
|
+
move(input: SortableInput): void;
|
|
14
|
+
finish(to: ManagedGhostFrame | null): Promise<void>;
|
|
15
|
+
remove(): void;
|
|
16
|
+
}>;
|
|
17
|
+
declare const sanitizeClone: (root: HTMLElement) => void;
|
|
18
|
+
declare const frameFromRect: (rect: DOMRect | DOMRectReadOnly) => ManagedGhostFrame;
|
|
19
|
+
declare const createSortableGhost: ({ source, input, preview, opacity }: {
|
|
20
|
+
source: HTMLElement;
|
|
21
|
+
input: SortableInput;
|
|
22
|
+
preview?: HTMLTemplateElement | null;
|
|
23
|
+
opacity?: number;
|
|
24
|
+
}) => SortableGhost;
|
|
25
|
+
export { createSortableGhost, frameFromRect, sanitizeClone };
|
|
26
|
+
export type { ManagedGhostFrame, SortableGhost };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { distanceToSegment, isSameSortablePlacement, projectSortablePlacement, resolveSortableIndicatorFrame, resolveSortablePlacement, resolveSortableReorderPlacement, } from './placement';
|
|
2
|
+
export { isValidGridColumns } from './contract';
|
|
3
|
+
export { projectSortableReorderLayout, resolveSortableDropFrame, resolveSortableReorderOffsets, } from './feedback';
|
|
4
|
+
export type { SortableReorderLayout, SortableReorderOffset } from './feedback';
|
|
5
|
+
export type { SortableIndicatorFrame } from './placement';
|
|
6
|
+
export { createSortableGhost, frameFromRect, sanitizeClone } from './ghost';
|
|
7
|
+
export type { ManagedGhostFrame, SortableGhost } from './ghost';
|
|
8
|
+
export { createSortableRegistry, sortable } from './registry';
|
|
9
|
+
export { activateSortableCursor } from './cursor';
|
|
10
|
+
export { createSortableSourceMachine } from './source-machine';
|
|
11
|
+
export type { SortablePointerSnapshot, SortableSourceMachineContext, SortableSourceMachineEffects, } from './source-machine';
|
|
12
|
+
export type { GroupRecord, SortableRegistry, SourceRecord } from './registry';
|
|
13
|
+
export type { ResolveSortablePlacementOptions, SortableAnchor, SortableCancelReason, SortableCanDropContext, SortableDirection, SortableDragDetail, SortableEdge, SortableFeedback, SortableFrame, SortableGroup, SortableDropDetail, SortableInput, SortableInsertSource, SortableItemGeometry, SortableOperation, SortableOrientation, SortablePlacement, SortableMoveSource, SortableSource, UiSortableService, } from './contract';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ResolveSortablePlacementOptions, SortablePlacement } from './contract';
|
|
2
|
+
type SortableIndicatorFrame = Readonly<{
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
kind: 'inline-boundary' | 'block-boundary';
|
|
8
|
+
}>;
|
|
9
|
+
declare const isSameSortablePlacement: (left: SortablePlacement | null, right: SortablePlacement | null) => boolean;
|
|
10
|
+
declare const distanceToSegment: ({ point, start, end, }: {
|
|
11
|
+
point: {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
};
|
|
15
|
+
start: {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
};
|
|
19
|
+
end: {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
};
|
|
23
|
+
}) => number;
|
|
24
|
+
declare const resolveSortablePlacement: (options: ResolveSortablePlacementOptions) => SortablePlacement;
|
|
25
|
+
declare const resolveSortableReorderPlacement: (options: ResolveSortablePlacementOptions) => SortablePlacement;
|
|
26
|
+
declare const projectSortablePlacement: ({ placement, sourceId, sourceGroupId, itemIds, }: {
|
|
27
|
+
placement: SortablePlacement;
|
|
28
|
+
sourceId: string;
|
|
29
|
+
sourceGroupId: string | null;
|
|
30
|
+
itemIds: readonly string[];
|
|
31
|
+
}) => SortablePlacement;
|
|
32
|
+
declare const resolveSortableIndicatorFrame: (options: Omit<ResolveSortablePlacementOptions, "input">, placement: SortablePlacement) => SortableIndicatorFrame;
|
|
33
|
+
export { distanceToSegment, isSameSortablePlacement, projectSortablePlacement, resolveSortableIndicatorFrame, resolveSortablePlacement, resolveSortableReorderPlacement, };
|
|
34
|
+
export type { SortableIndicatorFrame };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SortableCanDropContext, SortableGroup, SortablePlacement, SortableSource, SortableInput, UiSortableService } from './contract';
|
|
2
|
+
type GroupRecord = Readonly<{
|
|
3
|
+
element: HTMLElement;
|
|
4
|
+
getGroup(): SortableGroup;
|
|
5
|
+
getItemIds(): readonly string[];
|
|
6
|
+
canDrop?(context: SortableCanDropContext): boolean;
|
|
7
|
+
}>;
|
|
8
|
+
type SourceRecord = Readonly<{
|
|
9
|
+
element: HTMLElement;
|
|
10
|
+
getSource(): SortableSource;
|
|
11
|
+
isDisabled(): boolean;
|
|
12
|
+
}>;
|
|
13
|
+
type SortableRegistry = UiSortableService & Readonly<{
|
|
14
|
+
registerGroup(record: GroupRecord): () => void;
|
|
15
|
+
registerSource(record: SourceRecord): () => void;
|
|
16
|
+
group(scopeId: string, groupId: string): GroupRecord | null;
|
|
17
|
+
source(scopeId: string, sourceId: string): SourceRecord | null;
|
|
18
|
+
canDrop(source: SortableSource, destinationGroupId: string, input?: SortableInput | null): boolean;
|
|
19
|
+
isNoop(source: SortableSource, placement: SortablePlacement): boolean;
|
|
20
|
+
emitDrop(source: SortableSource, placement: SortablePlacement, input?: SortableInput | null): boolean;
|
|
21
|
+
}>;
|
|
22
|
+
declare const createSortableRegistry: () => SortableRegistry;
|
|
23
|
+
declare const sortable: SortableRegistry;
|
|
24
|
+
export { createSortableRegistry, sortable };
|
|
25
|
+
export type { GroupRecord, SortableRegistry, SourceRecord };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Machine, type MachineScope } from '../../state-machine';
|
|
2
|
+
type SortablePointerSnapshot = Readonly<{
|
|
3
|
+
destinationId: string | null;
|
|
4
|
+
input: Readonly<{
|
|
5
|
+
clientX: number;
|
|
6
|
+
clientY: number;
|
|
7
|
+
}>;
|
|
8
|
+
}>;
|
|
9
|
+
type SortableSourceMachineContext = {
|
|
10
|
+
data: Record<string, unknown>;
|
|
11
|
+
pointer: SortablePointerSnapshot | null;
|
|
12
|
+
};
|
|
13
|
+
type SortableSourceMachineEffects<TProps> = Readonly<{
|
|
14
|
+
resolvePlacement(scope: MachineScope<SortableSourceMachineContext, TProps>): void;
|
|
15
|
+
synced(scope: MachineScope<SortableSourceMachineContext, TProps>): void;
|
|
16
|
+
complete(scope: MachineScope<SortableSourceMachineContext, TProps>): void;
|
|
17
|
+
}>;
|
|
18
|
+
declare const createSortableSourceMachine: <TProps>({ props, effects }: {
|
|
19
|
+
props: TProps;
|
|
20
|
+
effects: SortableSourceMachineEffects<TProps>;
|
|
21
|
+
}) => Machine<SortableSourceMachineContext, TProps>;
|
|
22
|
+
export { createSortableSourceMachine };
|
|
23
|
+
export type { SortablePointerSnapshot, SortableSourceMachineContext, SortableSourceMachineEffects };
|
|
@@ -12,7 +12,7 @@ export { dispatchNativeControlChange, syncControlPresence, syncNativeControl, sy
|
|
|
12
12
|
export { FOCUSABLE_SELECTOR, closestFocusable, focusFirst, focusableElements, isFocusable, trapFocus } from './focus-scope';
|
|
13
13
|
export { getPathValue, normalizeOptionText, parseItemData, splitControlValues } from './option-data';
|
|
14
14
|
export { observeSemanticChanges, type SemanticObserverOptions } from './semantic-observer';
|
|
15
|
-
export { createResizable, registerResizable, type ResizableOptions, type ResizeAxis, type ResizeDirection, type ResizeEvent, type ResizeMode, type ResizePhase, } from './drag-and-drop';
|
|
15
|
+
export { createResizable, createSortableRegistry, registerResizable, sortable, type ResizableOptions, type ResizeAxis, type ResizeDirection, type ResizeEvent, type ResizeMode, type ResizePhase, type SortableAnchor, type SortableCancelReason, type SortableCanDropContext, type SortableDirection, type SortableDragDetail, type SortableDropDetail, type SortableEdge, type SortableFeedback, type SortableGroup, type SortableIndicatorFrame, type SortableInsertSource, type SortableMoveSource, type SortableOperation, type SortableOrientation, type SortablePlacement, type SortableReorderOffset, type SortableSource, type UiSortableService, } from './drag-and-drop';
|
|
16
16
|
export { defineManifest, propsFromSchema, type ComponentManifest, type DefineManifestOptions, type ManifestPart, type ManifestProp, type ManifestPropDetails, type ManifestToken, type PropsFromSchemaOptions, type SchemaPropDetails, } from './manifest';
|
|
17
17
|
export { defineStyles, resolveStyle, type DefineStylesOptions, type ResolveStyleOptions, type StyleDefinition, type StylePart, type StyleProps, } from './styles';
|
|
18
18
|
export { del as deleteRequest, get, post, put, registerRequestRuntime, type RequestLifecycleDetail, type RequestMethod, type RequestOptions, type RequestResult, } from './engine/request';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type Alpine from 'alpinejs';
|
|
2
2
|
import { motion } from '../motion';
|
|
3
3
|
import { del, get, post, put } from './engine/request';
|
|
4
|
+
import { type UiSortableService } from './drag-and-drop/sortable';
|
|
4
5
|
type UiRuntime = {
|
|
5
6
|
readonly delete: typeof del;
|
|
6
7
|
readonly get: typeof get;
|
|
@@ -8,6 +9,7 @@ type UiRuntime = {
|
|
|
8
9
|
readonly put: typeof put;
|
|
9
10
|
readonly isFetching: boolean;
|
|
10
11
|
readonly motion: typeof motion;
|
|
12
|
+
readonly sortable: UiSortableService;
|
|
11
13
|
};
|
|
12
14
|
declare const ui: UiRuntime;
|
|
13
15
|
declare const registerUiMagic: (AlpineInstance: Alpine.Alpine) => void;
|
|
@@ -3,6 +3,7 @@ type DispatchOptions<T> = {
|
|
|
3
3
|
el: HTMLElement;
|
|
4
4
|
name: string;
|
|
5
5
|
detail?: T;
|
|
6
|
+
composed?: boolean;
|
|
6
7
|
};
|
|
7
8
|
type AddListenerOptions = {
|
|
8
9
|
target: EventTarget;
|
|
@@ -29,7 +30,7 @@ type BoolOptions = {
|
|
|
29
30
|
value: string | undefined;
|
|
30
31
|
};
|
|
31
32
|
declare const asBool: ({ value }: BoolOptions) => boolean;
|
|
32
|
-
declare const dispatch: <T = unknown>({ el, name, detail }: DispatchOptions<T>) => void;
|
|
33
|
+
declare const dispatch: <T = unknown>({ el, name, detail, composed }: DispatchOptions<T>) => void;
|
|
33
34
|
declare const addListener: ({ target, event, handler, cleanup, options, }: AddListenerOptions) => (() => void);
|
|
34
35
|
declare const setPresence: ({ el, attr, present, value }: PresenceOptions) => void;
|
|
35
36
|
declare const setAttribute: ({ el, attr, value }: AttributeOptions) => void;
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
--text-xs--line-height: var(--text-1--line-height);
|
|
24
24
|
--text-sm: var(--text-2);
|
|
25
25
|
--text-sm--line-height: var(--text-2--line-height);
|
|
26
|
+
--text-base: var(--text-3);
|
|
27
|
+
--text-base--line-height: var(--text-3--line-height);
|
|
26
28
|
--font-weight-normal: 400;
|
|
27
29
|
--font-weight-medium: 500;
|
|
28
30
|
--font-weight-semibold: 600;
|
|
@@ -169,6 +171,7 @@
|
|
|
169
171
|
--text-3: 16px;
|
|
170
172
|
--text-3--line-height: 24px;
|
|
171
173
|
--text-3--letter-spacing: 0em;
|
|
174
|
+
--text-base--letter-spacing: var(--text-3--letter-spacing);
|
|
172
175
|
--text-4: 18px;
|
|
173
176
|
--text-4--line-height: 26px;
|
|
174
177
|
--text-4--letter-spacing: 0em;
|
|
@@ -3453,6 +3456,9 @@
|
|
|
3453
3456
|
.pt-2 {
|
|
3454
3457
|
padding-top: var(--spacing-2);
|
|
3455
3458
|
}
|
|
3459
|
+
.pt-4 {
|
|
3460
|
+
padding-top: var(--spacing-4);
|
|
3461
|
+
}
|
|
3456
3462
|
.pr-2 {
|
|
3457
3463
|
padding-right: var(--spacing-2);
|
|
3458
3464
|
}
|
|
@@ -3612,6 +3618,11 @@
|
|
|
3612
3618
|
line-height: var(--tw-leading, var(--text-badge-xs--line-height));
|
|
3613
3619
|
letter-spacing: var(--tw-tracking, var(--text-badge-xs--letter-spacing));
|
|
3614
3620
|
}
|
|
3621
|
+
.text-base {
|
|
3622
|
+
font-size: var(--text-base);
|
|
3623
|
+
line-height: var(--tw-leading, var(--text-base--line-height));
|
|
3624
|
+
letter-spacing: var(--tw-tracking, var(--text-base--letter-spacing));
|
|
3625
|
+
}
|
|
3615
3626
|
.text-body {
|
|
3616
3627
|
font-size: var(--text-body);
|
|
3617
3628
|
line-height: var(--tw-leading, var(--text-body--line-height));
|
|
@@ -9933,6 +9944,18 @@
|
|
|
9933
9944
|
}
|
|
9934
9945
|
}
|
|
9935
9946
|
@layer components {
|
|
9947
|
+
[data-ui-select-sheet-heading] {
|
|
9948
|
+
display: none;
|
|
9949
|
+
}
|
|
9950
|
+
[data-ui-select-sheet-header] {
|
|
9951
|
+
display: contents;
|
|
9952
|
+
}
|
|
9953
|
+
[data-ui-select-popover][data-presentation="anchored"] {
|
|
9954
|
+
max-height: var(--ui-popover-available-height, none);
|
|
9955
|
+
}
|
|
9956
|
+
[data-ui-select][data-mode="combobox"] [data-ui-select-popover][data-presentation="anchored"] [data-ui-select-search] {
|
|
9957
|
+
display: none;
|
|
9958
|
+
}
|
|
9936
9959
|
[data-ui-select-popover]:has([data-ui-select-search]) {
|
|
9937
9960
|
grid-template-rows: auto minmax(0, 1fr);
|
|
9938
9961
|
}
|
|
@@ -9940,6 +9963,45 @@
|
|
|
9940
9963
|
min-height: 0;
|
|
9941
9964
|
overflow: hidden;
|
|
9942
9965
|
}
|
|
9966
|
+
[data-ui-select-popover][data-presentation="dialog"], [data-ui-select-popover][data-presentation="fullscreen"] {
|
|
9967
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
9968
|
+
border: 0;
|
|
9969
|
+
padding-top: env(safe-area-inset-top);
|
|
9970
|
+
padding-right: env(safe-area-inset-right);
|
|
9971
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
9972
|
+
padding-left: env(safe-area-inset-left);
|
|
9973
|
+
}
|
|
9974
|
+
[data-ui-select-popover][data-presentation="dialog"] {
|
|
9975
|
+
border-radius: var(--radius-overlay-md);
|
|
9976
|
+
}
|
|
9977
|
+
[data-ui-select-popover][data-presentation="fullscreen"] {
|
|
9978
|
+
border-radius: 0;
|
|
9979
|
+
}
|
|
9980
|
+
[data-ui-select-popover][data-presentation="dialog"]::backdrop, [data-ui-select-popover][data-presentation="fullscreen"]::backdrop {
|
|
9981
|
+
background: var(--color-scrim);
|
|
9982
|
+
}
|
|
9983
|
+
[data-ui-select-popover][data-presentation="dialog"] [data-ui-select-sheet-header], [data-ui-select-popover][data-presentation="fullscreen"] [data-ui-select-sheet-header] {
|
|
9984
|
+
position: sticky;
|
|
9985
|
+
top: 0;
|
|
9986
|
+
z-index: 1;
|
|
9987
|
+
display: grid;
|
|
9988
|
+
background: inherit;
|
|
9989
|
+
}
|
|
9990
|
+
[data-ui-select-popover][data-presentation="dialog"] [data-ui-select-sheet-heading], [data-ui-select-popover][data-presentation="fullscreen"] [data-ui-select-sheet-heading] {
|
|
9991
|
+
display: flex;
|
|
9992
|
+
}
|
|
9993
|
+
[data-ui-select-popover][data-presentation="dialog"] [data-ui-select-listbox], [data-ui-select-popover][data-presentation="fullscreen"] [data-ui-select-listbox] {
|
|
9994
|
+
display: grid;
|
|
9995
|
+
height: 100%;
|
|
9996
|
+
min-height: 0;
|
|
9997
|
+
grid-template-rows: minmax(0, 1fr) auto auto;
|
|
9998
|
+
overflow: hidden;
|
|
9999
|
+
}
|
|
10000
|
+
[data-ui-select-popover][data-presentation="dialog"] [data-ui-select-viewport], [data-ui-select-popover][data-presentation="fullscreen"] [data-ui-select-viewport] {
|
|
10001
|
+
height: 100%;
|
|
10002
|
+
max-height: none;
|
|
10003
|
+
overscroll-behavior: contain;
|
|
10004
|
+
}
|
|
9943
10005
|
[data-ui-select-option-label]:has(>*+*) {
|
|
9944
10006
|
display: grid;
|
|
9945
10007
|
gap: var(--spacing-1);
|
|
@@ -10763,6 +10825,9 @@
|
|
|
10763
10825
|
}
|
|
10764
10826
|
}
|
|
10765
10827
|
}
|
|
10828
|
+
:root[data-ui-sortable-dragging], :root[data-ui-sortable-dragging] * {
|
|
10829
|
+
cursor: var(--ui-sortable-drag-cursor, default) !important;
|
|
10830
|
+
}
|
|
10766
10831
|
@media (hover: hover) {
|
|
10767
10832
|
[data-ui-elevation][data-ui-interactive="surface"]:hover {
|
|
10768
10833
|
--ui-state-shadow-layers: 0 0 0 var(--border-width-edge-perimeter) var(--color-intent-neutral-edge-hover);
|