@preply/ds-web-lib 10.0.0 → 11.0.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 (74) hide show
  1. package/dist/{DropdownMenu.primitives-CqJE9k4D.js → DropdownMenu.primitives-B3WK71bR.js} +4 -4
  2. package/dist/assets/Accordion.css +2 -2
  3. package/dist/assets/AlertBannerProvider.css +2 -2
  4. package/dist/assets/AlertDialog.css +2 -2
  5. package/dist/assets/Avatar.css +3 -3
  6. package/dist/assets/AvatarWithStatus.css +2 -2
  7. package/dist/assets/Badge.css +1 -1
  8. package/dist/assets/Box.css +3 -3
  9. package/dist/assets/BubbleCounter.css +1 -1
  10. package/dist/assets/Button.css +4 -4
  11. package/dist/assets/ButtonBase.css +4 -4
  12. package/dist/assets/Checkbox.css +1 -1
  13. package/dist/assets/Chips.css +2 -2
  14. package/dist/assets/ChipsPrimitive.css +2 -2
  15. package/dist/assets/CountryFlag.css +1 -1
  16. package/dist/assets/Dialog.css +3 -3
  17. package/dist/assets/Divider.css +1 -1
  18. package/dist/assets/DropdownMenu.css +2 -2
  19. package/dist/assets/FieldButton.css +3 -3
  20. package/dist/assets/FormControl.css +1 -1
  21. package/dist/assets/Heading.css +3 -3
  22. package/dist/assets/Icon.css +3 -3
  23. package/dist/assets/IconTile.css +9 -1
  24. package/dist/assets/InputContainer.css +2 -2
  25. package/dist/assets/LayoutFlex.css +1 -1
  26. package/dist/assets/LayoutFlexItem.css +1 -1
  27. package/dist/assets/Link.css +3 -3
  28. package/dist/assets/Loader.css +1 -1
  29. package/dist/assets/OnboardingTooltip.css +6 -4
  30. package/dist/assets/OnboardingTour.css +3 -2
  31. package/dist/assets/PreplyLogo.css +1 -1
  32. package/dist/assets/ProgressBar.css +1 -1
  33. package/dist/assets/ProgressSteps.css +1 -1
  34. package/dist/assets/Select.css +2 -2
  35. package/dist/assets/Slider.css +1 -1
  36. package/dist/assets/Spinner.css +3 -3
  37. package/dist/assets/Stars.css +3 -3
  38. package/dist/assets/Steps.css +2 -2
  39. package/dist/assets/Switch.css +1 -1
  40. package/dist/assets/Text.css +3 -3
  41. package/dist/assets/TextHighlighted.css +3 -3
  42. package/dist/assets/TextInline.css +3 -3
  43. package/dist/assets/Toast.css +2 -2
  44. package/dist/assets/Tooltip.css +1 -1
  45. package/dist/assets/align-self.css +1 -1
  46. package/dist/assets/exp-color.css +2 -2
  47. package/dist/assets/index.css +1 -1
  48. package/dist/assets/layout-gap.css +3 -3
  49. package/dist/assets/layout-grid.css +3 -3
  50. package/dist/assets/layout-hide.css +1 -1
  51. package/dist/assets/layout-padding.css +3 -3
  52. package/dist/assets/layout-relative.css +1 -1
  53. package/dist/assets/text-accent.css +2 -2
  54. package/dist/assets/text-centered.css +1 -1
  55. package/dist/assets/text-weight.css +2 -2
  56. package/dist/components/AlertDialog/AlertDialog.d.ts +3 -3
  57. package/dist/components/AlertDialog/AlertDialog.d.ts.map +1 -1
  58. package/dist/components/AlertDialog/AlertDialog.js +354 -18
  59. package/dist/components/Dialog/primitives/DialogCloseButton.d.ts.map +1 -1
  60. package/dist/components/Dialog/primitives/DialogCloseButton.js +5 -31
  61. package/dist/components/Dialog/primitives/DialogDescription.js +1 -1
  62. package/dist/components/Dialog/primitives/DialogRoot.js +5 -1149
  63. package/dist/components/Dialog/primitives/DialogTitle.js +1 -1
  64. package/dist/components/DropdownMenu/DropdownMenu.js +1 -1
  65. package/dist/components/DropdownMenu/primitives/DropdownMenu.primitives.js +1 -1
  66. package/dist/components/DropdownMenu/primitives/DropdownMenuSelectItem.primitives.js +1 -1
  67. package/dist/components/OnboardingTooltip/OnboardingTooltip.js +1 -1
  68. package/dist/{floating-ui.utils.dom-BvMNldxo.js → floating-ui.utils.dom-3OgjGonN.js} +1 -1
  69. package/dist/store-BUKWfVf3.js +1155 -0
  70. package/dist/{useButton-fjQ0ak8m.js → useButton-CFPpP0o5.js} +2 -2
  71. package/dist/useDialogClose-C9x1leGd.js +34 -0
  72. package/dist/{useOpenInteractionType-DNYFqf-a.js → useOpenInteractionType-Cj41-8Yk.js} +48 -48
  73. package/dist/{useRenderElement-BSthtPOr.js → useRenderElement-DtYPTE_y.js} +2 -2
  74. package/package.json +12 -12
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import * as React from "react";
3
- import { u as useEventCallback, a as useIsoLayoutEffect, i as isHTMLElement } from "./floating-ui.utils.dom-BvMNldxo.js";
4
- import { m as mergeProps, b as makeEventPreventable } from "./useRenderElement-BSthtPOr.js";
3
+ import { u as useEventCallback, a as useIsoLayoutEffect, i as isHTMLElement } from "./floating-ui.utils.dom-3OgjGonN.js";
4
+ import { m as mergeProps, a as makeEventPreventable } from "./useRenderElement-DtYPTE_y.js";
5
5
  let set;
