@cloudscape-design/components-themeable 3.0.1391 → 3.0.1392
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/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/box/visual-accent.scss +0 -24
- package/lib/internal/scss/button/constants.scss +15 -0
- package/lib/internal/scss/button/styles.scss +21 -1
- package/lib/internal/scss/input/styles.scss +15 -29
- package/lib/internal/scss/internal/components/autosuggest-input/styles.scss +138 -0
- package/lib/internal/scss/internal/components/autosuggest-input/test-classes/styles.scss +19 -0
- package/lib/internal/scss/internal/components/button-trigger/styles.scss +20 -1
- package/lib/internal/scss/internal/components/control-group/styles.scss +39 -15
- package/lib/internal/scss/internal/components/control-group/test-classes/styles.scss +16 -0
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/scss/internal/styles/forms/grouped-control.scss +65 -0
- package/lib/internal/scss/internal/styles/forms/index.scss +1 -0
- package/lib/internal/scss/internal/styles/forms/mixins.scss +41 -43
- package/lib/internal/scss/internal/styles/utils/mixins.scss +10 -0
- package/lib/internal/template/autosuggest/i18n-utils.d.ts +12 -0
- package/lib/internal/template/autosuggest/i18n-utils.d.ts.map +1 -0
- package/lib/internal/template/autosuggest/i18n-utils.js +15 -0
- package/lib/internal/template/autosuggest/i18n-utils.js.map +1 -0
- package/lib/internal/template/autosuggest/index.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/index.js +3 -0
- package/lib/internal/template/autosuggest/index.js.map +1 -1
- package/lib/internal/template/autosuggest/interfaces.d.ts +94 -1
- package/lib/internal/template/autosuggest/interfaces.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/interfaces.js.map +1 -1
- package/lib/internal/template/autosuggest/internal.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/internal.js +21 -12
- package/lib/internal/template/autosuggest/internal.js.map +1 -1
- package/lib/internal/template/autosuggest/options-controller.d.ts +2 -1
- package/lib/internal/template/autosuggest/options-controller.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/options-controller.js +3 -6
- package/lib/internal/template/autosuggest/options-controller.js.map +1 -1
- package/lib/internal/template/box/interfaces.d.ts +4 -1
- package/lib/internal/template/box/interfaces.d.ts.map +1 -1
- package/lib/internal/template/box/interfaces.js.map +1 -1
- package/lib/internal/template/box/styles.css.js +214 -220
- package/lib/internal/template/box/styles.scoped.css +259 -289
- package/lib/internal/template/box/styles.selectors.js +214 -220
- package/lib/internal/template/button/internal.d.ts +2 -2
- package/lib/internal/template/button/internal.d.ts.map +1 -1
- package/lib/internal/template/button/internal.js +9 -1
- package/lib/internal/template/button/internal.js.map +1 -1
- package/lib/internal/template/button/styles.css.js +24 -23
- package/lib/internal/template/button/styles.scoped.css +116 -70
- package/lib/internal/template/button/styles.selectors.js +24 -23
- package/lib/internal/template/button-dropdown/filter.d.ts +1 -1
- package/lib/internal/template/button-dropdown/filter.d.ts.map +1 -1
- package/lib/internal/template/i18n/messages/all.all.js +1 -1
- package/lib/internal/template/i18n/messages/all.all.json +1 -1
- package/lib/internal/template/i18n/messages/all.de.js +1 -1
- package/lib/internal/template/i18n/messages/all.de.json +1 -1
- package/lib/internal/template/i18n/messages/all.en-GB.js +1 -1
- package/lib/internal/template/i18n/messages/all.en-GB.json +1 -1
- package/lib/internal/template/i18n/messages/all.en.js +1 -1
- package/lib/internal/template/i18n/messages/all.en.json +1 -1
- package/lib/internal/template/i18n/messages/all.es.js +1 -1
- package/lib/internal/template/i18n/messages/all.es.json +1 -1
- package/lib/internal/template/i18n/messages/all.fr.js +1 -1
- package/lib/internal/template/i18n/messages/all.fr.json +1 -1
- package/lib/internal/template/i18n/messages/all.id.js +1 -1
- package/lib/internal/template/i18n/messages/all.id.json +1 -1
- package/lib/internal/template/i18n/messages/all.it.js +1 -1
- package/lib/internal/template/i18n/messages/all.it.json +1 -1
- package/lib/internal/template/i18n/messages/all.ja.js +1 -1
- package/lib/internal/template/i18n/messages/all.ja.json +1 -1
- package/lib/internal/template/i18n/messages/all.ko.js +1 -1
- package/lib/internal/template/i18n/messages/all.ko.json +1 -1
- package/lib/internal/template/i18n/messages/all.pt-BR.js +1 -1
- package/lib/internal/template/i18n/messages/all.pt-BR.json +1 -1
- package/lib/internal/template/i18n/messages/all.tr.js +1 -1
- package/lib/internal/template/i18n/messages/all.tr.json +1 -1
- package/lib/internal/template/i18n/messages/all.zh-CN.js +1 -1
- package/lib/internal/template/i18n/messages/all.zh-CN.json +1 -1
- package/lib/internal/template/i18n/messages/all.zh-TW.js +1 -1
- package/lib/internal/template/i18n/messages/all.zh-TW.json +1 -1
- package/lib/internal/template/i18n/messages-types.d.ts +13 -0
- package/lib/internal/template/i18n/messages-types.d.ts.map +1 -1
- package/lib/internal/template/i18n/messages-types.js.map +1 -1
- package/lib/internal/template/input/internal.d.ts +1 -0
- package/lib/internal/template/input/internal.d.ts.map +1 -1
- package/lib/internal/template/input/internal.js +2 -2
- package/lib/internal/template/input/internal.js.map +1 -1
- package/lib/internal/template/input/styles.css.js +38 -36
- package/lib/internal/template/input/styles.scoped.css +89 -76
- package/lib/internal/template/input/styles.selectors.js +38 -36
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/base-theme/styles.scoped.css +0 -61
- package/lib/internal/template/internal/components/autosuggest-input/index.d.ts +5 -0
- package/lib/internal/template/internal/components/autosuggest-input/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/autosuggest-input/index.js +154 -11
- package/lib/internal/template/internal/components/autosuggest-input/index.js.map +1 -1
- package/lib/internal/template/internal/components/autosuggest-input/inline-tokens.d.ts +21 -0
- package/lib/internal/template/internal/components/autosuggest-input/inline-tokens.d.ts.map +1 -0
- package/lib/internal/template/internal/components/autosuggest-input/inline-tokens.js +95 -0
- package/lib/internal/template/internal/components/autosuggest-input/inline-tokens.js.map +1 -0
- package/lib/internal/template/internal/components/autosuggest-input/overflow-dropdown.d.ts +16 -0
- package/lib/internal/template/internal/components/autosuggest-input/overflow-dropdown.d.ts.map +1 -0
- package/lib/internal/template/internal/components/autosuggest-input/overflow-dropdown.js +94 -0
- package/lib/internal/template/internal/components/autosuggest-input/overflow-dropdown.js.map +1 -0
- package/lib/internal/template/internal/components/autosuggest-input/styles.css.js +27 -2
- package/lib/internal/template/internal/components/autosuggest-input/styles.scoped.css +195 -2
- package/lib/internal/template/internal/components/autosuggest-input/styles.selectors.js +27 -2
- package/lib/internal/template/internal/components/autosuggest-input/test-classes/styles.css.js +9 -0
- package/lib/internal/template/internal/components/autosuggest-input/test-classes/styles.scoped.css +19 -0
- package/lib/internal/template/internal/components/autosuggest-input/test-classes/styles.selectors.js +10 -0
- package/lib/internal/template/internal/components/autosuggest-input/use-token-overflow.d.ts +21 -0
- package/lib/internal/template/internal/components/autosuggest-input/use-token-overflow.d.ts.map +1 -0
- package/lib/internal/template/internal/components/autosuggest-input/use-token-overflow.js +63 -0
- package/lib/internal/template/internal/components/autosuggest-input/use-token-overflow.js.map +1 -0
- package/lib/internal/template/internal/components/button-trigger/index.d.ts +4 -1
- package/lib/internal/template/internal/components/button-trigger/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/button-trigger/index.js +5 -3
- package/lib/internal/template/internal/components/button-trigger/index.js.map +1 -1
- package/lib/internal/template/internal/components/button-trigger/styles.css.js +23 -21
- package/lib/internal/template/internal/components/button-trigger/styles.scoped.css +79 -36
- package/lib/internal/template/internal/components/button-trigger/styles.selectors.js +23 -21
- package/lib/internal/template/internal/components/control-group/grouped-control-styles.d.ts +1 -1
- package/lib/internal/template/internal/components/control-group/grouped-control-styles.d.ts.map +1 -1
- package/lib/internal/template/internal/components/control-group/grouped-control-styles.js +3 -2
- package/lib/internal/template/internal/components/control-group/grouped-control-styles.js.map +1 -1
- package/lib/internal/template/internal/components/control-group/index.d.ts +3 -9
- package/lib/internal/template/internal/components/control-group/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/control-group/index.js +16 -10
- package/lib/internal/template/internal/components/control-group/index.js.map +1 -1
- package/lib/internal/template/internal/components/control-group/interfaces.d.ts +43 -0
- package/lib/internal/template/internal/components/control-group/interfaces.d.ts.map +1 -0
- package/lib/internal/template/internal/components/control-group/interfaces.js +2 -0
- package/lib/internal/template/internal/components/control-group/interfaces.js.map +1 -0
- package/lib/internal/template/internal/components/control-group/styles.css.js +16 -11
- package/lib/internal/template/internal/components/control-group/styles.scoped.css +34 -14
- package/lib/internal/template/internal/components/control-group/styles.selectors.js +16 -11
- package/lib/internal/template/internal/components/control-group/test-classes/styles.css.js +8 -0
- package/lib/internal/template/internal/components/control-group/test-classes/styles.scoped.css +15 -0
- package/lib/internal/template/internal/components/control-group/test-classes/styles.selectors.js +9 -0
- package/lib/internal/template/internal/context/control-group-context.d.ts +5 -0
- package/lib/internal/template/internal/context/control-group-context.d.ts.map +1 -1
- package/lib/internal/template/internal/context/control-group-context.js +1 -0
- package/lib/internal/template/internal/context/control-group-context.js.map +1 -1
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/segmented-control/styles.css.js +27 -26
- package/lib/internal/template/segmented-control/styles.scoped.css +51 -47
- package/lib/internal/template/segmented-control/styles.selectors.js +27 -26
- package/lib/internal/template/select/parts/filter.d.ts +1 -1
- package/lib/internal/template/select/parts/filter.d.ts.map +1 -1
- package/lib/internal/template/test-utils/dom/autosuggest/index.d.ts +39 -0
- package/lib/internal/template/test-utils/dom/autosuggest/index.js +68 -16
- package/lib/internal/template/test-utils/dom/autosuggest/index.js.map +1 -1
- package/lib/internal/template/test-utils/dom/internal/control-group.d.ts +5 -0
- package/lib/internal/template/test-utils/dom/internal/control-group.js +9 -2
- package/lib/internal/template/test-utils/dom/internal/control-group.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/autosuggest/index.d.ts +53 -0
- package/lib/internal/template/test-utils/selectors/autosuggest/index.js +84 -16
- package/lib/internal/template/test-utils/selectors/autosuggest/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/internal/control-group.d.ts +5 -0
- package/lib/internal/template/test-utils/selectors/internal/control-group.js +9 -2
- package/lib/internal/template/test-utils/selectors/internal/control-group.js.map +1 -1
- package/lib/internal/template/token/dismiss-button.d.ts.map +1 -1
- package/lib/internal/template/token/dismiss-button.js +6 -3
- package/lib/internal/template/token/dismiss-button.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,27 +3,33 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { useUniqueId } from '@cloudscape-design/component-toolkit/internal';
|
|
6
|
+
import { InternalButton } from '../../../button/internal';
|
|
6
7
|
import { getBaseProps } from '../../base-component';
|
|
7
|
-
import { GroupedControlContext
|
|
8
|
+
import { GroupedControlContext } from '../../context/control-group-context';
|
|
8
9
|
import { flattenChildren } from '../../utils/flatten-children';
|
|
9
10
|
import styles from './styles.css.js';
|
|
10
|
-
|
|
11
|
+
import testUtilStyles from './test-classes/styles.css.js';
|
|
12
|
+
export default function ControlGroup({ children, direction = 'horizontal', inlineLabelText, actionButton, ...props }) {
|
|
11
13
|
const baseProps = getBaseProps(props);
|
|
12
14
|
const labelId = useUniqueId('control-group-label');
|
|
13
15
|
const flattenedChildren = flattenChildren(children, 'ControlGroup');
|
|
14
16
|
const controlCount = flattenedChildren.length;
|
|
15
|
-
const
|
|
17
|
+
const rootClassnames = [styles.root, baseProps.className, testUtilStyles.root];
|
|
18
|
+
const controls = (React.createElement("div", { ...(inlineLabelText ? { 'aria-labelledby': labelId } : actionButton ? {} : baseProps), role: "group", className: clsx(styles.controls, styles[`controls-${direction}`], !actionButton && !inlineLabelText && rootClassnames) }, flattenedChildren.map((child, index) => {
|
|
16
19
|
const key = child && typeof child === 'object' ? child.key : undefined;
|
|
17
20
|
const position = controlCount === 1 ? 'only' : index === 0 ? 'first' : index === controlCount - 1 ? 'last' : 'middle';
|
|
18
21
|
return (React.createElement("div", { key: key ? String(key) : index, className: clsx(styles.control, styles[`control-${position}-${direction}`]) },
|
|
19
|
-
React.createElement(GroupedControlContext.Provider, { value: { position, direction } }, child)));
|
|
20
|
-
});
|
|
22
|
+
React.createElement(GroupedControlContext.Provider, { value: { position, direction, hasAction: !!actionButton } }, child)));
|
|
23
|
+
})));
|
|
24
|
+
const controlsWithAction = actionButton ? (React.createElement("div", { ...(inlineLabelText ? {} : baseProps), className: clsx(styles['group-layout'], styles[`group-layout-${direction}`], !inlineLabelText && rootClassnames) },
|
|
25
|
+
controls,
|
|
26
|
+
React.createElement("div", { className: styles['action-slot'] },
|
|
27
|
+
React.createElement(InternalButton, { className: testUtilStyles['action-button'], variant: "control-group-action", formAction: "none", iconName: actionButton.iconName, ariaLabel: actionButton.ariaLabel, disabled: actionButton.disabled, disabledReason: actionButton.disabledReason, ariaDescribedby: actionButton.ariaDescribedby, onClick: actionButton.onClick })))) : (controls);
|
|
21
28
|
if (inlineLabelText) {
|
|
22
|
-
return (React.createElement("div", { ...baseProps, className: clsx(
|
|
23
|
-
React.createElement("label", { id: labelId, className: clsx(styles['inline-label']) }, inlineLabelText),
|
|
24
|
-
React.createElement("div", { className: styles['inline-label-trigger-wrapper'] },
|
|
25
|
-
React.createElement("div", { role: "group", "aria-labelledby": labelId, className: clsx(styles.root, styles[`root-${direction}`]) }, controls))));
|
|
29
|
+
return (React.createElement("div", { ...baseProps, className: clsx(...rootClassnames, styles['inline-label-wrapper']) },
|
|
30
|
+
React.createElement("label", { id: labelId, className: clsx(styles['inline-label'], testUtilStyles['inline-label']) }, inlineLabelText),
|
|
31
|
+
React.createElement("div", { className: styles['inline-label-trigger-wrapper'] }, controlsWithAction)));
|
|
26
32
|
}
|
|
27
|
-
return
|
|
33
|
+
return controlsWithAction;
|
|
28
34
|
}
|
|
29
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/control-group/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/control-group/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAA0B,MAAM,qCAAqC,CAAC;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAI1D,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,QAAQ,EACR,SAAS,GAAG,YAAY,EACxB,eAAe,EACf,YAAY,EACZ,GAAG,KAAK,EACU;IAClB,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAEnD,MAAM,iBAAiB,GAAG,eAAe,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IACpE,MAAM,YAAY,GAAG,iBAAiB,CAAC,MAAM,CAAC;IAE9C,MAAM,cAAc,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;IAE/E,MAAM,QAAQ,GAAG,CACf,gCACM,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EACtF,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,QAAQ,EACf,MAAM,CAAC,YAAY,SAAS,EAAE,CAAC,EAC/B,CAAC,YAAY,IAAI,CAAC,eAAe,IAAI,cAAc,CACpD,IAEA,iBAAiB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QACtC,MAAM,GAAG,GAAG,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAE,KAAgC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;QACnG,MAAM,QAAQ,GACZ,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;QACvG,OAAO,CACL,6BACE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,EAC9B,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,WAAW,QAAQ,IAAI,SAAS,EAAE,CAAC,CAAC;YAE3E,oBAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,YAAY,EAAE,IACtF,KAAK,CACyB,CAC7B,CACP,CAAC;IACJ,CAAC,CAAC,CACE,CACP,CAAC;IAEF,MAAM,kBAAkB,GAAG,YAAY,CAAC,CAAC,CAAC,CACxC,gCACM,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EACtC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,gBAAgB,SAAS,EAAE,CAAC,EAAE,CAAC,eAAe,IAAI,cAAc,CAAC;QAE/G,QAAQ;QACT,6BAAK,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC;YACnC,oBAAC,cAAc,IACb,SAAS,EAAE,cAAc,CAAC,eAAe,CAAC,EAC1C,OAAO,EAAC,sBAAsB,EAC9B,UAAU,EAAC,MAAM,EACjB,QAAQ,EAAE,YAAY,CAAC,QAAQ,EAC/B,SAAS,EAAE,YAAY,CAAC,SAAS,EACjC,QAAQ,EAAE,YAAY,CAAC,QAAQ,EAC/B,cAAc,EAAE,YAAY,CAAC,cAAc,EAC3C,eAAe,EAAE,YAAY,CAAC,eAAe,EAC7C,OAAO,EAAE,YAAY,CAAC,OAAO,GAC7B,CACE,CACF,CACP,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CAAC;IAEF,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,CACL,gCAAS,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,cAAc,EAAE,MAAM,CAAC,sBAAsB,CAAC,CAAC;YACpF,+BAAO,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC,IACxF,eAAe,CACV;YACR,6BAAK,SAAS,EAAE,MAAM,CAAC,8BAA8B,CAAC,IAAG,kBAAkB,CAAO,CAC9E,CACP,CAAC;IACJ,CAAC;IAED,OAAO,kBAAkB,CAAC;AAC5B,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 { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport { InternalButton } from '../../../button/internal';\nimport { getBaseProps } from '../../base-component';\nimport { GroupedControlContext, GroupedControlPosition } from '../../context/control-group-context';\nimport { flattenChildren } from '../../utils/flatten-children';\nimport { ControlGroupProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nexport { ControlGroupProps };\n\nexport default function ControlGroup({\n children,\n direction = 'horizontal',\n inlineLabelText,\n actionButton,\n ...props\n}: ControlGroupProps) {\n const baseProps = getBaseProps(props);\n const labelId = useUniqueId('control-group-label');\n\n const flattenedChildren = flattenChildren(children, 'ControlGroup');\n const controlCount = flattenedChildren.length;\n\n const rootClassnames = [styles.root, baseProps.className, testUtilStyles.root];\n\n const controls = (\n <div\n {...(inlineLabelText ? { 'aria-labelledby': labelId } : actionButton ? {} : baseProps)}\n role=\"group\"\n className={clsx(\n styles.controls,\n styles[`controls-${direction}`],\n !actionButton && !inlineLabelText && rootClassnames\n )}\n >\n {flattenedChildren.map((child, index) => {\n const key = child && typeof child === 'object' ? (child as Record<'key', unknown>).key : undefined;\n const position: GroupedControlPosition =\n controlCount === 1 ? 'only' : index === 0 ? 'first' : index === controlCount - 1 ? 'last' : 'middle';\n return (\n <div\n key={key ? String(key) : index}\n className={clsx(styles.control, styles[`control-${position}-${direction}`])}\n >\n <GroupedControlContext.Provider value={{ position, direction, hasAction: !!actionButton }}>\n {child}\n </GroupedControlContext.Provider>\n </div>\n );\n })}\n </div>\n );\n\n const controlsWithAction = actionButton ? (\n <div\n {...(inlineLabelText ? {} : baseProps)}\n className={clsx(styles['group-layout'], styles[`group-layout-${direction}`], !inlineLabelText && rootClassnames)}\n >\n {controls}\n <div className={styles['action-slot']}>\n <InternalButton\n className={testUtilStyles['action-button']}\n variant=\"control-group-action\"\n formAction=\"none\"\n iconName={actionButton.iconName}\n ariaLabel={actionButton.ariaLabel}\n disabled={actionButton.disabled}\n disabledReason={actionButton.disabledReason}\n ariaDescribedby={actionButton.ariaDescribedby}\n onClick={actionButton.onClick}\n />\n </div>\n </div>\n ) : (\n controls\n );\n\n if (inlineLabelText) {\n return (\n <div {...baseProps} className={clsx(...rootClassnames, styles['inline-label-wrapper'])}>\n <label id={labelId} className={clsx(styles['inline-label'], testUtilStyles['inline-label'])}>\n {inlineLabelText}\n </label>\n <div className={styles['inline-label-trigger-wrapper']}>{controlsWithAction}</div>\n </div>\n );\n }\n\n return controlsWithAction;\n}\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ButtonProps } from '../../../button/interfaces';
|
|
2
|
+
import { IconProps } from '../../../icon/interfaces';
|
|
3
|
+
import { BaseComponentProps } from '../../../types/base-component';
|
|
4
|
+
import { GroupedControlDirection } from '../../context/control-group-context';
|
|
5
|
+
import { CancelableEventHandler } from '../../events';
|
|
6
|
+
export interface ControlGroupProps extends BaseComponentProps {
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
direction?: GroupedControlDirection;
|
|
9
|
+
inlineLabelText?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Specifies an action button rendered next to the grouped controls.
|
|
12
|
+
*/
|
|
13
|
+
actionButton?: ControlGroupProps.ActionButton;
|
|
14
|
+
}
|
|
15
|
+
export declare namespace ControlGroupProps {
|
|
16
|
+
interface ActionButton {
|
|
17
|
+
/**
|
|
18
|
+
* Called when the user clicks on the button and the button is not disabled.
|
|
19
|
+
*/
|
|
20
|
+
onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;
|
|
21
|
+
/**
|
|
22
|
+
* Renders the button as disabled and prevents clicks.
|
|
23
|
+
*/
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Provides a reason why the button is disabled (only when `disabled` is `true`).
|
|
27
|
+
* If provided, the button becomes focusable.
|
|
28
|
+
*/
|
|
29
|
+
disabledReason?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Adds `aria-label` to the button element.
|
|
32
|
+
* The text will also be added to the `title` attribute of the button.
|
|
33
|
+
*/
|
|
34
|
+
ariaLabel: string;
|
|
35
|
+
/**
|
|
36
|
+
* Adds `aria-describedby` to the button.
|
|
37
|
+
*/
|
|
38
|
+
ariaDescribedby?: string;
|
|
39
|
+
/** Specifies the icon to display (for example `remove` or `close`). */
|
|
40
|
+
iconName: IconProps.Name;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/control-group/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtD,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IAC3D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,uBAAuB,CAAC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,iBAAiB,CAAC,YAAY,CAAC;CAC/C;AAED,yBAAiB,iBAAiB,CAAC;IACjC,UAAiB,YAAY;QAC3B;;WAEG;QACH,OAAO,CAAC,EAAE,sBAAsB,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAE1D;;WAEG;QACH,QAAQ,CAAC,EAAE,OAAO,CAAC;QAEnB;;;WAGG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;QAExB;;;WAGG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;WAEG;QACH,eAAe,CAAC,EAAE,MAAM,CAAC;QAEzB,uEAAuE;QACvE,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC;KAC1B;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/control-group/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ButtonProps } from '../../../button/interfaces';\nimport { IconProps } from '../../../icon/interfaces';\nimport { BaseComponentProps } from '../../../types/base-component';\nimport { GroupedControlDirection } from '../../context/control-group-context';\nimport { CancelableEventHandler } from '../../events';\n\nexport interface ControlGroupProps extends BaseComponentProps {\n children?: React.ReactNode;\n direction?: GroupedControlDirection;\n inlineLabelText?: string;\n /**\n * Specifies an action button rendered next to the grouped controls.\n */\n actionButton?: ControlGroupProps.ActionButton;\n}\n\nexport namespace ControlGroupProps {\n export interface ActionButton {\n /**\n * Called when the user clicks on the button and the button is not disabled.\n */\n onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;\n\n /**\n * Renders the button as disabled and prevents clicks.\n */\n disabled?: boolean;\n\n /**\n * Provides a reason why the button is disabled (only when `disabled` is `true`).\n * If provided, the button becomes focusable.\n */\n disabledReason?: string;\n\n /**\n * Adds `aria-label` to the button element.\n * The text will also be added to the `title` attribute of the button.\n */\n ariaLabel: string;\n\n /**\n * Adds `aria-describedby` to the button.\n */\n ariaDescribedby?: string;\n\n /** Specifies the icon to display (for example `remove` or `close`). */\n iconName: IconProps.Name;\n }\n}\n"]}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
4
|
+
"root": "awsui_root_o08jm_1h1xd_9",
|
|
5
|
+
"action-slot": "awsui_action-slot_o08jm_1h1xd_41",
|
|
6
|
+
"group-layout": "awsui_group-layout_o08jm_1h1xd_46",
|
|
7
|
+
"group-layout-horizontal": "awsui_group-layout-horizontal_o08jm_1h1xd_50",
|
|
8
|
+
"group-layout-vertical": "awsui_group-layout-vertical_o08jm_1h1xd_53",
|
|
9
|
+
"controls": "awsui_controls_o08jm_1h1xd_57",
|
|
10
|
+
"controls-horizontal": "awsui_controls-horizontal_o08jm_1h1xd_61",
|
|
11
|
+
"controls-vertical": "awsui_controls-vertical_o08jm_1h1xd_65",
|
|
12
|
+
"control": "awsui_control_o08jm_1h1xd_57",
|
|
13
|
+
"control-middle-horizontal": "awsui_control-middle-horizontal_o08jm_1h1xd_73",
|
|
14
|
+
"control-last-horizontal": "awsui_control-last-horizontal_o08jm_1h1xd_73",
|
|
15
|
+
"control-middle-vertical": "awsui_control-middle-vertical_o08jm_1h1xd_76",
|
|
16
|
+
"control-last-vertical": "awsui_control-last-vertical_o08jm_1h1xd_76",
|
|
17
|
+
"inline-label": "awsui_inline-label_o08jm_1h1xd_85",
|
|
18
|
+
"inline-label-wrapper": "awsui_inline-label-wrapper_o08jm_1h1xd_110",
|
|
19
|
+
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-wrapper_o08jm_1h1xd_115"
|
|
15
20
|
};
|
|
16
21
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
7
7
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
8
8
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
9
|
-
.
|
|
9
|
+
.awsui_root_o08jm_1h1xd_9:not(#\9) {
|
|
10
10
|
border-collapse: separate;
|
|
11
11
|
border-spacing: 0;
|
|
12
12
|
box-sizing: border-box;
|
|
@@ -36,33 +36,53 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
36
36
|
font-family: var(--font-family-base-c9u5cr, "Noto Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
37
37
|
-webkit-font-smoothing: auto;
|
|
38
38
|
-moz-osx-font-smoothing: auto;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.awsui_action-slot_o08jm_1h1xd_41:not(#\9) {
|
|
39
42
|
display: flex;
|
|
43
|
+
margin-inline-start: calc(-1 * var(--border-width-field-2365x3, 1px));
|
|
40
44
|
}
|
|
41
|
-
|
|
45
|
+
|
|
46
|
+
.awsui_group-layout_o08jm_1h1xd_46:not(#\9) {
|
|
47
|
+
display: flex;
|
|
42
48
|
flex-direction: row;
|
|
43
|
-
|
|
49
|
+
}
|
|
50
|
+
.awsui_group-layout-horizontal_o08jm_1h1xd_50:not(#\9) {
|
|
44
51
|
align-items: flex-end;
|
|
45
52
|
}
|
|
46
|
-
.
|
|
47
|
-
|
|
53
|
+
.awsui_group-layout-vertical_o08jm_1h1xd_53:not(#\9), .awsui_group-layout-vertical_o08jm_1h1xd_53 > .awsui_action-slot_o08jm_1h1xd_41:not(#\9) {
|
|
54
|
+
align-items: stretch;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.awsui_controls_o08jm_1h1xd_57:not(#\9) {
|
|
58
|
+
display: flex;
|
|
48
59
|
align-items: stretch;
|
|
49
60
|
}
|
|
61
|
+
.awsui_controls-horizontal_o08jm_1h1xd_61:not(#\9) {
|
|
62
|
+
flex-direction: row;
|
|
63
|
+
flex-wrap: nowrap;
|
|
64
|
+
}
|
|
65
|
+
.awsui_controls-vertical_o08jm_1h1xd_65:not(#\9) {
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
}
|
|
50
68
|
|
|
51
|
-
.
|
|
69
|
+
.awsui_control_o08jm_1h1xd_57:not(#\9) {
|
|
52
70
|
min-inline-size: 0;
|
|
53
71
|
isolation: isolate;
|
|
54
72
|
}
|
|
55
|
-
.
|
|
56
|
-
z-index: 1;
|
|
57
|
-
}
|
|
58
|
-
.awsui_control-middle-horizontal_o08jm_1akgb_58:not(#\9), .awsui_control-last-horizontal_o08jm_1akgb_58:not(#\9) {
|
|
73
|
+
.awsui_control-middle-horizontal_o08jm_1h1xd_73:not(#\9), .awsui_control-last-horizontal_o08jm_1h1xd_73:not(#\9) {
|
|
59
74
|
margin-inline-start: calc(-1 * var(--border-width-field-2365x3, 1px));
|
|
60
75
|
}
|
|
61
|
-
.awsui_control-middle-
|
|
76
|
+
.awsui_control-middle-vertical_o08jm_1h1xd_76:not(#\9), .awsui_control-last-vertical_o08jm_1h1xd_76:not(#\9) {
|
|
62
77
|
margin-block-start: calc(-1 * var(--border-width-field-2365x3, 1px));
|
|
63
78
|
}
|
|
64
79
|
|
|
65
|
-
.
|
|
80
|
+
.awsui_action-slot_o08jm_1h1xd_41:not(#\9):focus-within,
|
|
81
|
+
.awsui_control_o08jm_1h1xd_57:not(#\9):focus-within {
|
|
82
|
+
z-index: 1;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.awsui_inline-label_o08jm_1h1xd_85:not(#\9) {
|
|
66
86
|
background: linear-gradient(to bottom, var(--awsui-inline-label-background-color-ka4djm, var(--color-background-layout-main-y4565g, #f2f3f3)), var(--color-background-input-default-1u0v1p, #ffffff));
|
|
67
87
|
border-start-start-radius: 2px;
|
|
68
88
|
border-start-end-radius: 2px;
|
|
@@ -87,11 +107,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
87
107
|
z-index: 2;
|
|
88
108
|
}
|
|
89
109
|
|
|
90
|
-
.awsui_inline-label-
|
|
110
|
+
.awsui_inline-label-wrapper_o08jm_1h1xd_110:not(#\9) {
|
|
91
111
|
margin-block-start: calc(var(--space-scaled-xs-pajbd1, 8px) * -1);
|
|
92
112
|
isolation: isolate;
|
|
93
113
|
}
|
|
94
114
|
|
|
95
|
-
.awsui_inline-label-trigger-
|
|
115
|
+
.awsui_inline-label-trigger-wrapper_o08jm_1h1xd_115:not(#\9) {
|
|
96
116
|
margin-block-start: -7px;
|
|
97
117
|
}
|
|
@@ -2,16 +2,21 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"root": "
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
5
|
+
"root": "awsui_root_o08jm_1h1xd_9",
|
|
6
|
+
"action-slot": "awsui_action-slot_o08jm_1h1xd_41",
|
|
7
|
+
"group-layout": "awsui_group-layout_o08jm_1h1xd_46",
|
|
8
|
+
"group-layout-horizontal": "awsui_group-layout-horizontal_o08jm_1h1xd_50",
|
|
9
|
+
"group-layout-vertical": "awsui_group-layout-vertical_o08jm_1h1xd_53",
|
|
10
|
+
"controls": "awsui_controls_o08jm_1h1xd_57",
|
|
11
|
+
"controls-horizontal": "awsui_controls-horizontal_o08jm_1h1xd_61",
|
|
12
|
+
"controls-vertical": "awsui_controls-vertical_o08jm_1h1xd_65",
|
|
13
|
+
"control": "awsui_control_o08jm_1h1xd_57",
|
|
14
|
+
"control-middle-horizontal": "awsui_control-middle-horizontal_o08jm_1h1xd_73",
|
|
15
|
+
"control-last-horizontal": "awsui_control-last-horizontal_o08jm_1h1xd_73",
|
|
16
|
+
"control-middle-vertical": "awsui_control-middle-vertical_o08jm_1h1xd_76",
|
|
17
|
+
"control-last-vertical": "awsui_control-last-vertical_o08jm_1h1xd_76",
|
|
18
|
+
"inline-label": "awsui_inline-label_o08jm_1h1xd_85",
|
|
19
|
+
"inline-label-wrapper": "awsui_inline-label-wrapper_o08jm_1h1xd_110",
|
|
20
|
+
"inline-label-trigger-wrapper": "awsui_inline-label-trigger-wrapper_o08jm_1h1xd_115"
|
|
16
21
|
};
|
|
17
22
|
|
package/lib/internal/template/internal/components/control-group/test-classes/styles.scoped.css
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
.awsui_root_1gp1v_ju9sr_5:not(#\9) {
|
|
6
|
+
/* used in test-utils */
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.awsui_action-button_1gp1v_ju9sr_9:not(#\9) {
|
|
10
|
+
/* used in test-utils */
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.awsui_inline-label_1gp1v_ju9sr_13:not(#\9) {
|
|
14
|
+
/* used in test-utils */
|
|
15
|
+
}
|
package/lib/internal/template/internal/components/control-group/test-classes/styles.selectors.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
// es-module interop with Babel and Typescript
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
module.exports.default = {
|
|
5
|
+
"root": "awsui_root_1gp1v_ju9sr_5",
|
|
6
|
+
"action-button": "awsui_action-button_1gp1v_ju9sr_9",
|
|
7
|
+
"inline-label": "awsui_inline-label_1gp1v_ju9sr_13"
|
|
8
|
+
};
|
|
9
|
+
|
|
@@ -12,6 +12,11 @@ export interface GroupedControlContextProps {
|
|
|
12
12
|
* controls.
|
|
13
13
|
*/
|
|
14
14
|
direction: GroupedControlDirection;
|
|
15
|
+
/**
|
|
16
|
+
* Whether an action is fused onto the group's inline-end. Controls square the
|
|
17
|
+
* inline-end corners facing the action so it owns the only rounded ones.
|
|
18
|
+
*/
|
|
19
|
+
hasAction?: boolean;
|
|
15
20
|
}
|
|
16
21
|
export declare const GroupedControlContext: React.Context<GroupedControlContextProps>;
|
|
17
22
|
export declare function useGroupedControlContext(): GroupedControlContextProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-group-context.d.ts","sourceRoot":"","sources":["../../../../src/internal/context/control-group-context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAEzD,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1E,MAAM,MAAM,uBAAuB,GAAG,YAAY,GAAG,UAAU,CAAC;AAEhE,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,QAAQ,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACxC;;;OAGG;IACH,SAAS,EAAE,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"control-group-context.d.ts","sourceRoot":"","sources":["../../../../src/internal/context/control-group-context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAEzD,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1E,MAAM,MAAM,uBAAuB,GAAG,YAAY,GAAG,UAAU,CAAC;AAEhE,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,QAAQ,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACxC;;;OAGG;IACH,SAAS,EAAE,uBAAuB,CAAC;IACnC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,qBAAqB,2CAIhC,CAAC;AAEH,wBAAgB,wBAAwB,+BAEvC;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,eAKrF"}
|
|
@@ -4,6 +4,7 @@ import React, { createContext, useContext } from 'react';
|
|
|
4
4
|
export const GroupedControlContext = createContext({
|
|
5
5
|
position: null,
|
|
6
6
|
direction: 'horizontal',
|
|
7
|
+
hasAction: false,
|
|
7
8
|
});
|
|
8
9
|
export function useGroupedControlContext() {
|
|
9
10
|
return useContext(GroupedControlContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-group-context.js","sourceRoot":"","sources":["../../../../src/internal/context/control-group-context.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"control-group-context.js","sourceRoot":"","sources":["../../../../src/internal/context/control-group-context.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAwBzD,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAA6B;IAC7E,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,KAAK;CACjB,CAAC,CAAC;AAEH,MAAM,UAAU,wBAAwB;IACtC,OAAO,UAAU,CAAC,qBAAqB,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,0BAA0B,CAAC,EAAE,QAAQ,EAAiC;IACpF,MAAM,EAAE,SAAS,EAAE,GAAG,wBAAwB,EAAE,CAAC;IACjD,OAAO,CACL,oBAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAG,QAAQ,CAAkC,CAClH,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { createContext, useContext } from 'react';\n\nexport type GroupedControlPosition = 'first' | 'middle' | 'last' | 'only';\n\nexport type GroupedControlDirection = 'horizontal' | 'vertical';\n\nexport interface GroupedControlContextProps {\n /**\n * The control's position within a control group,\n * or `null` when the control is not in a control group.\n */\n position: GroupedControlPosition | null;\n /**\n * The axis along which the surrounding control group lays out its\n * controls.\n */\n direction: GroupedControlDirection;\n /**\n * Whether an action is fused onto the group's inline-end. Controls square the\n * inline-end corners facing the action so it owns the only rounded ones.\n */\n hasAction?: boolean;\n}\n\nexport const GroupedControlContext = createContext<GroupedControlContextProps>({\n position: null,\n direction: 'horizontal',\n hasAction: false,\n});\n\nexport function useGroupedControlContext() {\n return useContext(GroupedControlContext);\n}\n\n/**\n * Resets the grouped-control context back to \"not in a group\" for a subtree.\n *\n * Controls that render caller-supplied content (for example, custom dropdown\n * content) should wrap that content with this provider. Otherwise a nested\n * control rendered inside such a slot would inherit the surrounding group's\n * `position` and incorrectly pick up the grouped-control styling\n * where adjacent borders lose their border radii.\n */\nexport function ResetGroupedControlContext({ children }: { children: React.ReactNode }) {\n const { direction } = useGroupedControlContext();\n return (\n <GroupedControlContext.Provider value={{ position: null, direction }}>{children}</GroupedControlContext.Provider>\n );\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export var PACKAGE_SOURCE = "components";
|
|
2
|
-
export var PACKAGE_VERSION = "3.0.0 (
|
|
3
|
-
export var GIT_SHA = "
|
|
2
|
+
export var PACKAGE_VERSION = "3.0.0 (8bbfddc2)";
|
|
3
|
+
export var GIT_SHA = "8bbfddc2";
|
|
4
4
|
export var THEME = "open-source-visual-refresh";
|
|
5
5
|
export var SYSTEM = "core";
|
|
6
6
|
export var ALWAYS_VISUAL_REFRESH = true;
|
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"segment": "
|
|
5
|
-
"full-width": "awsui_full-
|
|
6
|
-
"refresh": "
|
|
7
|
-
"disabled": "
|
|
8
|
-
"selected": "
|
|
9
|
-
"icon": "
|
|
10
|
-
"with-text": "awsui_with-
|
|
11
|
-
"with-no-text": "awsui_with-no-
|
|
12
|
-
"root": "
|
|
13
|
-
"segment-part": "awsui_segment-
|
|
14
|
-
"grouped": "
|
|
15
|
-
"grouped-only": "awsui_grouped-
|
|
16
|
-
"grouped-vertical": "awsui_grouped-
|
|
17
|
-
"grouped-horizontal-first": "awsui_grouped-horizontal-
|
|
18
|
-
"grouped-horizontal-middle": "awsui_grouped-horizontal-
|
|
19
|
-
"grouped-horizontal-last": "awsui_grouped-horizontal-
|
|
20
|
-
"grouped-vertical-first": "awsui_grouped-vertical-
|
|
21
|
-
"grouped-vertical-middle": "awsui_grouped-vertical-
|
|
22
|
-
"grouped-vertical-last": "awsui_grouped-vertical-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"segment-count-
|
|
26
|
-
"segment-count-
|
|
27
|
-
"segment-count-
|
|
28
|
-
"segment-count-
|
|
29
|
-
"
|
|
4
|
+
"segment": "awsui_segment_8cbea_1ai8f_17",
|
|
5
|
+
"full-width": "awsui_full-width_8cbea_1ai8f_44",
|
|
6
|
+
"refresh": "awsui_refresh_8cbea_1ai8f_47",
|
|
7
|
+
"disabled": "awsui_disabled_8cbea_1ai8f_53",
|
|
8
|
+
"selected": "awsui_selected_8cbea_1ai8f_110",
|
|
9
|
+
"icon": "awsui_icon_8cbea_1ai8f_121",
|
|
10
|
+
"with-text": "awsui_with-text_8cbea_1ai8f_125",
|
|
11
|
+
"with-no-text": "awsui_with-no-text_8cbea_1ai8f_131",
|
|
12
|
+
"root": "awsui_root_8cbea_1ai8f_136",
|
|
13
|
+
"segment-part": "awsui_segment-part_8cbea_1ai8f_168",
|
|
14
|
+
"grouped": "awsui_grouped_8cbea_1ai8f_189",
|
|
15
|
+
"grouped-only": "awsui_grouped-only_8cbea_1ai8f_189",
|
|
16
|
+
"grouped-vertical": "awsui_grouped-vertical_8cbea_1ai8f_193",
|
|
17
|
+
"grouped-horizontal-first": "awsui_grouped-horizontal-first_8cbea_1ai8f_204",
|
|
18
|
+
"grouped-horizontal-middle": "awsui_grouped-horizontal-middle_8cbea_1ai8f_208",
|
|
19
|
+
"grouped-horizontal-last": "awsui_grouped-horizontal-last_8cbea_1ai8f_214",
|
|
20
|
+
"grouped-vertical-first": "awsui_grouped-vertical-first_8cbea_1ai8f_218",
|
|
21
|
+
"grouped-vertical-middle": "awsui_grouped-vertical-middle_8cbea_1ai8f_222",
|
|
22
|
+
"grouped-vertical-last": "awsui_grouped-vertical-last_8cbea_1ai8f_228",
|
|
23
|
+
"grouped-with-action": "awsui_grouped-with-action_8cbea_1ai8f_232",
|
|
24
|
+
"select": "awsui_select_8cbea_1ai8f_110",
|
|
25
|
+
"segment-count-2": "awsui_segment-count-2_8cbea_1ai8f_249",
|
|
26
|
+
"segment-count-3": "awsui_segment-count-3_8cbea_1ai8f_256",
|
|
27
|
+
"segment-count-4": "awsui_segment-count-4_8cbea_1ai8f_263",
|
|
28
|
+
"segment-count-5": "awsui_segment-count-5_8cbea_1ai8f_270",
|
|
29
|
+
"segment-count-6": "awsui_segment-count-6_8cbea_1ai8f_277",
|
|
30
|
+
"disabled-reason-tooltip": "awsui_disabled-reason-tooltip_8cbea_1ai8f_284"
|
|
30
31
|
};
|
|
31
32
|
|