@gradeui/ui 2.1.0 → 3.1.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.
Files changed (53) hide show
  1. package/README.md +5 -12
  2. package/components/ui/button.md +11 -7
  3. package/components/ui/dropdown-menu.md +1 -0
  4. package/components/ui/logo.md +8 -6
  5. package/components/ui/map.md +3 -0
  6. package/components/ui/media-surface.md +1 -0
  7. package/components/ui/sidebar.md +2 -1
  8. package/components/ui/swatch.md +88 -0
  9. package/dist/contracts.js +6 -6
  10. package/dist/contracts.js.map +1 -1
  11. package/dist/contracts.mjs +6 -6
  12. package/dist/contracts.mjs.map +1 -1
  13. package/dist/index.d.mts +617 -393
  14. package/dist/index.d.ts +617 -393
  15. package/dist/index.js +602 -65
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.mjs +602 -65
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/map/google.d.mts +1 -1
  20. package/dist/map/google.d.ts +1 -1
  21. package/dist/map/google.js +1 -1
  22. package/dist/map/google.js.map +1 -1
  23. package/dist/map/google.mjs +1 -1
  24. package/dist/map/google.mjs.map +1 -1
  25. package/dist/map/leaflet.d.mts +1 -1
  26. package/dist/map/leaflet.d.ts +1 -1
  27. package/dist/map/leaflet.js +2 -2
  28. package/dist/map/leaflet.js.map +1 -1
  29. package/dist/map/leaflet.mjs +2 -2
  30. package/dist/map/leaflet.mjs.map +1 -1
  31. package/dist/map/mapbox.d.mts +1 -1
  32. package/dist/map/mapbox.d.ts +1 -1
  33. package/dist/map/mapbox.js +2 -2
  34. package/dist/map/mapbox.js.map +1 -1
  35. package/dist/map/mapbox.mjs +2 -2
  36. package/dist/map/mapbox.mjs.map +1 -1
  37. package/dist/map/maplibre.d.mts +1 -1
  38. package/dist/map/maplibre.d.ts +1 -1
  39. package/dist/map/maplibre.js +1 -1
  40. package/dist/map/maplibre.js.map +1 -1
  41. package/dist/map/maplibre.mjs +1 -1
  42. package/dist/map/maplibre.mjs.map +1 -1
  43. package/dist/styles.css +1 -1
  44. package/dist/{types-BxywIwvG.d.mts → types-B45Uirkp.d.mts} +23 -0
  45. package/dist/{types-BxywIwvG.d.ts → types-B45Uirkp.d.ts} +23 -0
  46. package/package.json +3 -6
  47. package/styles/globals.css +2402 -0
  48. package/dist/tailwind-preset.d.mts +0 -20
  49. package/dist/tailwind-preset.d.ts +0 -20
  50. package/dist/tailwind-preset.js +0 -2
  51. package/dist/tailwind-preset.js.map +0 -1
  52. package/dist/tailwind-preset.mjs +0 -2
  53. package/dist/tailwind-preset.mjs.map +0 -1
@@ -7,6 +7,20 @@ import * as React from 'react';
7
7
  */
8
8
  type Coords = [lng: number, lat: number];
9
9
  type MapAppearance = "light" | "dark" | "satellite" | "auto";
10
+ /**
11
+ * Which built-in map UI (zoom buttons today; compass/scale could join)
12
+ * renders on the map. `"auto"` (default) shows zoom buttons whenever the
13
+ * map is `interactive`; `"zoom"` forces them on regardless; `"none"`
14
+ * hides every tool. Attribution is NOT a tool — it's a license
15
+ * requirement and always renders.
16
+ */
17
+ type MapTools = "auto" | "zoom" | "none";
18
+ /**
19
+ * Corner the tools dock to. One vocabulary across providers — each
20
+ * adapter maps it to its native enum (Leaflet `topleft`, MapLibre/Mapbox
21
+ * `top-left`, Google `ControlPosition.*`).
22
+ */
23
+ type MapToolsPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
10
24
  type MapErrorCode = "sdk-missing" | "api-key-missing" | "provider-init-failed" | "style-load-failed" | "tile-load-failed";