6
6
  if (process.env.NODE_ENV !== "production") {
7
7
  set = /* @__PURE__ */ new Set();
@@ -0,0 +1,34 @@
1
+ "use client";
2
+ import { u as useEventCallback, c as createChangeEventDetails } from "./floating-ui.utils.dom-3OgjGonN.js";
3
+ import { u as useButton } from "./useButton-CFPpP0o5.js";
4
+ import { m as mergeProps } from "./useRenderElement-DtYPTE_y.js";
5
+ function useDialogClose(params) {
6
+ const {
7
+ open,
8
+ setOpen,
9
+ disabled,
10
+ nativeButton
11
+ } = params;
12
+ const handleClick = useEventCallback((event) => {
13
+ if (open) {
14
+ setOpen(false, createChangeEventDetails("close-press", event.nativeEvent));
15
+ }
16
+ });
17
+ const {
18
+ getButtonProps,
19
+ buttonRef
20
+ } = useButton({
21
+ disabled,
22
+ native: nativeButton
23
+ });
24
+ const getRootProps = (externalProps) => mergeProps({
25
+ onClick: handleClick
26
+ }, externalProps, getButtonProps);
27
+ return {
28
+ getRootProps,
29
+ ref: buttonRef
30
+ };
31
+ }
32
+ export {
33
+ useDialogClose as u
34
+ };
@@ -4,8 +4,8 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  import * as React from "react";
6
6
  import * as ReactDOM from "react-dom";
7
- import { u as useEventCallback, a as useIsoLayoutEffect, b as isShadowRoot, i as isHTMLElement, g as getNodeName, c as createChangeEventDetails, d as isNode, e as getWindow, f as isElement, h as isLastTraversableNode, j as getParentNode, k as getComputedStyle$1, l as getOverflowAncestors, m as isWebKit$1 } from "./floating-ui.utils.dom-BvMNldxo.js";
8
- import { a as useRefWithInit, i as isReactVersionAtLeast, c as useMergedRefs, E as EMPTY_OBJECT, N as NOOP } from "./useRenderElement-BSthtPOr.js";
7
+ import { u as useEventCallback, a as useIsoLayoutEffect, b as isShadowRoot, i as isHTMLElement, g as getNodeName, c as createChangeEventDetails, d as isNode, e as getWindow, f as isElement, h as isLastTraversableNode, j as getParentNode, k as getComputedStyle$1, l as getOverflowAncestors, m as isWebKit$1 } from "./floating-ui.utils.dom-3OgjGonN.js";
8
+ import { b as useRefWithInit, i as isReactVersionAtLeast, c as useMergedRefs, E as EMPTY_OBJECT, N as NOOP } from "./useRenderElement-DtYPTE_y.js";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  import { u as useId } from "./useId-BhIOp2JG.js";
11
11
  const TYPEAHEAD_RESET_MS = 500;
@@ -2823,58 +2823,58 @@ function useOpenInteractionType(open) {
2823
2823
  }), [openMethod, reset, onClick, onPointerDown]);
