@geoinsight/react-components 1.0.4 → 1.0.5

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.
Binary file
@@ -3,14 +3,17 @@ import { Button } from "./index";
3
3
  declare const meta: Meta<typeof Button>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof Button>;
6
- export declare const PrimaryMedium: Story;
7
- export declare const PrimaryLarge: Story;
8
- export declare const PrimarySmall: Story;
9
- export declare const SecondaryColor: Story;
10
- export declare const SecondaryButtonLink: Story;
11
- export declare const PrimaryButtonDisabled: Story;
12
- export declare const SecondaryButtonDisabled: Story;
13
- export declare const IconButton: Story;
14
- export declare const PrimaryButtonLink: Story;
6
+ export declare const ButtonPrimaryMedium: Story;
7
+ export declare const ButtonPrimaryLarge: Story;
8
+ export declare const ButtonPrimarySmall: Story;
9
+ export declare const ButtonPrimaryDisabled: Story;
10
+ export declare const ButtonPrimaryWithIcon: Story;
11
+ export declare const ButtonSecondary: Story;
12
+ export declare const ButtonSecondaryWithIcon: Story;
13
+ export declare const ButtonSecondaryDisabled: Story;
14
+ export declare const ButtonIcon: Story;
15
+ export declare const LinkPrimary: Story;
16
+ export declare const LinkSecondary: Story;
17
+ export declare const LinkIcon: Story;
15
18
  export declare const LinkOutsideButton: Story;
16
19
  export declare const LinkOutsideButtonAsPureLink: Story;
@@ -1,5 +1,4 @@
1
1
  import { Viewport } from "maplibre-gl";
2
- import "mapbox-gl/dist/mapbox-gl.css";
3
2
  import { MapAsMapbox } from "./index.types";
