@protonradio/proton-ui 0.7.0 → 0.7.1
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/README.md +73 -73
- package/dist/colors-BdogYmJi.js.map +1 -1
- package/dist/colors-Dwh4VIMR.mjs.map +1 -1
- package/dist/constants.cjs.js.map +1 -1
- package/dist/constants.es.js.map +1 -1
- package/dist/icons.svg +10 -10
- package/dist/index.cjs.js +3 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.es.js +23 -19
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/utils-D9D3Fg9O.mjs +145 -0
- package/dist/utils-D9D3Fg9O.mjs.map +1 -0
- package/dist/utils-DbIphMSk.js +2 -0
- package/dist/utils-DbIphMSk.js.map +1 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +1 -1
- package/package.json +91 -91
- package/dist/utils-BNyA6Kte.js +0 -2
- package/dist/utils-BNyA6Kte.js.map +0 -1
- package/dist/utils-CZQIdhYj.mjs +0 -125
- package/dist/utils-CZQIdhYj.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -389,7 +389,7 @@ declare type Palette = {
|
|
|
389
389
|
*
|
|
390
390
|
* @interface PopoverProps
|
|
391
391
|
*/
|
|
392
|
-
export declare function Popover({ children, state, arrow, offset, ...props }: PopoverProps): JSX_2.Element;
|
|
392
|
+
export declare function Popover({ children, state, arrow, offset, isEntering, ...props }: PopoverProps): JSX_2.Element;
|
|
393
393
|
|
|
394
394
|
declare interface PopoverProps extends Omit<AriaPopoverProps, "popoverRef"> {
|
|
395
395
|
/**
|
|
@@ -408,6 +408,10 @@ declare interface PopoverProps extends Omit<AriaPopoverProps, "popoverRef"> {
|
|
|
408
408
|
* Whether to show an arrow on the popover.
|
|
409
409
|
*/
|
|
410
410
|
arrow?: boolean;
|
|
411
|
+
/**
|
|
412
|
+
* Whether the popover is entering.
|
|
413
|
+
*/
|
|
414
|
+
isEntering?: boolean;
|
|
411
415
|
}
|
|
412
416
|
|
|
413
417
|
export declare interface ProtonColumnProps<T> extends ColumnProps<T> {
|
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import B, { useRef as M, useCallback as X, useState as j, useContext as Y, useEffect as L, createContext as ee, useMemo as H, useLayoutEffect as Kc, createElement as mi, isValidElement as Mc, forwardRef as pt, cloneElement as Ic } from "react";
|
|
2
2
|
import Cn, { flushSync as Fc, createPortal as bi } from "react-dom";
|
|
3
|
-
import { c as U, i as Nr, h as gi } from "./utils-
|
|
3
|
+
import { c as U, i as Nr, h as gi } from "./utils-D9D3Fg9O.mjs";
|
|
4
4
|
import { THEMES as Ee, BREAKPOINTS as $i } from "./constants.es.js";
|
|
5
5
|
import { transparentize as st } from "color2k";
|
|
6
6
|
import { G as be, S as tn, W as nn, D as rn, B as Rc } from "./colors-Dwh4VIMR.mjs";
|
|
@@ -9712,48 +9712,50 @@ function il({
|
|
|
9712
9712
|
state: e,
|
|
9713
9713
|
arrow: n = !0,
|
|
9714
9714
|
offset: r,
|
|
9715
|
-
|
|
9715
|
+
isEntering: l,
|
|
9716
|
+
...i
|
|
9716
9717
|
}) {
|
|
9717
|
-
const
|
|
9718
|
-
let { popoverProps:
|
|
9718
|
+
const o = M(null), { popoverRef: a = o } = i, { className: u, style: s, palette: c, theme: d } = We();
|
|
9719
|
+
let { popoverProps: f, underlayProps: p, arrowProps: h, placement: $ } = Wf(
|
|
9719
9720
|
{
|
|
9720
|
-
...
|
|
9721
|
+
...i,
|
|
9721
9722
|
offset: r,
|
|
9722
|
-
popoverRef:
|
|
9723
|
+
popoverRef: a
|
|
9723
9724
|
},
|
|
9724
9725
|
e
|
|
9725
9726
|
);
|
|
9726
|
-
const
|
|
9727
|
+
const g = {
|
|
9727
9728
|
"--dialog-background": (() => {
|
|
9728
|
-
switch (
|
|
9729
|
+
switch (d) {
|
|
9729
9730
|
case Ee.CUSTOM_DARK:
|
|
9730
|
-
return
|
|
9731
|
+
return c.PRIMARY.PRIMARY_MEDIUM;
|
|
9731
9732
|
case Ee.DARK:
|
|
9732
|
-
return
|
|
9733
|
+
return c.PRIMARY.PRIMARY_DARK;
|
|
9733
9734
|
default:
|
|
9734
9735
|
return be.WHITE;
|
|
9735
9736
|
}
|
|
9736
9737
|
})(),
|
|
9737
|
-
...
|
|
9738
|
+
...s
|
|
9738
9739
|
};
|
|
9739
9740
|
return /* @__PURE__ */ b.jsxs(Yf, { children: [
|
|
9740
|
-
/* @__PURE__ */ b.jsx("div", { ...
|
|
9741
|
+
/* @__PURE__ */ b.jsx("div", { ...p, style: { position: "fixed", inset: 0 } }),
|
|
9741
9742
|
/* @__PURE__ */ b.jsxs(
|
|
9742
9743
|
"div",
|
|
9743
9744
|
{
|
|
9744
|
-
...
|
|
9745
|
-
ref:
|
|
9746
|
-
className: U("proton-Popover",
|
|
9747
|
-
style: {
|
|
9748
|
-
"data-testid":
|
|
9745
|
+
...f,
|
|
9746
|
+
ref: a,
|
|
9747
|
+
className: U("proton-Popover", u),
|
|
9748
|
+
style: { ...g, ...f.style },
|
|
9749
|
+
"data-testid": i["data-testid"] || void 0,
|
|
9750
|
+
"data-entering": l ? "" : void 0,
|
|
9749
9751
|
children: [
|
|
9750
9752
|
/* @__PURE__ */ b.jsx(Vf, { onDismiss: e.close }),
|
|
9751
9753
|
n && /* @__PURE__ */ b.jsxs(
|
|
9752
9754
|
"svg",
|
|
9753
9755
|
{
|
|
9754
|
-
...
|
|
9756
|
+
...h,
|
|
9755
9757
|
className: "arrow",
|
|
9756
|
-
"data-placement":
|
|
9758
|
+
"data-placement": $,
|
|
9757
9759
|
viewBox: "0 0 12 12",
|
|
9758
9760
|
children: [
|
|
9759
9761
|
/* @__PURE__ */ b.jsx("title", { children: "arrow" }),
|
|
@@ -11175,11 +11177,13 @@ function Eh({
|
|
|
11175
11177
|
f.isOpen && /* @__PURE__ */ b.jsx("div", { className: "proton-Select__popover", children: /* @__PURE__ */ b.jsx(
|
|
11176
11178
|
il,
|
|
11177
11179
|
{
|
|
11180
|
+
arrow: !1,
|
|
11178
11181
|
state: f,
|
|
11179
11182
|
triggerRef: p,
|
|
11180
11183
|
popoverRef: h,
|
|
11181
11184
|
placement: "bottom start",
|
|
11182
11185
|
"data-testid": "select-popover",
|
|
11186
|
+
isEntering: f.isOpen,
|
|
11183
11187
|
children: /* @__PURE__ */ b.jsx(_r, { ...S, state: f })
|
|
11184
11188
|
}
|
|
11185
11189
|
) })
|