@zylem/ui 0.9.7 → 0.9.9

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.
@@ -73,6 +73,34 @@ export const DockNode: IconNode = [
73
73
  ],
74
74
  ];
75
75
 
76
+ /**
77
+ * One side-view camera — body on the left, lens pointing right, subject plane
78
+ * on the right — turned about the icon center. Positive degrees are clockwise,
79
+ * which is what puts the camera on that side of the subject:
80
+ * 0 left, 45 iso left/top, 90 top, 135 iso right/top, 180 right,
81
+ * 225 iso right/bottom, 270 bottom, 315 iso left/bottom.
82
+ */
83
+ const FACING_RIGHT: IconNode = [
84
+ ['rect', { x: '2', y: '8', width: '8', height: '8', rx: '2' }],
85
+ ['path', { d: 'm10 10 4-2v8l-4-2' }],
86
+ ['path', { d: 'M16 6h4v12h-4' }],
87
+ ];
88
+
89
+ function turnCamera(angle: number): IconNode {
90
+ if (angle === 0) return FACING_RIGHT;
91
+ const transform = `rotate(${angle} 12 12)`;
92
+ return FACING_RIGHT.map(([element, attrs]) => [element, { ...attrs, transform }]) as IconNode;
93
+ }
94
+
95
+ export const ViewLeftNode = turnCamera(0);
96
+ export const ViewIsoLeftTopNode = turnCamera(45);
97
+ export const ViewTopNode = turnCamera(90);
98
+ export const ViewIsoRightTopNode = turnCamera(135);
99
+ export const ViewRightNode = turnCamera(180);
100
+ export const ViewIsoRightBottomNode = turnCamera(225);
101
+ export const ViewBottomNode = turnCamera(270);
102
+ export const ViewIsoLeftBottomNode = turnCamera(315);
103
+
76
104
  export const cameraIconNodes = {
77
105
  perspective: PerspectiveNode,
78
106
  'sideview-perspective': SideviewPerspectiveNode,
@@ -80,6 +108,14 @@ export const cameraIconNodes = {
80
108
  'isometric-perspective': IsometricPerspectiveNode,
81
109
  'free-perspective': FreePerspectiveNode,
82
110
  'game-camera': GameCameraNode,
111
+ 'view-left': ViewLeftNode,
112
+ 'view-iso-left-top': ViewIsoLeftTopNode,
113
+ 'view-top': ViewTopNode,
114
+ 'view-iso-right-top': ViewIsoRightTopNode,
115
+ 'view-right': ViewRightNode,
116
+ 'view-iso-right-bottom': ViewIsoRightBottomNode,
117
+ 'view-bottom': ViewBottomNode,
118
+ 'view-iso-left-bottom': ViewIsoLeftBottomNode,
83
119
  } as const;
84
120
 
85
121
  export type CameraIconName = keyof typeof cameraIconNodes;
@@ -8,6 +8,14 @@ import {
8
8
  PerspectiveNode,
9
9
  SideviewPerspectiveNode,
10
10
  TopDownPerspectiveNode,
11
+ ViewBottomNode,
12
+ ViewIsoLeftBottomNode,
13
+ ViewIsoLeftTopNode,
14
+ ViewIsoRightBottomNode,
15
+ ViewIsoRightTopNode,
16
+ ViewLeftNode,
17
+ ViewRightNode,
18
+ ViewTopNode,
11
19
  } from './icon-nodes';
12
20
 
13
21
  export type { IconNode, CameraIconName } from './icon-nodes';
@@ -19,6 +27,14 @@ export {
19
27
  PerspectiveNode,
20
28
  SideviewPerspectiveNode,
21
29
  TopDownPerspectiveNode,
30
+ ViewBottomNode,
31
+ ViewIsoLeftBottomNode,
32
+ ViewIsoLeftTopNode,
33
+ ViewIsoRightBottomNode,
34
+ ViewIsoRightTopNode,
35
+ ViewLeftNode,
36
+ ViewRightNode,
37
+ ViewTopNode,
22
38
  } from './icon-nodes';
23
39
  export { createZylemIcon, type ZylemIconOptions, type ZylemIconProps } from './create-icon';
24
40
 
@@ -45,6 +61,23 @@ export const FreePerspective = createZylemIcon('FreePerspective', FreePerspectiv
45
61
  /** Recorder with controller buttons (game camera). */
46
62
  export const GameCamera = createZylemIcon('GameCamera', GameCameraNode);
47
63
 
64
+ /** Side camera on the left, looking right. */
65
+ export const ViewLeft = createZylemIcon('ViewLeft', ViewLeftNode);
66
+ /** Side camera on the right, looking left. */
67
+ export const ViewRight = createZylemIcon('ViewRight', ViewRightNode);
68
+ /** Camera above the subject, looking down. */
69
+ export const ViewTop = createZylemIcon('ViewTop', ViewTopNode);
70
+ /** Camera below the subject, looking up. */
71
+ export const ViewBottom = createZylemIcon('ViewBottom', ViewBottomNode);
72
+ /** Camera at the upper left, the iso left/top angle. */
73
+ export const ViewIsoLeftTop = createZylemIcon('ViewIsoLeftTop', ViewIsoLeftTopNode);
74
+ /** Camera at the upper right, the iso right/top angle. */
75
+ export const ViewIsoRightTop = createZylemIcon('ViewIsoRightTop', ViewIsoRightTopNode);
76
+ /** Camera at the lower right, the iso right/bottom angle. */
77
+ export const ViewIsoRightBottom = createZylemIcon('ViewIsoRightBottom', ViewIsoRightBottomNode);
78
+ /** Camera at the lower left, the iso left/bottom angle. */
79
+ export const ViewIsoLeftBottom = createZylemIcon('ViewIsoLeftBottom', ViewIsoLeftBottomNode);
80
+
48
81
  /** Filled window frame. Skips the 18px toolbar metric so `size` matches a chevron. */
49
82
  export const Dock = createZylemIcon('Dock', DockNode, {
50
83
  className: 'zylem-dock',
@@ -60,3 +93,18 @@ export const CAMERA_ICONS = [
60
93
  { name: 'free-perspective', label: 'Free / orbit', Icon: FreePerspective },
61
94
  { name: 'game-camera', label: 'Game camera', Icon: GameCamera },
62
95
  ] as const;
96
+
97
+ /**
98
+ * The eight angles around the view cube, clockwise from the top-left corner.
99
+ * Free, game, and perspective already live on `CAMERA_ICONS`.
100
+ */
101
+ export const CAMERA_VIEWS = [
102
+ { name: 'view-iso-left-top', label: 'Iso left/top', Icon: ViewIsoLeftTop },
103
+ { name: 'view-top', label: 'Top', Icon: ViewTop },
104
+ { name: 'view-iso-right-top', label: 'Iso right/top', Icon: ViewIsoRightTop },
105
+ { name: 'view-right', label: 'Right', Icon: ViewRight },
106
+ { name: 'view-iso-right-bottom', label: 'Iso right/bottom', Icon: ViewIsoRightBottom },
107
+ { name: 'view-bottom', label: 'Bottom', Icon: ViewBottom },
108
+ { name: 'view-iso-left-bottom', label: 'Iso left/bottom', Icon: ViewIsoLeftBottom },
109
+ { name: 'view-left', label: 'Left', Icon: ViewLeft },
110
+ ] as const;
@@ -93,7 +93,7 @@ export interface ResolvedLayer {
93
93
  /**
94
94
  * Resolve a tier to a portal target and a `z-index`.
95
95
  *
96
- * @param rank Offset within the tier, for ordering peers — raising a clicked
96
+ * @param rank - Offset within the tier, for ordering peers — raising a clicked
97
97
  * window above its siblings, say. Bands are 1000 apart, so ranks below that stay
98
98
  * inside their tier. The offset means the same thing inside a `LayerScope` as
99
99
  * out, so a panel can be lifted above a scope's tooltips while staying under its