carbon-react 106.1.3 → 106.1.6
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/esm/__internal__/checkable-input/checkable-input.d.ts +2 -2
- package/esm/__internal__/fieldset/fieldset.component.d.ts +45 -15
- package/esm/__internal__/form-field/form-field.component.d.ts +14 -0
- package/esm/__internal__/form-field/form-field.d.ts +2 -4
- package/esm/__internal__/input/input-presentation.style.d.ts +1 -1
- package/esm/__internal__/label/label.d.ts +2 -2
- package/esm/__internal__/validations/validation-icon.component.d.ts +2 -5
- package/esm/__spec_helper__/test-utils.d.ts +1 -1
- package/esm/components/accordion/accordion-group/accordion-group.component.d.ts +17 -3
- package/esm/components/accordion/accordion.component.js +1 -1
- package/esm/components/action-popover/action-popover.component.d.ts +35 -18
- package/esm/components/advanced-color-picker/advanced-color-picker.component.d.ts +14 -0
- package/esm/components/box/box.component.d.ts +1 -6
- package/esm/components/button-toggle-group/button-toggle-group.component.d.ts +14 -0
- package/esm/components/button-toggle-group/button-toggle-group.d.ts +2 -4
- package/esm/components/carbon-provider/carbon-provider.component.d.ts +1 -1
- package/esm/components/carbon-provider/carbon-provider.component.js +40 -38
- package/esm/components/card/card-row/card-row.component.d.ts +19 -4
- package/esm/components/card/card.component.d.ts +28 -10
- package/esm/components/checkbox/checkbox-group.component.d.ts +48 -15
- package/esm/components/checkbox/checkbox-group.d.ts +2 -2
- package/esm/components/checkbox/checkbox.component.d.ts +14 -0
- package/esm/components/content/content.component.d.ts +31 -9
- package/esm/components/date/__internal__/date-formats/index.js +88 -20
- package/esm/components/date/__internal__/utils.js +13 -3
- package/esm/components/date/date.component.js +13 -5
- package/esm/components/date-range/date-range.component.d.ts +68 -20
- package/esm/components/decimal/decimal.component.d.ts +14 -0
- package/esm/components/detail/detail.component.d.ts +34 -6
- package/esm/components/draggable/draggable-container.component.d.ts +24 -4
- package/esm/components/draggable/draggable-item.component.d.ts +34 -6
- package/esm/components/duelling-picklist/duelling-picklist.component.d.ts +27 -8
- package/esm/components/fieldset/fieldset.component.d.ts +23 -7
- package/esm/components/flat-table/flat-table-cell/flat-table-cell.component.d.ts +66 -17
- package/esm/components/flat-table/flat-table-header/flat-table-header.component.d.ts +48 -14
- package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.component.d.ts +44 -12
- package/esm/components/flat-table/flat-table.component.d.ts +46 -20
- package/esm/components/grid/grid-item/grid-item.component.d.ts +29 -22
- package/esm/components/grouped-character/grouped-character.component.d.ts +32 -10
- package/esm/components/heading/heading.component.d.ts +66 -18
- package/esm/components/help/help.component.d.ts +51 -22
- package/esm/components/loader/loader.component.d.ts +14 -0
- package/esm/components/loader-bar/loader-bar.component.d.ts +18 -3
- package/esm/components/message/message.component.d.ts +36 -12
- package/esm/components/multi-action-button/multi-action-button.component.d.ts +14 -0
- package/esm/components/note/note.component.d.ts +34 -11
- package/esm/components/numeral-date/numeral-date.component.d.ts +14 -0
- package/esm/components/numeral-date/numeral-date.d.ts +2 -2
- package/esm/components/pill/pill.component.d.ts +37 -22
- package/esm/components/pill/pill.style.js +1 -1
- package/esm/components/popover-container/popover-container.component.d.ts +54 -23
- package/esm/components/portrait/portrait.component.d.ts +55 -29
- package/esm/components/preview/preview.component.d.ts +26 -9
- package/esm/components/profile/profile.component.d.ts +28 -8
- package/esm/components/progress-tracker/progress-tracker.component.d.ts +14 -0
- package/esm/components/radio-button/radio-button-group.component.d.ts +60 -21
- package/esm/components/radio-button/radio-button-group.d.ts +2 -4
- package/esm/components/search/search.component.d.ts +14 -0
- package/esm/components/select/select-textbox/select-textbox.d.ts +2 -2
- package/esm/components/settings-row/settings-row.component.d.ts +26 -7
- package/esm/components/show-edit-pod/show-edit-pod.component.d.ts +58 -23
- package/esm/components/simple-color-picker/simple-color-picker.component.d.ts +52 -17
- package/esm/components/simple-color-picker/simple-color-picker.d.ts +2 -4
- package/esm/components/split-button/split-button.component.d.ts +14 -0
- package/esm/components/step-sequence/step-sequence.component.d.ts +21 -6
- package/esm/components/switch/switch.component.d.ts +14 -0
- package/esm/components/tabs/tab/tab.component.d.ts +51 -20
- package/esm/components/tabs/tabs.component.d.ts +46 -15
- package/esm/components/textarea/textarea.component.d.ts +14 -0
- package/esm/components/textarea/textarea.d.ts +2 -2
- package/esm/components/textbox/textbox.component.d.ts +14 -0
- package/esm/components/textbox/textbox.d.ts +2 -2
- package/esm/components/tile/tile-footer/tile-footer.component.d.ts +19 -4
- package/esm/components/tile-select/tile-select-group.component.d.ts +35 -12
- package/esm/components/tile-select/tile-select.component.d.ts +63 -26
- package/esm/components/typography/list.component.d.ts +1 -2
- package/esm/components/typography/typography.component.d.ts +1 -6
- package/esm/global.d.ts +1 -0
- package/esm/style/color-config/index.d.ts +2 -3
- package/esm/style/color-config/index.js +3 -2
- package/esm/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.d.ts +3 -2
- package/esm/style/design-tokens/debug-theme.util.d.ts +449 -1
- package/esm/style/design-tokens/debug-theme.util.js +1 -1
- package/esm/style/design-tokens/generate-css-variables.util.d.ts +10 -1
- package/esm/style/global-style.d.ts +1 -8
- package/esm/style/palette/index.d.ts +19 -7
- package/esm/style/themes/aegean/aegean-theme.config.d.ts +3 -25
- package/esm/style/themes/aegean/aegean-theme.config.js +16 -14
- package/esm/style/themes/aegean/index.d.ts +2 -5
- package/esm/style/themes/base/base-theme.config.d.ts +31 -468
- package/esm/style/themes/base/base-theme.config.js +3 -1
- package/esm/style/themes/base/index.d.ts +3 -62
- package/esm/style/themes/base/index.js +2 -2
- package/esm/style/themes/index.d.ts +1 -5
- package/esm/style/themes/medium/index.d.ts +1 -1
- package/esm/style/themes/mint/index.d.ts +2 -5
- package/esm/style/themes/mint/mint-theme.config.d.ts +3 -25
- package/esm/style/themes/mint/mint-theme.config.js +16 -14
- package/esm/style/themes/none/index.d.ts +2 -5
- package/esm/style/themes/none/none-theme.config.d.ts +2 -3
- package/esm/style/themes/sage/index.d.ts +8 -11
- package/esm/style/themes/small/index.d.ts +1 -1
- package/esm/style/themes/test-utils.d.ts +1 -1
- package/esm/style/utils/add-hex-symbols.d.ts +1 -1
- package/esm/style/utils/at-opacity.d.ts +6 -1
- package/esm/style/utils/at-opacity.js +4 -2
- package/esm/style/utils/color.d.ts +3 -7
- package/esm/style/utils/color.js +10 -10
- package/esm/style/utils/filter-out-styled-system-spacing-props.d.ts +1 -3
- package/esm/style/utils/filter-styled-system-margin-props.d.ts +3 -1
- package/esm/style/utils/filter-styled-system-margin-props.js +1 -1
- package/esm/style/utils/filter-styled-system-padding-props.d.ts +3 -1
- package/esm/style/utils/filter-styled-system-padding-props.js +1 -1
- package/esm/style/utils/get-rgb-values.d.ts +2 -2
- package/esm/style/utils/get-rgb-values.js +1 -1
- package/esm/style/utils/index.d.ts +1 -1
- package/esm/style/utils/merge-deep.d.ts +2 -6
- package/esm/style/utils/merge-deep.js +19 -22
- package/esm/style/utils/mix.d.ts +4 -1
- package/esm/style/utils/mix.js +10 -5
- package/esm/style/utils/shade.d.ts +1 -1
- package/esm/style/utils/tint.d.ts +1 -1
- package/esm/style/utils/width.d.ts +2 -3
- package/lib/__internal__/checkable-input/checkable-input.d.ts +2 -2
- package/lib/__internal__/fieldset/fieldset.component.d.ts +45 -15
- package/lib/__internal__/form-field/form-field.component.d.ts +14 -0
- package/lib/__internal__/form-field/form-field.d.ts +2 -4
- package/lib/__internal__/input/input-presentation.style.d.ts +1 -1
- package/lib/__internal__/label/label.d.ts +2 -2
- package/lib/__internal__/validations/validation-icon.component.d.ts +2 -5
- package/lib/__spec_helper__/test-utils.d.ts +1 -1
- package/lib/components/accordion/accordion-group/accordion-group.component.d.ts +17 -3
- package/lib/components/accordion/accordion.component.js +1 -1
- package/lib/components/action-popover/action-popover.component.d.ts +35 -18
- package/lib/components/advanced-color-picker/advanced-color-picker.component.d.ts +14 -0
- package/lib/components/box/box.component.d.ts +1 -6
- package/lib/components/button-toggle-group/button-toggle-group.component.d.ts +14 -0
- package/lib/components/button-toggle-group/button-toggle-group.d.ts +2 -4
- package/lib/components/carbon-provider/carbon-provider.component.d.ts +1 -1
- package/lib/components/carbon-provider/carbon-provider.component.js +20 -19
- package/lib/components/card/card-row/card-row.component.d.ts +19 -4
- package/lib/components/card/card.component.d.ts +28 -10
- package/lib/components/checkbox/checkbox-group.component.d.ts +48 -15
- package/lib/components/checkbox/checkbox-group.d.ts +2 -2
- package/lib/components/checkbox/checkbox.component.d.ts +14 -0
- package/lib/components/content/content.component.d.ts +31 -9
- package/lib/components/date/__internal__/date-formats/index.js +88 -20
- package/lib/components/date/__internal__/utils.js +14 -3
- package/lib/components/date/date.component.js +13 -5
- package/lib/components/date-range/date-range.component.d.ts +68 -20
- package/lib/components/decimal/decimal.component.d.ts +14 -0
- package/lib/components/detail/detail.component.d.ts +34 -6
- package/lib/components/draggable/draggable-container.component.d.ts +24 -4
- package/lib/components/draggable/draggable-item.component.d.ts +34 -6
- package/lib/components/duelling-picklist/duelling-picklist.component.d.ts +27 -8
- package/lib/components/fieldset/fieldset.component.d.ts +23 -7
- package/lib/components/flat-table/flat-table-cell/flat-table-cell.component.d.ts +66 -17
- package/lib/components/flat-table/flat-table-header/flat-table-header.component.d.ts +48 -14
- package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.component.d.ts +44 -12
- package/lib/components/flat-table/flat-table.component.d.ts +46 -20
- package/lib/components/grid/grid-item/grid-item.component.d.ts +29 -22
- package/lib/components/grouped-character/grouped-character.component.d.ts +32 -10
- package/lib/components/heading/heading.component.d.ts +66 -18
- package/lib/components/help/help.component.d.ts +51 -22
- package/lib/components/loader/loader.component.d.ts +14 -0
- package/lib/components/loader-bar/loader-bar.component.d.ts +18 -3
- package/lib/components/message/message.component.d.ts +36 -12
- package/lib/components/multi-action-button/multi-action-button.component.d.ts +14 -0
- package/lib/components/note/note.component.d.ts +34 -11
- package/lib/components/numeral-date/numeral-date.component.d.ts +14 -0
- package/lib/components/numeral-date/numeral-date.d.ts +2 -2
- package/lib/components/pill/pill.component.d.ts +37 -22
- package/lib/components/pill/pill.style.js +1 -1
- package/lib/components/popover-container/popover-container.component.d.ts +54 -23
- package/lib/components/portrait/portrait.component.d.ts +55 -29
- package/lib/components/preview/preview.component.d.ts +26 -9
- package/lib/components/profile/profile.component.d.ts +28 -8
- package/lib/components/progress-tracker/progress-tracker.component.d.ts +14 -0
- package/lib/components/radio-button/radio-button-group.component.d.ts +60 -21
- package/lib/components/radio-button/radio-button-group.d.ts +2 -4
- package/lib/components/search/search.component.d.ts +14 -0
- package/lib/components/select/select-textbox/select-textbox.d.ts +2 -2
- package/lib/components/settings-row/settings-row.component.d.ts +26 -7
- package/lib/components/show-edit-pod/show-edit-pod.component.d.ts +58 -23
- package/lib/components/simple-color-picker/simple-color-picker.component.d.ts +52 -17
- package/lib/components/simple-color-picker/simple-color-picker.d.ts +2 -4
- package/lib/components/split-button/split-button.component.d.ts +14 -0
- package/lib/components/step-sequence/step-sequence.component.d.ts +21 -6
- package/lib/components/switch/switch.component.d.ts +14 -0
- package/lib/components/tabs/tab/tab.component.d.ts +51 -20
- package/lib/components/tabs/tabs.component.d.ts +46 -15
- package/lib/components/textarea/textarea.component.d.ts +14 -0
- package/lib/components/textarea/textarea.d.ts +2 -2
- package/lib/components/textbox/textbox.component.d.ts +14 -0
- package/lib/components/textbox/textbox.d.ts +2 -2
- package/lib/components/tile/tile-footer/tile-footer.component.d.ts +19 -4
- package/lib/components/tile-select/tile-select-group.component.d.ts +35 -12
- package/lib/components/tile-select/tile-select.component.d.ts +63 -26
- package/lib/components/typography/list.component.d.ts +1 -2
- package/lib/components/typography/typography.component.d.ts +1 -6
- package/lib/global.d.ts +1 -0
- package/lib/style/color-config/index.d.ts +2 -3
- package/lib/style/color-config/index.js +2 -1
- package/lib/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.d.ts +3 -2
- package/lib/style/design-tokens/debug-theme.util.d.ts +449 -1
- package/lib/style/design-tokens/generate-css-variables.util.d.ts +10 -1
- package/lib/style/global-style.d.ts +1 -8
- package/lib/style/palette/index.d.ts +19 -7
- package/lib/style/themes/aegean/aegean-theme.config.d.ts +3 -25
- package/lib/style/themes/aegean/aegean-theme.config.js +16 -14
- package/lib/style/themes/aegean/index.d.ts +2 -5
- package/lib/style/themes/base/base-theme.config.d.ts +31 -468
- package/lib/style/themes/base/base-theme.config.js +3 -1
- package/lib/style/themes/base/index.d.ts +3 -62
- package/lib/style/themes/base/index.js +2 -2
- package/lib/style/themes/index.d.ts +1 -5
- package/lib/style/themes/medium/index.d.ts +1 -1
- package/lib/style/themes/mint/index.d.ts +2 -5
- package/lib/style/themes/mint/mint-theme.config.d.ts +3 -25
- package/lib/style/themes/mint/mint-theme.config.js +16 -14
- package/lib/style/themes/none/index.d.ts +2 -5
- package/lib/style/themes/none/none-theme.config.d.ts +2 -3
- package/lib/style/themes/sage/index.d.ts +8 -11
- package/lib/style/themes/small/index.d.ts +1 -1
- package/lib/style/themes/test-utils.d.ts +1 -1
- package/lib/style/utils/add-hex-symbols.d.ts +1 -1
- package/lib/style/utils/at-opacity.d.ts +6 -1
- package/lib/style/utils/at-opacity.js +4 -2
- package/lib/style/utils/color.d.ts +3 -7
- package/lib/style/utils/color.js +9 -9
- package/lib/style/utils/filter-out-styled-system-spacing-props.d.ts +1 -3
- package/lib/style/utils/filter-styled-system-margin-props.d.ts +3 -1
- package/lib/style/utils/filter-styled-system-margin-props.js +2 -0
- package/lib/style/utils/filter-styled-system-padding-props.d.ts +3 -1
- package/lib/style/utils/filter-styled-system-padding-props.js +2 -0
- package/lib/style/utils/get-rgb-values.d.ts +2 -2
- package/lib/style/utils/get-rgb-values.js +1 -1
- package/lib/style/utils/index.d.ts +1 -1
- package/lib/style/utils/merge-deep.d.ts +2 -6
- package/lib/style/utils/merge-deep.js +20 -24
- package/lib/style/utils/mix.d.ts +4 -1
- package/lib/style/utils/mix.js +10 -5
- package/lib/style/utils/shade.d.ts +1 -1
- package/lib/style/utils/tint.d.ts +1 -1
- package/lib/style/utils/width.d.ts +2 -3
- package/package.json +1 -1
- package/esm/style/__spec__.d.ts +0 -1
- package/esm/style/__spec__.js +0 -76
- package/lib/style/__spec__.d.ts +0 -1
- package/lib/style/__spec__.js +0 -82
|
@@ -9,21 +9,23 @@ export default (palette => {
|
|
|
9
9
|
},
|
|
10
10
|
|
|
11
11
|
get compatibility() {
|
|
12
|
+
var _this$colors, _this$colors2, _this$colors3, _this$colors4, _this$colors5, _this$colors6, _this$colors7, _this$colors8, _this$colors9, _this$colors10, _this$colors11, _this$colors12, _this$colors13, _this$colors14;
|
|
13
|
+
|
|
12
14
|
return {
|
|
13
|
-
colorsActionMajor150: this.colors.loadingBarBackground,
|
|
14
|
-
colorsActionMajor500: this.colors.primary,
|
|
15
|
-
colorsActionMajor600: this.colors.secondary,
|
|
16
|
-
colorsActionMajor700: this.colors.tertiary,
|
|
17
|
-
colorsComponentsMenuAutumnStandard600: this.colors.primary,
|
|
18
|
-
colorsComponentsMenuSpringChild600: this.colors.primary,
|
|
19
|
-
colorsComponentsMenuAutumnChild600: this.colors.primary,
|
|
20
|
-
colorsComponentsMenuSummerChild600: this.colors.primary,
|
|
21
|
-
colorsComponentsMenuWinterChild600: this.colors.primary,
|
|
22
|
-
colorsComponentsMenuSpringChildAlt600: this.colors.primary,
|
|
23
|
-
colorsComponentsMenuAutumnChildAlt600: this.colors.primary,
|
|
24
|
-
colorsComponentsMenuWinterChildAlt600: this.colors.primary,
|
|
25
|
-
colorsComponentsMenuSummerChildAlt600: this.colors.primary,
|
|
26
|
-
colorsBaseTheme: this.colors.primary
|
|
15
|
+
colorsActionMajor150: this === null || this === void 0 ? void 0 : (_this$colors = this.colors) === null || _this$colors === void 0 ? void 0 : _this$colors.loadingBarBackground,
|
|
16
|
+
colorsActionMajor500: this === null || this === void 0 ? void 0 : (_this$colors2 = this.colors) === null || _this$colors2 === void 0 ? void 0 : _this$colors2.primary,
|
|
17
|
+
colorsActionMajor600: this === null || this === void 0 ? void 0 : (_this$colors3 = this.colors) === null || _this$colors3 === void 0 ? void 0 : _this$colors3.secondary,
|
|
18
|
+
colorsActionMajor700: this === null || this === void 0 ? void 0 : (_this$colors4 = this.colors) === null || _this$colors4 === void 0 ? void 0 : _this$colors4.tertiary,
|
|
19
|
+
colorsComponentsMenuAutumnStandard600: this === null || this === void 0 ? void 0 : (_this$colors5 = this.colors) === null || _this$colors5 === void 0 ? void 0 : _this$colors5.primary,
|
|
20
|
+
colorsComponentsMenuSpringChild600: this === null || this === void 0 ? void 0 : (_this$colors6 = this.colors) === null || _this$colors6 === void 0 ? void 0 : _this$colors6.primary,
|
|
21
|
+
colorsComponentsMenuAutumnChild600: this === null || this === void 0 ? void 0 : (_this$colors7 = this.colors) === null || _this$colors7 === void 0 ? void 0 : _this$colors7.primary,
|
|
22
|
+
colorsComponentsMenuSummerChild600: this === null || this === void 0 ? void 0 : (_this$colors8 = this.colors) === null || _this$colors8 === void 0 ? void 0 : _this$colors8.primary,
|
|
23
|
+
colorsComponentsMenuWinterChild600: this === null || this === void 0 ? void 0 : (_this$colors9 = this.colors) === null || _this$colors9 === void 0 ? void 0 : _this$colors9.primary,
|
|
24
|
+
colorsComponentsMenuSpringChildAlt600: this === null || this === void 0 ? void 0 : (_this$colors10 = this.colors) === null || _this$colors10 === void 0 ? void 0 : _this$colors10.primary,
|
|
25
|
+
colorsComponentsMenuAutumnChildAlt600: this === null || this === void 0 ? void 0 : (_this$colors11 = this.colors) === null || _this$colors11 === void 0 ? void 0 : _this$colors11.primary,
|
|
26
|
+
colorsComponentsMenuWinterChildAlt600: this === null || this === void 0 ? void 0 : (_this$colors12 = this.colors) === null || _this$colors12 === void 0 ? void 0 : _this$colors12.primary,
|
|
27
|
+
colorsComponentsMenuSummerChildAlt600: this === null || this === void 0 ? void 0 : (_this$colors13 = this.colors) === null || _this$colors13 === void 0 ? void 0 : _this$colors13.primary,
|
|
28
|
+
colorsBaseTheme: this === null || this === void 0 ? void 0 : (_this$colors14 = this.colors) === null || _this$colors14 === void 0 ? void 0 : _this$colors14.primary
|
|
27
29
|
};
|
|
28
30
|
}
|
|
29
31
|
|
|
@@ -446,17 +446,14 @@ declare var _default: {
|
|
|
446
446
|
opacity800: string;
|
|
447
447
|
};
|
|
448
448
|
name: string;
|
|
449
|
-
palette
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
space: string[];
|
|
455
|
-
colors: import("../base").Colors;
|
|
456
|
-
disabled: {
|
|
449
|
+
palette?: import("../base/base-theme.config").BasePalette | undefined;
|
|
450
|
+
spacing?: number | undefined;
|
|
451
|
+
space?: string[] | undefined;
|
|
452
|
+
colors?: Partial<import("../base/base-theme.config").Colors> | undefined;
|
|
453
|
+
disabled?: {
|
|
457
454
|
background: string;
|
|
458
|
-
};
|
|
459
|
-
zIndex
|
|
455
|
+
} | undefined;
|
|
456
|
+
zIndex?: {
|
|
460
457
|
smallOverlay: number;
|
|
461
458
|
overlay: number;
|
|
462
459
|
popover: number;
|
|
@@ -466,6 +463,6 @@ declare var _default: {
|
|
|
466
463
|
fullScreenModal: number;
|
|
467
464
|
notification: number;
|
|
468
465
|
aboveAll: number;
|
|
469
|
-
};
|
|
466
|
+
} | undefined;
|
|
470
467
|
};
|
|
471
468
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare const _default: Partial<import("../base").ThemeObject>;
|
|
2
2
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const assertIsSubset: (obj: Record<string, unknown>, comparison: Record<string, unknown>) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare const _default: (configObject: Record<string, string>) => Record<string, string>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare const _default: (base: string) => (opacity: number | string) => string;
|
|
2
|
+
/**
|
|
3
|
+
* Given a base color hex will return a function that expects
|
|
4
|
+
* some given opactiy and returns the base color at that
|
|
5
|
+
* opacity.
|
|
6
|
+
*/
|
|
2
7
|
export default _default;
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* opacity.
|
|
5
5
|
*/
|
|
6
6
|
export default (base => {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
var _base$match;
|
|
8
|
+
|
|
9
|
+
const rgb = base === null || base === void 0 ? void 0 : (_base$match = base.match(/[^#]{2}/g)) === null || _base$match === void 0 ? void 0 : _base$match.map(pair => parseInt(pair, 16));
|
|
10
|
+
return opacity => `rgba(${rgb === null || rgb === void 0 ? void 0 : rgb.join(",")},${opacity})`;
|
|
9
11
|
});
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
color: any;
|
|
5
|
-
bg: any;
|
|
6
|
-
backgroundColor: any;
|
|
7
|
-
}): any;
|
|
1
|
+
import { ThemeObject } from "style/themes/base";
|
|
2
|
+
export declare const toColor: (theme: ThemeObject, color: string) => string;
|
|
3
|
+
declare const _default: ({ color, bg, backgroundColor, ...rest }: Record<string, unknown>) => any;
|
|
8
4
|
export default _default;
|
package/esm/style/utils/color.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// eslint-disable-next-line no-restricted-imports
|
|
2
2
|
import { color as styledColor } from "styled-system";
|
|
3
3
|
import tokens from "@sage/design-tokens/js/base/common";
|
|
4
|
+
|
|
4
5
|
/*
|
|
5
6
|
* styled-system/color allows users to use a color from the theme, from the `colors` object.
|
|
6
7
|
*
|
|
@@ -20,8 +21,9 @@ import tokens from "@sage/design-tokens/js/base/common";
|
|
|
20
21
|
*
|
|
21
22
|
* This allows us to keep our themes as plain objects.
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
24
|
export const toColor = (theme, color) => {
|
|
25
|
+
var _color$match;
|
|
26
|
+
|
|
25
27
|
if (color.startsWith("--") && color.slice(2) in tokens) {
|
|
26
28
|
return `var(${color})`;
|
|
27
29
|
}
|
|
@@ -30,13 +32,13 @@ export const toColor = (theme, color) => {
|
|
|
30
32
|
palette
|
|
31
33
|
} = theme;
|
|
32
34
|
const percentage = color.match(/\d+/);
|
|
33
|
-
const method = color.match(/[a-zA-Z]+/);
|
|
35
|
+
const method = (_color$match = color.match(/[a-zA-Z]+/)) === null || _color$match === void 0 ? void 0 : _color$match.toString();
|
|
34
36
|
|
|
35
|
-
if (method in palette) {
|
|
37
|
+
if (method && method in palette) {
|
|
36
38
|
const match = palette[method];
|
|
37
39
|
|
|
38
40
|
if (typeof match === "function") {
|
|
39
|
-
const arg = ["blackOpacity", "whiteOpacity"].includes(method
|
|
41
|
+
const arg = ["blackOpacity", "whiteOpacity"].includes(method) ? `0.${percentage}` : percentage;
|
|
40
42
|
return match(arg);
|
|
41
43
|
}
|
|
42
44
|
|
|
@@ -51,12 +53,10 @@ export default (({
|
|
|
51
53
|
backgroundColor,
|
|
52
54
|
...rest
|
|
53
55
|
}) => {
|
|
56
|
+
const obj = {};
|
|
57
|
+
obj.color = color ? toColor(rest.theme, color) : undefined;
|
|
58
|
+
obj.bg = bg || backgroundColor ? toColor(rest.theme, bg || backgroundColor) : undefined;
|
|
54
59
|
return styledColor({ ...rest,
|
|
55
|
-
...
|
|
56
|
-
color: toColor(rest.theme, color)
|
|
57
|
-
}),
|
|
58
|
-
...((bg || backgroundColor) && {
|
|
59
|
-
bg: toColor(rest.theme, bg || backgroundColor)
|
|
60
|
-
})
|
|
60
|
+
...obj
|
|
61
61
|
});
|
|
62
62
|
});
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { MarginProps } from "styled-system";
|
|
2
|
+
export declare const marginPropertyNames: string[];
|
|
3
|
+
export default function filterStyledSystemMarginProps(originalObject: Record<string, unknown> | MarginProps): MarginProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import filterObjectProperties from "../../__internal__/filter-object-properties";
|
|
2
|
-
const marginPropertyNames = ["margin", "m", "marginLeft", "ml", "marginRight", "mr", "marginTop", "mt", "marginBottom", "mb", "marginX", "mx", "marginY", "my"];
|
|
2
|
+
export const marginPropertyNames = ["margin", "m", "marginLeft", "ml", "marginRight", "mr", "marginTop", "mt", "marginBottom", "mb", "marginX", "mx", "marginY", "my"];
|
|
3
3
|
export default function filterStyledSystemMarginProps(originalObject) {
|
|
4
4
|
return filterObjectProperties(originalObject, marginPropertyNames);
|
|
5
5
|
}
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { PaddingProps } from "styled-system";
|
|
2
|
+
export declare const paddingPropertyNames: string[];
|
|
3
|
+
export default function filterStyledSystemPaddingProps(originalObject: Record<string, unknown>): PaddingProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import filterObjectProperties from "../../__internal__/filter-object-properties";
|
|
2
|
-
const paddingPropertyNames = ["padding", "p", "paddingLeft", "pl", "paddingRight", "pr", "paddingTop", "pt", "paddingBottom", "pb", "paddingX", "px", "paddingY", "py"];
|
|
2
|
+
export const paddingPropertyNames = ["padding", "p", "paddingLeft", "pl", "paddingRight", "pr", "paddingTop", "pt", "paddingBottom", "pb", "paddingX", "px", "paddingY", "py"];
|
|
3
3
|
export default function filterStyledSystemPaddingProps(originalObject) {
|
|
4
4
|
return filterObjectProperties(originalObject, paddingPropertyNames);
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Given a base color in hex will return its rgb values. */
|
|
2
2
|
const getRgbValues = baseColor => {
|
|
3
|
-
return [parseInt(baseColor.
|
|
3
|
+
return [parseInt(baseColor.substring(1, 3), 16), parseInt(baseColor.substring(3, 5), 16), parseInt(baseColor.substring(5, 6), 16)];
|
|
4
4
|
};
|
|
5
5
|
|
|
6
6
|
export default getRgbValues;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import filterStyledSystemPaddingProps from "./filter-styled-system-padding-props";
|
|
2
2
|
import filterStyledSystemMarginProps from "./filter-styled-system-margin-props";
|
|
3
3
|
import filterOutStyledSystemSpacingProps from "./filter-out-styled-system-spacing-props";
|
|
4
|
-
export { filterStyledSystemPaddingProps, filterStyledSystemMarginProps, filterOutStyledSystemSpacingProps };
|
|
4
|
+
export { filterStyledSystemPaddingProps, filterStyledSystemMarginProps, filterOutStyledSystemSpacingProps, };
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Simple object check.
|
|
3
|
-
* @param item
|
|
4
|
-
* @returns {boolean}
|
|
5
3
|
*/
|
|
6
|
-
export function isObject(item:
|
|
4
|
+
export declare function isObject(item: unknown): unknown;
|
|
7
5
|
/**
|
|
8
6
|
* Deep merge two objects.
|
|
9
|
-
* @param target
|
|
10
|
-
* @param ...sources
|
|
11
7
|
*/
|
|
12
|
-
export function mergeDeep(target:
|
|
8
|
+
export declare function mergeDeep(target: Record<string, unknown>, ...sources: Record<string, unknown>[]): Record<string, unknown>;
|
|
@@ -1,39 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Simple object check.
|
|
3
|
-
* @param item
|
|
4
|
-
* @returns {boolean}
|
|
5
3
|
*/
|
|
6
4
|
export function isObject(item) {
|
|
7
5
|
return item && typeof item === "object" && !Array.isArray(item);
|
|
8
6
|
}
|
|
9
|
-
/**
|
|
10
|
-
* Deep merge two objects.
|
|
11
|
-
* @param target
|
|
12
|
-
* @param ...sources
|
|
13
|
-
*/
|
|
14
7
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (!_sources.length) return _target;
|
|
8
|
+
function merge(_target, ..._sources) {
|
|
9
|
+
if (!_sources.length) return _target;
|
|
18
10
|
|
|
19
|
-
|
|
11
|
+
const source = _sources.shift();
|
|
20
12
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
13
|
+
if (isObject(_target) && isObject(source)) {
|
|
14
|
+
for (const key in source) {
|
|
15
|
+
if (isObject(source[key])) {
|
|
16
|
+
merge(_target[key], source[key]);
|
|
17
|
+
} else {
|
|
18
|
+
Object.assign(_target, {
|
|
19
|
+
[key]: source[key]
|
|
20
|
+
});
|
|
30
21
|
}
|
|
31
22
|
}
|
|
23
|
+
}
|
|
32
24
|
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
return merge(_target, ..._sources);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Deep merge two objects.
|
|
29
|
+
*/
|
|
35
30
|
|
|
36
31
|
|
|
32
|
+
export function mergeDeep(target, ...sources) {
|
|
33
|
+
// ensure function is not mutative
|
|
37
34
|
const newTarget = JSON.parse(JSON.stringify(target));
|
|
38
35
|
return merge(newTarget, ...sources);
|
|
39
36
|
}
|
package/esm/style/utils/mix.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare const _default: (inputColorA: string, inputColorB: string, weight?: number) => string;
|
|
2
|
+
/**
|
|
3
|
+
* A Javascript implementation of the Sass `mix` mixin.
|
|
4
|
+
*/
|
|
2
5
|
export default _default;
|
package/esm/style/utils/mix.js
CHANGED
|
@@ -16,11 +16,16 @@ const processHexes = (...hexes) => {
|
|
|
16
16
|
|
|
17
17
|
export default ((inputColorA, inputColorB, weight = 50) => {
|
|
18
18
|
const [colorA, colorB] = processHexes(inputColorA, inputColorB);
|
|
19
|
-
const colorAPairs = colorA.match(/.{1,2}/g)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
const colorAPairs = colorA.match(/.{1,2}/g);
|
|
20
|
+
const colorBPairs = colorB.match(/.{1,2}/g);
|
|
21
|
+
|
|
22
|
+
if (!colorBPairs) {
|
|
23
|
+
return "";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const hex = colorAPairs === null || colorAPairs === void 0 ? void 0 : colorAPairs.reduce((acc, pair, i) => {
|
|
27
|
+
const val1 = hexToDec(pair);
|
|
28
|
+
const val2 = hexToDec(colorBPairs[i]);
|
|
24
29
|
const combination = decToHex(Math.round(val2 + (val1 - val2) * (weight / 100.0)));
|
|
25
30
|
return acc + combination.padStart(2, "0");
|
|
26
31
|
}, "").toUpperCase();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare const _default: (color: string) => (weight: number | string) => string;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare const _default: (color: string) => (weight: number | string) => string;
|
|
2
2
|
export default _default;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { ValidationProps } from "../validations";
|
|
4
4
|
import { CommonHiddenCheckableInputProps } from "./hidden-checkable-input";
|
|
5
5
|
|
|
6
6
|
export interface CommonCheckableInputProps
|
|
7
|
-
extends
|
|
7
|
+
extends ValidationProps,
|
|
8
8
|
CommonHiddenCheckableInputProps {
|
|
9
9
|
/** If true, the component will be disabled */
|
|
10
10
|
disabled?: boolean;
|
|
@@ -14,22 +14,52 @@ declare function Fieldset({ legend, children, inline, legendWidth, legendAlign,
|
|
|
14
14
|
blockGroupBehaviour: any;
|
|
15
15
|
}): JSX.Element;
|
|
16
16
|
declare namespace Fieldset {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
const propTypes: {
|
|
18
|
+
/** Fieldset content */
|
|
19
|
+
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
20
|
+
/** The content for the Fieldset Legend */
|
|
21
|
+
legend: PropTypes.Requireable<string>;
|
|
22
|
+
/** Indicate that error has occurred
|
|
23
|
+
Pass string to display icon, tooltip and red border
|
|
24
|
+
Pass true boolean to only display red border */
|
|
25
|
+
error: PropTypes.Requireable<string | boolean>;
|
|
26
|
+
/** Indicate that warning has occurred
|
|
27
|
+
Pass string to display icon, tooltip and orange border
|
|
28
|
+
Pass true boolean to only display orange border */
|
|
29
|
+
warning: PropTypes.Requireable<string | boolean>;
|
|
30
|
+
/** Indicate additional information
|
|
31
|
+
Pass string to display icon, tooltip and blue border
|
|
32
|
+
Pass true boolean to only display blue border */
|
|
33
|
+
info: PropTypes.Requireable<string | boolean>;
|
|
34
|
+
/** When true, legend is placed in line with the children */
|
|
35
|
+
inline: PropTypes.Requireable<boolean>;
|
|
36
|
+
/** Percentage width of legend (only when legend is inline) */
|
|
37
|
+
legendWidth: PropTypes.Requireable<number>;
|
|
38
|
+
/** Text alignment of legend when inline */
|
|
39
|
+
legendAlign: PropTypes.Requireable<string>;
|
|
40
|
+
/** Spacing between legend and field for inline legend, number multiplied by base spacing unit (8) */
|
|
41
|
+
legendSpacing: PropTypes.Requireable<number>;
|
|
42
|
+
/** If true, an asterisk will be added to the label */
|
|
43
|
+
isRequired: PropTypes.Requireable<boolean>;
|
|
44
|
+
/** Controls whether group behaviour should be enabled */
|
|
45
|
+
blockGroupBehaviour: PropTypes.Requireable<boolean>;
|
|
46
|
+
marginBottom?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
47
|
+
margin?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
48
|
+
m?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
49
|
+
marginLeft?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
50
|
+
ml?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
51
|
+
marginRight?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
52
|
+
mr?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
53
|
+
marginTop?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
54
|
+
mt?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
55
|
+
mb?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
56
|
+
marginX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
57
|
+
mx?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
58
|
+
marginY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
59
|
+
my?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
60
|
+
};
|
|
30
61
|
namespace defaultProps {
|
|
31
|
-
const
|
|
32
|
-
export { inline_1 as inline };
|
|
62
|
+
const inline: boolean;
|
|
33
63
|
}
|
|
34
64
|
}
|
|
35
65
|
import PropTypes from "prop-types";
|
|
@@ -61,6 +61,20 @@ declare namespace FormField {
|
|
|
61
61
|
isRequired: PropTypes.Requireable<boolean>;
|
|
62
62
|
/** Id of the validation icon */
|
|
63
63
|
validationIconId: PropTypes.Requireable<string>;
|
|
64
|
+
marginBottom?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
65
|
+
margin?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
66
|
+
m?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
67
|
+
marginLeft?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
68
|
+
ml?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
69
|
+
marginRight?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
70
|
+
mr?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
71
|
+
marginTop?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
72
|
+
mt?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
73
|
+
mb?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
74
|
+
marginX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
75
|
+
mx?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
76
|
+
marginY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
77
|
+
my?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
64
78
|
};
|
|
65
79
|
}
|
|
66
80
|
import PropTypes from "prop-types";
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { MarginProps } from "styled-system";
|
|
3
|
-
import {
|
|
3
|
+
import { ValidationProps } from "../validations";
|
|
4
4
|
|
|
5
|
-
export interface CommonFormFieldPropTypes
|
|
6
|
-
extends MarginProps,
|
|
7
|
-
ValidationPropTypes {
|
|
5
|
+
export interface CommonFormFieldPropTypes extends MarginProps, ValidationProps {
|
|
8
6
|
/** If true, the component will be disabled */
|
|
9
7
|
disabled?: boolean;
|
|
10
8
|
/** Help content to be displayed under an input */
|
|
@@ -2,5 +2,5 @@ import { CommonInputPresentationProps } from "./input-presentation.component";
|
|
|
2
2
|
import { InputContextProps } from "../input-behaviour";
|
|
3
3
|
import { CarbonProviderProps } from "../../components/carbon-provider";
|
|
4
4
|
export declare const StyledInputPresentationContainer: import("styled-components").StyledComponent<"div", any, Pick<CommonInputPresentationProps, "inputWidth">, never>;
|
|
5
|
-
declare const InputPresentationStyle: import("styled-components").StyledComponent<"div", any, Pick<InputContextProps, "hasFocus"> & Pick<CommonInputPresentationProps, "disabled" | "
|
|
5
|
+
declare const InputPresentationStyle: import("styled-components").StyledComponent<"div", any, Pick<InputContextProps, "hasFocus"> & Pick<CommonInputPresentationProps, "disabled" | "error" | "info" | "warning" | "align" | "readOnly" | "size"> & Pick<CarbonProviderProps, "validationRedesignOptIn">, never>;
|
|
6
6
|
export default InputPresentationStyle;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { ValidationProps } from "../validations";
|
|
3
3
|
|
|
4
|
-
export interface LabelPropTypes extends
|
|
4
|
+
export interface LabelPropTypes extends ValidationProps {
|
|
5
5
|
/** Label width */
|
|
6
6
|
width?: number;
|
|
7
7
|
/** Label alignment */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { MarginProps } from "styled-system";
|
|
2
3
|
export interface ValidationProps {
|
|
3
4
|
/** Indicate that error has occurred
|
|
4
5
|
* Pass string to display icon, tooltip and red border
|
|
@@ -17,7 +18,7 @@ export interface ValidationProps {
|
|
|
17
18
|
warning?: boolean | string;
|
|
18
19
|
}
|
|
19
20
|
declare type TooltipPositions = "top" | "bottom" | "left" | "right";
|
|
20
|
-
export interface ValidationIconProps extends ValidationProps {
|
|
21
|
+
export interface ValidationIconProps extends ValidationProps, Pick<MarginProps, "mr" | "ml"> {
|
|
21
22
|
/** A small string to indicate the size of the icon */
|
|
22
23
|
size?: "small" | "medium" | "large";
|
|
23
24
|
/** The unique id of the component (used with aria-describedby for accessibility) */
|
|
@@ -42,10 +43,6 @@ export interface ValidationIconProps extends ValidationProps {
|
|
|
42
43
|
isPartOfInput?: boolean;
|
|
43
44
|
/** Overrides the default tabindex of the component */
|
|
44
45
|
tabIndex?: number;
|
|
45
|
-
/** Margin right, given number will be multiplied by base spacing unit (8) */
|
|
46
|
-
mr?: number;
|
|
47
|
-
/** Margin left, given number will be multiplied by base spacing unit (8) */
|
|
48
|
-
ml?: number;
|
|
49
46
|
}
|
|
50
47
|
export declare const ValidationIcon: ({ error, warning, info, size, onFocus, onBlur, iconId, tooltipId, isPartOfInput, tabIndex, onClick, tooltipPosition, tooltipFlipOverrides, ...rest }: ValidationIconProps) => JSX.Element | null;
|
|
51
48
|
export default ValidationIcon;
|
|
@@ -19,7 +19,7 @@ export function click(wrapper: any): any;
|
|
|
19
19
|
export namespace simulate {
|
|
20
20
|
export { keydown };
|
|
21
21
|
}
|
|
22
|
-
export const carbonThemesJestTable: (string | import("
|
|
22
|
+
export const carbonThemesJestTable: (string | Partial<import("style/themes/base/base-theme.config").ThemeObject> | undefined)[][];
|
|
23
23
|
import { mockMatchMedia } from "./mock-match-media";
|
|
24
24
|
export function testStyledSystemSpacing(component: any, defaults: any, styleContainer: any, assertOpts: any): void;
|
|
25
25
|
export function testStyledSystemMargin(component: any, defaults: any, styleContainer: any, assertOpts: any): void;
|
|
@@ -4,7 +4,21 @@ declare function AccordionGroup({ children, ...rest }: {
|
|
|
4
4
|
children: any;
|
|
5
5
|
}): JSX.Element;
|
|
6
6
|
declare namespace AccordionGroup {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const propTypes: {
|
|
8
|
+
children: (props: any, propName: any, componentName: any) => undefined;
|
|
9
|
+
marginBottom?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
10
|
+
margin?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
11
|
+
m?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
12
|
+
marginLeft?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
13
|
+
ml?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
14
|
+
marginRight?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
15
|
+
mr?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
16
|
+
marginTop?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
17
|
+
mt?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
18
|
+
mb?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
19
|
+
marginX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
20
|
+
mx?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
21
|
+
marginY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
22
|
+
my?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
|
23
|
+
};
|
|
10
24
|
}
|
|
@@ -67,7 +67,7 @@ const Accordion = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
67
67
|
});
|
|
68
68
|
(0, _react.useEffect)(() => {
|
|
69
69
|
setContentHeight(accordionContent.current.scrollHeight);
|
|
70
|
-
}, [isExpanded
|
|
70
|
+
}, [isExpanded]);
|
|
71
71
|
const toggleAccordion = (0, _react.useCallback)(ev => {
|
|
72
72
|
if (!isControlled) {
|
|
73
73
|
setIsExpandedInternal(!isExpanded);
|