4
3
  export interface MapboxMapProps {
5
4
  basemap?: string;
@@ -53,6 +53,9 @@
53
53
  cubic-bezier(0.1, 0.2, 0.3, 0.4);
54
54
  --transition-box-shadow-cubic-bezier: box-shadow 500ms
55
55
  cubic-bezier(0.1, 0.2, 0.3, 0.4);
56
+ --transition-border-cubic-bezier: border 250ms
57
+ cubic-bezier(0.1, 0.2, 0.3, 0.4);
58
+
56
59
 
57
60
  --color-dark-base: #2e3440;
58
61
  --color-dark-bright: #3b4252;
@@ -323,7 +326,8 @@ h6 {
323
326
  background-color: var(--color-primary-darker);
324
327
  }
325
328
 
326
- .button {
329
+ .button,
330
+ .link {
327
331
  align-items: center;
328
332
  border-radius: var(--spacing-32);
329
333
  border: none;
@@ -353,19 +357,46 @@ h6 {
353
357
  var(--transition-box-shadow-cubic-bezier);
354
358
  }
355
359
 
356
- .button__link {
360
+
361
+ .button__primary {
362
+ background-color: var(--color-primary-bright);
363
+ border: 3px solid var(--color-primary-base);
364
+ }
365
+
366
+ .button__secondary,
367
+ .link__secondary {
368
+ background-color: var(--color-main-background);
369
+ border: 3px solid var(--color-primary-base);
370
+ border-radius: var(--spacing-32);
371
+ text-decoration: unset;
372
+ }
373
+
374
+ .button__secondary:hover {
375
+ box-shadow: unset;
376
+ border: 3px solid var(--color-primary-base);
377
+ }
378
+
379
+ .button__icon {
380
+ background-color: var(--color-primary-bright);
381
+ }
382
+
383
+ .button__icon:hover {
384
+ border: unset;
385
+ }
386
+
387
+ .link__primary {
357
388
  background-color: unset !important;
358
389
  color: var(--color-primary-base) !important;
359
390
  text-decoration: underline 1px var(--color-primary-base);
360
391
  text-underline-offset: var(--spacing-4);
361
392
  }
362
393
 
363
- [data-theme="light"] .button__link {
394
+ [data-theme="light"] .link__primary {
364
395
  color: var(--color-primary-darker) !important;
365
396
  text-decoration: underline 1px var(--color-primary-darker);
366
397
  }
367
398
 
368
- .button__link:hover {
399
+ .link__primary:hover {
369
400
  border: unset;
370
401
  box-shadow: unset;
371
402
  color: var(--color-primary-dark) !important;
@@ -375,29 +406,48 @@ h6 {
375
406
  var(--transition-text-underline-offset-cubic-bezier);
376
407
  }
377
408
 
378
- .button__primary {
379
- background-color: var(--color-primary-bright);
409
+ .link__secondary:hover {
410
+ background-color: var(--color-primary-dark);
380
411
  border: 3px solid var(--color-primary-base);
412
+ box-shadow: unset;
413
+ transition: var(--transition-bg-cubic-bezier),
414
+ var(--transition-box-shadow-cubic-bezier);
381
415
  }
382
416
 
383
- .button__secondary {
384
- background-color: var(--color-main-background);
385
- border: 3px solid var(--color-primary-base);
386
- border-radius: var(--spacing-32);
387
- text-decoration: unset;
417
+ .link__icon {
418
+ background-color: unset !important;
419
+ color: var(--color-primary-base) !important;
388
420
  }
389
421
 
390
- .button__secondary:hover {
391
- box-shadow: unset;
392
- border: 3px solid var(--color-primary-base);
422
+ .link > a {
423
+ text-decoration: inherit;
424
+ color: inherit;
393
425
  }
394
426
 
395
- .button__icon {
396
- background-color: var(--color-primary-bright);
427
+ .link__icon svg {
428
+ border: 2px solid transparent;
429
+ border-bottom: 2px solid var(--color-primary-base);
430
+ border-radius: 2px;
431
+ padding: var(--spacing-4);
397
432
  }
398
433
 
399
- .button__icon:hover {
434
+ [data-theme="light"] .link__icon {
435
+ color: var(--color-primary-darker) !important;
436
+ }
437
+
438
+ [data-theme="light"] .link__icon svg {
439
+ border-bottom: 2px solid var(--color-primary-darker);
440
+ }
441
+
442
+ .link__icon:hover {
400
443
  border: unset;
444
+ box-shadow: unset;
445
+ }
446
+
447
+ .link__icon:hover svg {
448
+ color: var(--color-main-color) !important;
449
+ border: 2px solid var(--color-primary-dark);
450
+ transition: var(--transition-color-cubic-bezier), var(--transition-border-cubic-bezier);
401
451
  }
402
452
 
403
453
  .button__small {
@@ -412,11 +462,6 @@ h6 {
412
462
  padding: var(--spacing-16);
413
463
  }
414
464
 
415
- .button__link > a {
416
- text-decoration: inherit;
417
- color: inherit;
418
- }
419
-
420
465
  .button__icon.button__medium {
421
466
  padding: var(--spacing-8) var(--spacing-12);
422
467
  }
@@ -798,6 +843,8 @@ h6 {
798
843
  padding-bottom: var(--spacing-16);
799
844
  }
800
845
 
846
+ @import url("mapbox-gl/dist/mapbox-gl.css");
847
+
801
848
  .map {
802
849
  position: relative;
803
850
  height: 100%;
package/dist/cjs/index.js CHANGED
@@ -13,7 +13,6 @@ var Layers = require('@deck.gl/layers');
13
13
  var reactMapGl = require('react-map-gl');
14
14
  var maplibregl = require('maplibre-gl');
15
15
  var fi = require('react-icons/fi');
16
- require('mapbox-gl/dist/mapbox-gl.css');
17
16
 
18
17
  function _interopNamespaceDefault(e) {
19
18
  var n = Object.create(null);
@@ -84,7 +83,7 @@ const Anchor = ({ Custom, children, ...rest }) => {
84
83
  return Custom ? (jsxRuntime.jsx(Custom, { ...rest, children: children })) : (jsxRuntime.jsx("a", { ...rest, children: children }));
85
84
  };
86
85
  function Button({ children = "Click me", className = "", icon = undefined, isNewWindow = false, mode = "primary", size = "medium", as = "button", CustomAnchor, ...rest }) {
87
- return as === "link" ? (jsxRuntime.jsxs(Anchor, { Custom: CustomAnchor, ...(isNewWindow && { target: "_blank" }), className: clsx(`button ${className}`, mode === "secondary" ? `button__${mode}` : "button__link", `button__${size}`), ...rest, children: [children, icon] })) : (jsxRuntime.jsxs("button", { className: clsx("button", `button__${mode}`, `button__${size}`, className), ...rest, children: [children, icon] }));
86
+ return as === "link" ? (jsxRuntime.jsxs(Anchor, { Custom: CustomAnchor, ...(isNewWindow && { target: "_blank" }), className: clsx(`button ${className}`, `link__${mode}`, `button__${size}`), ...rest, children: [children, icon] })) : (jsxRuntime.jsxs("button", { className: clsx("button", `button__${mode}`, `button__${size}`, className), ...rest, children: [children, icon] }));
88
87
  }
89
88
 
90
89
  function MenuButton({ anchor, children, buttonClassName, nested, subnested, dropdown, isLink, isSelected, handleCallbackClick, ...props }) {