@auth0/quantum-product 2.9.5 → 2.10.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 (42) hide show
  1. package/chip/chip.js +1 -1
  2. package/date-picker/date-picker-popover.js +33 -17
  3. package/date-picker/date-picker-state.d.ts +1 -1
  4. package/date-picker/date-picker-types.d.ts +2 -0
  5. package/date-picker/date-picker-utils.d.ts +1 -0
  6. package/date-picker/date-picker-utils.js +5 -4
  7. package/date-picker/date-picker.js +32 -6
  8. package/esm/chip/chip.js +1 -1
  9. package/esm/date-picker/date-picker-popover.js +34 -18
  10. package/esm/date-picker/date-picker-utils.js +4 -3
  11. package/esm/date-picker/date-picker.js +32 -6
  12. package/esm/floating-bar/floating-bar-actions.js +34 -0
  13. package/esm/floating-bar/floating-bar-context.js +13 -0
  14. package/esm/floating-bar/floating-bar-description.js +24 -0
  15. package/esm/floating-bar/floating-bar-icon.js +32 -0
  16. package/esm/floating-bar/floating-bar-scroll.js +68 -0
  17. package/esm/floating-bar/floating-bar.js +206 -0
  18. package/esm/floating-bar/index.js +6 -0
  19. package/esm/index.js +1 -0
  20. package/esm/panel/panel/panel.js +155 -8
  21. package/esm/panel/panel-context.js +1 -0
  22. package/floating-bar/floating-bar-actions.d.ts +12 -0
  23. package/floating-bar/floating-bar-actions.js +70 -0
  24. package/floating-bar/floating-bar-context.d.ts +11 -0
  25. package/floating-bar/floating-bar-context.js +52 -0
  26. package/floating-bar/floating-bar-description.d.ts +12 -0
  27. package/floating-bar/floating-bar-description.js +60 -0
  28. package/floating-bar/floating-bar-icon.d.ts +12 -0
  29. package/floating-bar/floating-bar-icon.js +68 -0
  30. package/floating-bar/floating-bar-scroll.d.ts +11 -0
  31. package/floating-bar/floating-bar-scroll.js +104 -0
  32. package/floating-bar/floating-bar.d.ts +17 -0
  33. package/floating-bar/floating-bar.js +242 -0
  34. package/floating-bar/index.d.ts +12 -0
  35. package/floating-bar/index.js +17 -0
  36. package/index.d.ts +1 -0
  37. package/index.js +1 -0
  38. package/package.json +2 -2
  39. package/panel/panel/panel.d.ts +21 -3
  40. package/panel/panel/panel.js +155 -8
  41. package/panel/panel-context.d.ts +2 -0
  42. package/panel/panel-context.js +1 -0
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import { IStyledComponentProps } from '../styled';
3
+ export declare const floatingBarDescriptionComponentName = "QuantumFloatingBarDescription";
4
+ export type IFloatingBarDescriptionProps = IStyledComponentProps<{
5
+ props: {
6
+ children?: React.ReactNode;
7
+ };
8
+ defaultComponent: 'div';
9
+ }>;
10
+ export declare const FloatingBarDescription: React.ForwardRefExoticComponent<{
11
+ children?: React.ReactNode;
12
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref" | "children"> & import("../styled").IStyledCommonProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
46
+ Object.defineProperty(exports, "__esModule", { value: true });
47
+ exports.FloatingBarDescription = exports.floatingBarDescriptionComponentName = void 0;
48
+ var React = __importStar(require("react"));
49
+ var styled_1 = require("../styled");
50
+ exports.floatingBarDescriptionComponentName = 'QuantumFloatingBarDescription';
51
+ var Root = (0, styled_1.styled)('div', {
52
+ name: exports.floatingBarDescriptionComponentName,
53
+ slot: 'Root',
54
+ })(function (_a) {
55
+ var theme = _a.theme;
56
+ return (__assign(__assign({}, theme.typography.body2), { color: theme.tokens.color_fg_default, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', flex: 1, minWidth: 0, padding: theme.spacing(0, 0.5) }));
57
+ });
58
+ exports.FloatingBarDescription = React.forwardRef(function FloatingBarDescription(props, ref) {
59
+ return React.createElement(Root, __assign({ ref: ref }, props));
60
+ });
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import { IStyledComponentProps } from '../styled';
3
+ export declare const floatingBarIconComponentName = "QuantumFloatingBarIcon";
4
+ export type IFloatingBarIconProps = IStyledComponentProps<{
5
+ props: {
6
+ children?: React.ReactNode;
7
+ };
8
+ defaultComponent: 'div';
9
+ }>;
10
+ export declare const FloatingBarIcon: React.ForwardRefExoticComponent<{
11
+ children?: React.ReactNode;
12
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref" | "children"> & import("../styled").IStyledCommonProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
46
+ Object.defineProperty(exports, "__esModule", { value: true });
47
+ exports.FloatingBarIcon = exports.floatingBarIconComponentName = void 0;
48
+ var React = __importStar(require("react"));
49
+ var styled_1 = require("../styled");
50
+ exports.floatingBarIconComponentName = 'QuantumFloatingBarIcon';
51
+ var Root = (0, styled_1.styled)('div', {
52
+ name: exports.floatingBarIconComponentName,
53
+ slot: 'Root',
54
+ })(function (_a) {
55
+ var theme = _a.theme;
56
+ return ({
57
+ display: 'flex',
58
+ alignItems: 'center',
59
+ justifyContent: 'center',
60
+ color: theme.palette.text.secondary,
61
+ flexShrink: 0,
62
+ height: 24,
63
+ width: 24,
64
+ });
65
+ });
66
+ exports.FloatingBarIcon = React.forwardRef(function FloatingBarIcon(props, ref) {
67
+ return React.createElement(Root, __assign({ ref: ref }, props));
68
+ });
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ import { IStyledComponentProps } from '../styled';
3
+ export declare const floatingBarScrollComponentName = "QuantumFloatingBarScroll";
4
+ export interface IFloatingBarScrollOwnerState {
5
+ variant?: 'default' | 'compact' | 'dots';
6
+ }
7
+ export type IFloatingBarScrollProps = IStyledComponentProps<{
8
+ props: IFloatingBarScrollOwnerState;
9
+ defaultComponent: 'div';
10
+ }>;
11
+ export declare const FloatingBarScroll: React.ForwardRefExoticComponent<IFloatingBarScrollOwnerState & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref" | "variant"> & import("../styled").IStyledCommonProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
46
+ var __rest = (this && this.__rest) || function (s, e) {
47
+ var t = {};
48
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
49
+ t[p] = s[p];
50
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
51
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
52
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
53
+ t[p[i]] = s[p[i]];
54
+ }
55
+ return t;
56
+ };
57
+ Object.defineProperty(exports, "__esModule", { value: true });
58
+ exports.FloatingBarScroll = exports.floatingBarScrollComponentName = void 0;
59
+ var React = __importStar(require("react"));
60
+ var styled_1 = require("../styled");
61
+ var floating_bar_context_1 = require("./floating-bar-context");
62
+ exports.floatingBarScrollComponentName = 'QuantumFloatingBarScroll';
63
+ var Root = (0, styled_1.styled)('div', {
64
+ name: exports.floatingBarScrollComponentName,
65
+ slot: 'Root',
66
+ })(function (_a) {
67
+ var ownerState = _a.ownerState;
68
+ return ({
69
+ display: 'flex',
70
+ alignItems: 'center',
71
+ justifyContent: 'center',
72
+ flexShrink: 0,
73
+ width: ownerState.variant === 'compact' ? 16 : 20,
74
+ height: ownerState.variant === 'compact' ? 16 : 20,
75
+ });
76
+ });
77
+ exports.FloatingBarScroll = React.forwardRef(function FloatingBarScroll(inProps, ref) {
78
+ var scrollProgress = (0, floating_bar_context_1.useFloatingBarScrollProgress)();
79
+ var _a = inProps.variant, variant = _a === void 0 ? 'default' : _a, other = __rest(inProps, ["variant"]);
80
+ var ownerState = {
81
+ variant: variant,
82
+ };
83
+ var size = variant === 'compact' ? 16 : 20;
84
+ var strokeWidth = 2;
85
+ var radius = (size - strokeWidth) / 2;
86
+ var circumference = 2 * Math.PI * radius;
87
+ var progressOffset = circumference - (scrollProgress / 100) * circumference;
88
+ var dottedStrokeDasharray = '0 3.75';
89
+ var ringDasharray = variant === 'dots' ? dottedStrokeDasharray : "".concat(circumference);
90
+ var circleProps = {
91
+ cx: size / 2,
92
+ cy: size / 2,
93
+ r: radius,
94
+ fill: 'none',
95
+ stroke: 'currentColor',
96
+ strokeWidth: strokeWidth,
97
+ };
98
+ return (React.createElement(Root, __assign({ ref: ref, ownerState: ownerState }, other),
99
+ React.createElement("svg", { width: size, height: size, style: { transform: 'rotate(-90deg)' } },
100
+ React.createElement("circle", __assign({}, circleProps, { opacity: 0.2, strokeDasharray: ringDasharray, strokeLinecap: "round" })),
101
+ React.createElement("circle", __assign({}, circleProps, { strokeDasharray: circumference, strokeDashoffset: progressOffset, strokeLinecap: "round", style: {
102
+ transition: 'stroke-dashoffset 150ms ease-out',
103
+ } })))));
104
+ });
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ import { IStyledComponentProps } from '../styled';
3
+ export declare const floatingBarComponentName = "QuantumFloatingBar";
4
+ export interface IFloatingBarOwnerState {
5
+ trackScroll?: boolean;
6
+ containerRef?: React.RefObject<HTMLElement>;
7
+ open?: boolean;
8
+ side?: 'top' | 'bottom' | 'left' | 'right';
9
+ orientation?: 'horizontal' | 'vertical';
10
+ size?: 'small' | 'medium' | 'large';
11
+ exiting?: boolean;
12
+ }
13
+ export type IFloatingBarProps = IStyledComponentProps<{
14
+ props: IFloatingBarOwnerState;
15
+ defaultComponent: 'div';
16
+ }>;
17
+ export declare const FloatingBar: React.ForwardRefExoticComponent<IFloatingBarOwnerState & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref" | keyof IFloatingBarOwnerState> & import("../styled").IStyledCommonProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,242 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
46
+ var __rest = (this && this.__rest) || function (s, e) {
47
+ var t = {};
48
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
49
+ t[p] = s[p];
50
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
51
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
52
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
53
+ t[p[i]] = s[p[i]];
54
+ }
55
+ return t;
56
+ };
57
+ var __read = (this && this.__read) || function (o, n) {
58
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
59
+ if (!m) return o;
60
+ var i = m.call(o), r, ar = [], e;
61
+ try {
62
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
63
+ }
64
+ catch (error) { e = { error: error }; }
65
+ finally {
66
+ try {
67
+ if (r && !r.done && (m = i["return"])) m.call(i);
68
+ }
69
+ finally { if (e) throw e.error; }
70
+ }
71
+ return ar;
72
+ };
73
+ Object.defineProperty(exports, "__esModule", { value: true });
74
+ exports.FloatingBar = exports.floatingBarComponentName = void 0;
75
+ var React = __importStar(require("react"));
76
+ var react_1 = require("react");
77
+ var styled_1 = require("../styled");
78
+ var floating_bar_context_1 = require("./floating-bar-context");
79
+ exports.floatingBarComponentName = 'QuantumFloatingBar';
80
+ var sizeMap = {
81
+ small: 256,
82
+ medium: 384,
83
+ large: 512,
84
+ };
85
+ var ENTER_TRANSITION_DURATION_MS = 300;
86
+ var EXIT_TRANSITION_DURATION_MS = 150;
87
+ var EASING = 'cubic-bezier(0.19, 1, 0.22, 1)';
88
+ var TRANSFORM_SCALE = 0.95;
89
+ var TRANSFORM_DISTANCE_PX = 20;
90
+ var SCROLL_PROGRESS_STEP = 0.5;
91
+ var quantizeScrollProgress = function (progress) {
92
+ var clampedProgress = Math.min(100, Math.max(0, progress));
93
+ var snapThreshold = SCROLL_PROGRESS_STEP / 2;
94
+ if (clampedProgress <= snapThreshold) {
95
+ return 0;
96
+ }
97
+ if (clampedProgress >= 100 - snapThreshold) {
98
+ return 100;
99
+ }
100
+ var quantizedProgress = Math.round(clampedProgress / SCROLL_PROGRESS_STEP) * SCROLL_PROGRESS_STEP;
101
+ return Number(quantizedProgress.toFixed(2));
102
+ };
103
+ var resolveSide = function (orientation, side) {
104
+ if (orientation === 'vertical') {
105
+ return side === 'left' || side === 'right' ? side : 'right';
106
+ }
107
+ return side === 'top' || side === 'bottom' ? side : 'bottom';
108
+ };
109
+ var getTransforms = function (orientation, resolvedSide) {
110
+ if (orientation === 'vertical') {
111
+ return {
112
+ restingTransform: 'translateY(-50%) scale(1)',
113
+ exitingTransform: resolvedSide === 'left'
114
+ ? "translateY(-50%) translateX(-".concat(TRANSFORM_DISTANCE_PX, "px) scale(").concat(TRANSFORM_SCALE, ")")
115
+ : "translateY(-50%) translateX(".concat(TRANSFORM_DISTANCE_PX, "px) scale(").concat(TRANSFORM_SCALE, ")"),
116
+ };
117
+ }
118
+ return {
119
+ restingTransform: 'translateX(-50%) scale(1)',
120
+ exitingTransform: resolvedSide === 'top'
121
+ ? "translateX(-50%) translateY(-".concat(TRANSFORM_DISTANCE_PX, "px) scale(").concat(TRANSFORM_SCALE, ")")
122
+ : "translateX(-50%) translateY(".concat(TRANSFORM_DISTANCE_PX, "px) scale(").concat(TRANSFORM_SCALE, ")"),
123
+ };
124
+ };
125
+ var Root = (0, styled_1.styled)('div', {
126
+ name: exports.floatingBarComponentName,
127
+ slot: 'Root',
128
+ shouldForwardProp: function (prop) { return (0, styled_1.rootShouldForwardProp)(prop) && prop !== 'ownerState'; },
129
+ })(function (_a) {
130
+ var _b;
131
+ var theme = _a.theme, ownerState = _a.ownerState;
132
+ var orientation = ownerState.orientation || 'horizontal';
133
+ var resolvedSide = resolveSide(orientation, ownerState.side);
134
+ var size = ownerState.size || 'medium';
135
+ var _c = getTransforms(orientation, resolvedSide), restingTransform = _c.restingTransform, exitingTransform = _c.exitingTransform;
136
+ var isTransitioning = !!ownerState.exiting || !!ownerState.entering;
137
+ return __assign(__assign({ position: 'fixed' }, (orientation === 'vertical' ? { top: '50%' } : { left: '50%' })), (_b = {}, _b[resolvedSide] = theme.spacing(3), _b.transform = isTransitioning ? exitingTransform : restingTransform, _b.opacity = isTransitioning ? 0 : 1, _b.transition = ownerState.exiting
138
+ ? "opacity ".concat(EXIT_TRANSITION_DURATION_MS, "ms ").concat(EASING, ", transform ").concat(EXIT_TRANSITION_DURATION_MS, "ms ").concat(EASING)
139
+ : "opacity ".concat(ENTER_TRANSITION_DURATION_MS, "ms ").concat(EASING, ", transform ").concat(ENTER_TRANSITION_DURATION_MS, "ms ").concat(EASING), _b.zIndex = theme.zIndex.fab, _b.display = 'flex', _b.flexDirection = orientation === 'vertical' ? 'column' : 'row', _b.alignItems = orientation === 'vertical' ? 'stretch' : 'center', _b.gap = orientation === 'vertical' ? theme.spacing(0.75) : theme.spacing(1), _b.padding = theme.spacing(1.125), _b.minWidth = sizeMap[size], _b.maxWidth = "min(".concat(sizeMap[size], "px, calc(100vw - ").concat(theme.spacing(4), "))"), _b.boxSizing = 'border-box', _b.backgroundColor = theme.palette.background.paper, _b.border = "1px solid ".concat(theme.tokens.color_border_default), _b.borderRadius = theme.spacing(1.25), _b.overflow = 'hidden', _b.boxShadow = theme.shadows[16], _b));
140
+ });
141
+ exports.FloatingBar = React.forwardRef(function FloatingBar(inProps, ref) {
142
+ var _a = inProps.trackScroll, trackScroll = _a === void 0 ? false : _a, containerRef = inProps.containerRef, _b = inProps.open, open = _b === void 0 ? true : _b, side = inProps.side, _c = inProps.orientation, orientation = _c === void 0 ? 'horizontal' : _c, _d = inProps.size, size = _d === void 0 ? 'medium' : _d, children = inProps.children, onTransitionEnd = inProps.onTransitionEnd, other = __rest(inProps, ["trackScroll", "containerRef", "open", "side", "orientation", "size", "children", "onTransitionEnd"]);
143
+ var _e = __read((0, react_1.useState)(0), 2), scrollProgress = _e[0], setScrollProgress = _e[1];
144
+ var _f = __read((0, react_1.useState)(open), 2), isMounted = _f[0], setIsMounted = _f[1];
145
+ var _g = __read((0, react_1.useState)(false), 2), isExiting = _g[0], setIsExiting = _g[1];
146
+ var _h = __read((0, react_1.useState)(open), 2), isEntering = _h[0], setIsEntering = _h[1];
147
+ var scrollFrameIdRef = (0, react_1.useRef)(null);
148
+ var lastScrollProgressRef = (0, react_1.useRef)(0);
149
+ var containerElement = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current;
150
+ (0, react_1.useEffect)(function () {
151
+ if (open) {
152
+ setIsMounted(true);
153
+ setIsExiting(false);
154
+ setIsEntering(true);
155
+ return;
156
+ }
157
+ if (!isMounted) {
158
+ return;
159
+ }
160
+ setIsEntering(false);
161
+ setIsExiting(true);
162
+ }, [open, isMounted]);
163
+ (0, react_1.useEffect)(function () {
164
+ if (!(isMounted && isEntering && !isExiting)) {
165
+ return;
166
+ }
167
+ var frameId = window.requestAnimationFrame(function () {
168
+ setIsEntering(false);
169
+ });
170
+ return function () {
171
+ window.cancelAnimationFrame(frameId);
172
+ };
173
+ }, [isMounted, isEntering, isExiting]);
174
+ (0, react_1.useEffect)(function () {
175
+ if (!(trackScroll && open))
176
+ return;
177
+ var target = containerElement || window;
178
+ var updateScrollProgress = function () {
179
+ scrollFrameIdRef.current = null;
180
+ var scrollTop;
181
+ var scrollHeight;
182
+ if (target === window) {
183
+ scrollTop = window.scrollY;
184
+ scrollHeight = document.documentElement.scrollHeight - window.innerHeight;
185
+ }
186
+ else if (target instanceof HTMLElement) {
187
+ scrollTop = target.scrollTop;
188
+ scrollHeight = target.scrollHeight - target.clientHeight;
189
+ }
190
+ else {
191
+ return;
192
+ }
193
+ var progress = scrollHeight > 0 ? (scrollTop / scrollHeight) * 100 : 0;
194
+ var quantizedProgress = quantizeScrollProgress(progress);
195
+ if (quantizedProgress === lastScrollProgressRef.current) {
196
+ return;
197
+ }
198
+ lastScrollProgressRef.current = quantizedProgress;
199
+ setScrollProgress(quantizedProgress);
200
+ };
201
+ var handleScroll = function () {
202
+ if (scrollFrameIdRef.current !== null) {
203
+ return;
204
+ }
205
+ scrollFrameIdRef.current = window.requestAnimationFrame(updateScrollProgress);
206
+ };
207
+ target.addEventListener('scroll', handleScroll, { passive: true });
208
+ handleScroll();
209
+ return function () {
210
+ target.removeEventListener('scroll', handleScroll);
211
+ if (scrollFrameIdRef.current !== null) {
212
+ window.cancelAnimationFrame(scrollFrameIdRef.current);
213
+ scrollFrameIdRef.current = null;
214
+ }
215
+ };
216
+ }, [trackScroll, open, containerElement]);
217
+ if (!isMounted) {
218
+ return null;
219
+ }
220
+ var handleTransitionEnd = function (event) {
221
+ onTransitionEnd === null || onTransitionEnd === void 0 ? void 0 : onTransitionEnd(event);
222
+ if (!isExiting) {
223
+ return;
224
+ }
225
+ if (event.target !== event.currentTarget || event.propertyName !== 'opacity') {
226
+ return;
227
+ }
228
+ setIsMounted(false);
229
+ setIsExiting(false);
230
+ setIsEntering(false);
231
+ };
232
+ var ownerState = {
233
+ side: side,
234
+ orientation: orientation,
235
+ size: size,
236
+ exiting: isExiting,
237
+ entering: isEntering,
238
+ };
239
+ return (React.createElement(floating_bar_context_1.FloatingBarOrientationContext.Provider, { value: orientation },
240
+ React.createElement(floating_bar_context_1.FloatingBarScrollProgressContext.Provider, { value: scrollProgress },
241
+ React.createElement(Root, __assign({ ref: ref, ownerState: ownerState, onTransitionEnd: handleTransitionEnd }, other), children))));
242
+ });
@@ -0,0 +1,12 @@
1
+ export { FloatingBar } from './floating-bar';
2
+ export type { IFloatingBarOwnerState, IFloatingBarProps } from './floating-bar';
3
+ export { FloatingBarScroll } from './floating-bar-scroll';
4
+ export type { IFloatingBarScrollOwnerState, IFloatingBarScrollProps } from './floating-bar-scroll';
5
+ export { FloatingBarIcon } from './floating-bar-icon';
6
+ export type { IFloatingBarIconProps } from './floating-bar-icon';
7
+ export { FloatingBarDescription } from './floating-bar-description';
8
+ export type { IFloatingBarDescriptionProps } from './floating-bar-description';
9
+ export { FloatingBarActions } from './floating-bar-actions';
10
+ export type { IFloatingBarActionsProps } from './floating-bar-actions';
11
+ export { useFloatingBarContext, useFloatingBarOrientation, useFloatingBarScrollProgress } from './floating-bar-context';
12
+ export type { IFloatingBarContextValue } from './floating-bar-context';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useFloatingBarScrollProgress = exports.useFloatingBarOrientation = exports.useFloatingBarContext = exports.FloatingBarActions = exports.FloatingBarDescription = exports.FloatingBarIcon = exports.FloatingBarScroll = exports.FloatingBar = void 0;
4
+ var floating_bar_1 = require("./floating-bar");
5
+ Object.defineProperty(exports, "FloatingBar", { enumerable: true, get: function () { return floating_bar_1.FloatingBar; } });
6
+ var floating_bar_scroll_1 = require("./floating-bar-scroll");
7
+ Object.defineProperty(exports, "FloatingBarScroll", { enumerable: true, get: function () { return floating_bar_scroll_1.FloatingBarScroll; } });
8
+ var floating_bar_icon_1 = require("./floating-bar-icon");
9
+ Object.defineProperty(exports, "FloatingBarIcon", { enumerable: true, get: function () { return floating_bar_icon_1.FloatingBarIcon; } });
10
+ var floating_bar_description_1 = require("./floating-bar-description");
11
+ Object.defineProperty(exports, "FloatingBarDescription", { enumerable: true, get: function () { return floating_bar_description_1.FloatingBarDescription; } });
12
+ var floating_bar_actions_1 = require("./floating-bar-actions");
13
+ Object.defineProperty(exports, "FloatingBarActions", { enumerable: true, get: function () { return floating_bar_actions_1.FloatingBarActions; } });
14
+ var floating_bar_context_1 = require("./floating-bar-context");
15
+ Object.defineProperty(exports, "useFloatingBarContext", { enumerable: true, get: function () { return floating_bar_context_1.useFloatingBarContext; } });
16
+ Object.defineProperty(exports, "useFloatingBarOrientation", { enumerable: true, get: function () { return floating_bar_context_1.useFloatingBarOrientation; } });
17
+ Object.defineProperty(exports, "useFloatingBarScrollProgress", { enumerable: true, get: function () { return floating_bar_context_1.useFloatingBarScrollProgress; } });
package/index.d.ts CHANGED
@@ -34,6 +34,7 @@ export * from './dropdown-menu';
34
34
  export * from './empty-state';
35
35
  export * from './expansion-panel';
36
36
  export * from './field-set';
37
+ export * from './floating-bar';
37
38
  export * from './form';
38
39
  export * from './gallery-layout';
39
40
  export * from './icon';
package/index.js CHANGED
@@ -50,6 +50,7 @@ __exportStar(require("./dropdown-menu"), exports);
50
50
  __exportStar(require("./empty-state"), exports);
51
51
  __exportStar(require("./expansion-panel"), exports);
52
52
  __exportStar(require("./field-set"), exports);
53
+ __exportStar(require("./floating-bar"), exports);
53
54
  __exportStar(require("./form"), exports);
54
55
  __exportStar(require("./gallery-layout"), exports);
55
56
  __exportStar(require("./icon"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auth0/quantum-product",
3
- "version": "2.9.5",
3
+ "version": "2.10.0",
4
4
  "sideEffects": false,
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
@@ -25,7 +25,7 @@
25
25
  "react-dom": "*"
26
26
  },
27
27
  "scripts": {
28
- "artifactory": "cd ./build && npm publish",
28
+ "artifactory": "cd ./build && npm publish --access public",
29
29
  "build-storybook": "storybook build",
30
30
  "build": "yarn clean && yarn build:cjs && yarn build:esm && yarn copy:files",
31
31
  "build:cjs": "node --max-old-space-size=8192 ../../node_modules/.bin/tsc --project ./tsconfig.publish.json",
@@ -1,12 +1,14 @@
1
1
  import * as React from 'react';
2
- import { IStyledComponentProps } from '../../styled';
3
- import { PanelClasses } from './panel-classes';
4
2
  import { IIconButtonProps } from '../../icon-button';
3
+ import { IStyledComponentProps } from '../../styled';
5
4
  import { IPanelContextValue } from '../panel-context';
6
5
  import { IPanelHeaderProps } from '../panel-header';
6
+ import { PanelClasses } from './panel-classes';
7
7
  export type IPanelOwnerState = Pick<IPanelContextValue, 'size' | 'variant' | 'placement' | 'isOpen' | 'isFixed'> & {
8
8
  /** Sets top offset for panel. Defaults to appbar for fixed panels. All others default to 0. */
9
9
  offsetTop?: 'appbar' | number;
10
+ /** Active width of panel. Defaults to width from size. */
11
+ width?: number;
10
12
  };
11
13
  export type IPanelProps = IStyledComponentProps<{
12
14
  props: Partial<IPanelOwnerState> & {
@@ -18,6 +20,14 @@ export type IPanelProps = IStyledComponentProps<{
18
20
  onClose?(event: React.MouseEvent<HTMLButtonElement>, reason: 'closeButtonClick'): void;
19
21
  /** convenience prop for rendering the label for close button with a Panel component */
20
22
  closeButtonLabel?: string;
23
+ /** Allows resizing the panel width. */
24
+ resizable?: boolean;
25
+ /** Sets the maximum width of the panel when resizing. */
26
+ maxWidth?: number;
27
+ /** Sets the minimum width of the panel when resizing. */
28
+ minWidth?: number;
29
+ /** Show explicit drag handle */
30
+ showDragHandle?: boolean;
21
31
  classes?: Partial<PanelClasses>;
22
32
  closeIconButtonProps?: Partial<IIconButtonProps>;
23
33
  PanelHeaderProps?: Partial<IPanelHeaderProps>;
@@ -33,7 +43,15 @@ export declare const Panel: React.ForwardRefExoticComponent<Partial<IPanelOwnerS
33
43
  onClose?(event: React.MouseEvent<HTMLButtonElement>, reason: "closeButtonClick"): void;
34
44
  /** convenience prop for rendering the label for close button with a Panel component */
35
45
  closeButtonLabel?: string;
46
+ /** Allows resizing the panel width. */
47
+ resizable?: boolean;
48
+ /** Sets the maximum width of the panel when resizing. */
49
+ maxWidth?: number;
50
+ /** Sets the minimum width of the panel when resizing. */
51
+ minWidth?: number;
52
+ /** Show explicit drag handle */
53
+ showDragHandle?: boolean;
36
54
  classes?: Partial<PanelClasses>;
37
55
  closeIconButtonProps?: Partial<IIconButtonProps>;
38
56
  PanelHeaderProps?: Partial<IPanelHeaderProps>;
39
- } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "title" | "ref" | "size" | "children" | "onClose" | "classes" | "variant" | "placement" | "closeButtonLabel" | "isOpen" | "isFixed" | "offsetTop" | "closeIconButtonProps" | "PanelHeaderProps"> & import("../../styled").IStyledCommonProps & React.RefAttributes<HTMLDivElement>>;
57
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "title" | "ref" | "size" | "maxWidth" | "minWidth" | "width" | "children" | "onClose" | "classes" | "variant" | "placement" | "closeButtonLabel" | "resizable" | "isOpen" | "isFixed" | "offsetTop" | "showDragHandle" | "closeIconButtonProps" | "PanelHeaderProps"> & import("../../styled").IStyledCommonProps & React.RefAttributes<HTMLDivElement>>;