@fusion.dev/helix 0.101.0 → 0.103.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.
@@ -85,6 +85,7 @@ registerElementEvents({
85
85
  'toggle',
86
86
  ],
87
87
  'helix-listbox': ['change', 'helix-before-change', 'helix-filter', 'input'],
88
+ 'helix-map': ['helix-map-pan', 'helix-map-zoom'],
88
89
  'helix-megamenu': ['helix-before-close', 'helix-before-open', 'toggle'],
89
90
  'helix-menu': ['helix-before-close', 'helix-before-open', 'helix-select', 'toggle'],
90
91
  'helix-menu-item': ['helix-select'],
package/dist/index.d.ts CHANGED
@@ -57,6 +57,7 @@ export * from './line-chart/index.js';
57
57
  export * from './list/index.js';
58
58
  export * from './listbox/index.js';
59
59
  export * from './loader/index.js';
60
+ export * from './map/index.js';
60
61
  export * from './megamenu/index.js';
61
62
  export * from './menu/index.js';
62
63
  export * from './meter/index.js';
package/dist/index.js CHANGED
@@ -52,6 +52,7 @@ export * from './line-chart/index.js';
52
52
  export * from './list/index.js';
53
53
  export * from './listbox/index.js';
54
54
  export * from './loader/index.js';
55
+ export * from './map/index.js';
55
56
  export * from './megamenu/index.js';
56
57
  export * from './menu/index.js';
57
58
  export * from './meter/index.js';
@@ -0,0 +1 @@
1
+ export { HelixMap } from './root/map-root.js';
@@ -0,0 +1 @@
1
+ export { HelixMap } from './root/map-root.js';
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,147 @@
1
+ import { createSheet } from '@fusion.dev/helix-core';
2
+ export const styles = createSheet(`:host {
3
+ display: contents;
4
+ }
5
+
6
+ [part="region"] {
7
+ background-color: var(--map-background-color, var(--helix-color-surface-sunken));
8
+ block-size: var(--map-block-size, 24rem);
9
+ border: var(--helix-border-thin) solid var(--map-border-color, var(--helix-color-border));
10
+ border-radius: var(--helix-radii-sm);
11
+ box-sizing: border-box;
12
+ display: grid;
13
+ grid-template-rows: auto 1fr auto auto;
14
+ overflow: hidden;
15
+ position: relative;
16
+ }
17
+
18
+ [part="region"]:focus-within {
19
+ outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);
20
+ outline-offset: calc(var(--helix-size-focus-offset) * -1);
21
+ }
22
+
23
+ [part="viewport"] {
24
+ min-block-size: 0;
25
+ overflow: hidden;
26
+ position: relative;
27
+ }
28
+
29
+ [part="viewport"] ::slotted(*) {
30
+ block-size: 100%;
31
+ inline-size: 100%;
32
+ }
33
+
34
+ [part="controls"] {
35
+ display: grid;
36
+ gap: var(--helix-space-2xs);
37
+
38
+ grid-template-areas:
39
+ ". up . zoomin"
40
+ "start . end zoomout"
41
+ ". down . full";
42
+ position: absolute;
43
+
44
+ inset-block-start: var(--helix-space-sm);
45
+ inset-inline-end: var(--helix-space-sm);
46
+ transition: opacity var(--helix-duration-fast) var(--helix-easing-standard);
47
+ }
48
+
49
+ :host([controls]:not([controls~="zoom"])) [part="controls"] {
50
+ grid-template-areas:
51
+ ". up ."
52
+ "start . end"
53
+ ". down full";
54
+ }
55
+
56
+ :host([controls]:not([controls~="pan"])) [part="controls"] {
57
+ grid-template-areas:
58
+ "zoomin"
59
+ "zoomout"
60
+ "full";
61
+ }
62
+
63
+ :host([controls-placement="top-end"]) [part="controls"] {
64
+ inset-block: var(--helix-space-sm) auto;
65
+ inset-inline: auto var(--helix-space-sm);
66
+ }
67
+
68
+ :host([controls-placement="top-start"]) [part="controls"] {
69
+ inset-block: var(--helix-space-sm) auto;
70
+ inset-inline: var(--helix-space-sm) auto;
71
+ }
72
+
73
+ :host([controls-placement="bottom-end"]) [part="controls"] {
74
+ inset-block: auto var(--helix-space-sm);
75
+ inset-inline: auto var(--helix-space-sm);
76
+ }
77
+
78
+ :host([controls-placement="bottom-start"]) [part="controls"] {
79
+ inset-block: auto var(--helix-space-sm);
80
+ inset-inline: var(--helix-space-sm) auto;
81
+ }
82
+
83
+ [part="pan-up"] {
84
+ grid-area: up;
85
+ }
86
+ [part="pan-down"] {
87
+ grid-area: down;
88
+ }
89
+ [part="pan-start"] {
90
+ grid-area: start;
91
+ }
92
+ [part="pan-end"] {
93
+ grid-area: end;
94
+ }
95
+ [part="zoom-in"] {
96
+ grid-area: zoomin;
97
+ }
98
+ [part="zoom-out"] {
99
+ grid-area: zoomout;
100
+ }
101
+ [part="fullscreen"] {
102
+ grid-area: full;
103
+ }
104
+
105
+ [part="controls"] button {
106
+ align-items: center;
107
+ background-color: var(--map-control-background-color, var(--helix-color-surface-overlay));
108
+ border: var(--helix-border-thin) solid var(--helix-color-border);
109
+ border-radius: var(--helix-radii-sm);
110
+ block-size: var(--helix-size-control-sm);
111
+ color: var(--helix-color-foreground);
112
+ cursor: pointer;
113
+ display: inline-flex;
114
+ font-family: var(--helix-font-sans);
115
+ font-size: var(--helix-text-sm);
116
+ inline-size: var(--helix-size-control-sm);
117
+ justify-content: center;
118
+ padding: 0;
119
+ }
120
+
121
+ [part="controls"] button:hover {
122
+ background-color: var(--helix-color-surface-raised);
123
+ }
124
+
125
+ :host(:state(idle)) ::slotted([slot="header"]),
126
+ :host(:state(idle)) ::slotted([slot="footer"]) {
127
+ opacity: 0;
128
+ transition: opacity var(--helix-duration-fast) var(--helix-easing-standard);
129
+ }
130
+
131
+ ::slotted([slot="attribution"]) {
132
+ color: var(--helix-color-foreground-subtle);
133
+ font-size: var(--helix-text-xs);
134
+ padding: var(--helix-space-2xs) var(--helix-space-xs);
135
+ }
136
+
137
+ :host(:state(fullscreen)) [part="region"] {
138
+ block-size: 100dvh;
139
+ border: none;
140
+ border-radius: 0;
141
+ }
142
+
143
+ @media print {
144
+ [part="controls"] {
145
+ display: none;
146
+ }
147
+ }`);
@@ -0,0 +1,33 @@
1
+ import { HelixHeadlessMap } from '@fusion.dev/helix-headless/map';
2
+ import type { CSSResultGroup } from 'lit';
3
+ /**
4
+ * @summary A frame around somebody else's map.
5
+ *
6
+ * @description
7
+ * Presentation only: a bordered well with the controls over it, at the corner
8
+ * every map puts them. What the frame is for, and why the controls are buttons
9
+ * rather than arrow keys, is the base class.
10
+ *
11
+ * **The controls do not fade with the chrome.** A reader who has gone still has
12
+ * not stopped needing the only controls this frame offers, so the idle state
13
+ * takes the header and footer a consumer slotted and leaves the buttons alone.
14
+ *
15
+ * @since 0.100.0
16
+ * @status stable
17
+ * @category media
18
+ * @aliases Map frame, Map container, Geo
19
+ * @documentation https://fusion.dev/helix/components/map
20
+ *
21
+ * @cssproperty --map-background-color - The well behind the map, seen while tiles are on their way.
22
+ * @cssproperty --map-block-size - How tall the frame is. A length, since the map fills it.
23
+ * @cssproperty --map-border-color - Color of the frame's edge.
24
+ * @cssproperty --map-control-background-color - The ground under the pan and zoom buttons.
25
+ */
26
+ export declare class HelixMap extends HelixHeadlessMap {
27
+ static styles: CSSResultGroup;
28
+ }
29
+ declare global {
30
+ interface HTMLElementTagNameMap {
31
+ 'helix-map': HelixMap;
32
+ }
33
+ }
@@ -0,0 +1,16 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { customElement } from '@fusion.dev/helix-core';
8
+ import { HelixHeadlessMap } from '@fusion.dev/helix-headless/map';
9
+ import { styles } from './map-root.css.js';
10
+ let HelixMap = class HelixMap extends HelixHeadlessMap {
11
+ static { this.styles = styles; }
12
+ };
13
+ HelixMap = __decorate([
14
+ customElement('helix-map')
15
+ ], HelixMap);
16
+ export { HelixMap };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fusion.dev/helix",
3
3
  "description": "Styled component tier. Extends the headless tier with token-driven presentation.",
4
- "version": "0.101.0",
4
+ "version": "0.103.0",
5
5
  "license": "MIT",
6
6
  "author": "Ross Sheppard <ross.sheppard@fusion.dev>",
7
7
  "repository": {
@@ -47,13 +47,13 @@
47
47
  },
48
48
  "bugs": "https://github.com/project-fusion/fusion/issues",
49
49
  "dependencies": {
50
- "@fusion.dev/helix-core": "0.101.0",
51
- "@fusion.dev/helix-headless": "0.101.0",
52
- "@fusion.dev/helix-styles": "0.101.0"
50
+ "@fusion.dev/helix-core": "0.103.0",
51
+ "@fusion.dev/helix-headless": "0.103.0",
52
+ "@fusion.dev/helix-styles": "0.103.0"
53
53
  },
54
54
  "devDependencies": {
55
- "@fusion.dev/helix-cem": "0.101.0",
56
- "@fusion.dev/helix-testing": "0.101.0",
55
+ "@fusion.dev/helix-cem": "0.103.0",
56
+ "@fusion.dev/helix-testing": "0.103.0",
57
57
  "@fusion.dev/scripts": "0.0.0-dev",
58
58
  "@happy-dom/global-registrator": "^20.0.0",
59
59
  "@lit-labs/ssr": "^4.1.0",