@cloudscape-design/components 3.0.620 → 3.0.622
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/annotation-context/annotation/styles.css.js +24 -24
- package/annotation-context/annotation/styles.scoped.css +31 -31
- package/annotation-context/annotation/styles.selectors.js +24 -24
- package/app-layout/classic.js.map +1 -1
- package/app-layout/notifications/styles.css.js +3 -3
- package/app-layout/notifications/styles.scoped.css +7 -7
- package/app-layout/notifications/styles.selectors.js +3 -3
- package/app-layout/visual-refresh/styles.css.js +81 -81
- package/app-layout/visual-refresh/styles.scoped.css +258 -258
- package/app-layout/visual-refresh/styles.selectors.js +81 -81
- package/area-chart/elements/use-highlight-details.js.map +1 -1
- package/code-editor/interfaces.d.ts +2 -2
- package/code-editor/interfaces.d.ts.map +1 -1
- package/code-editor/interfaces.js.map +1 -1
- package/code-editor/util.js.map +1 -1
- package/column-layout/internal.d.ts +1 -1
- package/column-layout/internal.d.ts.map +1 -1
- package/column-layout/internal.js.map +1 -1
- package/flashbar/styles.css.js +47 -47
- package/flashbar/styles.scoped.css +171 -171
- package/flashbar/styles.selectors.js +47 -47
- package/i18n/dynamic.js +30 -30
- package/i18n/messages/all.all.d.ts +1 -1
- package/i18n/messages/all.all.js +1 -14558
- package/i18n/messages/all.all.json +1 -14615
- package/i18n/messages/all.de.d.ts +1 -1
- package/i18n/messages/all.de.js +1 -1086
- package/i18n/messages/all.de.json +1 -1096
- package/i18n/messages/all.en-GB.d.ts +1 -1
- package/i18n/messages/all.en-GB.js +1 -1064
- package/i18n/messages/all.en-GB.json +1 -1067
- package/i18n/messages/all.en.d.ts +1 -1
- package/i18n/messages/all.en.js +1 -1064
- package/i18n/messages/all.en.json +1 -1063
- package/i18n/messages/all.es.d.ts +1 -1
- package/i18n/messages/all.es.js +1 -1080
- package/i18n/messages/all.es.json +1 -1083
- package/i18n/messages/all.fr.d.ts +1 -1
- package/i18n/messages/all.fr.js +1 -1104
- package/i18n/messages/all.fr.json +1 -1110
- package/i18n/messages/all.id.d.ts +1 -1
- package/i18n/messages/all.id.js +1 -1049
- package/i18n/messages/all.id.json +1 -1054
- package/i18n/messages/all.it.d.ts +1 -1
- package/i18n/messages/all.it.js +1 -1042
- package/i18n/messages/all.it.json +1 -1046
- package/i18n/messages/all.ja.d.ts +1 -1
- package/i18n/messages/all.ja.js +1 -1081
- package/i18n/messages/all.ja.json +1 -1083
- package/i18n/messages/all.ko.d.ts +1 -1
- package/i18n/messages/all.ko.js +1 -1054
- package/i18n/messages/all.ko.json +1 -1065
- package/i18n/messages/all.pt-BR.d.ts +1 -1
- package/i18n/messages/all.pt-BR.js +1 -1074
- package/i18n/messages/all.pt-BR.json +1 -1082
- package/i18n/messages/all.th.d.ts +1 -1
- package/i18n/messages/all.th.js +1 -733
- package/i18n/messages/all.th.json +1 -734
- package/i18n/messages/all.tr.d.ts +1 -1
- package/i18n/messages/all.tr.js +1 -1072
- package/i18n/messages/all.tr.json +1 -1079
- package/i18n/messages/all.zh-CN.d.ts +1 -1
- package/i18n/messages/all.zh-CN.js +1 -1054
- package/i18n/messages/all.zh-CN.json +1 -1053
- package/i18n/messages/all.zh-TW.d.ts +1 -1
- package/i18n/messages/all.zh-TW.js +1 -1053
- package/i18n/messages/all.zh-TW.json +1 -1052
- package/i18n/messages-types.d.ts +7 -0
- package/i18n/messages-types.d.ts.map +1 -1
- package/i18n/messages-types.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/internal/animate.js.map +1 -1
- package/internal/base-component/styles.scoped.css +25 -0
- package/internal/components/dropdown/dropdown-fit-handler.js.map +1 -1
- package/internal/components/dropdown/styles.css.js +20 -20
- package/internal/components/dropdown/styles.scoped.css +41 -41
- package/internal/components/dropdown/styles.selectors.js +20 -20
- package/internal/components/options-list/utils/use-highlight-option.d.ts.map +1 -1
- package/internal/components/options-list/utils/use-highlight-option.js.map +1 -1
- package/internal/environment.d.ts +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +2 -2
- package/internal/events/index.d.ts.map +1 -1
- package/internal/events/index.js.map +1 -1
- package/internal/focus-tracker.d.ts.map +1 -1
- package/internal/focus-tracker.js.map +1 -1
- package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
- package/internal/generated/custom-css-properties/index.js +51 -43
- package/internal/generated/custom-css-properties/index.js.map +1 -1
- package/internal/generated/styles/tokens.d.ts +5 -0
- package/internal/generated/styles/tokens.js +5 -0
- package/internal/generated/theming/index.cjs +155 -0
- package/internal/generated/theming/index.js +155 -0
- package/internal/hooks/container-queries/use-container-breakpoints.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/mixed-line-bar-chart/chart-container.js.map +1 -1
- package/package.json +2 -1
- package/pie-chart/utils.d.ts.map +1 -1
- package/pie-chart/utils.js.map +1 -1
- package/slider/index.d.ts +5 -0
- package/slider/index.d.ts.map +1 -0
- package/slider/index.js +14 -0
- package/slider/index.js.map +1 -0
- package/slider/interfaces.d.ts +75 -0
- package/slider/interfaces.d.ts.map +1 -0
- package/slider/interfaces.js +2 -0
- package/slider/interfaces.js.map +1 -0
- package/slider/internal.d.ts +7 -0
- package/slider/internal.d.ts.map +1 -0
- package/slider/internal.js +119 -0
- package/slider/internal.js.map +1 -0
- package/slider/slider-labels.d.ts +11 -0
- package/slider/slider-labels.d.ts.map +1 -0
- package/slider/slider-labels.js +76 -0
- package/slider/slider-labels.js.map +1 -0
- package/slider/styles.css.js +28 -0
- package/slider/styles.scoped.css +411 -0
- package/slider/styles.selectors.js +29 -0
- package/slider/tick-marks.d.ts +16 -0
- package/slider/tick-marks.d.ts.map +1 -0
- package/slider/tick-marks.js +37 -0
- package/slider/tick-marks.js.map +1 -0
- package/slider/utils.d.ts +9 -0
- package/slider/utils.d.ts.map +1 -0
- package/slider/utils.js +26 -0
- package/slider/utils.js.map +1 -0
- package/spinner/styles.css.js +13 -13
- package/spinner/styles.scoped.css +39 -39
- package/spinner/styles.selectors.js +13 -13
- package/table/internal.js.map +1 -1
- package/test-utils/dom/index.d.ts +3 -0
- package/test-utils/dom/index.js +12 -7
- package/test-utils/dom/index.js.map +1 -1
- package/test-utils/dom/slider/index.d.ts +6 -0
- package/test-utils/dom/slider/index.js +12 -0
- package/test-utils/dom/slider/index.js.map +1 -0
- package/test-utils/selectors/index.d.ts +3 -0
- package/test-utils/selectors/index.js +10 -4
- package/test-utils/selectors/index.js.map +1 -1
- package/test-utils/selectors/slider/index.d.ts +6 -0
- package/test-utils/selectors/slider/index.js +12 -0
- package/test-utils/selectors/slider/index.js.map +1 -0
- package/test-utils/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import styles from './styles.css.js';
|
|
6
|
+
import { useMobile } from '../internal/hooks/use-mobile/index.js';
|
|
7
|
+
import customCssProps from '../internal/generated/custom-css-properties/index.js';
|
|
8
|
+
export default function SliderLabels({ min, max, referenceValues, valueFormatter, labelsId, ariaDescription, }) {
|
|
9
|
+
const isMobile = useMobile();
|
|
10
|
+
const MAX_LABEL_COUNT = isMobile ? 4 : 10;
|
|
11
|
+
const minDistance = (max - min) / MAX_LABEL_COUNT;
|
|
12
|
+
// Returns only values that have enough distance between them to show properly.
|
|
13
|
+
// We also remove non-integer values and any values outside of the slider range.
|
|
14
|
+
const getVisibleReferenceValues = () => {
|
|
15
|
+
if (!referenceValues || referenceValues.length === 0) {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
const values = [];
|
|
19
|
+
let lastValue = min;
|
|
20
|
+
for (let i = 0; i <= referenceValues.length; i++) {
|
|
21
|
+
if (referenceValues[i] > min &&
|
|
22
|
+
referenceValues[i] < max &&
|
|
23
|
+
Math.abs(referenceValues[i] - lastValue) >= minDistance &&
|
|
24
|
+
Math.abs(max - referenceValues[i]) >= minDistance &&
|
|
25
|
+
Number.isInteger(referenceValues[i])) {
|
|
26
|
+
values.push(referenceValues[i]);
|
|
27
|
+
lastValue = referenceValues[i];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return values;
|
|
31
|
+
};
|
|
32
|
+
function getLabelPosition(index) {
|
|
33
|
+
const colSpan = Math.floor(minDistance / 2);
|
|
34
|
+
const positionStart = index - colSpan;
|
|
35
|
+
const positionEnd = index + colSpan;
|
|
36
|
+
// We simplify label treatment if the range is less than the max label count.
|
|
37
|
+
// This is because we don't need to add extra grid columns for necessary width.
|
|
38
|
+
const hasSmallRange = max - min <= MAX_LABEL_COUNT;
|
|
39
|
+
if (hasSmallRange) {
|
|
40
|
+
return {
|
|
41
|
+
min: 1,
|
|
42
|
+
max: (max - min) * 2 - 1,
|
|
43
|
+
posStart: (index - min) * 2,
|
|
44
|
+
posEnd: (index - min) * 2,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const roundedHalfCol = Math.round(colSpan / 2);
|
|
48
|
+
return {
|
|
49
|
+
min: colSpan * 2 + roundedHalfCol,
|
|
50
|
+
max: (max - min - colSpan) * 2 - roundedHalfCol + 1,
|
|
51
|
+
// add one to center the label
|
|
52
|
+
posStart: (positionStart - min) * 2 + 1 + roundedHalfCol,
|
|
53
|
+
posEnd: (positionEnd - min) * 2 - roundedHalfCol,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return (React.createElement(React.Fragment, null,
|
|
57
|
+
React.createElement("div", { role: "list", "aria-hidden": !valueFormatter && !referenceValues ? 'true' : undefined, className: clsx(styles.labels, {
|
|
58
|
+
[styles['labels-noref']]: getVisibleReferenceValues().length === 0,
|
|
59
|
+
}), style: {
|
|
60
|
+
[customCssProps.sliderLabelCount]: getVisibleReferenceValues().length === 0 ? 2 : (max - min) * 2,
|
|
61
|
+
}, id: !ariaDescription ? labelsId : undefined },
|
|
62
|
+
React.createElement("span", { role: "listitem", className: clsx(styles.label, styles['labels-min']), style: {
|
|
63
|
+
[customCssProps.sliderMinEnd]: getLabelPosition(0).min,
|
|
64
|
+
} }, valueFormatter ? valueFormatter(min) : min),
|
|
65
|
+
getVisibleReferenceValues().map(step => {
|
|
66
|
+
return (React.createElement("span", { role: "listitem", key: step, style: {
|
|
67
|
+
[customCssProps.sliderReferenceColumn]: getLabelPosition(step).posStart,
|
|
68
|
+
[customCssProps.sliderNextReferenceColumn]: getLabelPosition(step).posEnd,
|
|
69
|
+
}, className: clsx(styles.label, styles['labels-reference']) }, valueFormatter ? valueFormatter(step) : step));
|
|
70
|
+
}),
|
|
71
|
+
React.createElement("span", { role: "listitem", className: clsx(styles.label, styles['labels-max']), style: {
|
|
72
|
+
[customCssProps.sliderMaxStart]: !referenceValues ? 2 : getLabelPosition(0).max,
|
|
73
|
+
} }, valueFormatter ? valueFormatter(max) : max)),
|
|
74
|
+
ariaDescription && (React.createElement("div", { className: clsx(styles['labels-aria-description']), id: labelsId }, ariaDescription))));
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=slider-labels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider-labels.js","sourceRoot":"","sources":["../../../src/slider/slider-labels.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,OAAO,cAAc,MAAM,sDAAsD,CAAC;AAUlF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,GAAG,EACH,GAAG,EACH,eAAe,EACf,cAAc,EACd,QAAQ,EACR,eAAe,GACE;IACjB,MAAM,QAAQ,GAAG,SAAS,EAAE,CAAC;IAC7B,MAAM,eAAe,GAAG,QAAQ,CAAC,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Ae,IAAI,CAClB,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,IAClE,eAAe,CACZ,CACP,CACA,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport styles from './styles.css.js';\nimport { useMobile } from '../internal/hooks/use-mobile/index.js';\nimport customCssProps from '../internal/generated/custom-css-properties/index.js';\n\nexport interface SliderLabelProps {\n min: number;\n max: number;\n referenceValues?: ReadonlyArray<number>;\n valueFormatter?: (value: number) => string;\n labelsId: string;\n ariaDescription?: string;\n}\nexport default function SliderLabels({\n min,\n max,\n referenceValues,\n valueFormatter,\n labelsId,\n ariaDescription,\n}: SliderLabelProps) {\n const isMobile = useMobile();\n const MAX_LABEL_COUNT = isMobile ? 4 : 10;\n const minDistance = (max - min) / MAX_LABEL_COUNT;\n\n // Returns only values that have enough distance between them to show properly.\n // We also remove non-integer values and any values outside of the slider range.\n const getVisibleReferenceValues = () => {\n if (!referenceValues || referenceValues.length === 0) {\n return [];\n }\n\n const values: Array<number> = [];\n\n let lastValue = min;\n for (let i = 0; i <= referenceValues.length; i++) {\n if (\n referenceValues[i] > min &&\n referenceValues[i] < max &&\n Math.abs(referenceValues[i] - lastValue) >= minDistance &&\n Math.abs(max - referenceValues[i]) >= minDistance &&\n Number.isInteger(referenceValues[i])\n ) {\n values.push(referenceValues[i]);\n lastValue = referenceValues[i];\n }\n }\n return values;\n };\n\n function getLabelPosition(index: number) {\n const colSpan = Math.floor(minDistance / 2);\n const positionStart = index - colSpan;\n const positionEnd = index + colSpan;\n\n // We simplify label treatment if the range is less than the max label count.\n // This is because we don't need to add extra grid columns for necessary width.\n const hasSmallRange = max - min <= MAX_LABEL_COUNT;\n\n if (hasSmallRange) {\n return {\n min: 1,\n max: (max - min) * 2 - 1,\n posStart: (index - min) * 2,\n posEnd: (index - min) * 2,\n };\n }\n const roundedHalfCol = Math.round(colSpan / 2);\n\n return {\n min: colSpan * 2 + roundedHalfCol,\n max: (max - min - colSpan) * 2 - roundedHalfCol + 1,\n // add one to center the label\n posStart: (positionStart - min) * 2 + 1 + roundedHalfCol,\n posEnd: (positionEnd - min) * 2 - roundedHalfCol,\n };\n }\n\n return (\n <>\n <div\n role=\"list\"\n aria-hidden={!valueFormatter && !referenceValues ? 'true' : undefined}\n className={clsx(styles.labels, {\n [styles['labels-noref']]: getVisibleReferenceValues().length === 0,\n })}\n style={{\n [customCssProps.sliderLabelCount]: getVisibleReferenceValues().length === 0 ? 2 : (max - min) * 2,\n }}\n id={!ariaDescription ? labelsId : undefined}\n >\n <span\n role=\"listitem\"\n className={clsx(styles.label, styles['labels-min'])}\n style={{\n [customCssProps.sliderMinEnd]: getLabelPosition(0).min,\n }}\n >\n {valueFormatter ? valueFormatter(min) : min}\n </span>\n {getVisibleReferenceValues().map(step => {\n return (\n <span\n role=\"listitem\"\n key={step}\n style={{\n [customCssProps.sliderReferenceColumn]: getLabelPosition(step).posStart,\n [customCssProps.sliderNextReferenceColumn]: getLabelPosition(step).posEnd,\n }}\n className={clsx(styles.label, styles['labels-reference'])}\n >\n {valueFormatter ? valueFormatter(step) : step}\n </span>\n );\n })}\n <span\n role=\"listitem\"\n className={clsx(styles.label, styles['labels-max'])}\n style={{\n [customCssProps.sliderMaxStart]: !referenceValues ? 2 : getLabelPosition(0).max,\n }}\n >\n {valueFormatter ? valueFormatter(max) : max}\n </span>\n </div>\n {ariaDescription && (\n <div className={clsx(styles['labels-aria-description'])} id={labelsId}>\n {ariaDescription}\n </div>\n )}\n </>\n );\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
import './styles.scoped.css';
|
|
3
|
+
export default {
|
|
4
|
+
"root": "awsui_root_pcgz5_glf7y_103",
|
|
5
|
+
"slider": "awsui_slider_pcgz5_glf7y_143",
|
|
6
|
+
"slider-track": "awsui_slider-track_pcgz5_glf7y_147",
|
|
7
|
+
"slider-range": "awsui_slider-range_pcgz5_glf7y_147",
|
|
8
|
+
"disabled": "awsui_disabled_pcgz5_glf7y_162",
|
|
9
|
+
"error": "awsui_error_pcgz5_glf7y_171",
|
|
10
|
+
"active": "awsui_active_pcgz5_glf7y_174",
|
|
11
|
+
"error-active": "awsui_error-active_pcgz5_glf7y_177",
|
|
12
|
+
"labels": "awsui_labels_pcgz5_glf7y_184",
|
|
13
|
+
"labels-noref": "awsui_labels-noref_pcgz5_glf7y_190",
|
|
14
|
+
"labels-reference": "awsui_labels-reference_pcgz5_glf7y_193",
|
|
15
|
+
"labels-min": "awsui_labels-min_pcgz5_glf7y_200",
|
|
16
|
+
"labels-max": "awsui_labels-max_pcgz5_glf7y_206",
|
|
17
|
+
"labels-aria-description": "awsui_labels-aria-description_pcgz5_glf7y_214",
|
|
18
|
+
"ticks": "awsui_ticks_pcgz5_glf7y_232",
|
|
19
|
+
"ticks-wrapper": "awsui_ticks-wrapper_pcgz5_glf7y_238",
|
|
20
|
+
"tick": "awsui_tick_pcgz5_glf7y_232",
|
|
21
|
+
"middle": "awsui_middle_pcgz5_glf7y_253",
|
|
22
|
+
"filled": "awsui_filled_pcgz5_glf7y_256",
|
|
23
|
+
"tooltip-thumb": "awsui_tooltip-thumb_pcgz5_glf7y_272",
|
|
24
|
+
"thumb": "awsui_thumb_pcgz5_glf7y_280",
|
|
25
|
+
"min": "awsui_min_pcgz5_glf7y_295",
|
|
26
|
+
"max": "awsui_max_pcgz5_glf7y_298"
|
|
27
|
+
};
|
|
28
|
+
|
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
/* stylelint-disable plugin/no-unsupported-browser-features */
|
|
6
|
+
/* stylelint-enable plugin/no-unsupported-browser-features */
|
|
7
|
+
/*
|
|
8
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
9
|
+
SPDX-License-Identifier: Apache-2.0
|
|
10
|
+
*/
|
|
11
|
+
/*
|
|
12
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
13
|
+
SPDX-License-Identifier: Apache-2.0
|
|
14
|
+
*/
|
|
15
|
+
/*
|
|
16
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
17
|
+
SPDX-License-Identifier: Apache-2.0
|
|
18
|
+
*/
|
|
19
|
+
/*
|
|
20
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
21
|
+
SPDX-License-Identifier: Apache-2.0
|
|
22
|
+
*/
|
|
23
|
+
/*
|
|
24
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
25
|
+
SPDX-License-Identifier: Apache-2.0
|
|
26
|
+
*/
|
|
27
|
+
/*
|
|
28
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
29
|
+
SPDX-License-Identifier: Apache-2.0
|
|
30
|
+
*/
|
|
31
|
+
/*
|
|
32
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
33
|
+
SPDX-License-Identifier: Apache-2.0
|
|
34
|
+
*/
|
|
35
|
+
/*
|
|
36
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
37
|
+
SPDX-License-Identifier: Apache-2.0
|
|
38
|
+
*/
|
|
39
|
+
/*
|
|
40
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
41
|
+
SPDX-License-Identifier: Apache-2.0
|
|
42
|
+
*/
|
|
43
|
+
/*
|
|
44
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
45
|
+
SPDX-License-Identifier: Apache-2.0
|
|
46
|
+
*/
|
|
47
|
+
/*
|
|
48
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
49
|
+
SPDX-License-Identifier: Apache-2.0
|
|
50
|
+
*/
|
|
51
|
+
/*
|
|
52
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
53
|
+
SPDX-License-Identifier: Apache-2.0
|
|
54
|
+
*/
|
|
55
|
+
/*
|
|
56
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
57
|
+
SPDX-License-Identifier: Apache-2.0
|
|
58
|
+
*/
|
|
59
|
+
/*
|
|
60
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
61
|
+
SPDX-License-Identifier: Apache-2.0
|
|
62
|
+
*/
|
|
63
|
+
/*
|
|
64
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
65
|
+
SPDX-License-Identifier: Apache-2.0
|
|
66
|
+
*/
|
|
67
|
+
/*
|
|
68
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
69
|
+
SPDX-License-Identifier: Apache-2.0
|
|
70
|
+
*/
|
|
71
|
+
/* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
72
|
+
/* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
73
|
+
/*
|
|
74
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
75
|
+
SPDX-License-Identifier: Apache-2.0
|
|
76
|
+
*/
|
|
77
|
+
/*
|
|
78
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
79
|
+
SPDX-License-Identifier: Apache-2.0
|
|
80
|
+
*/
|
|
81
|
+
/*
|
|
82
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
83
|
+
SPDX-License-Identifier: Apache-2.0
|
|
84
|
+
*/
|
|
85
|
+
/*
|
|
86
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
87
|
+
SPDX-License-Identifier: Apache-2.0
|
|
88
|
+
*/
|
|
89
|
+
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
90
|
+
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
91
|
+
/*
|
|
92
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
93
|
+
SPDX-License-Identifier: Apache-2.0
|
|
94
|
+
*/
|
|
95
|
+
/*
|
|
96
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
97
|
+
SPDX-License-Identifier: Apache-2.0
|
|
98
|
+
*/
|
|
99
|
+
/*
|
|
100
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
101
|
+
SPDX-License-Identifier: Apache-2.0
|
|
102
|
+
*/
|
|
103
|
+
.awsui_root_pcgz5_glf7y_103:not(#\9) {
|
|
104
|
+
border-collapse: separate;
|
|
105
|
+
border-spacing: 0;
|
|
106
|
+
box-sizing: border-box;
|
|
107
|
+
caption-side: top;
|
|
108
|
+
cursor: auto;
|
|
109
|
+
direction: inherit;
|
|
110
|
+
empty-cells: show;
|
|
111
|
+
font-family: serif;
|
|
112
|
+
font-size: medium;
|
|
113
|
+
font-style: normal;
|
|
114
|
+
font-variant: normal;
|
|
115
|
+
font-weight: 400;
|
|
116
|
+
font-stretch: normal;
|
|
117
|
+
line-height: normal;
|
|
118
|
+
-webkit-hyphens: none;
|
|
119
|
+
hyphens: none;
|
|
120
|
+
letter-spacing: normal;
|
|
121
|
+
list-style: disc outside none;
|
|
122
|
+
tab-size: 8;
|
|
123
|
+
text-align: start;
|
|
124
|
+
text-indent: 0;
|
|
125
|
+
text-shadow: none;
|
|
126
|
+
text-transform: none;
|
|
127
|
+
visibility: visible;
|
|
128
|
+
white-space: normal;
|
|
129
|
+
word-spacing: normal;
|
|
130
|
+
font-size: var(--font-size-body-m-x4okxb, 14px);
|
|
131
|
+
line-height: var(--line-height-body-m-30ar75, 20px);
|
|
132
|
+
color: var(--color-text-body-default-at06ol, #000716);
|
|
133
|
+
font-weight: 400;
|
|
134
|
+
font-family: var(--font-family-base-dnvic8, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
135
|
+
-webkit-font-smoothing: auto;
|
|
136
|
+
-moz-osx-font-smoothing: auto;
|
|
137
|
+
font-size: var(--font-size-body-s-asqx2i, 12px);
|
|
138
|
+
padding-block: var(--space-s-34lx8l, 12px);
|
|
139
|
+
position: relative;
|
|
140
|
+
max-inline-size: 800px;
|
|
141
|
+
margin-inline: calc(var(--space-m-udix3p, 16px) / 2);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.awsui_slider_pcgz5_glf7y_143:not(#\9) {
|
|
145
|
+
display: flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
}
|
|
148
|
+
.awsui_slider-track_pcgz5_glf7y_147:not(#\9), .awsui_slider-range_pcgz5_glf7y_147:not(#\9) {
|
|
149
|
+
position: absolute;
|
|
150
|
+
border-start-start-radius: 3px;
|
|
151
|
+
border-start-end-radius: 3px;
|
|
152
|
+
border-end-start-radius: 3px;
|
|
153
|
+
border-end-end-radius: 3px;
|
|
154
|
+
margin-block-start: var(--space-xs-zb16t3, 8px);
|
|
155
|
+
margin-inline: calc(var(--space-m-udix3p, 16px) / -2);
|
|
156
|
+
}
|
|
157
|
+
.awsui_slider-track_pcgz5_glf7y_147:not(#\9) {
|
|
158
|
+
background-color: var(--color-background-slider-track-3m68rn, #7d8998);
|
|
159
|
+
inline-size: calc(100% + var(--space-m-udix3p, 16px));
|
|
160
|
+
block-size: 2px;
|
|
161
|
+
cursor: pointer;
|
|
162
|
+
}
|
|
163
|
+
.awsui_slider-track_pcgz5_glf7y_147.awsui_disabled_pcgz5_glf7y_162:not(#\9) {
|
|
164
|
+
cursor: default;
|
|
165
|
+
background-color: var(--color-background-control-disabled-pwkvgd, #d1d5db);
|
|
166
|
+
}
|
|
167
|
+
.awsui_slider-range_pcgz5_glf7y_147:not(#\9) {
|
|
168
|
+
background-color: var(--color-background-slider-handle-default-atrlod, #0972d3);
|
|
169
|
+
block-size: 4px;
|
|
170
|
+
inline-size: calc(var(--awsui-slider-range-inline-size-tkr9yl) + var(--space-m-udix3p, 16px));
|
|
171
|
+
}
|
|
172
|
+
.awsui_slider-range_pcgz5_glf7y_147.awsui_error_pcgz5_glf7y_171:not(#\9) {
|
|
173
|
+
background-color: var(--color-text-status-error-wdvepn, #d91515);
|
|
174
|
+
}
|
|
175
|
+
.awsui_slider-range_pcgz5_glf7y_147.awsui_active_pcgz5_glf7y_174:not(#\9) {
|
|
176
|
+
background-color: var(--color-background-slider-handle-active-ccegzg, #065299);
|
|
177
|
+
}
|
|
178
|
+
.awsui_slider-range_pcgz5_glf7y_147.awsui_error-active_pcgz5_glf7y_177:not(#\9) {
|
|
179
|
+
background-color: var(--color-background-slider-error-pressed-g7oqnt, #7c2718);
|
|
180
|
+
}
|
|
181
|
+
.awsui_slider-range_pcgz5_glf7y_147.awsui_disabled_pcgz5_glf7y_162:not(#\9) {
|
|
182
|
+
background-color: var(--color-background-control-disabled-pwkvgd, #d1d5db);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.awsui_labels_pcgz5_glf7y_184:not(#\9) {
|
|
186
|
+
display: grid;
|
|
187
|
+
grid-template-columns: 3fr repeat(calc((var(--awsui-slider-label-count-tkr9yl) - 2) / 2 + (var(--awsui-slider-label-count-tkr9yl) - 2) / 2 - 1), 2fr) 3fr;
|
|
188
|
+
grid-auto-rows: 100%;
|
|
189
|
+
padding-block-start: var(--space-m-udix3p, 16px);
|
|
190
|
+
}
|
|
191
|
+
.awsui_labels-noref_pcgz5_glf7y_190:not(#\9) {
|
|
192
|
+
grid-template-columns: 1fr 1fr;
|
|
193
|
+
}
|
|
194
|
+
.awsui_labels-reference_pcgz5_glf7y_193:not(#\9) {
|
|
195
|
+
grid-column-start: var(--awsui-slider-reference-column-tkr9yl);
|
|
196
|
+
grid-column-end: var(--awsui-slider-next-reference-column-tkr9yl);
|
|
197
|
+
grid-row: 1;
|
|
198
|
+
justify-self: center;
|
|
199
|
+
text-align: center;
|
|
200
|
+
}
|
|
201
|
+
.awsui_labels-min_pcgz5_glf7y_200:not(#\9) {
|
|
202
|
+
grid-column: 1;
|
|
203
|
+
grid-row: 1;
|
|
204
|
+
grid-column-end: var(--awsui-slider-min-end-tkr9yl);
|
|
205
|
+
margin-inline-start: calc(var(--space-m-udix3p, 16px) / -2);
|
|
206
|
+
}
|
|
207
|
+
.awsui_labels-max_pcgz5_glf7y_206:not(#\9) {
|
|
208
|
+
text-align: end;
|
|
209
|
+
justify-content: flex-end;
|
|
210
|
+
grid-row: 1;
|
|
211
|
+
grid-column-end: calc(var(--awsui-slider-label-count-tkr9yl) + 1);
|
|
212
|
+
grid-column-start: var(--awsui-slider-max-start-tkr9yl);
|
|
213
|
+
margin-inline-end: calc(var(--space-m-udix3p, 16px) / -2);
|
|
214
|
+
}
|
|
215
|
+
.awsui_labels-aria-description_pcgz5_glf7y_214:not(#\9) {
|
|
216
|
+
display: none;
|
|
217
|
+
}
|
|
218
|
+
@media (max-width: 576px) {
|
|
219
|
+
.awsui_labels_pcgz5_glf7y_184:not(#\9) {
|
|
220
|
+
grid-template-columns: 1fr 1fr;
|
|
221
|
+
}
|
|
222
|
+
.awsui_labels-min_pcgz5_glf7y_200:not(#\9) {
|
|
223
|
+
grid-column: 1;
|
|
224
|
+
}
|
|
225
|
+
.awsui_labels-max_pcgz5_glf7y_206:not(#\9) {
|
|
226
|
+
grid-column: 2;
|
|
227
|
+
}
|
|
228
|
+
.awsui_labels_pcgz5_glf7y_184 > .awsui_labels-reference_pcgz5_glf7y_193:not(#\9) {
|
|
229
|
+
display: none;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.awsui_ticks_pcgz5_glf7y_232:not(#\9) {
|
|
234
|
+
display: grid;
|
|
235
|
+
grid-template-columns: repeat(var(--awsui-slider-tick-count-tkr9yl), 1fr);
|
|
236
|
+
inline-size: calc(100% - var(--space-m-udix3p, 16px));
|
|
237
|
+
margin-inline: calc(var(--space-m-udix3p, 16px) / 2);
|
|
238
|
+
}
|
|
239
|
+
.awsui_ticks-wrapper_pcgz5_glf7y_238:not(#\9) {
|
|
240
|
+
block-size: 0;
|
|
241
|
+
display: flex;
|
|
242
|
+
margin-inline: calc(var(--space-m-udix3p, 16px) / -2);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.awsui_tick_pcgz5_glf7y_232:not(#\9) {
|
|
246
|
+
grid-row: 1;
|
|
247
|
+
block-size: var(--space-xs-zb16t3, 8px);
|
|
248
|
+
inline-size: var(--space-xxxs-zbmxqb, 2px);
|
|
249
|
+
padding-inline: 0;
|
|
250
|
+
padding-block: 0;
|
|
251
|
+
background: var(--color-background-slider-track-3m68rn, #7d8998);
|
|
252
|
+
inset-block-start: -4px;
|
|
253
|
+
}
|
|
254
|
+
.awsui_tick_pcgz5_glf7y_232.awsui_middle_pcgz5_glf7y_253:not(#\9):first-child, .awsui_tick_pcgz5_glf7y_232.awsui_middle_pcgz5_glf7y_253:not(#\9):last-child {
|
|
255
|
+
visibility: hidden;
|
|
256
|
+
}
|
|
257
|
+
.awsui_tick_pcgz5_glf7y_232.awsui_filled_pcgz5_glf7y_256:not(#\9) {
|
|
258
|
+
background: var(--color-background-slider-handle-default-atrlod, #0972d3);
|
|
259
|
+
}
|
|
260
|
+
.awsui_tick_pcgz5_glf7y_232.awsui_active_pcgz5_glf7y_174:not(#\9) {
|
|
261
|
+
background: var(--color-background-slider-handle-active-ccegzg, #065299);
|
|
262
|
+
}
|
|
263
|
+
.awsui_tick_pcgz5_glf7y_232.awsui_error_pcgz5_glf7y_171:not(#\9) {
|
|
264
|
+
background: var(--color-text-status-error-wdvepn, #d91515);
|
|
265
|
+
}
|
|
266
|
+
.awsui_tick_pcgz5_glf7y_232.awsui_error-active_pcgz5_glf7y_177:not(#\9) {
|
|
267
|
+
background-color: var(--color-background-slider-error-pressed-g7oqnt, #7c2718);
|
|
268
|
+
}
|
|
269
|
+
.awsui_tick_pcgz5_glf7y_232.awsui_disabled_pcgz5_glf7y_162:not(#\9) {
|
|
270
|
+
background: var(--color-background-control-disabled-pwkvgd, #d1d5db);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.awsui_tooltip-thumb_pcgz5_glf7y_272:not(#\9) {
|
|
274
|
+
position: absolute;
|
|
275
|
+
inline-size: var(--space-xxl-cu2m1r, 32px);
|
|
276
|
+
block-size: var(--space-xxl-cu2m1r, 32px);
|
|
277
|
+
margin-block-start: calc(var(--space-s-34lx8l, 12px) / -1);
|
|
278
|
+
inset-inline-start: var(--awsui-slider-tooltip-position-tkr9yl);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.awsui_thumb_pcgz5_glf7y_280:not(#\9) {
|
|
282
|
+
background: transparent;
|
|
283
|
+
-webkit-appearance: none;
|
|
284
|
+
appearance: none;
|
|
285
|
+
position: absolute;
|
|
286
|
+
block-size: 0;
|
|
287
|
+
inline-size: calc(100% + var(--space-m-udix3p, 16px));
|
|
288
|
+
margin-inline-start: calc(var(--space-m-udix3p, 16px) / -2);
|
|
289
|
+
outline: 0;
|
|
290
|
+
margin-block-start: var(--space-xxs-p8yyaw, 4px);
|
|
291
|
+
cursor: pointer;
|
|
292
|
+
touch-action: none;
|
|
293
|
+
}
|
|
294
|
+
.awsui_thumb_pcgz5_glf7y_280.awsui_disabled_pcgz5_glf7y_162:not(#\9) {
|
|
295
|
+
cursor: default;
|
|
296
|
+
}
|
|
297
|
+
.awsui_thumb_pcgz5_glf7y_280.awsui_min_pcgz5_glf7y_295:not(#\9) {
|
|
298
|
+
margin-inline-start: calc(-1px + var(--space-m-udix3p, 16px) / -2);
|
|
299
|
+
}
|
|
300
|
+
.awsui_thumb_pcgz5_glf7y_280.awsui_max_pcgz5_glf7y_298:not(#\9) {
|
|
301
|
+
margin-inline-start: calc(1px + var(--space-m-udix3p, 16px) / -2);
|
|
302
|
+
}
|
|
303
|
+
.awsui_thumb_pcgz5_glf7y_280:not(#\9)::-webkit-slider-thumb {
|
|
304
|
+
-webkit-appearance: none;
|
|
305
|
+
appearance: none;
|
|
306
|
+
appearance: none;
|
|
307
|
+
background: var(--color-background-slider-handle-default-atrlod, #0972d3);
|
|
308
|
+
border-color: var(--color-background-slider-handle-default-atrlod, #0972d3);
|
|
309
|
+
border-block-width: 2px;
|
|
310
|
+
border-inline-width: 2px;
|
|
311
|
+
border-start-start-radius: 50%;
|
|
312
|
+
border-start-end-radius: 50%;
|
|
313
|
+
border-end-start-radius: 50%;
|
|
314
|
+
border-end-end-radius: 50%;
|
|
315
|
+
box-shadow: none;
|
|
316
|
+
cursor: pointer;
|
|
317
|
+
block-size: var(--space-m-udix3p, 16px);
|
|
318
|
+
inline-size: var(--space-m-udix3p, 16px);
|
|
319
|
+
pointer-events: all;
|
|
320
|
+
position: relative;
|
|
321
|
+
}
|
|
322
|
+
.awsui_thumb_pcgz5_glf7y_280:not(#\9)::-moz-range-thumb {
|
|
323
|
+
appearance: none;
|
|
324
|
+
appearance: none;
|
|
325
|
+
background: var(--color-background-slider-handle-default-atrlod, #0972d3);
|
|
326
|
+
border-color: var(--color-background-slider-handle-default-atrlod, #0972d3);
|
|
327
|
+
border-block-width: 2px;
|
|
328
|
+
border-inline-width: 2px;
|
|
329
|
+
border-start-start-radius: 50%;
|
|
330
|
+
border-start-end-radius: 50%;
|
|
331
|
+
border-end-start-radius: 50%;
|
|
332
|
+
border-end-end-radius: 50%;
|
|
333
|
+
box-shadow: none;
|
|
334
|
+
cursor: pointer;
|
|
335
|
+
block-size: var(--space-m-udix3p, 16px);
|
|
336
|
+
inline-size: var(--space-m-udix3p, 16px);
|
|
337
|
+
pointer-events: all;
|
|
338
|
+
position: relative;
|
|
339
|
+
}
|
|
340
|
+
.awsui_thumb_pcgz5_glf7y_280:not(#\9):hover::-webkit-slider-thumb {
|
|
341
|
+
box-shadow: 0px 0 0 2px var(--color-background-slider-handle-ring-31445h, #ffffff), 0 0 0 4px var(--color-background-slider-handle-default-atrlod, #0972d3);
|
|
342
|
+
}
|
|
343
|
+
.awsui_thumb_pcgz5_glf7y_280:not(#\9):hover::-moz-range-thumb {
|
|
344
|
+
box-shadow: 0px 0 0 2px var(--color-background-slider-handle-ring-31445h, #ffffff), 0 0 0 4px var(--color-background-slider-handle-default-atrlod, #0972d3);
|
|
345
|
+
}
|
|
346
|
+
.awsui_thumb_pcgz5_glf7y_280:not(#\9):focus::-webkit-slider-thumb, .awsui_thumb_pcgz5_glf7y_280:not(#\9):active::-webkit-slider-thumb {
|
|
347
|
+
block-size: 20px;
|
|
348
|
+
inline-size: 20px;
|
|
349
|
+
box-shadow: 0px 0 0 2px var(--color-background-slider-handle-ring-31445h, #ffffff), 0 0 0 4px var(--color-background-slider-handle-active-ccegzg, #065299);
|
|
350
|
+
background: var(--color-background-slider-handle-active-ccegzg, #065299);
|
|
351
|
+
border-color: var(--color-background-slider-handle-active-ccegzg, #065299);
|
|
352
|
+
border-block-width: 2px;
|
|
353
|
+
border-inline-width: 2px;
|
|
354
|
+
}
|
|
355
|
+
.awsui_thumb_pcgz5_glf7y_280:not(#\9):focus::-moz-range-thumb, .awsui_thumb_pcgz5_glf7y_280:not(#\9):active::-moz-range-thumb {
|
|
356
|
+
block-size: 20px;
|
|
357
|
+
inline-size: 20px;
|
|
358
|
+
box-shadow: 0px 0 0 2px var(--color-background-slider-handle-ring-31445h, #ffffff), 0 0 0 4px var(--color-background-slider-handle-active-ccegzg, #065299);
|
|
359
|
+
background: var(--color-background-slider-handle-active-ccegzg, #065299);
|
|
360
|
+
border-color: var(--color-background-slider-handle-active-ccegzg, #065299);
|
|
361
|
+
border-block-width: 2px;
|
|
362
|
+
border-inline-width: 2px;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.awsui_error_pcgz5_glf7y_171:not(#\9)::-webkit-slider-thumb {
|
|
366
|
+
background-color: var(--color-text-status-error-wdvepn, #d91515);
|
|
367
|
+
border-color: var(--color-text-status-error-wdvepn, #d91515);
|
|
368
|
+
}
|
|
369
|
+
.awsui_error_pcgz5_glf7y_171:not(#\9)::-moz-range-thumb {
|
|
370
|
+
background-color: var(--color-text-status-error-wdvepn, #d91515);
|
|
371
|
+
border-color: var(--color-text-status-error-wdvepn, #d91515);
|
|
372
|
+
}
|
|
373
|
+
.awsui_error_pcgz5_glf7y_171:not(#\9):hover::-webkit-slider-thumb {
|
|
374
|
+
background-color: var(--color-text-status-error-wdvepn, #d91515);
|
|
375
|
+
box-shadow: 0px 0 0 2px var(--color-background-slider-handle-ring-31445h, #ffffff), 0 0 0 4px var(--color-text-status-error-wdvepn, #d91515);
|
|
376
|
+
}
|
|
377
|
+
.awsui_error_pcgz5_glf7y_171:not(#\9):hover::-moz-range-thumb {
|
|
378
|
+
background-color: var(--color-text-status-error-wdvepn, #d91515);
|
|
379
|
+
box-shadow: 0px 0 0 2px var(--color-background-slider-handle-ring-31445h, #ffffff), 0 0 0 4px var(--color-text-status-error-wdvepn, #d91515);
|
|
380
|
+
}
|
|
381
|
+
.awsui_error_pcgz5_glf7y_171:not(#\9):focus::-webkit-slider-thumb, .awsui_error_pcgz5_glf7y_171:not(#\9):active::-webkit-slider-thumb {
|
|
382
|
+
background-color: var(--color-background-slider-error-pressed-g7oqnt, #7c2718);
|
|
383
|
+
border-block-width: 2px;
|
|
384
|
+
border-inline-width: 2px;
|
|
385
|
+
border-color: var(--color-background-slider-error-pressed-g7oqnt, #7c2718);
|
|
386
|
+
box-shadow: 0px 0 0 2px var(--color-background-slider-handle-ring-31445h, #ffffff), 0 0 0 4px var(--color-background-slider-error-pressed-g7oqnt, #7c2718);
|
|
387
|
+
}
|
|
388
|
+
.awsui_error_pcgz5_glf7y_171:not(#\9):focus::-moz-range-thumb, .awsui_error_pcgz5_glf7y_171:not(#\9):active::-moz-range-thumb {
|
|
389
|
+
background-color: var(--color-background-slider-error-pressed-g7oqnt, #7c2718);
|
|
390
|
+
border-block-width: 2px;
|
|
391
|
+
border-inline-width: 2px;
|
|
392
|
+
border-color: var(--color-background-slider-error-pressed-g7oqnt, #7c2718);
|
|
393
|
+
box-shadow: 0px 0 0 2px var(--color-background-slider-handle-ring-31445h, #ffffff), 0 0 0 4px var(--color-background-slider-error-pressed-g7oqnt, #7c2718);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.awsui_disabled_pcgz5_glf7y_162:not(#\9)::-webkit-slider-thumb,
|
|
397
|
+
.awsui_disabled_pcgz5_glf7y_162:not(#\9):hover::-webkit-slider-thumb,
|
|
398
|
+
.awsui_disabled_pcgz5_glf7y_162:not(#\9):active::-webkit-slider-thumb {
|
|
399
|
+
background-color: var(--color-background-control-disabled-pwkvgd, #d1d5db);
|
|
400
|
+
border-color: var(--color-background-control-disabled-pwkvgd, #d1d5db);
|
|
401
|
+
box-shadow: none;
|
|
402
|
+
pointer-events: none;
|
|
403
|
+
}
|
|
404
|
+
.awsui_disabled_pcgz5_glf7y_162:not(#\9)::-moz-range-thumb,
|
|
405
|
+
.awsui_disabled_pcgz5_glf7y_162:not(#\9):hover::-moz-range-thumb,
|
|
406
|
+
.awsui_disabled_pcgz5_glf7y_162:not(#\9):active::-moz-range-thumb {
|
|
407
|
+
background-color: var(--color-background-control-disabled-pwkvgd, #d1d5db);
|
|
408
|
+
border-color: var(--color-background-control-disabled-pwkvgd, #d1d5db);
|
|
409
|
+
box-shadow: none;
|
|
410
|
+
pointer-events: none;
|
|
411
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
// es-module interop with Babel and Typescript
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
module.exports.default = {
|
|
5
|
+
"root": "awsui_root_pcgz5_glf7y_103",
|
|
6
|
+
"slider": "awsui_slider_pcgz5_glf7y_143",
|
|
7
|
+
"slider-track": "awsui_slider-track_pcgz5_glf7y_147",
|
|
8
|
+
"slider-range": "awsui_slider-range_pcgz5_glf7y_147",
|
|
9
|
+
"disabled": "awsui_disabled_pcgz5_glf7y_162",
|
|
10
|
+
"error": "awsui_error_pcgz5_glf7y_171",
|
|
11
|
+
"active": "awsui_active_pcgz5_glf7y_174",
|
|
12
|
+
"error-active": "awsui_error-active_pcgz5_glf7y_177",
|
|
13
|
+
"labels": "awsui_labels_pcgz5_glf7y_184",
|
|
14
|
+
"labels-noref": "awsui_labels-noref_pcgz5_glf7y_190",
|
|
15
|
+
"labels-reference": "awsui_labels-reference_pcgz5_glf7y_193",
|
|
16
|
+
"labels-min": "awsui_labels-min_pcgz5_glf7y_200",
|
|
17
|
+
"labels-max": "awsui_labels-max_pcgz5_glf7y_206",
|
|
18
|
+
"labels-aria-description": "awsui_labels-aria-description_pcgz5_glf7y_214",
|
|
19
|
+
"ticks": "awsui_ticks_pcgz5_glf7y_232",
|
|
20
|
+
"ticks-wrapper": "awsui_ticks-wrapper_pcgz5_glf7y_238",
|
|
21
|
+
"tick": "awsui_tick_pcgz5_glf7y_232",
|
|
22
|
+
"middle": "awsui_middle_pcgz5_glf7y_253",
|
|
23
|
+
"filled": "awsui_filled_pcgz5_glf7y_256",
|
|
24
|
+
"tooltip-thumb": "awsui_tooltip-thumb_pcgz5_glf7y_272",
|
|
25
|
+
"thumb": "awsui_thumb_pcgz5_glf7y_280",
|
|
26
|
+
"min": "awsui_min_pcgz5_glf7y_295",
|
|
27
|
+
"max": "awsui_max_pcgz5_glf7y_298"
|
|
28
|
+
};
|
|
29
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface SliderTicksProps {
|
|
3
|
+
hideFillLine?: boolean;
|
|
4
|
+
value: number;
|
|
5
|
+
isActive: boolean;
|
|
6
|
+
invalid?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
min: number;
|
|
9
|
+
max: number;
|
|
10
|
+
step: number;
|
|
11
|
+
}
|
|
12
|
+
export interface SliderTickMarkProps extends SliderTicksProps {
|
|
13
|
+
type: 'min' | 'max' | 'step';
|
|
14
|
+
}
|
|
15
|
+
export default function SliderTickMarks(props: SliderTicksProps): JSX.Element;
|
|
16
|
+
//# sourceMappingURL=tick-marks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tick-marks.d.ts","sourceRoot":"","sources":["../../../src/slider/tick-marks.tsx"],"names":[],"mappings":";AAQA,MAAM,WAAW,gBAAgB;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;CAC9B;AA6BD,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,gBAAgB,eAmB9D"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import customCssProps from '../internal/generated/custom-css-properties/index.js';
|
|
6
|
+
import styles from './styles.css.js';
|
|
7
|
+
import { getStepArray } from './utils.js';
|
|
8
|
+
function TickMark(props) {
|
|
9
|
+
const { hideFillLine, value, isActive, invalid, disabled, type, min, max, step } = props;
|
|
10
|
+
const getType = () => {
|
|
11
|
+
if (type === 'min') {
|
|
12
|
+
return min;
|
|
13
|
+
}
|
|
14
|
+
if (type === 'max') {
|
|
15
|
+
return max;
|
|
16
|
+
}
|
|
17
|
+
return step;
|
|
18
|
+
};
|
|
19
|
+
return (React.createElement("div", { className: clsx(styles.tick, {
|
|
20
|
+
[styles.filled]: !hideFillLine && value > getType(),
|
|
21
|
+
[styles.active]: !hideFillLine && isActive && value > getType(),
|
|
22
|
+
[styles.error]: invalid && !hideFillLine && value > getType(),
|
|
23
|
+
[styles['error-active']]: invalid && isActive && !hideFillLine && value > getType(),
|
|
24
|
+
[styles.disabled]: disabled,
|
|
25
|
+
[styles.middle]: type === 'step',
|
|
26
|
+
}) }));
|
|
27
|
+
}
|
|
28
|
+
export default function SliderTickMarks(props) {
|
|
29
|
+
const { min, max, step } = props;
|
|
30
|
+
return (React.createElement("div", { className: clsx(styles['ticks-wrapper']) },
|
|
31
|
+
React.createElement(TickMark, Object.assign({}, props, { type: "min" })),
|
|
32
|
+
React.createElement("div", { className: clsx(styles.ticks), style: {
|
|
33
|
+
[customCssProps.sliderTickCount]: Math.round((max - min) / step),
|
|
34
|
+
} }, getStepArray(step, [min, max]).map((step, index) => (React.createElement(TickMark, Object.assign({}, props, { type: "step", step: step, key: `step-${index}` }))))),
|
|
35
|
+
React.createElement(TickMark, Object.assign({}, props, { type: "max" }))));
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=tick-marks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tick-marks.js","sourceRoot":"","sources":["../../../src/slider/tick-marks.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,cAAc,MAAM,sDAAsD,CAAC;AAClF,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAiB1C,SAAS,QAAQ,CAAC,KAA0B;IAC1C,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,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,KAAK,CAAC,EAC7B,KAAK,EAAE;gBACL,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC;aACjE,IAEA,YAAY,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CACnD,oBAAC,QAAQ,oBAAK,KAAK,IAAE,IAAI,EAAC,MAAM,EAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,KAAK,EAAE,IAAI,CACtE,CAAC,CACE;QACN,oBAAC,QAAQ,oBAAK,KAAK,IAAE,IAAI,EAAC,KAAK,IAAG,CAC9B,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport customCssProps from '../internal/generated/custom-css-properties/index.js';\nimport styles from './styles.css.js';\nimport { getStepArray } from './utils.js';\n\nexport interface SliderTicksProps {\n hideFillLine?: boolean;\n value: number;\n isActive: boolean;\n invalid?: boolean;\n disabled?: boolean;\n min: number;\n max: number;\n step: number;\n}\n\nexport interface SliderTickMarkProps extends SliderTicksProps {\n type: 'min' | 'max' | 'step';\n}\n\nfunction TickMark(props: SliderTickMarkProps) {\n const { hideFillLine, value, isActive, invalid, disabled, type, min, max, step } = props;\n\n const getType = () => {\n if (type === 'min') {\n return min;\n }\n if (type === 'max') {\n return max;\n }\n return step;\n };\n\n return (\n <div\n className={clsx(styles.tick, {\n [styles.filled]: !hideFillLine && value > getType(),\n [styles.active]: !hideFillLine && isActive && value > getType(),\n [styles.error]: invalid && !hideFillLine && value > getType(),\n [styles['error-active']]: invalid && isActive && !hideFillLine && value > getType(),\n [styles.disabled]: disabled,\n [styles.middle]: type === 'step',\n })}\n />\n );\n}\n\nexport default function SliderTickMarks(props: SliderTicksProps) {\n const { min, max, step } = props;\n\n return (\n <div className={clsx(styles['ticks-wrapper'])}>\n <TickMark {...props} type=\"min\" />\n <div\n className={clsx(styles.ticks)}\n style={{\n [customCssProps.sliderTickCount]: Math.round((max - min) / step),\n }}\n >\n {getStepArray(step, [min, max]).map((step, index) => (\n <TickMark {...props} type=\"step\" step={step} key={`step-${index}`} />\n ))}\n </div>\n <TickMark {...props} type=\"max\" />\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function getPercent(value: number, range: [min: number, max: number]): number;
|
|
2
|
+
export declare const getStepArray: (step: number, range: [min: number, max: number]) => number[];
|
|
3
|
+
export declare const findLowerAndHigherValues: <T extends number>(array: readonly T[], value: T) => {
|
|
4
|
+
lower: T | undefined;
|
|
5
|
+
higher: T | undefined;
|
|
6
|
+
};
|
|
7
|
+
export declare const valuesAreValid: (referenceValues: ReadonlyArray<number>) => boolean;
|
|
8
|
+
export declare const THUMB_SIZE = 16;
|
|
9
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/slider/utils.ts"],"names":[],"mappings":"AAGA,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,UAE1E;AACD,eAAO,MAAM,YAAY,SAAU,MAAM,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,aAO3E,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;CAYpC,CAAC;AAEF,eAAO,MAAM,cAAc,oBAAqB,cAAc,MAAM,CAAC,YAIpE,CAAC;AAEF,eAAO,MAAM,UAAU,KAAK,CAAC"}
|