@repere/react 0.2.1 → 0.3.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.
package/dist/styles.css CHANGED
@@ -1 +1 @@
1
- [data-repere-popover]{position:absolute;position-anchor:var(--repere-anchor);inset:unset;margin:0;opacity:var(--repere-exit-opacity, 0);transform:translate(var(--repere-exit-x, 0)) translateY(var(--repere-exit-y, -20px)) scale(var(--repere-exit-scale, 1));transition-property:opacity,transform,overlay,display;transition-duration:var(--repere-transition-duration, .3s);transition-timing-function:var( --repere-transition-timing, cubic-bezier(.4, 0, .2, 1) );transition-behavior:allow-discrete}[data-repere-popover]:popover-open{opacity:var(--repere-animate-opacity, 1);transform:translate(var(--repere-animate-x, 0)) translateY(var(--repere-animate-y, 0)) scale(var(--repere-animate-scale, 1))}@starting-style{[data-repere-popover]:popover-open{opacity:var(--repere-initial-opacity, 0);transform:translate(var(--repere-initial-x, 0)) translateY(var(--repere-initial-y, -20px)) scale(var(--repere-initial-scale, 1))}}[data-repere-popover][data-position=bottom-left]{top:anchor(bottom);left:anchor(left);position-try-fallbacks:--bottom-right,--top-left,--top-right}[data-repere-popover][data-position=bottom-center]{top:anchor(bottom);left:anchor(center);translate:-50% 0;position-try-fallbacks:--bottom-left,--bottom-right,--top-center}[data-repere-popover][data-position=bottom-right]{top:anchor(bottom);right:anchor(right);position-try-fallbacks:--bottom-left,--top-right,--top-left}[data-repere-popover][data-position=top-left]{bottom:anchor(top);left:anchor(left);position-try-fallbacks:--top-right,--bottom-left,--bottom-right}[data-repere-popover][data-position=top-center]{bottom:anchor(top);left:anchor(center);translate:-50% 0;position-try-fallbacks:--top-left,--top-right,--bottom-center}[data-repere-popover][data-position=top-right]{bottom:anchor(top);right:anchor(right);position-try-fallbacks:--top-left,--bottom-right,--bottom-left}[data-repere-popover][data-position=left-center]:popover-open{top:anchor(center);right:anchor(left);translate:0 -50%;position-try-fallbacks:--right-center,--bottom-center,--top-center}[data-repere-popover][data-position=right-center]:popover-open{top:anchor(center);left:anchor(right);translate:0 -50%;position-try-fallbacks:--left-center,--bottom-center,--top-center}[data-repere-trigger]{anchor-name:var(--repere-anchor)}@position-try --bottom-left{top:anchor(bottom);left:anchor(left);right:auto;bottom:auto;translate:0 0}@position-try --bottom-right{top:anchor(bottom);right:anchor(right);left:auto;bottom:auto;translate:0 0}@position-try --bottom-center{top:anchor(bottom);left:anchor(center);right:auto;bottom:auto;translate:-50% 0}@position-try --top-left{bottom:anchor(top);left:anchor(left);right:auto;top:auto;translate:0 0}@position-try --top-right{bottom:anchor(top);right:anchor(right);left:auto;top:auto;translate:0 0}@position-try --top-center{bottom:anchor(top);left:anchor(center);right:auto;top:auto;translate:-50% 0}@position-try --left-center{top:anchor(center);right:anchor(left);left:auto;bottom:auto;translate:0 -50%}@position-try --right-center{top:anchor(center);left:anchor(right);right:auto;bottom:auto;translate:0 -50%}
1
+ [data-repere-popover]{position:absolute;position-anchor:var(--repere-anchor);inset:unset;margin:0;opacity:var(--repere-exit-opacity, 0);transform:translate(var(--repere-exit-x, 0)) translateY(var(--repere-exit-y, -20px)) scale(var(--repere-exit-scale, 1));transition-property:opacity,transform,overlay,display;transition-duration:var(--repere-transition-duration, .3s);transition-timing-function:var( --repere-transition-timing, cubic-bezier(.4, 0, .2, 1) );transition-behavior:allow-discrete}[data-repere-popover]:popover-open{opacity:var(--repere-animate-opacity, 1);transform:translate(var(--repere-animate-x, 0)) translateY(var(--repere-animate-y, 0)) scale(var(--repere-animate-scale, 1))}@starting-style{[data-repere-popover]:popover-open{opacity:var(--repere-initial-opacity, 0);transform:translate(var(--repere-initial-x, 0)) translateY(var(--repere-initial-y, -20px)) scale(var(--repere-initial-scale, 1))}}[data-repere-popover][data-anchor-point=bottom-left]{top:anchor(bottom);left:anchor(left);position-try-fallbacks:--bottom-right,--top-left,--top-right}[data-repere-popover][data-anchor-point=bottom-center]{top:anchor(bottom);left:anchor(center);translate:-50% 0;position-try-fallbacks:--bottom-left,--bottom-right,--top-center}[data-repere-popover][data-anchor-point=bottom-right]{top:anchor(bottom);right:anchor(right);position-try-fallbacks:--bottom-left,--top-right,--top-left}[data-repere-popover][data-anchor-point=top-left]{bottom:anchor(top);left:anchor(left);position-try-fallbacks:--top-right,--bottom-left,--bottom-right}[data-repere-popover][data-anchor-point=top-center]{bottom:anchor(top);left:anchor(center);translate:-50% 0;position-try-fallbacks:--top-left,--top-right,--bottom-center}[data-repere-popover][data-anchor-point=top-right]{bottom:anchor(top);right:anchor(right);position-try-fallbacks:--top-left,--bottom-right,--bottom-left}[data-repere-popover][data-anchor-point=left-center]:popover-open{top:anchor(center);right:anchor(left);translate:0 -50%;position-try-fallbacks:--right-center,--bottom-center,--top-center}[data-repere-popover][data-anchor-point=right-center]:popover-open{top:anchor(center);left:anchor(right);translate:0 -50%;position-try-fallbacks:--left-center,--bottom-center,--top-center}[data-repere-trigger]{anchor-name:var(--repere-anchor)}@position-try --bottom-left{top:anchor(bottom);left:anchor(left);right:auto;bottom:auto;translate:0 0}@position-try --bottom-right{top:anchor(bottom);right:anchor(right);left:auto;bottom:auto;translate:0 0}@position-try --bottom-center{top:anchor(bottom);left:anchor(center);right:auto;bottom:auto;translate:-50% 0}@position-try --top-left{bottom:anchor(top);left:anchor(left);right:auto;top:auto;translate:0 0}@position-try --top-right{bottom:anchor(top);right:anchor(right);left:auto;top:auto;translate:0 0}@position-try --top-center{bottom:anchor(top);left:anchor(center);right:auto;top:auto;translate:-50% 0}@position-try --left-center{top:anchor(center);right:anchor(left);left:auto;bottom:auto;translate:0 -50%}@position-try --right-center{top:anchor(center);left:anchor(right);right:auto;bottom:auto;translate:0 -50%}
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BasePopoverProps, BaseTriggerProps, Beacon, CalculatedBeaconPosition, Page, RepereConfig } from '@repere/core';
1
+ import { BasePopoverProps, BaseTriggerProps, Beacon, CalculatedBeaconAnchorPoint, Page, RepereConfig } from '@repere/core';
2
2
  import { ComponentType, ReactElement, ReactNode } from 'react';