2824
2824
  }
2825
2825
  export {
2826
- triggerOpenStateMapping as $,
2826
+ pressableTriggerOpenStateMapping as $,
2827
2827
  ARROW_UP$1 as A,
2828
- isMouseLikePointerType as B,
2828
+ createAttribute as B,
2829
2829
  CommonPopupDataAttributes as C,
2830
- contains as D,
2831
- activeElement as E,
2830
+ isMouseLikePointerType as D,
2831
+ contains as E,
2832
2832
  FloatingFocusManager as F,
2833
- isTypeableElement as G,
2834
- matchesFocusVisible as H,
2833
+ activeElement as G,
2834
+ isTypeableElement as H,
2835
2835
  InternalBackdrop as I,
2836
- isMac as J,
2837
- isSafari as K,
2838
- getFloatingFocusElement as L,
2839
- isTypeableCombobox as M,
2840
- enqueueFocus as N,
2841
- isVirtualClick as O,
2842
- isVirtualPointerEvent as P,
2843
- getNodeChildren as Q,
2844
- ownerDocument as R,
2845
- DISABLED_TRANSITIONS_STYLE as S,
2836
+ matchesFocusVisible as J,
2837
+ isMac as K,
2838
+ isSafari as L,
2839
+ getFloatingFocusElement as M,
2840
+ isTypeableCombobox as N,
2841
+ enqueueFocus as O,
2842
+ isVirtualClick as P,
2843
+ isVirtualPointerEvent as Q,
2844
+ getNodeChildren as R,
2845
+ ownerDocument as S,
2846
2846
  Timeout as T,
2847
- DROPDOWN_COLLISION_AVOIDANCE as U,
2848
- useFloatingNodeId as V,
2849
- FloatingNode as W,
2850
- PATIENT_CLICK_THRESHOLD as X,
2851
- FloatingTree as Y,
2852
- TYPEAHEAD_RESET_MS as Z,
2853
- pressableTriggerOpenStateMapping as _,
2854
- useOpenInteractionType as a,
2855
- useOpenChangeComplete as b,
2856
- useFloatingRootContext as c,
2857
- useRole as d,
2858
- useClick as e,
2859
- useDismiss as f,
2860
- getTarget as g,
2861
- useScrollLock as h,
2862
- useInteractions as i,
2863
- COMPOSITE_KEYS as j,
2864
- inertValue as k,
2865
- FloatingPortal as l,
2866
- getEmptyContext as m,
2867
- ARROW_DOWN$1 as n,
2868
- ARROW_LEFT$1 as o,
2847
+ DISABLED_TRANSITIONS_STYLE as U,
2848
+ DROPDOWN_COLLISION_AVOIDANCE as V,
2849
+ useFloatingNodeId as W,
2850
+ FloatingNode as X,
2851
+ PATIENT_CLICK_THRESHOLD as Y,
2852
+ FloatingTree as Z,
2853
+ TYPEAHEAD_RESET_MS as _,
2854
+ COMPOSITE_KEYS as a,
2855
+ FloatingPortal as b,
2856
+ triggerOpenStateMapping as c,
2857
+ useTransitionStatus as d,
2858
+ useOpenInteractionType as e,
2859
+ useFloatingRootContext as f,
2860
+ getEmptyContext as g,
2861
+ useRole as h,
2862
+ inertValue as i,
2863
+ useClick as j,
2864
+ useDismiss as k,
2865
+ useScrollLock as l,
2866
+ useInteractions as m,
2867
+ getTarget as n,
2868
+ ARROW_DOWN$1 as o,
2869
2869
  popupStateMapping as p,
2870
- ARROW_RIGHT$1 as q,
2871
- useFloatingTree as r,
2870
+ ARROW_LEFT$1 as q,
2871
+ ARROW_RIGHT$1 as r,
2872
2872
  stopEvent as s,
2873
2873
  transitionStatusMapping as t,
2874
- useTransitionStatus as u,
2875
- useFloatingParentNodeId as v,
2876
- useLatestRef as w,
2877
- useTimeout as x,
2878
- getDocument as y,
2879
- createAttribute as z
2874
+ useOpenChangeComplete as u,
2875
+ useFloatingTree as v,
2876
+ useFloatingParentNodeId as w,
2877
+ useLatestRef as x,
2878
+ useTimeout as y,
2879
+ getDocument as z
2880
2880
  };