11
25
  type MapError = {
12
26
  code: MapErrorCode;
@@ -51,6 +65,13 @@ type MapBaseProps = {
51
65
  appearance?: MapAppearance;
52
66
  /** Default `true`. `false` disables pan/zoom/rotate (static display). */
53
67
  interactive?: boolean;
68
+ /** Which built-in map UI shows. Default `"auto"` — zoom buttons follow
69
+ * `interactive`. `"none"` for chrome-free maps (hero backdrops,
70
+ * posters); attribution always stays (license). */
71
+ tools?: MapTools;
72
+ /** Corner the tools dock to. Default `"top-left"`. Handy when the
73
+ * layout puts a search bar or legend over the default corner. */
74
+ toolsPosition?: MapToolsPosition;
54
75
  /** Controlled hovered marker id — pairs with `onHoveredIdChange` for list↔map sync. */
55
76
  hoveredId?: string | null;
56
77
  onHoveredIdChange?: (id: string | null) => void;
@@ -116,6 +137,8 @@ type AdapterOpts = {
116
137
  bounds?: [Coords, Coords];
117
138
  appearance: "light" | "dark" | "satellite";
118
139
  interactive: boolean;
140
+ tools: MapTools;
141
+ toolsPosition: MapToolsPosition;
119
142
  styleUrl?: string;
120
143
  tilerKey?: string;
121
144
  accessToken?: string;
@@ -7,6 +7,20 @@ import * as React from 'react';
7
7
  */
8
8
  type Coords = [lng: number, lat: number];
9
9
  type MapAppearance = "light" | "dark" | "satellite" | "auto";
10
+ /**
11
+ * Which built-in map UI (zoom buttons today; compass/scale could join)
12
+ * renders on the map. `"auto"` (default) shows zoom buttons whenever the
13
+ * map is `interactive`; `"zoom"` forces them on regardless; `"none"`
14
+ * hides every tool. Attribution is NOT a tool — it's a license
15
+ * requirement and always renders.
16
+ */
17
+ type MapTools = "auto" | "zoom" | "none";
18
+ /**
19
+ * Corner the tools dock to. One vocabulary across providers — each
20
+ * adapter maps it to its native enum (Leaflet `topleft`, MapLibre/Mapbox
21
+ * `top-left`, Google `ControlPosition.*`).
22
+ */
23
+ type MapToolsPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
10
24
  type MapErrorCode = "sdk-missing" | "api-key-missing" | "provider-init-failed" | "style-load-failed" | "tile-load-failed";
11
25
  type MapError = {
12
26
  code: MapErrorCode;
@@ -51,6 +65,13 @@ type MapBaseProps = {
51
65
  appearance?: MapAppearance;
52
66
  /** Default `true`. `false` disables pan/zoom/rotate (static display). */
53
67
  interactive?: boolean;
68
+ /** Which built-in map UI shows. Default `"auto"` — zoom buttons follow
69
+ * `interactive`. `"none"` for chrome-free maps (hero backdrops,
70
+ * posters); attribution always stays (license). */
71
+ tools?: MapTools;
72
+ /** Corner the tools dock to. Default `"top-left"`. Handy when the
73
+ * layout puts a search bar or legend over the default corner. */
74
+ toolsPosition?: MapToolsPosition;
54
75
  /** Controlled hovered marker id — pairs with `onHoveredIdChange` for list↔map sync. */
55
76
  hoveredId?: string | null;
56
77
  onHoveredIdChange?: (id: string | null) => void;
@@ -116,6 +137,8 @@ type AdapterOpts = {
116
137
  bounds?: [Coords, Coords];
117
138
  appearance: "light" | "dark" | "satellite";
118
139
  interactive: boolean;
140
+ tools: MapTools;
141
+ toolsPosition: MapToolsPosition;
119
142
  styleUrl?: string;
120
143
  tilerKey?: string;
121
144
  accessToken?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradeui/ui",
3
- "version": "2.1.0",
3
+ "version": "3.1.0",
4
4
  "description": "Grade Design System — React components, theme engine, and design tokens",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -61,16 +61,12 @@
61
61
  },
62
62
  "./package.json": "./package.json",
63
63
  "./styles.css": "./dist/styles.css",
64
+ "./styles/globals.css": "./styles/globals.css",
64
65
  "./contracts": {
65
66
  "types": "./dist/contracts.d.ts",
66
67
  "import": "./dist/contracts.mjs",
67
68
  "require": "./dist/contracts.js"
68
69
  },
69
- "./tailwind-preset": {
70
- "types": "./dist/tailwind-preset.d.ts",
71
- "import": "./dist/tailwind-preset.mjs",
72
- "require": "./dist/tailwind-preset.js"
73
- },
74
70
  "./map/maplibre": {
75
71
  "types": "./dist/map/maplibre.d.ts",
76
72
  "import": "./dist/map/maplibre.mjs",
@@ -89,6 +85,7 @@
89
85
  },
90
86
  "files": [
91
87
  "dist",
88
+ "styles",
92
89
  "components/ui/*.md"
93
90
  ],
94
91
  "sideEffects": [