se-design 1.0.77 → 1.0.78-dev1
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/assets/style.css +1 -1
- package/dist/components/CustomModal/index.d.ts +29 -0
- package/dist/index12.js +36 -34
- package/dist/index12.js.map +1 -1
- package/dist/index13.js +11 -11
- package/dist/index13.js.map +1 -1
- package/dist/index19.js +154 -154
- package/dist/index19.js.map +1 -1
- package/dist/index197.js +5 -5
- package/dist/index201.js +1 -1
- package/dist/{index206.js → index208.js} +1 -1
- package/dist/{index206.js.map → index208.js.map} +1 -1
- package/dist/{index207.js → index209.js} +1 -1
- package/dist/{index207.js.map → index209.js.map} +1 -1
- package/dist/{index215.js → index217.js} +1 -1
- package/dist/{index215.js.map → index217.js.map} +1 -1
- package/dist/{index223.js → index225.js} +1 -1
- package/dist/{index223.js.map → index225.js.map} +1 -1
- package/dist/{index226.js → index228.js} +1 -1
- package/dist/{index226.js.map → index228.js.map} +1 -1
- package/dist/{index235.js → index237.js} +1 -1
- package/dist/{index235.js.map → index237.js.map} +1 -1
- package/dist/index238.js +3 -18
- package/dist/index238.js.map +1 -1
- package/dist/index240.js +18 -9
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +9 -4
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +10 -170
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +5 -11
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +170 -6
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +11 -6
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +5 -37
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +6 -2
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +37 -7
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +2 -327
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +7 -49
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +327 -2
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +45 -71
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +2 -93
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +72 -48
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +92 -7
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +51 -4
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +7 -51
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +5 -2
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +52 -2
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +5 -0
- package/dist/index260.js.map +1 -0
- package/dist/index261.js +5 -0
- package/dist/index261.js.map +1 -0
- package/dist/index28.js +2 -2
- package/dist/index40.js +1 -1
- package/dist/index46.js +1 -1
- package/dist/index49.js +16 -14
- package/dist/index49.js.map +1 -1
- package/dist/index51.js +17 -17
- package/dist/index51.js.map +1 -1
- package/dist/index53.js +1 -1
- package/dist/index63.js +1 -1
- package/dist/index76.js +1 -1
- package/package.json +1 -1
- package/dist/index236.js +0 -7
- package/dist/index236.js.map +0 -1
- package/dist/index239.js +0 -13
- package/dist/index239.js.map +0 -1
package/dist/index259.js
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
|
-
|
|
1
|
+
import { __require as E } from "./index257.js";
|
|
2
|
+
import { __require as _ } from "./index258.js";
|
|
3
|
+
var f, v;
|
|
4
|
+
function P() {
|
|
5
|
+
if (v) return f;
|
|
6
|
+
v = 1;
|
|
7
|
+
var o = function() {
|
|
8
|
+
};
|
|
9
|
+
if (process.env.NODE_ENV !== "production") {
|
|
10
|
+
var y = E(), t = {}, d = _();
|
|
11
|
+
o = function(n) {
|
|
12
|
+
var a = "Warning: " + n;
|
|
13
|
+
typeof console < "u" && console.error(a);
|
|
14
|
+
try {
|
|
15
|
+
throw new Error(a);
|
|
16
|
+
} catch {
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function u(n, a, i, s, c) {
|
|
21
|
+
if (process.env.NODE_ENV !== "production") {
|
|
22
|
+
for (var e in n)
|
|
23
|
+
if (d(n, e)) {
|
|
24
|
+
var r;
|
|
25
|
+
try {
|
|
26
|
+
if (typeof n[e] != "function") {
|
|
27
|
+
var h = Error(
|
|
28
|
+
(s || "React class") + ": " + i + " type `" + e + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof n[e] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
29
|
+
);
|
|
30
|
+
throw h.name = "Invariant Violation", h;
|
|
31
|
+
}
|
|
32
|
+
r = n[e](a, e, s, i, null, y);
|
|
33
|
+
} catch (l) {
|
|
34
|
+
r = l;
|
|
35
|
+
}
|
|
36
|
+
if (r && !(r instanceof Error) && o(
|
|
37
|
+
(s || "React class") + ": type specification of " + i + " `" + e + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof r + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
38
|
+
), r instanceof Error && !(r.message in t)) {
|
|
39
|
+
t[r.message] = !0;
|
|
40
|
+
var p = c ? c() : "";
|
|
41
|
+
o(
|
|
42
|
+
"Failed " + i + " type: " + r.message + (p ?? "")
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return u.resetWarningCache = function() {
|
|
49
|
+
process.env.NODE_ENV !== "production" && (t = {});
|
|
50
|
+
}, f = u, f;
|
|
51
|
+
}
|
|
2
52
|
export {
|
|
3
|
-
|
|
53
|
+
P as __require
|
|
4
54
|
};
|
|
5
55
|
//# sourceMappingURL=index259.js.map
|
package/dist/index259.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index259.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"index259.js","sources":["../node_modules/prop-types/checkPropTypes.js"],"sourcesContent":["/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n var has = require('./lib/has');\n\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) { /**/ }\n };\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error(\n (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +\n 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'\n );\n err.name = 'Invariant Violation';\n throw err;\n }\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n if (error && !(error instanceof Error)) {\n printWarning(\n (componentName || 'React class') + ': type specification of ' +\n location + ' `' + typeSpecName + '` is invalid; the type checker ' +\n 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +\n 'You may have forgotten to pass an argument to the type checker ' +\n 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +\n 'shape all require an argument).'\n );\n }\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n printWarning(\n 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')\n );\n }\n }\n }\n }\n}\n\n/**\n * Resets warning cache when testing.\n *\n * @private\n */\ncheckPropTypes.resetWarningCache = function() {\n if (process.env.NODE_ENV !== 'production') {\n loggedTypeFailures = {};\n }\n}\n\nmodule.exports = checkPropTypes;\n"],"names":["printWarning","ReactPropTypesSecret","require$$0","loggedTypeFailures","has","require$$1","text","message","checkPropTypes","typeSpecs","values","location","componentName","getStack","typeSpecName","error","err","ex","stack","checkPropTypes_1"],"mappings":";;;;;;AASA,MAAIA,IAAe,WAAW;AAAA,EAAA;AAE9B,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAIC,IAAuBC,EAAA,GACvBC,IAAqB,CAAA,GACrBC,IAAMC,EAAA;AAEV,IAAAL,IAAe,SAASM,GAAM;AAC5B,UAAIC,IAAU,cAAcD;AAC5B,MAAI,OAAO,UAAY,OACrB,QAAQ,MAAMC,CAAO;AAEvB,UAAI;AAIF,cAAM,IAAI,MAAMA,CAAO;AAAA,MAC7B,QAAgB;AAAA,MAAA;AAAA,IAChB;AAAA,EACA;AAaA,WAASC,EAAeC,GAAWC,GAAQC,GAAUC,GAAeC,GAAU;AAC5E,QAAI,QAAQ,IAAI,aAAa;AAC3B,eAASC,KAAgBL;AACvB,YAAIL,EAAIK,GAAWK,CAAY,GAAG;AAChC,cAAIC;AAIJ,cAAI;AAGF,gBAAI,OAAON,EAAUK,CAAY,KAAM,YAAY;AACjD,kBAAIE,IAAM;AAAA,iBACPJ,KAAiB,iBAAiB,OAAOD,IAAW,YAAYG,IAAe,+FACC,OAAOL,EAAUK,CAAY,IAAI;AAAA,cAEhI;AACY,oBAAAE,EAAI,OAAO,uBACLA;AAAA,YAClB;AACU,YAAAD,IAAQN,EAAUK,CAAY,EAAEJ,GAAQI,GAAcF,GAAeD,GAAU,MAAMV,CAAoB;AAAA,UACnH,SAAiBgB,GAAI;AACX,YAAAF,IAAQE;AAAA,UAClB;AAWQ,cAVIF,KAAS,EAAEA,aAAiB,UAC9Bf;AAAA,aACGY,KAAiB,iBAAiB,6BACnCD,IAAW,OAAOG,IAAe,6FAC6B,OAAOC,IAAQ;AAAA,UAIzF,GAEYA,aAAiB,SAAS,EAAEA,EAAM,WAAWZ,IAAqB;AAGpE,YAAAA,EAAmBY,EAAM,OAAO,IAAI;AAEpC,gBAAIG,IAAQL,IAAWA,EAAQ,IAAK;AAEpC,YAAAb;AAAA,cACE,YAAYW,IAAW,YAAYI,EAAM,WAAWG,KAAwB;AAAA,YACxF;AAAA,UACA;AAAA,QACA;AAAA;AAAA,EAGA;AAOA,SAAAV,EAAe,oBAAoB,WAAW;AAC5C,IAAI,QAAQ,IAAI,aAAa,iBAC3BL,IAAqB,CAAA;AAAA,EAEzB,GAEAgB,IAAiBX;;","x_google_ignoreList":[0]}
|
package/dist/index260.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index260.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index261.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index261.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index28.js
CHANGED
|
@@ -2,8 +2,8 @@ import i, { useMemo as D, useRef as j, useEffect as m } from "react";
|
|
|
2
2
|
import { Icon as M } from "./index6.js";
|
|
3
3
|
import { getA11yNameAttributes as $ } from "./index78.js";
|
|
4
4
|
import { useFocusTrap as k } from "./index72.js";
|
|
5
|
-
import { useDismissOnEscape as z } from "./
|
|
6
|
-
import { useFocusSentinel as T } from "./
|
|
5
|
+
import { useDismissOnEscape as z } from "./index208.js";
|
|
6
|
+
import { useFocusSentinel as T } from "./index209.js";
|
|
7
7
|
/* empty css */
|
|
8
8
|
function u() {
|
|
9
9
|
return u = Object.assign ? Object.assign.bind() : function(s) {
|
package/dist/index40.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import a, { useState as d, useRef as $, useEffect as r, useMemo as D } from "react";
|
|
2
2
|
import { Icon as g } from "./index6.js";
|
|
3
3
|
import { LabelChip as F } from "./index11.js";
|
|
4
|
-
import { debounce as L } from "./
|
|
4
|
+
import { debounce as L } from "./index217.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
function z(p) {
|
|
7
7
|
const {
|
package/dist/index46.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import t, { useState as h, useRef as f, useCallback as g, useEffect as _ } from "react";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import C from "./
|
|
3
|
+
import C from "./index225.js";
|
|
4
4
|
import { Icon as M } from "./index6.js";
|
|
5
5
|
import { useStableId as v } from "./index199.js";
|
|
6
6
|
import { getA11yNameAttributes as T } from "./index78.js";
|
package/dist/index49.js
CHANGED
|
@@ -8,6 +8,8 @@ import { MenuList as _ } from "./index18.js";
|
|
|
8
8
|
import "./index9.js";
|
|
9
9
|
/* empty css */
|
|
10
10
|
/* empty css */
|
|
11
|
+
/* empty css */
|
|
12
|
+
/* empty css */
|
|
11
13
|
import "react-dom";
|
|
12
14
|
import "./index17.js";
|
|
13
15
|
import { Popover as $ } from "./index19.js";
|
|
@@ -29,7 +31,7 @@ import { Popover as $ } from "./index19.js";
|
|
|
29
31
|
/* empty css */
|
|
30
32
|
/* empty css */
|
|
31
33
|
/* empty css */
|
|
32
|
-
import { TabButton as j } from "./
|
|
34
|
+
import { TabButton as j } from "./index228.js";
|
|
33
35
|
/* empty css */
|
|
34
36
|
/* empty css */
|
|
35
37
|
/* empty css */
|
|
@@ -40,16 +42,16 @@ import "./index60.js";
|
|
|
40
42
|
/* empty css */
|
|
41
43
|
import "./index64.js";
|
|
42
44
|
/* empty css */
|
|
43
|
-
function
|
|
44
|
-
return
|
|
45
|
+
function c() {
|
|
46
|
+
return c = Object.assign ? Object.assign.bind() : function(i) {
|
|
45
47
|
for (var o = 1; o < arguments.length; o++) {
|
|
46
48
|
var n = arguments[o];
|
|
47
49
|
for (var s in n) ({}).hasOwnProperty.call(n, s) && (i[s] = n[s]);
|
|
48
50
|
}
|
|
49
51
|
return i;
|
|
50
|
-
},
|
|
52
|
+
}, c.apply(null, arguments);
|
|
51
53
|
}
|
|
52
|
-
const
|
|
54
|
+
const Se = ({
|
|
53
55
|
defaultActiveNavigationItem: i,
|
|
54
56
|
navigationItems: o,
|
|
55
57
|
onNavigationItemChange: n,
|
|
@@ -82,7 +84,7 @@ const ke = ({
|
|
|
82
84
|
!r || r.disabled || (m(e), n?.(e));
|
|
83
85
|
}, g = f(() => o.map((e) => {
|
|
84
86
|
const r = e.id === l, a = r && e.panelHasFocusableContent === !1 ? 0 : void 0;
|
|
85
|
-
return /* @__PURE__ */ t.createElement("div",
|
|
87
|
+
return /* @__PURE__ */ t.createElement("div", c({
|
|
86
88
|
key: e.id
|
|
87
89
|
}, b(e.id), {
|
|
88
90
|
hidden: !r,
|
|
@@ -90,26 +92,26 @@ const ke = ({
|
|
|
90
92
|
className: `navigation-item-content ${r ? "block" : "hidden"}`
|
|
91
93
|
}), r && e?.renderNavigationItemContent?.(e));
|
|
92
94
|
}), [o, l, b]), B = o.find((e) => e.id === l);
|
|
93
|
-
return /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div",
|
|
95
|
+
return /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", c({
|
|
94
96
|
className: "se-design-navigation-bar flex items-center gap-4",
|
|
95
97
|
"data-automation-id": "navigation-bar-container"
|
|
96
98
|
}, F({
|
|
97
99
|
ariaLabel: E,
|
|
98
100
|
ariaLabelledBy: P
|
|
99
101
|
})), !s && o.map((e) => {
|
|
100
|
-
const r = l === e.id, a = e.disabled,
|
|
102
|
+
const r = l === e.id, a = e.disabled, p = T(e.id);
|
|
101
103
|
return /* @__PURE__ */ t.createElement(j, {
|
|
102
104
|
key: e.id,
|
|
103
|
-
ref:
|
|
104
|
-
tabIndex:
|
|
105
|
-
id:
|
|
105
|
+
ref: p.ref,
|
|
106
|
+
tabIndex: p.tabIndex,
|
|
107
|
+
id: p.id,
|
|
106
108
|
label: e.label,
|
|
107
109
|
isSelected: r,
|
|
108
110
|
isDisabled: a,
|
|
109
|
-
panelId:
|
|
111
|
+
panelId: p["aria-controls"],
|
|
110
112
|
onClick: () => u(e),
|
|
111
113
|
onFocus: () => {
|
|
112
|
-
|
|
114
|
+
p.onFocus(), x === "automatic" && !a && S(e.id);
|
|
113
115
|
},
|
|
114
116
|
onKeyDown: k,
|
|
115
117
|
className: `text-base ${a ? "text-[var(--color-gray-400)] cursor-not-allowed" : r ? "text-[var(--color-gray-900)] font-bold hover:cursor-pointer" : "text-[var(--color-gray-700)] font-normal hover:text-[var(--color-gray-900)] cursor-pointer"} focus-outline rounded-[6px]`,
|
|
@@ -145,6 +147,6 @@ const ke = ({
|
|
|
145
147
|
}, g));
|
|
146
148
|
};
|
|
147
149
|
export {
|
|
148
|
-
|
|
150
|
+
Se as NavigationBar
|
|
149
151
|
};
|
|
150
152
|
//# sourceMappingURL=index49.js.map
|
package/dist/index49.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index49.js","sources":["../src/components/NavigationBar/index.tsx"],"sourcesContent":["import React, { FC, ReactNode, useState,useMemo, useEffect } from 'react';\nimport { Popover, MenuList, Icon } from 'src/components';\nimport { TabButton } from './TabButton';\nimport { useTabsA11y } from '../../utils/a11y';\n\nexport interface NavigationItemProps {\n label: string;\n id: string;\n disabled?: boolean;\n panelHasFocusableContent?: boolean; // If false, the panel itself will be tabbable when active\n renderNavigationItemContent?: (navigationItem: NavigationItemProps) => ReactNode;\n}\n\ninterface NavigationBarProps {\n defaultActiveNavigationItem?: string;\n navigationItems: NavigationItemProps[];\n isCompactView?: boolean;\n onNavigationItemChange?: (navigationItemId: string) => void;\n keyboardActivationMode?: 'automatic' | 'manual'; //manual: arrow keys move focus only; Enter/Space activates the focused tab\n orientation?: 'horizontal' | 'vertical'; // required for aria and arrow shortcuts\n ariaLabel?: string; // Used when ariaLabelledBy is not provided\n ariaLabelledBy?: string; // ID of element that labels this tablist (preferred over ariaLabel when visible label exists)\n idBase?: string; //optional ID namespace to avoid collisions\n}\n\nexport const NavigationBar: FC<NavigationBarProps> = ({\n defaultActiveNavigationItem,\n navigationItems,\n onNavigationItemChange,\n isCompactView = false,\n keyboardActivationMode = 'automatic',\n orientation = 'horizontal',\n ariaLabel = 'Sections',\n ariaLabelledBy,\n idBase = ''\n}) => {\n const defaultNavigationItemId = defaultActiveNavigationItem || navigationItems[0]?.id || '';\n const [activeNavigationItem, setActiveNavigationItem] = useState<string>(defaultNavigationItemId);\n\n // Exclude disabled tabs from roving focus (keeps native disabled buttons, avoids focus-on-disabled).\n const itemIds = useMemo(\n () => navigationItems.filter((item) => !item.disabled).map((item) => item.id),\n [navigationItems]\n );\n\n // Hook for managing Tabs (NavigationBar) focus and ARIA props.\n const { getTabProps, setFocusedTabId, handleKeyDown, getPanelProps, getTabListProps } = useTabsA11y({\n itemIds,\n orientation,\n activeItem: activeNavigationItem,\n idBase\n });\n\n useEffect(() => {\n if (defaultActiveNavigationItem) {\n setActiveNavigationItem(defaultActiveNavigationItem);\n setFocusedTabId(defaultActiveNavigationItem);\n }\n }, [defaultActiveNavigationItem, setFocusedTabId]);\n\n const handleNavigationItemClick = (navigationItem: NavigationItemProps) => {\n if (navigationItem?.disabled) return;\n setActiveNavigationItem(navigationItem?.id);\n onNavigationItemChange?.(navigationItem?.id);\n };\n\n const activateTabById = (id: string) => {\n const item = navigationItems.find((i) => i.id === id);\n if (!item || item.disabled) return;\n setActiveNavigationItem(id);\n onNavigationItemChange?.(id);\n };\n\n const renderPanels = useMemo(() => {\n return navigationItems.map((navigationItem) => {\n const isSelected = navigationItem.id === activeNavigationItem;\n const panelTabIndex = isSelected && navigationItem.panelHasFocusableContent === false ? 0 : undefined;\n\n return (\n <div\n key={navigationItem.id}\n {...getPanelProps(navigationItem.id)}\n hidden={!isSelected}\n tabIndex={panelTabIndex}\n className={`navigation-item-content ${isSelected ? 'block' : 'hidden'}`}\n >\n {isSelected && navigationItem?.renderNavigationItemContent?.(navigationItem)}\n </div>\n );\n });\n }, [navigationItems, activeNavigationItem, getPanelProps]);\n\n const activeNavigationItemData = navigationItems.find((item) => item.id === activeNavigationItem);\n\n return (\n <>\n <div\n className=\"se-design-navigation-bar flex items-center gap-4\"\n data-automation-id=\"navigation-bar-container\"\n {...getTabListProps({ ariaLabel, ariaLabelledBy })}\n >\n {!isCompactView && navigationItems.map((navigationItem) => {\n const isSelected = activeNavigationItem === navigationItem.id;\n const isDisabled = navigationItem.disabled;\n\n const tabProps = getTabProps(navigationItem.id);\n\n return (\n <TabButton\n key={navigationItem.id}\n ref={tabProps.ref as (el: HTMLButtonElement | null) => void}\n tabIndex={tabProps.tabIndex}\n id={tabProps.id}\n label={navigationItem.label}\n isSelected={isSelected}\n isDisabled={isDisabled}\n panelId={tabProps['aria-controls']}\n onClick={() => handleNavigationItemClick(navigationItem)}\n onFocus={() => {\n tabProps.onFocus();\n if (keyboardActivationMode === 'automatic' && !isDisabled) {\n activateTabById(navigationItem.id);\n }\n }}\n onKeyDown={handleKeyDown}\n className={`text-base ${\n isDisabled\n ? 'text-[var(--color-gray-400)] cursor-not-allowed'\n : isSelected\n ? 'text-[var(--color-gray-900)] font-bold hover:cursor-pointer'\n : 'text-[var(--color-gray-700)] font-normal hover:text-[var(--color-gray-900)] cursor-pointer'\n } focus-outline rounded-[6px]`}\n automationId={`navigation-item-${navigationItem.id}`}\n />\n );\n })}\n {isCompactView && (\n <Popover\n className=\"navigation-bar-popover\"\n position=\"bottom-left\"\n noBorder\n renderPopoverSrcElement={({ displayPopover }) => (\n <div className=\"navigation-bar-popover-src-element flex items-center gap-1 cursor-pointer\">\n <label className=\"font-semibold cursor-pointer\">{activeNavigationItemData?.label}</label>\n <Icon name=\"chevron\" rotation={displayPopover ? '180' : '0'} />\n </div>\n )}\n renderPopoverContents={({ closePopoverCb }) => (\n <MenuList items={navigationItems.map((item) => ({\n id: item.id,\n label: item.label,\n onClick: () => {\n handleNavigationItemClick(item);\n closePopoverCb();\n }\n }))}\n />\n )}\n />\n )}\n </div>\n\n <div className=\"se-design-navigation-bar-content\">\n {renderPanels}\n </div>\n </>\n );\n};\n"],"names":["NavigationBar","defaultActiveNavigationItem","navigationItems","onNavigationItemChange","isCompactView","keyboardActivationMode","orientation","ariaLabel","ariaLabelledBy","idBase","defaultNavigationItemId","id","activeNavigationItem","setActiveNavigationItem","useState","itemIds","useMemo","filter","item","disabled","map","getTabProps","setFocusedTabId","handleKeyDown","getPanelProps","getTabListProps","useTabsA11y","activeItem","useEffect","handleNavigationItemClick","navigationItem","activateTabById","find","i","renderPanels","isSelected","panelTabIndex","panelHasFocusableContent","undefined","React","createElement","_extends","key","hidden","tabIndex","className","renderNavigationItemContent","activeNavigationItemData","Fragment","isDisabled","tabProps","TabButton","ref","label","panelId","onClick","onFocus","onKeyDown","automationId","Popover","position","noBorder","renderPopoverSrcElement","displayPopover","Icon","name","rotation","renderPopoverContents","closePopoverCb","MenuList","items"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,MAAMA,KAAwCA,CAAC;AAAA,EACpDC,6BAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACAC,wBAAAA;AAAAA,EACAC,eAAAA,IAAgB;AAAA,EAChBC,wBAAAA,IAAyB;AAAA,EACzBC,aAAAA,IAAc;AAAA,EACdC,WAAAA,IAAY;AAAA,EACZC,gBAAAA;AAAAA,EAC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,mBAAmB5B,EAAenB,EAAE;AAAA,IAAA,CACnD;AAAA,EAEL,CAAC,GACAP,KACCmC,gBAAAA,EAAAC,cAACmB,GAAO;AAAA,IACNd,WAAU;AAAA,IACVe,UAAS;AAAA,IACTC,UAAQ;AAAA,IACRC,yBAAyBA,CAAC;AAAA,MAAEC,gBAAAA;AAAAA,IAAAA,MAC1BxB,gBAAAA,EAAAC,cAAA,OAAA;AAAA,MAAKK,WAAU;AAAA,IAAA,GACbN,gBAAAA,EAAAC,cAAA,SAAA;AAAA,MAAOK,WAAU;AAAA,IAAA,GAAgCE,GAA0BM,KAAa,GACxFd,gBAAAA,EAAAC,cAACwB,GAAI;AAAA,MAACC,MAAK;AAAA,MAAUC,UAAUH,IAAiB,QAAQ;AAAA,IAAA,CAAM,CAC3D;AAAA,IAEPI,uBAAuBA,CAAC;AAAA,MAAEC,gBAAAA;AAAAA,IAAAA,MACxB7B,gBAAAA,EAAAC,cAAC6B,GAAQ;AAAA,MAACC,OAAOpE,EAAgBkB,IAAKF,CAAAA,OAAU;AAAA,QAC9CP,IAAIO,EAAKP;AAAAA,QACT0C,OAAOnC,EAAKmC;AAAAA,QACZE,SAASA,MAAM;AACb1B,UAAAA,EAA0BX,CAAI,GAC9BkD,EAAAA;AAAAA,QACF;AAAA,MAAA,EACA;AAAA,IAAA,CACD;AAAA,EAAA,CAEJ,CAEA,GAEL7B,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKK,WAAU;AAAA,EAAA,GACZX,CACE,CACL;AAEN;"}
|
|
1
|
+
{"version":3,"file":"index49.js","sources":["../src/components/NavigationBar/index.tsx"],"sourcesContent":["import React, { FC, ReactNode, useState,useMemo, useEffect } from 'react';\nimport { Popover, MenuList, Icon } from 'src/components';\nimport { TabButton } from './TabButton';\nimport { useTabsA11y } from '../../utils/a11y';\n\nexport interface NavigationItemProps {\n label: string;\n id: string;\n disabled?: boolean;\n panelHasFocusableContent?: boolean; // If false, the panel itself will be tabbable when active\n renderNavigationItemContent?: (navigationItem: NavigationItemProps) => ReactNode;\n}\n\ninterface NavigationBarProps {\n defaultActiveNavigationItem?: string;\n navigationItems: NavigationItemProps[];\n isCompactView?: boolean;\n onNavigationItemChange?: (navigationItemId: string) => void;\n keyboardActivationMode?: 'automatic' | 'manual'; //manual: arrow keys move focus only; Enter/Space activates the focused tab\n orientation?: 'horizontal' | 'vertical'; // required for aria and arrow shortcuts\n ariaLabel?: string; // Used when ariaLabelledBy is not provided\n ariaLabelledBy?: string; // ID of element that labels this tablist (preferred over ariaLabel when visible label exists)\n idBase?: string; //optional ID namespace to avoid collisions\n}\n\nexport const NavigationBar: FC<NavigationBarProps> = ({\n defaultActiveNavigationItem,\n navigationItems,\n onNavigationItemChange,\n isCompactView = false,\n keyboardActivationMode = 'automatic',\n orientation = 'horizontal',\n ariaLabel = 'Sections',\n ariaLabelledBy,\n idBase = ''\n}) => {\n const defaultNavigationItemId = defaultActiveNavigationItem || navigationItems[0]?.id || '';\n const [activeNavigationItem, setActiveNavigationItem] = useState<string>(defaultNavigationItemId);\n\n // Exclude disabled tabs from roving focus (keeps native disabled buttons, avoids focus-on-disabled).\n const itemIds = useMemo(\n () => navigationItems.filter((item) => !item.disabled).map((item) => item.id),\n [navigationItems]\n );\n\n // Hook for managing Tabs (NavigationBar) focus and ARIA props.\n const { getTabProps, setFocusedTabId, handleKeyDown, getPanelProps, getTabListProps } = useTabsA11y({\n itemIds,\n orientation,\n activeItem: activeNavigationItem,\n idBase\n });\n\n useEffect(() => {\n if (defaultActiveNavigationItem) {\n setActiveNavigationItem(defaultActiveNavigationItem);\n setFocusedTabId(defaultActiveNavigationItem);\n }\n }, [defaultActiveNavigationItem, setFocusedTabId]);\n\n const handleNavigationItemClick = (navigationItem: NavigationItemProps) => {\n if (navigationItem?.disabled) return;\n setActiveNavigationItem(navigationItem?.id);\n onNavigationItemChange?.(navigationItem?.id);\n };\n\n const activateTabById = (id: string) => {\n const item = navigationItems.find((i) => i.id === id);\n if (!item || item.disabled) return;\n setActiveNavigationItem(id);\n onNavigationItemChange?.(id);\n };\n\n const renderPanels = useMemo(() => {\n return navigationItems.map((navigationItem) => {\n const isSelected = navigationItem.id === activeNavigationItem;\n const panelTabIndex = isSelected && navigationItem.panelHasFocusableContent === false ? 0 : undefined;\n\n return (\n <div\n key={navigationItem.id}\n {...getPanelProps(navigationItem.id)}\n hidden={!isSelected}\n tabIndex={panelTabIndex}\n className={`navigation-item-content ${isSelected ? 'block' : 'hidden'}`}\n >\n {isSelected && navigationItem?.renderNavigationItemContent?.(navigationItem)}\n </div>\n );\n });\n }, [navigationItems, activeNavigationItem, getPanelProps]);\n\n const activeNavigationItemData = navigationItems.find((item) => item.id === activeNavigationItem);\n\n return (\n <>\n <div\n className=\"se-design-navigation-bar flex items-center gap-4\"\n data-automation-id=\"navigation-bar-container\"\n {...getTabListProps({ ariaLabel, ariaLabelledBy })}\n >\n {!isCompactView && navigationItems.map((navigationItem) => {\n const isSelected = activeNavigationItem === navigationItem.id;\n const isDisabled = navigationItem.disabled;\n\n const tabProps = getTabProps(navigationItem.id);\n\n return (\n <TabButton\n key={navigationItem.id}\n ref={tabProps.ref as (el: HTMLButtonElement | null) => void}\n tabIndex={tabProps.tabIndex}\n id={tabProps.id}\n label={navigationItem.label}\n isSelected={isSelected}\n isDisabled={isDisabled}\n panelId={tabProps['aria-controls']}\n onClick={() => handleNavigationItemClick(navigationItem)}\n onFocus={() => {\n tabProps.onFocus();\n if (keyboardActivationMode === 'automatic' && !isDisabled) {\n activateTabById(navigationItem.id);\n }\n }}\n onKeyDown={handleKeyDown}\n className={`text-base ${\n isDisabled\n ? 'text-[var(--color-gray-400)] cursor-not-allowed'\n : isSelected\n ? 'text-[var(--color-gray-900)] font-bold hover:cursor-pointer'\n : 'text-[var(--color-gray-700)] font-normal hover:text-[var(--color-gray-900)] cursor-pointer'\n } focus-outline rounded-[6px]`}\n automationId={`navigation-item-${navigationItem.id}`}\n />\n );\n })}\n {isCompactView && (\n <Popover\n className=\"navigation-bar-popover\"\n position=\"bottom-left\"\n noBorder\n renderPopoverSrcElement={({ displayPopover }) => (\n <div className=\"navigation-bar-popover-src-element flex items-center gap-1 cursor-pointer\">\n <label className=\"font-semibold cursor-pointer\">{activeNavigationItemData?.label}</label>\n <Icon name=\"chevron\" rotation={displayPopover ? '180' : '0'} />\n </div>\n )}\n renderPopoverContents={({ closePopoverCb }) => (\n <MenuList items={navigationItems.map((item) => ({\n id: item.id,\n label: item.label,\n onClick: () => {\n handleNavigationItemClick(item);\n closePopoverCb();\n }\n }))}\n />\n )}\n />\n )}\n </div>\n\n <div className=\"se-design-navigation-bar-content\">\n {renderPanels}\n </div>\n </>\n );\n};\n"],"names":["NavigationBar","defaultActiveNavigationItem","navigationItems","onNavigationItemChange","isCompactView","keyboardActivationMode","orientation","ariaLabel","ariaLabelledBy","idBase","defaultNavigationItemId","id","activeNavigationItem","setActiveNavigationItem","useState","itemIds","useMemo","filter","item","disabled","map","getTabProps","setFocusedTabId","handleKeyDown","getPanelProps","getTabListProps","useTabsA11y","activeItem","useEffect","handleNavigationItemClick","navigationItem","activateTabById","find","i","renderPanels","isSelected","panelTabIndex","panelHasFocusableContent","undefined","React","createElement","_extends","key","hidden","tabIndex","className","renderNavigationItemContent","activeNavigationItemData","Fragment","isDisabled","tabProps","TabButton","ref","label","panelId","onClick","onFocus","onKeyDown","automationId","Popover","position","noBorder","renderPopoverSrcElement","displayPopover","Icon","name","rotation","renderPopoverContents","closePopoverCb","MenuList","items"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,MAAMA,KAAwCA,CAAC;AAAA,EACpDC,6BAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACAC,wBAAAA;AAAAA,EACAC,eAAAA,IAAgB;AAAA,EAChBC,wBAAAA,IAAyB;AAAA,EACzBC,aAAAA,IAAc;AAAA,EACdC,WAAAA,IAAY;AAAA,EACZC,gBAAAA;AAAAA,EACAC,QAAAA,IA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AAenB,EAAE;AAAA,IAAA,CACnD;AAAA,EAEL,CAAC,GACAP,KACCmC,gBAAAA,EAAAC,cAACmB,GAAO;AAAA,IACNd,WAAU;AAAA,IACVe,UAAS;AAAA,IACTC,UAAQ;AAAA,IACRC,yBAAyBA,CAAC;AAAA,MAAEC,gBAAAA;AAAAA,IAAAA,MAC1BxB,gBAAAA,EAAAC,cAAA,OAAA;AAAA,MAAKK,WAAU;AAAA,IAAA,GACbN,gBAAAA,EAAAC,cAAA,SAAA;AAAA,MAAOK,WAAU;AAAA,IAAA,GAAgCE,GAA0BM,KAAa,GACxFd,gBAAAA,EAAAC,cAACwB,GAAI;AAAA,MAACC,MAAK;AAAA,MAAUC,UAAUH,IAAiB,QAAQ;AAAA,IAAA,CAAM,CAC3D;AAAA,IAEPI,uBAAuBA,CAAC;AAAA,MAAEC,gBAAAA;AAAAA,IAAAA,MACxB7B,gBAAAA,EAAAC,cAAC6B,GAAQ;AAAA,MAACC,OAAOpE,EAAgBkB,IAAKF,CAAAA,OAAU;AAAA,QAC9CP,IAAIO,EAAKP;AAAAA,QACT0C,OAAOnC,EAAKmC;AAAAA,QACZE,SAASA,MAAM;AACb1B,UAAAA,EAA0BX,CAAI,GAC9BkD,EAAAA;AAAAA,QACF;AAAA,MAAA,EACA;AAAA,IAAA,CACD;AAAA,EAAA,CAEJ,CAEA,GAEL7B,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKK,WAAU;AAAA,EAAA,GACZX,CACE,CACL;AAEN;"}
|
package/dist/index51.js
CHANGED
|
@@ -2,7 +2,7 @@ import r, { useState as T } from "react";
|
|
|
2
2
|
import { Button as z } from "./index4.js";
|
|
3
3
|
import { Icon as _ } from "./index6.js";
|
|
4
4
|
import { Dropdown as te } from "./index25.js";
|
|
5
|
-
import { useDatePickerA11y as He, formatDateId as Le, getCellAriaLabel as Pe } from "./
|
|
5
|
+
import { useDatePickerA11y as He, formatDateId as Le, getCellAriaLabel as Pe } from "./index237.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
function O() {
|
|
8
8
|
return O = Object.assign ? Object.assign.bind() : function(h) {
|
|
@@ -88,7 +88,7 @@ const Te = ["S", "M", "T", "W", "T", "F", "S"], ae = ["Sunday", "Monday", "Tuesd
|
|
|
88
88
|
}, le = () => {
|
|
89
89
|
const t = /* @__PURE__ */ new Date(), e = /* @__PURE__ */ new Date();
|
|
90
90
|
return t.setDate(1), e.setDate(1), p || e.setMonth(e.getMonth() - 1), t.setHours(0, 0, 0, 0), e.setHours(0, 0, 0, 0), [e, t];
|
|
91
|
-
}, [c,
|
|
91
|
+
}, [c, x] = T(se), [Q] = T(le), [k, W] = T(() => Q[0]), [L, G] = T(() => Q[1]), V = (t, e) => t.getTime() > e.getTime() ? [e, t] : [t, e], N = (t, e) => {
|
|
92
92
|
if (p) {
|
|
93
93
|
W(t);
|
|
94
94
|
return;
|
|
@@ -109,7 +109,7 @@ const Te = ["S", "M", "T", "W", "T", "F", "S"], ae = ["Sunday", "Monday", "Tuesd
|
|
|
109
109
|
rightMonth: L,
|
|
110
110
|
showSingleMonth: p,
|
|
111
111
|
selectedRange: c,
|
|
112
|
-
onMonthChange:
|
|
112
|
+
onMonthChange: N
|
|
113
113
|
}), de = (t, e) => {
|
|
114
114
|
const a = Se(t, e), n = Re(t, e), g = [];
|
|
115
115
|
for (let s = 0; s < n; s++)
|
|
@@ -146,7 +146,7 @@ const Te = ["S", "M", "T", "W", "T", "F", "S"], ae = ["Sunday", "Monday", "Tuesd
|
|
|
146
146
|
if (I(t)) return;
|
|
147
147
|
const e = new Date(t);
|
|
148
148
|
if (e.setHours(12, 0, 0, 0), H) {
|
|
149
|
-
|
|
149
|
+
x({
|
|
150
150
|
startDate: e,
|
|
151
151
|
endDate: e
|
|
152
152
|
}), S({
|
|
@@ -156,7 +156,7 @@ const Te = ["S", "M", "T", "W", "T", "F", "S"], ae = ["Sunday", "Monday", "Tuesd
|
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
158
|
if (!c.startDate || c.endDate)
|
|
159
|
-
|
|
159
|
+
x({
|
|
160
160
|
startDate: e,
|
|
161
161
|
endDate: null
|
|
162
162
|
});
|
|
@@ -164,7 +164,7 @@ const Te = ["S", "M", "T", "W", "T", "F", "S"], ae = ["Sunday", "Monday", "Tuesd
|
|
|
164
164
|
const a = new Date(c.startDate);
|
|
165
165
|
a.setHours(12, 0, 0, 0);
|
|
166
166
|
const n = e > a ? e : a, g = e > a ? a : e;
|
|
167
|
-
|
|
167
|
+
x({
|
|
168
168
|
startDate: g,
|
|
169
169
|
endDate: n
|
|
170
170
|
});
|
|
@@ -201,7 +201,7 @@ const Te = ["S", "M", "T", "W", "T", "F", "S"], ae = ["Sunday", "Monday", "Tuesd
|
|
|
201
201
|
});
|
|
202
202
|
}, ve = () => {
|
|
203
203
|
const t = /* @__PURE__ */ new Date(), e = /* @__PURE__ */ new Date();
|
|
204
|
-
e.setHours(0, 0, 0, 0), t.setHours(23, 59, 59, 999),
|
|
204
|
+
e.setHours(0, 0, 0, 0), t.setHours(23, 59, 59, 999), x({
|
|
205
205
|
startDate: e,
|
|
206
206
|
endDate: t
|
|
207
207
|
});
|
|
@@ -236,7 +236,7 @@ const Te = ["S", "M", "T", "W", "T", "F", "S"], ae = ["Sunday", "Monday", "Tuesd
|
|
|
236
236
|
a = M(new Date(e.getFullYear(), e.getMonth() - 1, 1)), n = E(new Date(e.getFullYear(), e.getMonth(), 0));
|
|
237
237
|
break;
|
|
238
238
|
}
|
|
239
|
-
|
|
239
|
+
x({
|
|
240
240
|
startDate: a,
|
|
241
241
|
endDate: n
|
|
242
242
|
});
|
|
@@ -274,7 +274,7 @@ const Te = ["S", "M", "T", "W", "T", "F", "S"], ae = ["Sunday", "Monday", "Tuesd
|
|
|
274
274
|
const e = t.getFullYear(), a = t.getMonth(), n = de(e, a), g = (/* @__PURE__ */ new Date()).getFullYear(), s = t.getTime() === k.getTime(), u = be(g, e), b = new Date(e, a, 1).toLocaleString("en-US", {
|
|
275
275
|
month: "long",
|
|
276
276
|
year: "numeric"
|
|
277
|
-
}), Me = s ? ie : ue, X = `calendar-instructions-${s ? "left" : "right"}`, Ee = H ? "Press Enter or Space to select a date. Use arrow keys to navigate days, Page Up and Page Down to change months." : "Press Enter or Space to select a start date, then again to select an end date. Use arrow keys to navigate days, Page Up and Page Down to change months.",
|
|
277
|
+
}), Me = s ? ie : ue, X = `calendar-instructions-${s ? "left" : "right"}`, Ee = H ? "Press Enter or Space to select a date. Use arrow keys to navigate days, Page Up and Page Down to change months." : "Press Enter or Space to select a start date, then again to select an end date. Use arrow keys to navigate days, Page Up and Page Down to change months.", xe = ce({
|
|
278
278
|
isLeftCalendar: s,
|
|
279
279
|
isDateDisabled: I,
|
|
280
280
|
handleDateClick: me
|
|
@@ -284,7 +284,7 @@ const Te = ["S", "M", "T", "W", "T", "F", "S"], ae = ["Sunday", "Monday", "Tuesd
|
|
|
284
284
|
for (; l.length < 7; ) l.push(null);
|
|
285
285
|
Z.push(l);
|
|
286
286
|
}
|
|
287
|
-
const C = /* @__PURE__ */ new Date(),
|
|
287
|
+
const C = /* @__PURE__ */ new Date(), Ne = j && t.getMonth() === C.getMonth() && t.getFullYear() === C.getFullYear(), Ce = !F && a === C.getMonth() && e === C.getFullYear() || d !== void 0 && (() => {
|
|
288
288
|
const o = new Date(C);
|
|
289
289
|
return o.setDate(o.getDate() + d), t.getMonth() === o.getMonth() && t.getFullYear() === o.getFullYear();
|
|
290
290
|
})();
|
|
@@ -296,7 +296,7 @@ const Te = ["S", "M", "T", "W", "T", "F", "S"], ae = ["Sunday", "Monday", "Tuesd
|
|
|
296
296
|
name: "chevron",
|
|
297
297
|
rotation: "90",
|
|
298
298
|
size: 16,
|
|
299
|
-
disabled:
|
|
299
|
+
disabled: Ne,
|
|
300
300
|
onClick: () => {
|
|
301
301
|
const o = K(t, !1);
|
|
302
302
|
if (j) {
|
|
@@ -304,7 +304,7 @@ const Te = ["S", "M", "T", "W", "T", "F", "S"], ae = ["Sunday", "Monday", "Tuesd
|
|
|
304
304
|
if (l.setHours(0, 0, 0, 0), o < l && o.getMonth() !== l.getMonth())
|
|
305
305
|
return;
|
|
306
306
|
}
|
|
307
|
-
|
|
307
|
+
N(o, s);
|
|
308
308
|
},
|
|
309
309
|
automationId: `${y}-previous-month`,
|
|
310
310
|
ariaLabel: p ? "Previous month" : s ? "Previous month of starting date" : "Previous month of end date"
|
|
@@ -321,7 +321,7 @@ const Te = ["S", "M", "T", "W", "T", "F", "S"], ae = ["Sunday", "Monday", "Tuesd
|
|
|
321
321
|
ariaLabel: p ? "Month" : s ? "Month of starting date" : "Month of end date",
|
|
322
322
|
onOptionClick: (o) => {
|
|
323
323
|
const l = new Date(t);
|
|
324
|
-
l.setMonth(q.findIndex((i) => i.value === o.value)),
|
|
324
|
+
l.setMonth(q.findIndex((i) => i.value === o.value)), N(l, s);
|
|
325
325
|
},
|
|
326
326
|
className: "w-[124px] dropdown-option-container"
|
|
327
327
|
}), /* @__PURE__ */ r.createElement(te, {
|
|
@@ -334,7 +334,7 @@ const Te = ["S", "M", "T", "W", "T", "F", "S"], ae = ["Sunday", "Monday", "Tuesd
|
|
|
334
334
|
ariaLabel: p ? "Year" : s ? "Year of starting date" : "Year of end date",
|
|
335
335
|
onOptionClick: (o) => {
|
|
336
336
|
const l = new Date(t);
|
|
337
|
-
l.setFullYear(o.value),
|
|
337
|
+
l.setFullYear(o.value), N(l, s);
|
|
338
338
|
},
|
|
339
339
|
className: "w-[104px] dropdown-option-container"
|
|
340
340
|
})), /* @__PURE__ */ r.createElement(_, {
|
|
@@ -349,7 +349,7 @@ const Te = ["S", "M", "T", "W", "T", "F", "S"], ae = ["Sunday", "Monday", "Tuesd
|
|
|
349
349
|
if (i.setDate(i.getDate() + d), o > i)
|
|
350
350
|
return;
|
|
351
351
|
}
|
|
352
|
-
|
|
352
|
+
N(o, s);
|
|
353
353
|
},
|
|
354
354
|
automationId: `${y}-next-month`,
|
|
355
355
|
ariaLabel: p ? "Next month" : s ? "Next month of starting date" : "Next month of end date"
|
|
@@ -385,7 +385,7 @@ const Te = ["S", "M", "T", "W", "T", "F", "S"], ae = ["Sunday", "Monday", "Tuesd
|
|
|
385
385
|
const ee = Le(i), D = fe(i), f = he(i), Y = pe(i), U = !D && !f && ge(i), B = De(i), $ = I(i), {
|
|
386
386
|
ref: $e,
|
|
387
387
|
...Fe
|
|
388
|
-
} =
|
|
388
|
+
} = xe({
|
|
389
389
|
cellId: ee,
|
|
390
390
|
cellDate: i,
|
|
391
391
|
disabled: $,
|
|
@@ -417,7 +417,7 @@ const Te = ["S", "M", "T", "W", "T", "F", "S"], ae = ["Sunday", "Monday", "Tuesd
|
|
|
417
417
|
})))));
|
|
418
418
|
};
|
|
419
419
|
return /* @__PURE__ */ r.createElement("div", {
|
|
420
|
-
className: `se-design-datepicker-container flex flex-col bg-[var(--color-white)] rounded-md shadow-md w-max ${oe}`
|
|
420
|
+
className: `se-design-datepicker-container flex flex-col bg-[var(--color-white)] rounded-md shadow-md w-max max-w-full ${oe}`
|
|
421
421
|
}, m && /* @__PURE__ */ r.createElement("div", {
|
|
422
422
|
className: "se-design-datepicker-header flex justify-between items-center border-b border-[var(--color-gray-200)] p-4"
|
|
423
423
|
}, /* @__PURE__ */ r.createElement("h2", {
|