@@ -340,8 +340,8 @@ function getChildRef(render) {
340
340
  export {
341
341
  EMPTY_OBJECT as E,
342
342
  NOOP as N,
343
- useRefWithInit as a,
344
- makeEventPreventable as b,
343
+ makeEventPreventable as a,
344
+ useRefWithInit as b,
345
345
  useMergedRefs as c,
346
346
  EMPTY_ARRAY as d,
347
347
  isReactVersionAtLeast as i,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@preply/ds-web-lib",
3
- "version": "10.0.0",
3
+ "version": "11.0.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -34,21 +34,21 @@
34
34
  "usehooks-ts": "^3.1.1"
35
35
  },
36
36
  "peerDependencies": {
37
- "@preply/ds-core": "10.0.0",
38
- "@preply/ds-media-icons": "10.0.0",
39
- "@preply/ds-visual-coverage-preply-component-names": "10.0.0",
40
- "@preply/ds-web-core": "10.0.0",
41
- "@preply/ds-web-root": "10.0.0",
37
+ "@preply/ds-core": "11.0.0",
38
+ "@preply/ds-media-icons": "11.0.0",
39
+ "@preply/ds-visual-coverage-preply-component-names": "11.0.0",
40
+ "@preply/ds-web-core": "11.0.0",
41
+ "@preply/ds-web-root": "11.0.0",
42
42
  "react": "^16 || ^18",
43
43
  "react-dom": "^16 || ^18",
44
44
  "react-intl": "^6.5.5"
45
45
  },
46
46
  "devDependencies": {
47
- "@preply/ds-core": "10.0.0",
48
- "@preply/ds-media-icons": "10.0.0",
49
- "@preply/ds-visual-coverage-preply-component-names": "10.0.0",
50
- "@preply/ds-web-core": "10.0.0",
51
- "@preply/ds-web-root": "10.0.0",
47
+ "@preply/ds-core": "11.0.0",
48
+ "@preply/ds-media-icons": "11.0.0",
49
+ "@preply/ds-visual-coverage-preply-component-names": "11.0.0",
50
+ "@preply/ds-web-core": "11.0.0",
51
+ "@preply/ds-web-root": "11.0.0",
52
52
  "@storybook/react-vite": "10.1.4",
53
53
  "@testing-library/react": "16.3.0",
54
54
  "@types/react-is": "^18.2.0",
@@ -64,5 +64,5 @@
64
64
  "vite-plugin-svgr": "4.5.0",
65
65
  "vitest-browser-react": "^0.1.1"
66
66
  },
67
- "gitHead": "dd93773dac396f5379d25904b46c1e416285dd0e"
67
+ "gitHead": "da9b3a2d347e7925a14341797a074d832986ce43"
68
68
  }