3
3
  export interface ToggleEvent extends Event {
4
4
  newState: "open" | "closed";
@@ -12,7 +12,7 @@ export interface RepereReactConfig extends RepereConfig<ReactComponent> {
12
12
  }
13
13
  export interface TriggerComponentProps extends BaseTriggerProps {
14
14
  beacon: ReactBeacon;
15
- style: CalculatedBeaconPosition;
15
+ style: CalculatedBeaconAnchorPoint;
16
16
  onClick: () => void;
17
17
  popoverTarget?: string;
18
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,MAAM,EACN,wBAAwB,EACxB,IAAI,EACJ,YAAY,EACb,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGpE,MAAM,WAAW,WAAY,SAAQ,KAAK;IACxC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC7B;AAGD,MAAM,MAAM,cAAc,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC;AAGnE,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AACjD,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC;AAG7C,MAAM,WAAW,iBAAkB,SAAQ,YAAY,CAAC,cAAc,CAAC;IACrE,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB;AAGD,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,EAAE,wBAAwB,CAAC;IAChC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAGD,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D,MAAM,EAA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B,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;KAClD;CACF"}
@@ -1,16 +1,16 @@
1
- import { Beacon, CalculatedBeaconPosition, Position } from '@repere/core';
1
+ import { AnchorPoint, Beacon, CalculatedBeaconAnchorPoint } from '@repere/core';
2
2
  import { ReactElement } from 'react';
3
3
  import { ReactComponent } from '../types';
4
- export declare function renderTriggerComponent(triggerSource: ReactComponent | undefined, props: {
4
+ export declare function renderTriggerComponent(component: ReactComponent | undefined, props: {
5
5
  beacon: Beacon;
6
- calculatedPosition: CalculatedBeaconPosition;
7
- position: Position;
6
+ calculatedAnchorPoint: CalculatedBeaconAnchorPoint;
7
+ anchorPoint: AnchorPoint;
8
8
  isOpen: boolean;
9
9
  togglePopover: () => void;
10
10
  }): ReactElement | null;
11
- export declare function renderPopoverComponent(popoverSource: ReactComponent, props: {
11
+ export declare function renderPopoverComponent(component: ReactComponent, props: {
12
12
  beacon: Beacon;
13
- position: Position;
13
+ anchorPoint: AnchorPoint;
14
14
  handleDismiss: () => void;
15
15
  hidePopover: () => void;
16
16
  handlePopoverRef: (node: HTMLDivElement | null) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"renderRepereComponents.d.ts","sourceRoot":"","sources":["../../src/utils/renderRepereComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,wBAAwB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAgC,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAiB/C,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,cAAc,GAAG,SAAS,EACzC,KAAK,EAAE;IACL,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,wBAAwB,CAAC;IAC7C,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,GACA,YAAY,GAAG,IAAI,CAiBrB;AAED,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,cAAc,EAC7B,KAAK,EAAE;IACL,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,gBAAgB,EAAE,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,SAAS,EAAE,MAAM,CAAC;CACnB,GACA,YAAY,CAuBd"}
1
+ {"version":3,"file":"renderRepereComponents.d.ts","sourceRoot":"","sources":["../../src/utils/renderRepereComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,MAAM,EACN,2BAA2B,EAC5B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAgC,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAiB/C,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,cAAc,GAAG,SAAS,EACrC,KAAK,EAAE;IACL,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB,EAAE,2BAA2B,CAAC;IACnD,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,GACA,YAAY,GAAG,IAAI,CAmBrB;AAED,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,cAAc,EACzB,KAAK,EAAE;IACL,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,WAAW,CAAC;IACzB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,gBAAgB,EAAE,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,SAAS,EAAE,MAAM,CAAC;CACnB,GACA,YAAY,CAmBd"}
@@ -1,11 +1,12 @@
1
- import { Beacon, Offset, Position } from '@repere/core';
1
+ import { AnchorPoint, Beacon, Offset, PositioningStrategy } from '@repere/core';
2
2
  import { RepereReactConfig } from '../types';
3
3
  export declare function resolveBeaconConfig(beacon: Beacon, config: RepereReactConfig): {
4
- position: Position;
4
+ anchorPoint: AnchorPoint;
5
5
  zIndex: number;
6
6
  offset: Offset | undefined;
7
7
  delay: number | undefined;
8
- popoverPosition: Position;
8
+ positioningStrategy: PositioningStrategy | undefined;
9
+ popoverAnchorPoint: AnchorPoint;
9
10
  popoverOffset: Offset;
10
11
  };
11
12
  //# sourceMappingURL=resolveBeaconConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolveBeaconConfig.d.ts","sourceRoot":"","sources":["../../src/utils/resolveBeaconConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB;;;;;;;EAwB5E"}
1
+ {"version":3,"file":"resolveBeaconConfig.d.ts","sourceRoot":"","sources":["../../src/utils/resolveBeaconConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,MAAM,EACN,MAAM,EACN,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB;;;;;;;;EA8B5E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@repere/react",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -14,7 +14,7 @@
14
14
  "dist"
15
15
  ],
16
16
  "dependencies": {
17
- "@repere/core": "0.1.1"
17
+ "@repere/core": "0.2.0"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "motion": "^12.0.0",
@@ -1,16 +0,0 @@
1
- import { CalculatedBeaconPosition, Offset, Position } from '@repere/core';
2
- interface UseBeaconPositionParams {
3
- targetSelector: string;
4
- position: Position;
5
- offset?: Offset;
6
- zIndex?: number;
7
- delay?: number;
8
- enabled?: boolean;
9
- debug?: boolean;
10
- }
11
- export declare function useBeaconPosition({ targetSelector, position, offset, zIndex, delay, enabled, debug, }: UseBeaconPositionParams): {
12
- calculatedPosition: CalculatedBeaconPosition | null;
13
- targetElement: HTMLElement | null;
14
- };
15
- export {};
16
- //# sourceMappingURL=useBeaconPosition.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useBeaconPosition.d.ts","sourceRoot":"","sources":["../../src/hooks/useBeaconPosition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAI/E,UAAU,uBAAuB;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,cAAc,EACd,QAAQ,EACR,MAAM,EACN,MAAa,EACb,KAAK,EACL,OAAc,EACd,KAAa,GACd,EAAE,uBAAuB;;;EAkCzB"}