@okta/odyssey-react-mui 1.37.1 → 1.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/EmptyState.cjs +14 -4
- package/dist/cjs/EmptyState.cjs.map +1 -1
- package/dist/cjs/addSpecificity.cjs +22 -0
- package/dist/cjs/addSpecificity.cjs.map +1 -0
- package/dist/cjs/labs/DatePickers/DateTimePicker.cjs +7 -5
- package/dist/cjs/labs/DatePickers/DateTimePicker.cjs.map +1 -1
- package/dist/cjs/labs/DatePickers/dateTimePickerTheme.cjs +36 -2
- package/dist/cjs/labs/DatePickers/dateTimePickerTheme.cjs.map +1 -1
- package/dist/cjs/labs/PageTemplate/PageTemplate.cjs +1 -1
- package/dist/cjs/labs/PageTemplate/PageTemplate.cjs.map +1 -1
- package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs +1 -1
- package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs.map +1 -1
- package/dist/esm/EmptyState.js +14 -4
- package/dist/esm/EmptyState.js.map +1 -1
- package/dist/esm/addSpecificity.js +15 -0
- package/dist/esm/addSpecificity.js.map +1 -0
- package/dist/esm/labs/DatePickers/DateTimePicker.js +6 -4
- package/dist/esm/labs/DatePickers/DateTimePicker.js.map +1 -1
- package/dist/esm/labs/DatePickers/dateTimePickerTheme.js +35 -1
- package/dist/esm/labs/DatePickers/dateTimePickerTheme.js.map +1 -1
- package/dist/esm/labs/PageTemplate/PageTemplate.js +2 -2
- package/dist/esm/labs/PageTemplate/PageTemplate.js.map +1 -1
- package/dist/esm/web-component/odysseyWebComponentVersion.generated.js +1 -1
- package/dist/esm/web-component/odysseyWebComponentVersion.generated.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +21 -232
- package/dist/index.mjs +1 -1
- package/dist/index.scss +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/dist/types/EmptyState.d.ts.map +1 -1
- package/dist/types/addSpecificity.d.ts +38 -0
- package/dist/types/addSpecificity.d.ts.map +1 -0
- package/dist/types/labs/DatePickers/DateTimePicker.d.ts +3 -0
- package/dist/types/labs/DatePickers/DateTimePicker.d.ts.map +1 -1
- package/dist/types/labs/DatePickers/dateTimePickerTheme.d.ts.map +1 -1
- package/dist/types/web-component/odysseyWebComponentVersion.generated.d.ts +1 -1
- package/package.json +4 -4
package/dist/cjs/EmptyState.cjs
CHANGED
|
@@ -36,6 +36,13 @@ const EmptyContainer = (0, _styled.default)("div", {
|
|
|
36
36
|
width: "100%",
|
|
37
37
|
alignItems: "center"
|
|
38
38
|
}));
|
|
39
|
+
const TextContainer = (0, _styled.default)("div", {
|
|
40
|
+
shouldForwardProp: prop => prop !== "odysseyDesignTokens"
|
|
41
|
+
})(({
|
|
42
|
+
odysseyDesignTokens
|
|
43
|
+
}) => ({
|
|
44
|
+
maxWidth: odysseyDesignTokens.TypographyLineLengthMax
|
|
45
|
+
}));
|
|
39
46
|
const EmptyState = ({
|
|
40
47
|
heading,
|
|
41
48
|
description,
|
|
@@ -45,10 +52,13 @@ const EmptyState = ({
|
|
|
45
52
|
const odysseyDesignTokens = (0, _OdysseyDesignTokensContext.useOdysseyDesignTokens)();
|
|
46
53
|
return (0, _jsxRuntime.jsxs)(EmptyContainer, {
|
|
47
54
|
odysseyDesignTokens: odysseyDesignTokens,
|
|
48
|
-
children: [(0, _jsxRuntime.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
children: [(0, _jsxRuntime.jsxs)(TextContainer, {
|
|
56
|
+
odysseyDesignTokens: odysseyDesignTokens,
|
|
57
|
+
children: [(0, _jsxRuntime.jsx)(_Typography.Heading4, {
|
|
58
|
+
children: heading
|
|
59
|
+
}), (0, _jsxRuntime.jsx)(_Typography.Paragraph, {
|
|
60
|
+
children: description
|
|
61
|
+
})]
|
|
52
62
|
}), (PrimaryCallToActionComponent || SecondaryCallToActionComponent) && (0, _jsxRuntime.jsxs)(_Box.Box, {
|
|
53
63
|
sx: {
|
|
54
64
|
marginBlockStart: 5
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.cjs","names":["_react","require","_Typography","_Box","_styled","_interopRequireDefault","_OdysseyDesignTokensContext","_jsxRuntime","e","__esModule","default","EmptyContainer","styled","shouldForwardProp","prop","odysseyDesignTokens","display","flexDirection","marginBlock","Spacing9","padding","Spacing5","textAlign","width","alignItems","EmptyState","heading","description","PrimaryCallToActionComponent","SecondaryCallToActionComponent","useOdysseyDesignTokens","jsxs","children","jsx","Heading4","Paragraph","Box","sx","marginBlockStart","MemoizedEmptyState","exports","DataTableEmptyState","memo","displayName"],"sources":["../../src/EmptyState.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { ReactNode, memo } from \"react\";\nimport { Heading4, Paragraph } from \"./Typography.js\";\nimport { Box } from \"./Box.js\";\nimport styled from \"@emotion/styled\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"./OdysseyDesignTokensContext.js\";\n\nconst EmptyContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n flexDirection: \"column\",\n marginBlock: odysseyDesignTokens.Spacing9,\n padding: odysseyDesignTokens.Spacing5,\n textAlign: \"center\",\n width: \"100%\",\n alignItems: \"center\",\n}));\n\nexport type EmptyStateProps = {\n /**\n * Main heading of the empty state\n */\n heading: string;\n /**\n * A descriptive text explaining more context as to why we don't have data.\n */\n description: string;\n /**\n * Primary call to action\n */\n PrimaryCallToActionComponent?: ReactNode;\n /**\n * Secondary call to action\n */\n SecondaryCallToActionComponent?: ReactNode;\n};\n\nconst EmptyState = ({\n heading,\n description,\n PrimaryCallToActionComponent,\n SecondaryCallToActionComponent,\n}: EmptyStateProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n return (\n <EmptyContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Heading4>{heading}</Heading4>\n
|
|
1
|
+
{"version":3,"file":"EmptyState.cjs","names":["_react","require","_Typography","_Box","_styled","_interopRequireDefault","_OdysseyDesignTokensContext","_jsxRuntime","e","__esModule","default","EmptyContainer","styled","shouldForwardProp","prop","odysseyDesignTokens","display","flexDirection","marginBlock","Spacing9","padding","Spacing5","textAlign","width","alignItems","TextContainer","maxWidth","TypographyLineLengthMax","EmptyState","heading","description","PrimaryCallToActionComponent","SecondaryCallToActionComponent","useOdysseyDesignTokens","jsxs","children","jsx","Heading4","Paragraph","Box","sx","marginBlockStart","MemoizedEmptyState","exports","DataTableEmptyState","memo","displayName"],"sources":["../../src/EmptyState.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { ReactNode, memo } from \"react\";\nimport { Heading4, Paragraph } from \"./Typography.js\";\nimport { Box } from \"./Box.js\";\nimport styled from \"@emotion/styled\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"./OdysseyDesignTokensContext.js\";\n\nconst EmptyContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n flexDirection: \"column\",\n marginBlock: odysseyDesignTokens.Spacing9,\n padding: odysseyDesignTokens.Spacing5,\n textAlign: \"center\",\n width: \"100%\",\n alignItems: \"center\",\n}));\n\nconst TextContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n maxWidth: odysseyDesignTokens.TypographyLineLengthMax,\n}));\n\nexport type EmptyStateProps = {\n /**\n * Main heading of the empty state\n */\n heading: string;\n /**\n * A descriptive text explaining more context as to why we don't have data.\n */\n description: string;\n /**\n * Primary call to action\n */\n PrimaryCallToActionComponent?: ReactNode;\n /**\n * Secondary call to action\n */\n SecondaryCallToActionComponent?: ReactNode;\n};\n\nconst EmptyState = ({\n heading,\n description,\n PrimaryCallToActionComponent,\n SecondaryCallToActionComponent,\n}: EmptyStateProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n return (\n <EmptyContainer odysseyDesignTokens={odysseyDesignTokens}>\n <TextContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Heading4>{heading}</Heading4>\n <Paragraph>{description}</Paragraph>\n </TextContainer>\n {(PrimaryCallToActionComponent || SecondaryCallToActionComponent) && (\n <Box sx={{ marginBlockStart: 5 }}>\n {SecondaryCallToActionComponent}\n {PrimaryCallToActionComponent}\n </Box>\n )}\n </EmptyContainer>\n );\n};\n\nconst MemoizedEmptyState = memo(EmptyState);\nMemoizedEmptyState.displayName = \"EmptyState\";\n\nexport { MemoizedEmptyState as EmptyState };\nexport { MemoizedEmptyState as DataTableEmptyState };\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ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,EAAClC,WAAA,CAAAmC,QAAQ;QAAAF,QAAA,EAAEN;MAAO,CAAW,CAAC,EAC9B,IAAAtB,WAAA,CAAA6B,GAAA,EAAClC,WAAA,CAAAoC,SAAS;QAAAH,QAAA,EAAEL;MAAW,CAAY,CAAC;IAAA,CACvB,CAAC,EACf,CAACC,4BAA4B,IAAIC,8BAA8B,KAC9D,IAAAzB,WAAA,CAAA2B,IAAA,EAAC/B,IAAA,CAAAoC,GAAG;MAACC,EAAE,EAAE;QAAEC,gBAAgB,EAAE;MAAE,CAAE;MAAAN,QAAA,GAC9BH,8BAA8B,EAC9BD,4BAA4B;IAAA,CAC1B,CACN;EAAA,CACa,CAAC;AAErB,CAAC;AAED,MAAMW,kBAAkB,GAAAC,OAAA,CAAAC,mBAAA,GAAAD,OAAA,CAAAf,UAAA,GAAG,IAAAiB,WAAI,EAACjB,UAAU,CAAC;AAC3Cc,kBAAkB,CAACI,WAAW,GAAG,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.addSpecificity = void 0;
|
|
7
|
+
/*!
|
|
8
|
+
* Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
9
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
10
|
+
*
|
|
11
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
14
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
*
|
|
16
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
17
|
+
*/const addSpecificity = (specificityCount, selector) => {
|
|
18
|
+
const ampersands = "&".repeat(specificityCount);
|
|
19
|
+
return `${ampersands}${selector}`;
|
|
20
|
+
};
|
|
21
|
+
exports.addSpecificity = addSpecificity;
|
|
22
|
+
//# sourceMappingURL=addSpecificity.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addSpecificity.cjs","names":["addSpecificity","specificityCount","selector","ampersands","repeat","exports"],"sources":["../../src/addSpecificity.ts"],"sourcesContent":["/*!\n * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n/**\n * Adds CSS specificity to class selectors by prepending a specified number of ampersands.\n * This function helps override MUI component styles by increasing selector specificity.\n *\n * @param {number} specificityCount - Number of ampersands to prepend (e.g., 2 results in \"&&\")\n * @param {string} selector - The selector string to add specificity to.\n * Include spaces in the selector if needed for descendant selectors.\n * @returns {string} The selector with added specificity\n *\n * @example\n * // Direct selector: \"&&.MuiButton-root\"\n * addSpecificity(2, \".MuiButton-root\")\n *\n * // Descendant selector: \"&& .MuiButton-root\"\n * addSpecificity(2, \" .MuiButton-root\")\n *\n * // Direct selector with class reference:\n * addSpecificity(2, `.${buttonClasses.root}`)\n *\n * // Descendant selector with class reference:\n * addSpecificity(2, ` .${buttonClasses.root}`)\n *\n * // Combined selector: \"&&.MuiButton-root:hover\"\n * addSpecificity(2, \".MuiButton-root:hover\")\n */\nexport const addSpecificity = (\n specificityCount: number,\n selector: string,\n): string => {\n const ampersands = \"&\".repeat(specificityCount);\n return `${ampersands}${selector}`;\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GA2BO,MAAMA,cAAc,GAAGA,CAC5BC,gBAAwB,EACxBC,QAAgB,KACL;EACX,MAAMC,UAAU,GAAG,GAAG,CAACC,MAAM,CAACH,gBAAgB,CAAC;EAC/C,OAAO,GAAGE,UAAU,GAAGD,QAAQ,EAAE;AACnC,CAAC;AAACG,OAAA,CAAAL,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.DateTimePicker = void 0;
|
|
6
|
+
exports.DateTimePickerSize = exports.DateTimePicker = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactI18next = require("react-i18next");
|
|
9
9
|
var _xDatePickers = require("@mui/x-date-pickers");
|
|
@@ -18,6 +18,7 @@ var _dateTimePickerTheme = require("./dateTimePickerTheme.cjs");
|
|
|
18
18
|
var _index2 = require("../../icons.generated/index.cjs");
|
|
19
19
|
var _OdysseyDesignTokensContext = require("../../OdysseyDesignTokensContext.cjs");
|
|
20
20
|
var _OdysseyThemeProvider = require("../../OdysseyThemeProvider.cjs");
|
|
21
|
+
var _index3 = require("../../theme/index.cjs");
|
|
21
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
23
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
23
24
|
/*!
|
|
@@ -32,17 +33,18 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
32
33
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
33
34
|
*/
|
|
34
35
|
|
|
36
|
+
const DateTimePickerSize = exports.DateTimePickerSize = {
|
|
37
|
+
maxWidth: `${(0, _index3.pxToRem)(486)}rem`
|
|
38
|
+
};
|
|
35
39
|
const DatePickerContainer = _styled.default.div({
|
|
36
40
|
".MuiFormControl-root": {
|
|
37
41
|
marginBlockEnd: 0
|
|
38
42
|
}
|
|
39
43
|
});
|
|
40
|
-
const DatePickerWidthContainer = _styled.default.div(({
|
|
41
|
-
odysseyDesignTokens
|
|
42
|
-
}) => ({
|
|
44
|
+
const DatePickerWidthContainer = _styled.default.div(() => ({
|
|
43
45
|
".MuiInput-root": {
|
|
44
46
|
width: "100%",
|
|
45
|
-
maxWidth:
|
|
47
|
+
maxWidth: DateTimePickerSize.maxWidth
|
|
46
48
|
}
|
|
47
49
|
}));
|
|
48
50
|
const TimeZonePickerContainer = (0, _styled.default)("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimePicker.cjs","names":["_react","require","_reactI18next","_xDatePickers","_styled","_interopRequireDefault","_index","_DateFieldActionBar","_DateFieldLocalizationProvider","_TimeZonePicker","_useOdysseyDateFields","_DateTimeField","_dateTimePickerTheme","_index2","_OdysseyDesignTokensContext","_OdysseyThemeProvider","_jsxRuntime","e","__esModule","default","DatePickerContainer","styled","div","marginBlockEnd","DatePickerWidthContainer","odysseyDesignTokens","width","maxWidth","TypographyLineLengthMax","TimeZonePickerContainer","shouldForwardProp","prop","marginBlockStart","Spacing3","DateTimePicker","defaultValue","defaultValueProp","errorMessage","hint","HintLinkComponent","isDateEnabled","isDisabled","isOptional","isReadOnly","isMonthEnabled","isYearEnabled","label","minDate","minDateProp","maxDate","maxDateProp","onBlur","onCalendarDateChange","onInputChange","onInputChangeProp","timeZone","timeZonePickerLabel","timeZoneOptions","value","valueProp","i18n","t","useTranslation","inputRef","useRef","useOdysseyDesignTokens","closeCalendar","commonIcons","defaultedLanguageCode","formatDateTimeToUtcIsoDateString","formatDayOfWeek","inputValues","internalTimeZone","isOpen","localeText","onTimeZoneChange","popperElement","setPopperElement","shouldDisableDate","shouldDisableMonth","shouldDisableYear","toggleCalendarVisibility","useOdysseyDateFields","language","containerRef","useEffect","current","formatDateTimeToJsDateStringOnCalendarSelection","useCallback","dateStringFromDateTime","renderDateTimeField","jsx","DateTimeField","endAdornment","Button","ariaLabel","onClick","size","startIcon","CalendarIcon","variant","onChange","timezone","slots","useMemo","actionBar","DateFieldActionBar","field","muiProps","leftArrowIcon","ArrowLeftIcon","rightArrowIcon","ArrowRightIcon","switchViewIcon","ChevronDownIcon","slotProps","wrapperVariant","onAccept","onCancel","actions","popper","anchorEl","tabs","dateIcon","timeIcon","ClockIcon","toolbar","toolbarPlaceholder","OdysseyThemeProvider","themeOverride","dateTimePickerTheme","children","jsxs","DateFieldLocalizationProvider","ref","dayOfWeekFormatter","disabled","fixedWeekNumber","onClose","open","readOnly","TimeZonePicker","MemoizedDateTimePicker","exports","memo","displayName"],"sources":["../../../../src/labs/DatePickers/DateTimePicker.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, useCallback, useEffect, useMemo, useRef } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n type DateTimePickerSlots,\n DateTimePicker as MuiDateTimePicker,\n DateTimePickerProps as MuiDateTimePickerProps,\n DateTimePickerSlotProps,\n} from \"@mui/x-date-pickers\";\nimport { DateTime } from \"luxon\";\nimport styled from \"@emotion/styled\";\n\nimport { Button } from \"../../Buttons/index.js\";\nimport { DateFieldActionBar } from \"../../DatePickers/DateFieldActionBar.js\";\nimport { DateFieldLocalizationProvider } from \"../../DatePickers/DateFieldLocalizationProvider.js\";\nimport { TimeZonePicker } from \"../../DatePickers/TimeZonePicker.js\";\nimport {\n useOdysseyDateFields,\n OdysseyDateFieldProps,\n} from \"../../DatePickers/useOdysseyDateFields.js\";\nimport { DateTimeField, DateTimeFieldProps } from \"./DateTimeField.js\";\nimport { dateTimePickerTheme } from \"./dateTimePickerTheme.js\";\nimport { FieldComponentProps } from \"../../FieldComponentProps.js\";\nimport { CalendarIcon, ClockIcon } from \"../../icons.generated/index.js\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\nimport { OdysseyThemeProvider } from \"../../OdysseyThemeProvider.js\";\n\nconst DatePickerContainer = styled.div({\n \".MuiFormControl-root\": {\n marginBlockEnd: 0,\n },\n});\n\nconst DatePickerWidthContainer = styled.div<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n \".MuiInput-root\": {\n width: \"100%\",\n maxWidth: odysseyDesignTokens.TypographyLineLengthMax,\n },\n}));\n\nconst TimeZonePickerContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n marginBlockStart: odysseyDesignTokens.Spacing3,\n}));\n\ntype RenderDateTimeFieldProps = {\n defaultValue: DateTimeFieldProps[\"defaultValue\"];\n value: DateTimeFieldProps[\"value\"];\n} & MuiDateTimePickerProps<DateTime>;\n\nexport type DateTimePickerProps = OdysseyDateFieldProps &\n Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"isDisabled\"\n | \"isReadOnly\"\n | \"isOptional\"\n >;\n\nconst DateTimePicker = ({\n defaultValue: defaultValueProp,\n errorMessage,\n hint,\n HintLinkComponent,\n isDateEnabled = () => true,\n isDisabled,\n isOptional,\n isReadOnly,\n isMonthEnabled = () => true,\n isYearEnabled = () => true,\n label,\n minDate: minDateProp,\n maxDate: maxDateProp,\n onBlur,\n onCalendarDateChange,\n onInputChange: onInputChangeProp,\n timeZone,\n timeZonePickerLabel,\n timeZoneOptions,\n value: valueProp,\n}: DateTimePickerProps) => {\n const { i18n, t } = useTranslation();\n const inputRef = useRef<HTMLInputElement>(null);\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const {\n closeCalendar,\n commonIcons,\n defaultedLanguageCode,\n formatDateTimeToUtcIsoDateString,\n formatDayOfWeek,\n inputValues,\n internalTimeZone,\n isOpen,\n localeText,\n minDate,\n maxDate,\n onInputChange,\n onTimeZoneChange,\n popperElement,\n setPopperElement,\n shouldDisableDate,\n shouldDisableMonth,\n shouldDisableYear,\n toggleCalendarVisibility,\n } = useOdysseyDateFields({\n defaultValue: defaultValueProp,\n errorMessage,\n isDateEnabled,\n isMonthEnabled,\n isYearEnabled,\n minDate: minDateProp,\n maxDate: maxDateProp,\n onInputChange: onInputChangeProp,\n timeZone,\n value: valueProp,\n });\n\n const { language } = i18n;\n const containerRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n setPopperElement(containerRef.current);\n }, [setPopperElement]);\n\n const formatDateTimeToJsDateStringOnCalendarSelection = useCallback<\n NonNullable<MuiDateTimePickerProps<DateTime>[\"onChange\"]>\n >(\n (value) => {\n if (value) {\n const dateStringFromDateTime = formatDateTimeToUtcIsoDateString(value);\n\n if (dateStringFromDateTime) {\n onCalendarDateChange?.({\n value: dateStringFromDateTime,\n timeZone: internalTimeZone,\n });\n }\n }\n },\n [formatDateTimeToUtcIsoDateString, internalTimeZone, onCalendarDateChange],\n );\n\n const renderDateTimeField = useCallback(\n ({ defaultValue, inputRef, value }: RenderDateTimeFieldProps) => {\n return (\n <DateTimeField\n defaultValue={defaultValue}\n endAdornment={\n <Button\n ariaLabel={t(\"picker.labels.date.choose\")}\n label=\"\"\n onClick={toggleCalendarVisibility}\n size=\"small\"\n startIcon={<commonIcons.CalendarIcon />}\n variant=\"floating\"\n />\n }\n errorMessage={errorMessage}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n inputRef={inputRef}\n isDisabled={isDisabled}\n isOptional={isOptional}\n isReadOnly={isReadOnly}\n label={label}\n onBlur={onBlur}\n minDate={minDate}\n maxDate={maxDate}\n onChange={onInputChange}\n timezone={internalTimeZone}\n value={value}\n />\n );\n },\n [\n commonIcons,\n errorMessage,\n hint,\n HintLinkComponent,\n internalTimeZone,\n isDisabled,\n isOptional,\n isReadOnly,\n label,\n onBlur,\n onInputChange,\n minDate,\n maxDate,\n t,\n toggleCalendarVisibility,\n ],\n );\n\n const slots = useMemo<DateTimePickerSlots<DateTime>>(\n () => ({\n actionBar: DateFieldActionBar,\n field: (muiProps: RenderDateTimeFieldProps) =>\n renderDateTimeField(muiProps),\n leftArrowIcon: () => <commonIcons.ArrowLeftIcon />,\n rightArrowIcon: () => <commonIcons.ArrowRightIcon />,\n switchViewIcon: () => <commonIcons.ChevronDownIcon />,\n }),\n [commonIcons, renderDateTimeField],\n );\n\n const slotProps = useMemo<DateTimePickerSlotProps<DateTime, false>>(\n () => ({\n actionBar: ({ wrapperVariant, onAccept, onCancel }) => ({\n actions:\n // This is the default behavior but felt more clear to pass them in explicitly\n wrapperVariant === \"desktop\" ? [] : [\"accept\", \"cancel\"],\n onAccept,\n onCancel,\n }),\n popper: {\n anchorEl: popperElement,\n },\n tabs: {\n dateIcon: <CalendarIcon />,\n timeIcon: <ClockIcon />,\n },\n toolbar: {\n toolbarPlaceholder: \"\",\n },\n }),\n [popperElement],\n );\n\n return (\n <OdysseyThemeProvider themeOverride={dateTimePickerTheme}>\n <DateFieldLocalizationProvider\n defaultedLanguageCode={defaultedLanguageCode}\n localeText={localeText}\n >\n <DatePickerContainer>\n <DatePickerWidthContainer\n odysseyDesignTokens={odysseyDesignTokens}\n ref={containerRef}\n >\n <MuiDateTimePicker\n dayOfWeekFormatter={formatDayOfWeek}\n defaultValue={inputValues?.defaultValue}\n disabled={isDisabled}\n fixedWeekNumber={6}\n inputRef={inputRef}\n key={language}\n label={label}\n minDate={minDate}\n maxDate={maxDate}\n onChange={formatDateTimeToJsDateStringOnCalendarSelection}\n onClose={closeCalendar}\n open={isOpen}\n readOnly={isReadOnly}\n shouldDisableDate={shouldDisableDate}\n shouldDisableMonth={shouldDisableMonth}\n shouldDisableYear={shouldDisableYear}\n slots={slots}\n slotProps={slotProps}\n timezone={internalTimeZone}\n value={inputValues?.value}\n />\n </DatePickerWidthContainer>\n </DatePickerContainer>\n\n {timeZoneOptions && timeZonePickerLabel && (\n <TimeZonePickerContainer odysseyDesignTokens={odysseyDesignTokens}>\n <TimeZonePicker\n label={timeZonePickerLabel}\n onTimeZoneChange={onTimeZoneChange}\n isReadOnly={isReadOnly}\n timeZoneOptions={timeZoneOptions}\n value={internalTimeZone}\n />\n </TimeZonePickerContainer>\n )}\n </DateFieldLocalizationProvider>\n </OdysseyThemeProvider>\n );\n};\n\nconst MemoizedDateTimePicker = memo(DateTimePicker);\nMemoizedDateTimePicker.displayName = \"DateTimePicker\";\n\nexport { MemoizedDateTimePicker as DateTimePicker };\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAOA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,8BAAA,GAAAP,OAAA;AACA,IAAAQ,eAAA,GAAAR,OAAA;AACA,IAAAS,qBAAA,GAAAT,OAAA;AAIA,IAAAU,cAAA,GAAAV,OAAA;AACA,IAAAW,oBAAA,GAAAX,OAAA;AAEA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,2BAAA,GAAAb,OAAA;AAIA,IAAAc,qBAAA,GAAAd,OAAA;AAAqE,IAAAe,WAAA,GAAAf,OAAA;AAAA,SAAAI,uBAAAY,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAvCrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA+BA,MAAMG,mBAAmB,GAAGC,eAAM,CAACC,GAAG,CAAC;EACrC,sBAAsB,EAAE;IACtBC,cAAc,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List":[]}
|
|
1
|
+
{"version":3,"file":"DateTimePicker.cjs","names":["_react","require","_reactI18next","_xDatePickers","_styled","_interopRequireDefault","_index","_DateFieldActionBar","_DateFieldLocalizationProvider","_TimeZonePicker","_useOdysseyDateFields","_DateTimeField","_dateTimePickerTheme","_index2","_OdysseyDesignTokensContext","_OdysseyThemeProvider","_index3","_jsxRuntime","e","__esModule","default","DateTimePickerSize","exports","maxWidth","pxToRem","DatePickerContainer","styled","div","marginBlockEnd","DatePickerWidthContainer","width","TimeZonePickerContainer","shouldForwardProp","prop","odysseyDesignTokens","marginBlockStart","Spacing3","DateTimePicker","defaultValue","defaultValueProp","errorMessage","hint","HintLinkComponent","isDateEnabled","isDisabled","isOptional","isReadOnly","isMonthEnabled","isYearEnabled","label","minDate","minDateProp","maxDate","maxDateProp","onBlur","onCalendarDateChange","onInputChange","onInputChangeProp","timeZone","timeZonePickerLabel","timeZoneOptions","value","valueProp","i18n","t","useTranslation","inputRef","useRef","useOdysseyDesignTokens","closeCalendar","commonIcons","defaultedLanguageCode","formatDateTimeToUtcIsoDateString","formatDayOfWeek","inputValues","internalTimeZone","isOpen","localeText","onTimeZoneChange","popperElement","setPopperElement","shouldDisableDate","shouldDisableMonth","shouldDisableYear","toggleCalendarVisibility","useOdysseyDateFields","language","containerRef","useEffect","current","formatDateTimeToJsDateStringOnCalendarSelection","useCallback","dateStringFromDateTime","renderDateTimeField","jsx","DateTimeField","endAdornment","Button","ariaLabel","onClick","size","startIcon","CalendarIcon","variant","onChange","timezone","slots","useMemo","actionBar","DateFieldActionBar","field","muiProps","leftArrowIcon","ArrowLeftIcon","rightArrowIcon","ArrowRightIcon","switchViewIcon","ChevronDownIcon","slotProps","wrapperVariant","onAccept","onCancel","actions","popper","anchorEl","tabs","dateIcon","timeIcon","ClockIcon","toolbar","toolbarPlaceholder","OdysseyThemeProvider","themeOverride","dateTimePickerTheme","children","jsxs","DateFieldLocalizationProvider","ref","dayOfWeekFormatter","disabled","fixedWeekNumber","onClose","open","readOnly","TimeZonePicker","MemoizedDateTimePicker","memo","displayName"],"sources":["../../../../src/labs/DatePickers/DateTimePicker.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, useCallback, useEffect, useMemo, useRef } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n type DateTimePickerSlots,\n DateTimePicker as MuiDateTimePicker,\n DateTimePickerProps as MuiDateTimePickerProps,\n DateTimePickerSlotProps,\n} from \"@mui/x-date-pickers\";\nimport { DateTime } from \"luxon\";\nimport styled from \"@emotion/styled\";\n\nimport { Button } from \"../../Buttons/index.js\";\nimport { DateFieldActionBar } from \"../../DatePickers/DateFieldActionBar.js\";\nimport { DateFieldLocalizationProvider } from \"../../DatePickers/DateFieldLocalizationProvider.js\";\nimport { TimeZonePicker } from \"../../DatePickers/TimeZonePicker.js\";\nimport {\n useOdysseyDateFields,\n OdysseyDateFieldProps,\n} from \"../../DatePickers/useOdysseyDateFields.js\";\nimport { DateTimeField, DateTimeFieldProps } from \"./DateTimeField.js\";\nimport { dateTimePickerTheme } from \"./dateTimePickerTheme.js\";\nimport { FieldComponentProps } from \"../../FieldComponentProps.js\";\nimport { CalendarIcon, ClockIcon } from \"../../icons.generated/index.js\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\nimport { OdysseyThemeProvider } from \"../../OdysseyThemeProvider.js\";\nimport { pxToRem } from \"../../theme/index.js\";\n\nexport const DateTimePickerSize = {\n maxWidth: `${pxToRem(486)}rem`,\n};\n\nconst DatePickerContainer = styled.div({\n \".MuiFormControl-root\": {\n marginBlockEnd: 0,\n },\n});\n\nconst DatePickerWidthContainer = styled.div<{\n odysseyDesignTokens: DesignTokens;\n}>(() => ({\n \".MuiInput-root\": {\n width: \"100%\",\n maxWidth: DateTimePickerSize.maxWidth,\n },\n}));\n\nconst TimeZonePickerContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n marginBlockStart: odysseyDesignTokens.Spacing3,\n}));\n\ntype RenderDateTimeFieldProps = {\n defaultValue: DateTimeFieldProps[\"defaultValue\"];\n value: DateTimeFieldProps[\"value\"];\n} & MuiDateTimePickerProps<DateTime>;\n\nexport type DateTimePickerProps = OdysseyDateFieldProps &\n Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"isDisabled\"\n | \"isReadOnly\"\n | \"isOptional\"\n >;\n\nconst DateTimePicker = ({\n defaultValue: defaultValueProp,\n errorMessage,\n hint,\n HintLinkComponent,\n isDateEnabled = () => true,\n isDisabled,\n isOptional,\n isReadOnly,\n isMonthEnabled = () => true,\n isYearEnabled = () => true,\n label,\n minDate: minDateProp,\n maxDate: maxDateProp,\n onBlur,\n onCalendarDateChange,\n onInputChange: onInputChangeProp,\n timeZone,\n timeZonePickerLabel,\n timeZoneOptions,\n value: valueProp,\n}: DateTimePickerProps) => {\n const { i18n, t } = useTranslation();\n const inputRef = useRef<HTMLInputElement>(null);\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const {\n closeCalendar,\n commonIcons,\n defaultedLanguageCode,\n formatDateTimeToUtcIsoDateString,\n formatDayOfWeek,\n inputValues,\n internalTimeZone,\n isOpen,\n localeText,\n minDate,\n maxDate,\n onInputChange,\n onTimeZoneChange,\n popperElement,\n setPopperElement,\n shouldDisableDate,\n shouldDisableMonth,\n shouldDisableYear,\n toggleCalendarVisibility,\n } = useOdysseyDateFields({\n defaultValue: defaultValueProp,\n errorMessage,\n isDateEnabled,\n isMonthEnabled,\n isYearEnabled,\n minDate: minDateProp,\n maxDate: maxDateProp,\n onInputChange: onInputChangeProp,\n timeZone,\n value: valueProp,\n });\n\n const { language } = i18n;\n const containerRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n setPopperElement(containerRef.current);\n }, [setPopperElement]);\n\n const formatDateTimeToJsDateStringOnCalendarSelection = useCallback<\n NonNullable<MuiDateTimePickerProps<DateTime>[\"onChange\"]>\n >(\n (value) => {\n if (value) {\n const dateStringFromDateTime = formatDateTimeToUtcIsoDateString(value);\n\n if (dateStringFromDateTime) {\n onCalendarDateChange?.({\n value: dateStringFromDateTime,\n timeZone: internalTimeZone,\n });\n }\n }\n },\n [formatDateTimeToUtcIsoDateString, internalTimeZone, onCalendarDateChange],\n );\n\n const renderDateTimeField = useCallback(\n ({ defaultValue, inputRef, value }: RenderDateTimeFieldProps) => {\n return (\n <DateTimeField\n defaultValue={defaultValue}\n endAdornment={\n <Button\n ariaLabel={t(\"picker.labels.date.choose\")}\n label=\"\"\n onClick={toggleCalendarVisibility}\n size=\"small\"\n startIcon={<commonIcons.CalendarIcon />}\n variant=\"floating\"\n />\n }\n errorMessage={errorMessage}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n inputRef={inputRef}\n isDisabled={isDisabled}\n isOptional={isOptional}\n isReadOnly={isReadOnly}\n label={label}\n onBlur={onBlur}\n minDate={minDate}\n maxDate={maxDate}\n onChange={onInputChange}\n timezone={internalTimeZone}\n value={value}\n />\n );\n },\n [\n commonIcons,\n errorMessage,\n hint,\n HintLinkComponent,\n internalTimeZone,\n isDisabled,\n isOptional,\n isReadOnly,\n label,\n onBlur,\n onInputChange,\n minDate,\n maxDate,\n t,\n toggleCalendarVisibility,\n ],\n );\n\n const slots = useMemo<DateTimePickerSlots<DateTime>>(\n () => ({\n actionBar: DateFieldActionBar,\n field: (muiProps: RenderDateTimeFieldProps) =>\n renderDateTimeField(muiProps),\n leftArrowIcon: () => <commonIcons.ArrowLeftIcon />,\n rightArrowIcon: () => <commonIcons.ArrowRightIcon />,\n switchViewIcon: () => <commonIcons.ChevronDownIcon />,\n }),\n [commonIcons, renderDateTimeField],\n );\n\n const slotProps = useMemo<DateTimePickerSlotProps<DateTime, false>>(\n () => ({\n actionBar: ({ wrapperVariant, onAccept, onCancel }) => ({\n actions:\n // This is the default behavior but felt more clear to pass them in explicitly\n wrapperVariant === \"desktop\" ? [] : [\"accept\", \"cancel\"],\n onAccept,\n onCancel,\n }),\n popper: {\n anchorEl: popperElement,\n },\n tabs: {\n dateIcon: <CalendarIcon />,\n timeIcon: <ClockIcon />,\n },\n toolbar: {\n toolbarPlaceholder: \"\",\n },\n }),\n [popperElement],\n );\n\n return (\n <OdysseyThemeProvider themeOverride={dateTimePickerTheme}>\n <DateFieldLocalizationProvider\n defaultedLanguageCode={defaultedLanguageCode}\n localeText={localeText}\n >\n <DatePickerContainer>\n <DatePickerWidthContainer\n odysseyDesignTokens={odysseyDesignTokens}\n ref={containerRef}\n >\n <MuiDateTimePicker\n dayOfWeekFormatter={formatDayOfWeek}\n defaultValue={inputValues?.defaultValue}\n disabled={isDisabled}\n fixedWeekNumber={6}\n inputRef={inputRef}\n key={language}\n label={label}\n minDate={minDate}\n maxDate={maxDate}\n onChange={formatDateTimeToJsDateStringOnCalendarSelection}\n onClose={closeCalendar}\n open={isOpen}\n readOnly={isReadOnly}\n shouldDisableDate={shouldDisableDate}\n shouldDisableMonth={shouldDisableMonth}\n shouldDisableYear={shouldDisableYear}\n slots={slots}\n slotProps={slotProps}\n timezone={internalTimeZone}\n value={inputValues?.value}\n />\n </DatePickerWidthContainer>\n </DatePickerContainer>\n\n {timeZoneOptions && timeZonePickerLabel && (\n <TimeZonePickerContainer odysseyDesignTokens={odysseyDesignTokens}>\n <TimeZonePicker\n label={timeZonePickerLabel}\n onTimeZoneChange={onTimeZoneChange}\n isReadOnly={isReadOnly}\n timeZoneOptions={timeZoneOptions}\n value={internalTimeZone}\n />\n </TimeZonePickerContainer>\n )}\n </DateFieldLocalizationProvider>\n </OdysseyThemeProvider>\n );\n};\n\nconst MemoizedDateTimePicker = memo(DateTimePicker);\nMemoizedDateTimePicker.displayName = \"DateTimePicker\";\n\nexport { MemoizedDateTimePicker as DateTimePicker };\n"],"mappings":";;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAOA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,8BAAA,GAAAP,OAAA;AACA,IAAAQ,eAAA,GAAAR,OAAA;AACA,IAAAS,qBAAA,GAAAT,OAAA;AAIA,IAAAU,cAAA,GAAAV,OAAA;AACA,IAAAW,oBAAA,GAAAX,OAAA;AAEA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,2BAAA,GAAAb,OAAA;AAIA,IAAAc,qBAAA,GAAAd,OAAA;AACA,IAAAe,OAAA,GAAAf,OAAA;AAA+C,IAAAgB,WAAA,GAAAhB,OAAA;AAAA,SAAAI,uBAAAa,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAxC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgCO,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG;EAChCE,QAAQ,EAAE,GAAG,IAAAC,eAAO,EAAC,GAAG,CAAC;AAC3B,CAAC;AAED,MAAMC,mBAAmB,GAAGC,eAAM,CAACC,GAAG,CAAC;EACrC,sBAAsB,EAAE;IACtBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;AAEF,MAAMC,wBAAwB,GAAGH,eAAM,CAACC,GAAG,CAExC,OA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ils = require("@mui/utils");
|
|
8
|
+
var _DigitalClock = require("@mui/x-date-pickers/DigitalClock");
|
|
9
|
+
var _MultiSectionDigitalClock = require("@mui/x-date-pickers/MultiSectionDigitalClock");
|
|
8
10
|
var _datePickerTheme = require("../../DatePickers/datePickerTheme.cjs");
|
|
11
|
+
var _DateTimePicker = require("./DateTimePicker.cjs");
|
|
12
|
+
var _index = require("../../theme/index.cjs");
|
|
13
|
+
var _addSpecificity = require("../../addSpecificity.cjs");
|
|
9
14
|
/*!
|
|
10
15
|
* Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
11
16
|
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
@@ -16,7 +21,11 @@ var _datePickerTheme = require("../../DatePickers/datePickerTheme.cjs");
|
|
|
16
21
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
22
|
*
|
|
18
23
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
19
|
-
*/const
|
|
24
|
+
*/const DateTimePickerComponentSize = {
|
|
25
|
+
dateCalendarMaxHeight: `${(0, _index.pxToRem)(336)}rem`,
|
|
26
|
+
slideTransitionMinHeight: `${(0, _index.pxToRem)(240)}rem`
|
|
27
|
+
};
|
|
28
|
+
const theme = {
|
|
20
29
|
components: {
|
|
21
30
|
MuiClock: {
|
|
22
31
|
styleOverrides: {
|
|
@@ -53,7 +62,9 @@ var _datePickerTheme = require("../../DatePickers/datePickerTheme.cjs");
|
|
|
53
62
|
styleOverrides: {
|
|
54
63
|
root: {
|
|
55
64
|
display: "block",
|
|
56
|
-
width: "100%"
|
|
65
|
+
width: "100%",
|
|
66
|
+
maxHeight: DateTimePickerComponentSize.dateCalendarMaxHeight,
|
|
67
|
+
height: DateTimePickerComponentSize.dateCalendarMaxHeight
|
|
57
68
|
}
|
|
58
69
|
}
|
|
59
70
|
},
|
|
@@ -82,6 +93,11 @@ var _datePickerTheme = require("../../DatePickers/datePickerTheme.cjs");
|
|
|
82
93
|
},
|
|
83
94
|
MuiPickersLayout: {
|
|
84
95
|
styleOverrides: {
|
|
96
|
+
root: () => ({
|
|
97
|
+
display: "block",
|
|
98
|
+
width: _DateTimePicker.DateTimePickerSize.maxWidth,
|
|
99
|
+
maxWidth: _DateTimePicker.DateTimePickerSize.maxWidth
|
|
100
|
+
}),
|
|
85
101
|
contentWrapper: ({
|
|
86
102
|
theme
|
|
87
103
|
}) => ({
|
|
@@ -90,6 +106,17 @@ var _datePickerTheme = require("../../DatePickers/datePickerTheme.cjs");
|
|
|
90
106
|
})
|
|
91
107
|
}
|
|
92
108
|
},
|
|
109
|
+
MuiMultiSectionDigitalClock: {
|
|
110
|
+
styleOverrides: {
|
|
111
|
+
root: {
|
|
112
|
+
[`${(0, _addSpecificity.addSpecificity)(2, `.${_MultiSectionDigitalClock.multiSectionDigitalClockClasses.root}`)},
|
|
113
|
+
${(0, _addSpecificity.addSpecificity)(2, ` .${_MultiSectionDigitalClock.multiSectionDigitalClockSectionClasses.root}`)},
|
|
114
|
+
${(0, _addSpecificity.addSpecificity)(2, `.${_DigitalClock.digitalClockClasses.root}`)}`]: {
|
|
115
|
+
maxHeight: DateTimePickerComponentSize.dateCalendarMaxHeight
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
93
120
|
MuiMultiSectionDigitalClockSection: {
|
|
94
121
|
styleOverrides: {
|
|
95
122
|
root: {
|
|
@@ -222,6 +249,13 @@ var _datePickerTheme = require("../../DatePickers/datePickerTheme.cjs");
|
|
|
222
249
|
})
|
|
223
250
|
}
|
|
224
251
|
},
|
|
252
|
+
MuiDayCalendar: {
|
|
253
|
+
styleOverrides: {
|
|
254
|
+
slideTransition: {
|
|
255
|
+
minHeight: DateTimePickerComponentSize.slideTransitionMinHeight
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
},
|
|
225
259
|
MuiTimeClock: {
|
|
226
260
|
styleOverrides: {
|
|
227
261
|
arrowSwitcher: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateTimePickerTheme.cjs","names":["_utils","require","_datePickerTheme","theme","components","MuiClock","styleOverrides","clock","width","spacing","height","backgroundColor","palette","grey","pin","primary","light","MuiClockPointer","root","thumb","borderColor","main","MuiDateCalendar","display","MuiPickersArrowSwitcher","button","margin","padding","color","typography","body1","marginInlineStart","svg","spacer","MuiPickersLayout","contentWrapper","gridTemplateColumns","MuiMultiSectionDigitalClockSection","item","dateStyles","default","marginInline","marginBlockStart","hover","focus","selected","hoverSelected","disabled","MuiDateTimePickerToolbar","dateContainer","flexDirection","marginInlineEnd","timeDigitsContainer","alignItems","ampmSelection","common","white","separator","h5","marginBlock","MuiPickersToolbarButton","border","borderRadius","mixins","subtitle1","MuiPickersToolbarText","position","lineHeight","left","bottom","opacity","content","transition","transform","MuiTimeClock","arrowSwitcher","top","right","dateTimePickerTheme","exports","deepmerge","datePickerTheme"],"sources":["../../../../src/labs/DatePickers/dateTimePickerTheme.ts"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n// import { CSSInterpolation } from \"@mui/material/styles\";\nimport { deepmerge } from \"@mui/utils\";\nimport { ThemeOptions } from \"@mui/material\";\n\nimport {\n datePickerTheme,\n dateStyles,\n} from \"../../DatePickers/datePickerTheme.js\";\n\nconst theme: ThemeOptions = {\n components: {\n MuiClock: {\n styleOverrides: {\n clock: ({ theme }) => ({\n width: `calc(${theme.spacing(9)} * 4)`,\n height: `calc(${theme.spacing(9)} * 4)`,\n backgroundColor: theme.palette.grey[50],\n }),\n pin: ({ theme }) => ({\n backgroundColor: theme.palette.primary.light,\n }),\n },\n },\n MuiClockPointer: {\n styleOverrides: {\n root: ({ theme }) => ({\n backgroundColor: theme.palette.primary.light,\n }),\n thumb: ({ theme }) => ({\n borderColor: theme.palette.primary.light,\n backgroundColor: theme.palette.primary.main,\n }),\n },\n },\n MuiDateCalendar: {\n styleOverrides: {\n root: {\n display: \"block\",\n width: \"100%\",\n },\n },\n },\n MuiPickersArrowSwitcher: {\n styleOverrides: {\n button: ({ theme }) => ({\n display: \"flex\",\n margin: 0,\n padding: theme.spacing(2),\n color: theme.typography.body1.color,\n\n \"& + &\": {\n marginInlineStart: theme.spacing(2),\n },\n\n svg: {\n display: \"flex\",\n },\n }),\n spacer: ({ theme }) => ({\n width: theme.spacing(1),\n }),\n },\n },\n MuiPickersLayout: {\n styleOverrides: {\n contentWrapper: ({ theme }) => ({\n padding: theme.spacing(3),\n gridTemplateColumns: \"1fr 16px auto\",\n }),\n },\n },\n MuiMultiSectionDigitalClockSection: {\n styleOverrides: {\n root: {\n width: \"auto\",\n },\n item: ({ theme }) => [\n dateStyles.default({ theme }),\n {\n margin: 0,\n marginInline: theme.spacing(1),\n \"& + &\": {\n marginBlockStart: theme.spacing(1),\n },\n \"&:hover\": dateStyles.hover({ theme }),\n \"&:focus\": dateStyles.focus({ theme }),\n\n \"&.Mui-selected, &.Mui-selected:focus\": dateStyles.selected({\n theme,\n }),\n \"&.Mui-selected:hover\": dateStyles.hoverSelected({ theme }),\n\n \"&.Mui-disabled\": dateStyles.disabled({ theme }),\n },\n ],\n },\n },\n MuiDateTimePickerToolbar: {\n styleOverrides: {\n root: ({ theme }) => ({\n padding: theme.spacing(3),\n }),\n dateContainer: ({ theme }) => ({\n flexDirection: \"row-reverse\",\n\n button: {\n \"+ button\": {\n marginInlineEnd: theme.spacing(2),\n },\n },\n }),\n timeDigitsContainer: {\n alignItems: \"center\",\n },\n ampmSelection: ({ theme }) => ({\n margin: 0,\n marginInlineStart: theme.spacing(3),\n\n button: {\n padding: theme.spacing(2),\n\n \"&:has(.Mui-selected)\": {\n backgroundColor: theme.palette.primary.main,\n\n \".Mui-selected\": {\n color: theme.palette.common.white,\n \"&::after\": {\n display: \"none\",\n },\n },\n },\n },\n }),\n separator: ({ theme }) => ({\n ...theme.typography.h5,\n marginBlock: 0,\n marginInline: theme.spacing(1),\n }),\n },\n },\n MuiPickersToolbarButton: {\n styleOverrides: {\n root: ({ theme }) => ({\n height: \"auto\",\n padding: 0,\n margin: 0,\n border: 0,\n borderRadius: theme.mixins.borderRadius,\n backgroundColor: \"transparent\",\n color: theme.typography.subtitle1.color,\n\n \"&:hover\": {\n backgroundColor: \"transparent\",\n },\n\n \"& + &\": {\n marginInlineStart: 0,\n },\n }),\n },\n },\n MuiPickersToolbarText: {\n styleOverrides: {\n root: ({ theme }) => ({\n ...theme.typography.h5,\n position: \"relative\",\n margin: 0,\n lineHeight: 1,\n color: \"inherit\",\n\n \"&::after\": {\n position: \"absolute\",\n left: 0,\n bottom: 0,\n width: \"100%\",\n height: 2,\n backgroundColor: \"currentColor\",\n opacity: 0,\n content: \"''\",\n transition: \"opacity 100ms, transform 200ms\",\n },\n\n \"&.Mui-selected\": {\n color: theme.typography.body1.color,\n\n \"&::after\": {\n transform: \"translateY(2px)\",\n opacity: 1,\n },\n },\n }),\n },\n },\n MuiTimeClock: {\n styleOverrides: {\n arrowSwitcher: {\n top: 0,\n right: 0,\n },\n },\n },\n },\n};\nexport const dateTimePickerTheme = deepmerge(datePickerTheme, theme);\n"],"mappings":";;;;;;AAaA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,gBAAA,GAAAD,OAAA;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAWA,MAAME,KAAmB,GAAG;EAC1BC,UAAU,EAAE;IACVC,QAAQ,EAAE;MACRC,cAAc,EAAE;QACdC,KAAK,EAAEA,CAAC;UAAEJ;QAAM,CAAC,MAAM;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Aa;UAC9BiB,KAAK,EAAEzB,KAAK,CAAC0B,UAAU,CAACmC,SAAS,CAACpC,KAAK;UAEvC,SAAS,EAAE;YACTjB,eAAe,EAAE;UACnB,CAAC;UAED,OAAO,EAAE;YACPoB,iBAAiB,EAAE;UACrB;QACF,CAAC;MACH;IACF,CAAC;IACDkC,qBAAqB,EAAE;MACrB3D,cAAc,EAAE;QACdY,IAAI,EAAEA,CAAC;UAAEf;QAAM,CAAC,MAAM;UACpB,GAAGA,KAAK,CAAC0B,UAAU,CAAC6B,EAAE;UACtBQ,QAAQ,EAAE,UAAU;UACpBxC,MAAM,EAAE,CAAC;UACTyC,UAAU,EAAE,CAAC;UACbvC,KAAK,EAAE,SAAS;UAEhB,UAAU,EAAE;YACVsC,QAAQ,EAAE,UAAU;YACpBE,IAAI,EAAE,CAAC;YACPC,MAAM,EAAE,CAAC;YACT7D,KAAK,EAAE,MAAM;YACbE,MAAM,EAAE,CAAC;YACTC,eAAe,EAAE,cAAc;YAC/B2D,OAAO,EAAE,CAAC;YACVC,OAAO,EAAE,IAAI;YACbC,UAAU,EAAE;UACd,CAAC;UAED,gBAAgB,EAAE;YAChB5C,KAAK,EAAEzB,KAAK,CAAC0B,UAAU,CAACC,KAAK,CAACF,KAAK;YAEnC,UAAU,EAAE;cACV6C,SAAS,EAAE,iBAAiB;cAC5BH,OAAO,EAAE;YACX;UACF;QACF,CAAC;MACH;IACF,CAAC;IACDI,YAAY,EAAE;MACZpE,cAAc,EAAE;QACdqE,aAAa,EAAE;UACbC,GAAG,EAAE,CAAC;UACNC,KAAK,EAAE;QACT;MACF;IACF;EACF;AACF,CAAC;AACM,MAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG,IAAAE,gBAAS,EAACC,gCAAe,EAAE9E,KAAK,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"dateTimePickerTheme.cjs","names":["_utils","require","_DigitalClock","_MultiSectionDigitalClock","_datePickerTheme","_DateTimePicker","_index","_addSpecificity","DateTimePickerComponentSize","dateCalendarMaxHeight","pxToRem","slideTransitionMinHeight","theme","components","MuiClock","styleOverrides","clock","width","spacing","height","backgroundColor","palette","grey","pin","primary","light","MuiClockPointer","root","thumb","borderColor","main","MuiDateCalendar","display","maxHeight","MuiPickersArrowSwitcher","button","margin","padding","color","typography","body1","marginInlineStart","svg","spacer","MuiPickersLayout","DateTimePickerSize","maxWidth","contentWrapper","gridTemplateColumns","MuiMultiSectionDigitalClock","addSpecificity","multiSectionDigitalClockClasses","multiSectionDigitalClockSectionClasses","digitalClockClasses","MuiMultiSectionDigitalClockSection","item","dateStyles","default","marginInline","marginBlockStart","hover","focus","selected","hoverSelected","disabled","MuiDateTimePickerToolbar","dateContainer","flexDirection","marginInlineEnd","timeDigitsContainer","alignItems","ampmSelection","common","white","separator","h5","marginBlock","MuiPickersToolbarButton","border","borderRadius","mixins","subtitle1","MuiPickersToolbarText","position","lineHeight","left","bottom","opacity","content","transition","transform","MuiDayCalendar","slideTransition","minHeight","MuiTimeClock","arrowSwitcher","top","right","dateTimePickerTheme","exports","deepmerge","datePickerTheme"],"sources":["../../../../src/labs/DatePickers/dateTimePickerTheme.ts"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n// import { CSSInterpolation } from \"@mui/material/styles\";\nimport { deepmerge } from \"@mui/utils\";\nimport { ThemeOptions } from \"@mui/material\";\nimport { digitalClockClasses } from \"@mui/x-date-pickers/DigitalClock\";\nimport {\n multiSectionDigitalClockSectionClasses,\n multiSectionDigitalClockClasses,\n} from \"@mui/x-date-pickers/MultiSectionDigitalClock\";\nimport {\n datePickerTheme,\n dateStyles,\n} from \"../../DatePickers/datePickerTheme.js\";\nimport { DateTimePickerSize } from \"./DateTimePicker.js\";\nimport { pxToRem } from \"../../theme/index.js\";\nimport { addSpecificity } from \"../../addSpecificity.js\";\n\nconst DateTimePickerComponentSize = {\n dateCalendarMaxHeight: `${pxToRem(336)}rem`,\n slideTransitionMinHeight: `${pxToRem(240)}rem`,\n};\n\nconst theme: ThemeOptions = {\n components: {\n MuiClock: {\n styleOverrides: {\n clock: ({ theme }) => ({\n width: `calc(${theme.spacing(9)} * 4)`,\n height: `calc(${theme.spacing(9)} * 4)`,\n backgroundColor: theme.palette.grey[50],\n }),\n pin: ({ theme }) => ({\n backgroundColor: theme.palette.primary.light,\n }),\n },\n },\n MuiClockPointer: {\n styleOverrides: {\n root: ({ theme }) => ({\n backgroundColor: theme.palette.primary.light,\n }),\n thumb: ({ theme }) => ({\n borderColor: theme.palette.primary.light,\n backgroundColor: theme.palette.primary.main,\n }),\n },\n },\n MuiDateCalendar: {\n styleOverrides: {\n root: {\n display: \"block\",\n width: \"100%\",\n maxHeight: DateTimePickerComponentSize.dateCalendarMaxHeight,\n height: DateTimePickerComponentSize.dateCalendarMaxHeight,\n },\n },\n },\n MuiPickersArrowSwitcher: {\n styleOverrides: {\n button: ({ theme }) => ({\n display: \"flex\",\n margin: 0,\n padding: theme.spacing(2),\n color: theme.typography.body1.color,\n\n \"& + &\": {\n marginInlineStart: theme.spacing(2),\n },\n\n svg: {\n display: \"flex\",\n },\n }),\n spacer: ({ theme }) => ({\n width: theme.spacing(1),\n }),\n },\n },\n MuiPickersLayout: {\n styleOverrides: {\n root: () => ({\n display: \"block\",\n width: DateTimePickerSize.maxWidth,\n maxWidth: DateTimePickerSize.maxWidth,\n }),\n contentWrapper: ({ theme }) => ({\n padding: theme.spacing(3),\n gridTemplateColumns: \"1fr 16px auto\",\n }),\n },\n },\n MuiMultiSectionDigitalClock: {\n styleOverrides: {\n root: {\n [`${addSpecificity(2, `.${multiSectionDigitalClockClasses.root}`)}, \n ${addSpecificity(2, ` .${multiSectionDigitalClockSectionClasses.root}`)}, \n ${addSpecificity(2, `.${digitalClockClasses.root}`)}`]: {\n maxHeight: DateTimePickerComponentSize.dateCalendarMaxHeight,\n },\n },\n },\n },\n MuiMultiSectionDigitalClockSection: {\n styleOverrides: {\n root: {\n width: \"auto\",\n },\n item: ({ theme }) => [\n dateStyles.default({ theme }),\n {\n margin: 0,\n marginInline: theme.spacing(1),\n \"& + &\": {\n marginBlockStart: theme.spacing(1),\n },\n \"&:hover\": dateStyles.hover({ theme }),\n \"&:focus\": dateStyles.focus({ theme }),\n\n \"&.Mui-selected, &.Mui-selected:focus\": dateStyles.selected({\n theme,\n }),\n \"&.Mui-selected:hover\": dateStyles.hoverSelected({ theme }),\n\n \"&.Mui-disabled\": dateStyles.disabled({ theme }),\n },\n ],\n },\n },\n MuiDateTimePickerToolbar: {\n styleOverrides: {\n root: ({ theme }) => ({\n padding: theme.spacing(3),\n }),\n dateContainer: ({ theme }) => ({\n flexDirection: \"row-reverse\",\n\n button: {\n \"+ button\": {\n marginInlineEnd: theme.spacing(2),\n },\n },\n }),\n timeDigitsContainer: {\n alignItems: \"center\",\n },\n ampmSelection: ({ theme }) => ({\n margin: 0,\n marginInlineStart: theme.spacing(3),\n\n button: {\n padding: theme.spacing(2),\n\n \"&:has(.Mui-selected)\": {\n backgroundColor: theme.palette.primary.main,\n\n \".Mui-selected\": {\n color: theme.palette.common.white,\n \"&::after\": {\n display: \"none\",\n },\n },\n },\n },\n }),\n separator: ({ theme }) => ({\n ...theme.typography.h5,\n marginBlock: 0,\n marginInline: theme.spacing(1),\n }),\n },\n },\n MuiPickersToolbarButton: {\n styleOverrides: {\n root: ({ theme }) => ({\n height: \"auto\",\n padding: 0,\n margin: 0,\n border: 0,\n borderRadius: theme.mixins.borderRadius,\n backgroundColor: \"transparent\",\n color: theme.typography.subtitle1.color,\n\n \"&:hover\": {\n backgroundColor: \"transparent\",\n },\n\n \"& + &\": {\n marginInlineStart: 0,\n },\n }),\n },\n },\n MuiPickersToolbarText: {\n styleOverrides: {\n root: ({ theme }) => ({\n ...theme.typography.h5,\n position: \"relative\",\n margin: 0,\n lineHeight: 1,\n color: \"inherit\",\n\n \"&::after\": {\n position: \"absolute\",\n left: 0,\n bottom: 0,\n width: \"100%\",\n height: 2,\n backgroundColor: \"currentColor\",\n opacity: 0,\n content: \"''\",\n transition: \"opacity 100ms, transform 200ms\",\n },\n\n \"&.Mui-selected\": {\n color: theme.typography.body1.color,\n\n \"&::after\": {\n transform: \"translateY(2px)\",\n opacity: 1,\n },\n },\n }),\n },\n },\n MuiDayCalendar: {\n styleOverrides: {\n slideTransition: {\n minHeight: DateTimePickerComponentSize.slideTransitionMinHeight,\n },\n },\n },\n MuiTimeClock: {\n styleOverrides: {\n arrowSwitcher: {\n top: 0,\n right: 0,\n },\n },\n },\n },\n};\nexport const dateTimePickerTheme = deepmerge(datePickerTheme, theme);\n"],"mappings":";;;;;;AAaA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,yBAAA,GAAAF,OAAA;AAIA,IAAAG,gBAAA,GAAAH,OAAA;AAIA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AA1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAkBA,MAAMO,2BAA2B,GAAG;EAClCC,qBAAqB,EAAE,GAAG,IAAAC,cAAO,EAAC,GAAG,CAAC,KAAK;EAC3CC,wBAAwB,EAAE,GAAG,IAAAD,cAAO,EAAC,GAAG,CAAC;AAC3C,CAAC;AAED,MAAME,KAAmB,GAAG;EAC1BC,UAAU,EAAE;IACVC,QAAQ,EAAE;MACRC,cAAc,EAAE;QACdC,KAAK,EAAEA,CAAC;UAAEJ;QAAM,CAAC,MAAM;UACrBK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,eAAe,EAAE,cAAc;YAC/BmE,OAAO,EAAE,CAAC;YACVC,OAAO,EAAE,IAAI;YACbC,UAAU,EAAE;UACd,CAAC;UAED,gBAAgB,EAAE;YAChBnD,KAAK,EAAE1B,KAAK,CAAC2B,UAAU,CAACC,KAAK,CAACF,KAAK;YAEnC,UAAU,EAAE;cACVoD,SAAS,EAAE,iBAAiB;cAC5BH,OAAO,EAAE;YACX;UACF;QACF,CAAC;MACH;IACF,CAAC;IACDI,cAAc,EAAE;MACd5E,cAAc,EAAE;QACd6E,eAAe,EAAE;UACfC,SAAS,EAAErF,2BAA2B,CAACG;QACzC;MACF;IACF,CAAC;IACDmF,YAAY,EAAE;MACZ/E,cAAc,EAAE;QACdgF,aAAa,EAAE;UACbC,GAAG,EAAE,CAAC;UACNC,KAAK,EAAE;QACT;MACF;IACF;EACF;AACF,CAAC;AACM,MAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG,IAAAE,gBAAS,EAACC,gCAAe,EAAEzF,KAAK,CAAC","ignoreList":[]}
|
|
@@ -135,7 +135,7 @@ const PageTemplate = ({
|
|
|
135
135
|
odysseyDesignTokens: odysseyDesignTokens,
|
|
136
136
|
children: [title && (0, _jsxRuntime.jsx)(_Typography.Heading4, {
|
|
137
137
|
children: title
|
|
138
|
-
}), description && (0, _jsxRuntime.jsx)(_Typography.
|
|
138
|
+
}), description && (0, _jsxRuntime.jsx)(_Typography.Paragraph, {
|
|
139
139
|
children: description
|
|
140
140
|
})]
|
|
141
141
|
}), (0, _jsxRuntime.jsxs)(TemplateHeaderSecondaryContent, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageTemplate.cjs","names":["_styled","_interopRequireDefault","require","_react","_index","_DocumentationLink","_OdysseyDesignTokensContext","_Typography","_useHasUiShell","_jsxRuntime","e","__esModule","default","TemplateContainer","styled","shouldForwardProp","prop","hasUiShell","isFullWidth","odysseyDesignTokens","maxWidth","Spacing6","marginInline","padding","TemplateHeader","display","alignItems","justifyContent","gap","Spacing4","TemplateHeaderPrimaryContent","TypographyLineLengthMax","marginBlockEnd","TemplateHeaderSecondaryContent","flexDirection","minHeight","Spacing7","whiteSpace","TemplateHeaderButtons","Spacing2","TemplateContent","includes","isDrawerOpen","drawerVariant","gridTemplateColumns","gridGap","marginBlock","animation","PageTemplate","children","description","documentationLink","documentationText","drawer","primaryCallToActionComponent","secondaryCallToActionComponent","tertiaryCallToActionComponent","title","useOdysseyDesignTokens","isOpen","variant","props","useHasUiShell","jsxs","jsx","Heading4","Subordinate","DocumentationLink","href","icon","DocumentationIcon","target","MemoizedPageTemplate","exports","memo","displayName"],"sources":["../../../../src/labs/PageTemplate/PageTemplate.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { memo, ReactElement, ReactNode } from \"react\";\n\nimport { DrawerProps } from \"../../Drawer.js\";\nimport { DocumentationIcon } from \"../../icons.generated/index.js\";\nimport { DocumentationLink } from \"./DocumentationLink.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\nimport { Heading4, Subordinate } from \"../../Typography.js\";\nimport { useHasUiShell } from \"../../ui-shell/useHasUiShell.js\";\n\nexport type PageTemplateProps = {\n /**\n * The title of the layout to be situated in the layout header\n */\n title?: string;\n /**\n * A supplementary description to be situated in the layout header\n */\n description?: string;\n /**\n * The destination for a documentation `Link` to be situated in the layout header\n */\n documentationLink?: string;\n /**\n * The text for a documentation `Link` to be situated in the layout header\n */\n documentationText?: string;\n /**\n * An optional `Drawer` object. Can be of variant 'temporary' or 'persistent'.\n */\n drawer?: ReactElement<DrawerProps>;\n /**\n * An optional `Button` object to be situated in the layout header. Should almost always be of variant `primary`.\n */\n primaryCallToActionComponent?: ReactElement;\n /**\n * An optional `Button` object to be situated in the layout header, alongside the `callToActionPrimaryComponent`.\n */\n secondaryCallToActionComponent?: ReactElement;\n /**\n * An optional `Button` object to be situated in the layout header, alongside the other two `callToAction` components.\n */\n tertiaryCallToActionComponent?: ReactElement;\n /**\n * The content of the layout. May be a `string` or any other `ReactNode` or array of `ReactNode`s. Will often be `Grid` objects.\n */\n children?: ReactNode;\n /**\n * When set to `true`, the layout expands past its max width of 1440px and spans the entire available screen width.\n */\n isFullWidth?: boolean;\n};\n\ntype TemplateContentProps = {\n odysseyDesignTokens: DesignTokens;\n isDrawerOpen?: boolean;\n drawerVariant?: string;\n};\n\nconst TemplateContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"hasUiShell\" &&\n prop !== \"isFullWidth\",\n})<{\n hasUiShell: boolean;\n isFullWidth: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(({ hasUiShell, isFullWidth, odysseyDesignTokens }) => ({\n maxWidth: isFullWidth\n ? \"100%\"\n : `calc(1440px + ${odysseyDesignTokens.Spacing6} + ${odysseyDesignTokens.Spacing6})`,\n marginInline:\n isFullWidth && !hasUiShell ? odysseyDesignTokens.Spacing6 : \"auto\",\n padding: hasUiShell ? 0 : odysseyDesignTokens.Spacing6,\n}));\n\nconst TemplateHeader = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n alignItems: \"flex-start\",\n justifyContent: \"space-between\",\n gap: odysseyDesignTokens.Spacing4,\n}));\n\nconst TemplateHeaderPrimaryContent = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n maxWidth: odysseyDesignTokens.TypographyLineLengthMax,\n [\".MuiTypography-root:last-child\"]: {\n marginBlockEnd: \"0\",\n },\n}));\n\nconst TemplateHeaderSecondaryContent = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n alignItems: \"flex-end\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: odysseyDesignTokens.Spacing4,\n minHeight: odysseyDesignTokens.Spacing7,\n justifyContent: \"center\",\n whiteSpace: \"nowrap\",\n}));\n\nconst TemplateHeaderButtons = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n gap: odysseyDesignTokens.Spacing2,\n}));\n\nconst TemplateContent = styled(\"div\", {\n shouldForwardProp: (prop) =>\n ![\"odysseyDesignTokens\", \"isDrawerOpen\", \"drawerVariant\"].includes(prop),\n})<TemplateContentProps>(\n ({ odysseyDesignTokens, isDrawerOpen, drawerVariant }) => ({\n \"@keyframes animate-drawer-open\": {\n \"0%\": {\n gridTemplateColumns: \"minmax(0, 1fr) 0\",\n },\n \"100%\": {\n gridTemplateColumns: \"minmax(0, 1fr) 360px\",\n },\n },\n \"@keyframes animate-drawer-close\": {\n \"0%\": {\n gridTemplateColumns: \"minmax(0, 1fr) 360px\",\n },\n \"100%\": {\n gridTemplateColumns: \"minmax(0, 1fr) 0\",\n },\n },\n display: \"grid\",\n gridGap:\n drawerVariant === \"persistent\" && !isDrawerOpen\n ? 0\n : odysseyDesignTokens.Spacing4,\n gap:\n drawerVariant === \"persistent\" && !isDrawerOpen\n ? 0\n : odysseyDesignTokens.Spacing4,\n marginBlock: odysseyDesignTokens.Spacing4,\n gridTemplateColumns:\n drawerVariant === \"persistent\"\n ? isDrawerOpen\n ? \"minmax(0, 1fr) 360px\"\n : \"minmax(0, 1fr) 0\"\n : \"minmax(0, 1fr)\",\n animation:\n drawerVariant === \"persistent\" && isDrawerOpen\n ? \"animate-drawer-open 225ms cubic-bezier(0, 0, 0.2, 1)\"\n : \"animate-drawer-close 225ms cubic-bezier(0, 0, 0.2, 1)\",\n }),\n);\n\nconst PageTemplate = ({\n children,\n description,\n documentationLink,\n documentationText,\n drawer,\n isFullWidth = false,\n primaryCallToActionComponent,\n secondaryCallToActionComponent,\n tertiaryCallToActionComponent,\n title,\n}: PageTemplateProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { isOpen: isDrawerOpen, variant: drawerVariant } = drawer?.props ?? {};\n\n const hasUiShell = useHasUiShell();\n\n return (\n <TemplateContainer\n hasUiShell={hasUiShell}\n isFullWidth={isFullWidth}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <TemplateHeader odysseyDesignTokens={odysseyDesignTokens}>\n <TemplateHeaderPrimaryContent odysseyDesignTokens={odysseyDesignTokens}>\n {title && <Heading4>{title}</Heading4>}\n {description && <Subordinate>{description}</Subordinate>}\n </TemplateHeaderPrimaryContent>\n\n <TemplateHeaderSecondaryContent\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {documentationLink && (\n <DocumentationLink\n href={documentationLink}\n icon={<DocumentationIcon />}\n target=\"_blank\"\n >\n {documentationText}\n </DocumentationLink>\n )}\n {(primaryCallToActionComponent ||\n secondaryCallToActionComponent ||\n tertiaryCallToActionComponent) && (\n <TemplateHeaderButtons odysseyDesignTokens={odysseyDesignTokens}>\n {tertiaryCallToActionComponent}\n {secondaryCallToActionComponent}\n {primaryCallToActionComponent}\n </TemplateHeaderButtons>\n )}\n </TemplateHeaderSecondaryContent>\n </TemplateHeader>\n <TemplateContent\n odysseyDesignTokens={odysseyDesignTokens}\n isDrawerOpen={isDrawerOpen}\n drawerVariant={drawerVariant}\n >\n {children}\n {drawer}\n </TemplateContent>\n </TemplateContainer>\n );\n};\n\nconst MemoizedPageTemplate = memo(PageTemplate);\nMemoizedPageTemplate.displayName = \"PageTemplate\";\n\nexport { MemoizedPageTemplate as PageTemplate };\n"],"mappings":";;;;;;AAYA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAGA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,2BAAA,GAAAJ,OAAA;AAIA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AAAgE,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAD,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAvBhE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgEA,MAAMG,iBAAiB,GAAG,IAAAC,eAAM,EAAC,KAAK,EAAE;EACtCC,iBAAiB,EAAGC,IAAI,IACtBA,IAAI,KAAK,qBAAqB,IAC9BA,IAAI,KAAK,YAAY,IACrBA,IAAI,KAAK;AACb,CAAC,CAAC,CAIC,CAAC;EAAEC,UAAU;EAAEC,WAAW;EAAEC;AAAoB,CAAC,MAAM;EACxDC,QAAQ,EAAEF,WAAW,GACjB,MAAM,GACN,iBAAiBC,mBAAmB,CAACE,QAAQ,MAAMF,mBAAmB,CAACE,QAAQ,GAAG;EACtFC,YAAY,EACVJ,WAAW,IAAI,CAACD,UAAU,GAAGE,mBAAmB,CAACE,QAAQ,GAAG,MAAM;EACpEE,OAAO,EAAEN,UAAU,GAAG,CAAC,GAAGE,mBAAmB,CAACE;AAChD,CAAC,CAAC,CAAC;AAEH,MAAMG,cAAc,GAAG,IAAAV,eAAM,EAAC,KAAK,EAAE;EACnCC,iBAAiB,EAAGC,IAAI,IAAKA,IAAI,KAAK;AACxC,CAAC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B;MAAA,CAC6B,CAAC;IAAA,CACnB,CAAC,EACjB,IAAA7C,WAAA,CAAAsD,IAAA,EAACvB,eAAe;MACdrB,mBAAmB,EAAEA,mBAAoB;MACzCuB,YAAY,EAAEA,YAAa;MAC3BC,aAAa,EAAEA,aAAc;MAAAM,QAAA,GAE5BA,QAAQ,EACRI,MAAM;IAAA,CACQ,CAAC;EAAA,CACD,CAAC;AAExB,CAAC;AAED,MAAMmB,oBAAoB,GAAAC,OAAA,CAAAzB,YAAA,GAAG,IAAA0B,WAAI,EAAC1B,YAAY,CAAC;AAC/CwB,oBAAoB,CAACG,WAAW,GAAG,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"PageTemplate.cjs","names":["_styled","_interopRequireDefault","require","_react","_index","_DocumentationLink","_OdysseyDesignTokensContext","_Typography","_useHasUiShell","_jsxRuntime","e","__esModule","default","TemplateContainer","styled","shouldForwardProp","prop","hasUiShell","isFullWidth","odysseyDesignTokens","maxWidth","Spacing6","marginInline","padding","TemplateHeader","display","alignItems","justifyContent","gap","Spacing4","TemplateHeaderPrimaryContent","TypographyLineLengthMax","marginBlockEnd","TemplateHeaderSecondaryContent","flexDirection","minHeight","Spacing7","whiteSpace","TemplateHeaderButtons","Spacing2","TemplateContent","includes","isDrawerOpen","drawerVariant","gridTemplateColumns","gridGap","marginBlock","animation","PageTemplate","children","description","documentationLink","documentationText","drawer","primaryCallToActionComponent","secondaryCallToActionComponent","tertiaryCallToActionComponent","title","useOdysseyDesignTokens","isOpen","variant","props","useHasUiShell","jsxs","jsx","Heading4","Paragraph","DocumentationLink","href","icon","DocumentationIcon","target","MemoizedPageTemplate","exports","memo","displayName"],"sources":["../../../../src/labs/PageTemplate/PageTemplate.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { memo, ReactElement, ReactNode } from \"react\";\n\nimport { DrawerProps } from \"../../Drawer.js\";\nimport { DocumentationIcon } from \"../../icons.generated/index.js\";\nimport { DocumentationLink } from \"./DocumentationLink.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\nimport { Heading4, Paragraph } from \"../../Typography.js\";\nimport { useHasUiShell } from \"../../ui-shell/useHasUiShell.js\";\n\nexport type PageTemplateProps = {\n /**\n * The title of the layout to be situated in the layout header\n */\n title?: string;\n /**\n * A supplementary description to be situated in the layout header\n */\n description?: string;\n /**\n * The destination for a documentation `Link` to be situated in the layout header\n */\n documentationLink?: string;\n /**\n * The text for a documentation `Link` to be situated in the layout header\n */\n documentationText?: string;\n /**\n * An optional `Drawer` object. Can be of variant 'temporary' or 'persistent'.\n */\n drawer?: ReactElement<DrawerProps>;\n /**\n * An optional `Button` object to be situated in the layout header. Should almost always be of variant `primary`.\n */\n primaryCallToActionComponent?: ReactElement;\n /**\n * An optional `Button` object to be situated in the layout header, alongside the `callToActionPrimaryComponent`.\n */\n secondaryCallToActionComponent?: ReactElement;\n /**\n * An optional `Button` object to be situated in the layout header, alongside the other two `callToAction` components.\n */\n tertiaryCallToActionComponent?: ReactElement;\n /**\n * The content of the layout. May be a `string` or any other `ReactNode` or array of `ReactNode`s. Will often be `Grid` objects.\n */\n children?: ReactNode;\n /**\n * When set to `true`, the layout expands past its max width of 1440px and spans the entire available screen width.\n */\n isFullWidth?: boolean;\n};\n\ntype TemplateContentProps = {\n odysseyDesignTokens: DesignTokens;\n isDrawerOpen?: boolean;\n drawerVariant?: string;\n};\n\nconst TemplateContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"hasUiShell\" &&\n prop !== \"isFullWidth\",\n})<{\n hasUiShell: boolean;\n isFullWidth: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(({ hasUiShell, isFullWidth, odysseyDesignTokens }) => ({\n maxWidth: isFullWidth\n ? \"100%\"\n : `calc(1440px + ${odysseyDesignTokens.Spacing6} + ${odysseyDesignTokens.Spacing6})`,\n marginInline:\n isFullWidth && !hasUiShell ? odysseyDesignTokens.Spacing6 : \"auto\",\n padding: hasUiShell ? 0 : odysseyDesignTokens.Spacing6,\n}));\n\nconst TemplateHeader = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n alignItems: \"flex-start\",\n justifyContent: \"space-between\",\n gap: odysseyDesignTokens.Spacing4,\n}));\n\nconst TemplateHeaderPrimaryContent = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n maxWidth: odysseyDesignTokens.TypographyLineLengthMax,\n [\".MuiTypography-root:last-child\"]: {\n marginBlockEnd: \"0\",\n },\n}));\n\nconst TemplateHeaderSecondaryContent = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n alignItems: \"flex-end\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: odysseyDesignTokens.Spacing4,\n minHeight: odysseyDesignTokens.Spacing7,\n justifyContent: \"center\",\n whiteSpace: \"nowrap\",\n}));\n\nconst TemplateHeaderButtons = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n gap: odysseyDesignTokens.Spacing2,\n}));\n\nconst TemplateContent = styled(\"div\", {\n shouldForwardProp: (prop) =>\n ![\"odysseyDesignTokens\", \"isDrawerOpen\", \"drawerVariant\"].includes(prop),\n})<TemplateContentProps>(\n ({ odysseyDesignTokens, isDrawerOpen, drawerVariant }) => ({\n \"@keyframes animate-drawer-open\": {\n \"0%\": {\n gridTemplateColumns: \"minmax(0, 1fr) 0\",\n },\n \"100%\": {\n gridTemplateColumns: \"minmax(0, 1fr) 360px\",\n },\n },\n \"@keyframes animate-drawer-close\": {\n \"0%\": {\n gridTemplateColumns: \"minmax(0, 1fr) 360px\",\n },\n \"100%\": {\n gridTemplateColumns: \"minmax(0, 1fr) 0\",\n },\n },\n display: \"grid\",\n gridGap:\n drawerVariant === \"persistent\" && !isDrawerOpen\n ? 0\n : odysseyDesignTokens.Spacing4,\n gap:\n drawerVariant === \"persistent\" && !isDrawerOpen\n ? 0\n : odysseyDesignTokens.Spacing4,\n marginBlock: odysseyDesignTokens.Spacing4,\n gridTemplateColumns:\n drawerVariant === \"persistent\"\n ? isDrawerOpen\n ? \"minmax(0, 1fr) 360px\"\n : \"minmax(0, 1fr) 0\"\n : \"minmax(0, 1fr)\",\n animation:\n drawerVariant === \"persistent\" && isDrawerOpen\n ? \"animate-drawer-open 225ms cubic-bezier(0, 0, 0.2, 1)\"\n : \"animate-drawer-close 225ms cubic-bezier(0, 0, 0.2, 1)\",\n }),\n);\n\nconst PageTemplate = ({\n children,\n description,\n documentationLink,\n documentationText,\n drawer,\n isFullWidth = false,\n primaryCallToActionComponent,\n secondaryCallToActionComponent,\n tertiaryCallToActionComponent,\n title,\n}: PageTemplateProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { isOpen: isDrawerOpen, variant: drawerVariant } = drawer?.props ?? {};\n\n const hasUiShell = useHasUiShell();\n\n return (\n <TemplateContainer\n hasUiShell={hasUiShell}\n isFullWidth={isFullWidth}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <TemplateHeader odysseyDesignTokens={odysseyDesignTokens}>\n <TemplateHeaderPrimaryContent odysseyDesignTokens={odysseyDesignTokens}>\n {title && <Heading4>{title}</Heading4>}\n {description && <Paragraph>{description}</Paragraph>}\n </TemplateHeaderPrimaryContent>\n\n <TemplateHeaderSecondaryContent\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {documentationLink && (\n <DocumentationLink\n href={documentationLink}\n icon={<DocumentationIcon />}\n target=\"_blank\"\n >\n {documentationText}\n </DocumentationLink>\n )}\n {(primaryCallToActionComponent ||\n secondaryCallToActionComponent ||\n tertiaryCallToActionComponent) && (\n <TemplateHeaderButtons odysseyDesignTokens={odysseyDesignTokens}>\n {tertiaryCallToActionComponent}\n {secondaryCallToActionComponent}\n {primaryCallToActionComponent}\n </TemplateHeaderButtons>\n )}\n </TemplateHeaderSecondaryContent>\n </TemplateHeader>\n <TemplateContent\n odysseyDesignTokens={odysseyDesignTokens}\n isDrawerOpen={isDrawerOpen}\n drawerVariant={drawerVariant}\n >\n {children}\n {drawer}\n </TemplateContent>\n </TemplateContainer>\n );\n};\n\nconst MemoizedPageTemplate = memo(PageTemplate);\nMemoizedPageTemplate.displayName = \"PageTemplate\";\n\nexport { MemoizedPageTemplate as PageTemplate };\n"],"mappings":";;;;;;AAYA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAGA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,2BAAA,GAAAJ,OAAA;AAIA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AAAgE,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAD,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAvBhE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgEA,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AAEC;QAAW,CAAY,CAAC;MAAA,CACxB,CAAC,EAE/B,IAAAzC,WAAA,CAAAsD,IAAA,EAAC9B,8BAA8B;QAC7Bd,mBAAmB,EAAEA,mBAAoB;QAAA8B,QAAA,GAExCE,iBAAiB,IAChB,IAAA1C,WAAA,CAAAuD,GAAA,EAAC3D,kBAAA,CAAA8D,iBAAiB;UAChBC,IAAI,EAAEjB,iBAAkB;UACxBkB,IAAI,EAAE,IAAA5D,WAAA,CAAAuD,GAAA,EAAC5D,MAAA,CAAAkE,iBAAiB,IAAE,CAAE;UAC5BC,MAAM,EAAC,QAAQ;UAAAtB,QAAA,EAEdG;QAAiB,CACD,CACpB,EACA,CAACE,4BAA4B,IAC5BC,8BAA8B,IAC9BC,6BAA6B,KAC7B,IAAA/C,WAAA,CAAAsD,IAAA,EAACzB,qBAAqB;UAACnB,mBAAmB,EAAEA,mBAAoB;UAAA8B,QAAA,GAC7DO,6BAA6B,EAC7BD,8BAA8B,EAC9BD,4BAA4B;QAAA,CACR,CACxB;MAAA,CAC6B,CAAC;IAAA,CACnB,CAAC,EACjB,IAAA7C,WAAA,CAAAsD,IAAA,EAACvB,eAAe;MACdrB,mBAAmB,EAAEA,mBAAoB;MACzCuB,YAAY,EAAEA,YAAa;MAC3BC,aAAa,EAAEA,aAAc;MAAAM,QAAA,GAE5BA,QAAQ,EACRI,MAAM;IAAA,CACQ,CAAC;EAAA,CACD,CAAC;AAExB,CAAC;AAED,MAAMmB,oBAAoB,GAAAC,OAAA,CAAAzB,YAAA,GAAG,IAAA0B,WAAI,EAAC1B,YAAY,CAAC;AAC/CwB,oBAAoB,CAACG,WAAW,GAAG,cAAc","ignoreList":[]}
|
|
@@ -15,5 +15,5 @@ exports.default = void 0;
|
|
|
15
15
|
*
|
|
16
16
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
17
17
|
*/
|
|
18
|
-
var _default = exports.default = "1-
|
|
18
|
+
var _default = exports.default = "1-38-0";
|
|
19
19
|
//# sourceMappingURL=odysseyWebComponentVersion.generated.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odysseyWebComponentVersion.generated.cjs","names":["_default","exports","default"],"sources":["../../../src/web-component/odysseyWebComponentVersion.generated.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n/**\n * DO NOT UPDATE THIS FILE MANUALLY\n * This file is managed by scripts/updateWebComponentVersion.ts and any changes made will be overwritten\n * This script only needs to be run during release, and shouldn't be used during local development.\n */\nexport default \"1-
|
|
1
|
+
{"version":3,"file":"odysseyWebComponentVersion.generated.cjs","names":["_default","exports","default"],"sources":["../../../src/web-component/odysseyWebComponentVersion.generated.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n/**\n * DO NOT UPDATE THIS FILE MANUALLY\n * This file is managed by scripts/updateWebComponentVersion.ts and any changes made will be overwritten\n * This script only needs to be run during release, and shouldn't be used during local development.\n */\nexport default \"1-38-0\";\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,IAAAA,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAiBe,QAAQ","ignoreList":[]}
|
package/dist/esm/EmptyState.js
CHANGED
|
@@ -29,6 +29,13 @@ const EmptyContainer = styled("div", {
|
|
|
29
29
|
width: "100%",
|
|
30
30
|
alignItems: "center"
|
|
31
31
|
}));
|
|
32
|
+
const TextContainer = styled("div", {
|
|
33
|
+
shouldForwardProp: prop => prop !== "odysseyDesignTokens"
|
|
34
|
+
})(({
|
|
35
|
+
odysseyDesignTokens
|
|
36
|
+
}) => ({
|
|
37
|
+
maxWidth: odysseyDesignTokens.TypographyLineLengthMax
|
|
38
|
+
}));
|
|
32
39
|
const EmptyState = ({
|
|
33
40
|
heading,
|
|
34
41
|
description,
|
|
@@ -38,10 +45,13 @@ const EmptyState = ({
|
|
|
38
45
|
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
39
46
|
return _jsxs(EmptyContainer, {
|
|
40
47
|
odysseyDesignTokens: odysseyDesignTokens,
|
|
41
|
-
children: [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
children: [_jsxs(TextContainer, {
|
|
49
|
+
odysseyDesignTokens: odysseyDesignTokens,
|
|
50
|
+
children: [_jsx(Heading4, {
|
|
51
|
+
children: heading
|
|
52
|
+
}), _jsx(Paragraph, {
|
|
53
|
+
children: description
|
|
54
|
+
})]
|
|
45
55
|
}), (PrimaryCallToActionComponent || SecondaryCallToActionComponent) && _jsxs(Box, {
|
|
46
56
|
sx: {
|
|
47
57
|
marginBlockStart: 5
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.js","names":["memo","Heading4","Paragraph","Box","styled","useOdysseyDesignTokens","jsx","_jsx","jsxs","_jsxs","EmptyContainer","shouldForwardProp","prop","odysseyDesignTokens","display","flexDirection","marginBlock","Spacing9","padding","Spacing5","textAlign","width","alignItems","EmptyState","heading","description","PrimaryCallToActionComponent","SecondaryCallToActionComponent","children","sx","marginBlockStart","MemoizedEmptyState","displayName","DataTableEmptyState"],"sources":["../../src/EmptyState.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { ReactNode, memo } from \"react\";\nimport { Heading4, Paragraph } from \"./Typography.js\";\nimport { Box } from \"./Box.js\";\nimport styled from \"@emotion/styled\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"./OdysseyDesignTokensContext.js\";\n\nconst EmptyContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n flexDirection: \"column\",\n marginBlock: odysseyDesignTokens.Spacing9,\n padding: odysseyDesignTokens.Spacing5,\n textAlign: \"center\",\n width: \"100%\",\n alignItems: \"center\",\n}));\n\nexport type EmptyStateProps = {\n /**\n * Main heading of the empty state\n */\n heading: string;\n /**\n * A descriptive text explaining more context as to why we don't have data.\n */\n description: string;\n /**\n * Primary call to action\n */\n PrimaryCallToActionComponent?: ReactNode;\n /**\n * Secondary call to action\n */\n SecondaryCallToActionComponent?: ReactNode;\n};\n\nconst EmptyState = ({\n heading,\n description,\n PrimaryCallToActionComponent,\n SecondaryCallToActionComponent,\n}: EmptyStateProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n return (\n <EmptyContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Heading4>{heading}</Heading4>\n
|
|
1
|
+
{"version":3,"file":"EmptyState.js","names":["memo","Heading4","Paragraph","Box","styled","useOdysseyDesignTokens","jsx","_jsx","jsxs","_jsxs","EmptyContainer","shouldForwardProp","prop","odysseyDesignTokens","display","flexDirection","marginBlock","Spacing9","padding","Spacing5","textAlign","width","alignItems","TextContainer","maxWidth","TypographyLineLengthMax","EmptyState","heading","description","PrimaryCallToActionComponent","SecondaryCallToActionComponent","children","sx","marginBlockStart","MemoizedEmptyState","displayName","DataTableEmptyState"],"sources":["../../src/EmptyState.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { ReactNode, memo } from \"react\";\nimport { Heading4, Paragraph } from \"./Typography.js\";\nimport { Box } from \"./Box.js\";\nimport styled from \"@emotion/styled\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"./OdysseyDesignTokensContext.js\";\n\nconst EmptyContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n flexDirection: \"column\",\n marginBlock: odysseyDesignTokens.Spacing9,\n padding: odysseyDesignTokens.Spacing5,\n textAlign: \"center\",\n width: \"100%\",\n alignItems: \"center\",\n}));\n\nconst TextContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n maxWidth: odysseyDesignTokens.TypographyLineLengthMax,\n}));\n\nexport type EmptyStateProps = {\n /**\n * Main heading of the empty state\n */\n heading: string;\n /**\n * A descriptive text explaining more context as to why we don't have data.\n */\n description: string;\n /**\n * Primary call to action\n */\n PrimaryCallToActionComponent?: ReactNode;\n /**\n * Secondary call to action\n */\n SecondaryCallToActionComponent?: ReactNode;\n};\n\nconst EmptyState = ({\n heading,\n description,\n PrimaryCallToActionComponent,\n SecondaryCallToActionComponent,\n}: EmptyStateProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n return (\n <EmptyContainer odysseyDesignTokens={odysseyDesignTokens}>\n <TextContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Heading4>{heading}</Heading4>\n <Paragraph>{description}</Paragraph>\n </TextContainer>\n {(PrimaryCallToActionComponent || SecondaryCallToActionComponent) && (\n <Box sx={{ marginBlockStart: 5 }}>\n {SecondaryCallToActionComponent}\n {PrimaryCallToActionComponent}\n </Box>\n )}\n </EmptyContainer>\n );\n};\n\nconst MemoizedEmptyState = memo(EmptyState);\nMemoizedEmptyState.displayName = \"EmptyState\";\n\nexport { MemoizedEmptyState as EmptyState };\nexport { MemoizedEmptyState as DataTableEmptyState };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAoBA,IAAI,QAAQ,OAAO;AACvC,SAASC,QAAQ,EAAEC,SAAS,QAAQ,iBAAiB;AACrD,SAASC,GAAG,QAAQ,UAAU;AAC9B,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SACEC,sBAAsB,QAEjB,iCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEzC,MAAMC,cAAc,GAAGN,MAAM,CAAC,KAAK,EAAE;EACnCO,iBAAiB,EAAGC,IAAI,IAAKA,IAAI,KAAK;AACxC,CAAC,CAAC,CAAwC,CAAC;EAAEC;AAAoB,CAAC,MAAM;EACtEC,OAAO,EAAE,MAAM;EACfC,aAAa,EAAE,QAAQ;EACvBC,WAAW,EAAEH,mBAAmB,CAACI,QAAQ;EACzCC,OAAO,EAAEL,mBAAmB,CAACM,QAAQ;EACrCC,SAAS,EAA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reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/export const addSpecificity = (specificityCount, selector) => {
|
|
12
|
+
const ampersands = "&".repeat(specificityCount);
|
|
13
|
+
return `${ampersands}${selector}`;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=addSpecificity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addSpecificity.js","names":["addSpecificity","specificityCount","selector","ampersands","repeat"],"sources":["../../src/addSpecificity.ts"],"sourcesContent":["/*!\n * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n/**\n * Adds CSS specificity to class selectors by prepending a specified number of ampersands.\n * This function helps override MUI component styles by increasing selector specificity.\n *\n * @param {number} specificityCount - Number of ampersands to prepend (e.g., 2 results in \"&&\")\n * @param {string} selector - The selector string to add specificity to.\n * Include spaces in the selector if needed for descendant selectors.\n * @returns {string} The selector with added specificity\n *\n * @example\n * // Direct selector: \"&&.MuiButton-root\"\n * addSpecificity(2, \".MuiButton-root\")\n *\n * // Descendant selector: \"&& .MuiButton-root\"\n * addSpecificity(2, \" .MuiButton-root\")\n *\n * // Direct selector with class reference:\n * addSpecificity(2, `.${buttonClasses.root}`)\n *\n * // Descendant selector with class reference:\n * addSpecificity(2, ` .${buttonClasses.root}`)\n *\n * // Combined selector: \"&&.MuiButton-root:hover\"\n * addSpecificity(2, \".MuiButton-root:hover\")\n */\nexport const addSpecificity = (\n specificityCount: number,\n selector: string,\n): string => {\n const ampersands = \"&\".repeat(specificityCount);\n return `${ampersands}${selector}`;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GA2BA,OAAO,MAAMA,cAAc,GAAGA,CAC5BC,gBAAwB,EACxBC,QAAgB,KACL;EACX,MAAMC,UAAU,GAAG,GAAG,CAACC,MAAM,CAACH,gBAAgB,CAAC;EAC/C,OAAO,GAAGE,UAAU,GAAGD,QAAQ,EAAE;AACnC,CAAC","ignoreList":[]}
|
|
@@ -24,18 +24,20 @@ import { dateTimePickerTheme } from "./dateTimePickerTheme.js";
|
|
|
24
24
|
import { CalendarIcon, ClockIcon } from "../../icons.generated/index.js";
|
|
25
25
|
import { useOdysseyDesignTokens } from "../../OdysseyDesignTokensContext.js";
|
|
26
26
|
import { OdysseyThemeProvider } from "../../OdysseyThemeProvider.js";
|
|
27
|
+
import { pxToRem } from "../../theme/index.js";
|
|
27
28
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
|
+
export const DateTimePickerSize = {
|
|
30
|
+
maxWidth: `${pxToRem(486)}rem`
|
|
31
|
+
};
|
|
28
32
|
const DatePickerContainer = styled.div({
|
|
29
33
|
".MuiFormControl-root": {
|
|
30
34
|
marginBlockEnd: 0
|
|
31
35
|
}
|
|
32
36
|
});
|
|
33
|
-
const DatePickerWidthContainer = styled.div(({
|
|
34
|
-
odysseyDesignTokens
|
|
35
|
-
}) => ({
|
|
37
|
+
const DatePickerWidthContainer = styled.div(() => ({
|
|
36
38
|
".MuiInput-root": {
|
|
37
39
|
width: "100%",
|
|
38
|
-
maxWidth:
|
|
40
|
+
maxWidth: DateTimePickerSize.maxWidth
|
|
39
41
|
}
|
|
40
42
|
}));
|
|
41
43
|
const TimeZonePickerContainer = styled("div", {
|