@central-design-system/components 3.0.0-beta.2 → 3.0.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cds.css +1 -1
- package/dist/cds.d.ts +4 -2
- package/dist/cds.es.js +10713 -9313
- package/dist/cds.umd.js +7 -3
- package/dist/components/CdsAutocomplete/CdsAutocomplete.vue.d.ts +97 -37
- package/dist/components/CdsBadge/CdsBadge.vue.d.ts +36 -12
- package/dist/components/CdsBreadcrumbs/CdsBreadcrumbs.vue.d.ts +11 -0
- package/dist/components/CdsBreadcrumbs/CdsBreadcrumbsItem.vue.d.ts +14 -3
- package/dist/components/CdsButton/CdsButton.vue.d.ts +37 -26
- package/dist/components/CdsCheckbox/CdsCheckbox.vue.d.ts +68 -3
- package/dist/components/CdsCheckbox/CdsCheckboxGroup.vue.d.ts +13 -0
- package/dist/components/CdsCombobox/CdsCombobox.vue.d.ts +270 -126
- package/dist/components/CdsContainer/CdsContainer.vue.d.ts +41 -24
- package/dist/components/CdsContainer/context.d.ts +1 -1
- package/dist/components/CdsContentSwitcher/CdsContentSwitcher.vue.d.ts +66 -0
- package/dist/components/CdsContentSwitcher/CdsContentSwitcherItem.vue.d.ts +212 -0
- package/dist/components/CdsContentSwitcher/index.d.ts +2 -0
- package/dist/components/CdsDatePicker/CdsDatePicker.vue.d.ts +12 -1
- package/dist/components/CdsDatePicker/composable/calendar.d.ts +2 -2
- package/dist/components/CdsDrawer/CdsDrawer.vue.d.ts +16 -4
- package/dist/components/CdsDropdown/CdsDropdown.vue.d.ts +228 -127
- package/dist/components/CdsEmptyState/CdsEmptyState.vue.d.ts +4 -4
- package/dist/components/CdsExpandablePanel/CdsExpandablePanel.vue.d.ts +13 -13
- package/dist/components/CdsExpandablePanel/CdsExpandablePanelTitle.vue.d.ts +10 -10
- package/dist/components/CdsExpandablePanel/CdsExpandablePanels.vue.d.ts +17 -6
- package/dist/components/CdsExpandablePanel/composable/expandablePanelTitleProps.d.ts +3 -3
- package/dist/components/CdsFooter/CdsFooter.vue.d.ts +23 -3
- package/dist/components/CdsForm/CdsForm.vue.d.ts +11 -0
- package/dist/components/CdsGrid/composable/column.d.ts +1 -1
- package/dist/components/CdsGrid/composable/subgrid.d.ts +1 -1
- package/dist/components/CdsGrid/mode/CSSGrid.d.ts +1 -1
- package/dist/components/CdsGrid/mode/FlexGrid.d.ts +1 -1
- package/dist/components/CdsHeader/CdsHeader.vue.d.ts +23 -3
- package/dist/components/CdsIcon/CdsIcon.vue.d.ts +27 -3
- package/dist/components/CdsInput/CdsInput.vue.d.ts +26 -21
- package/dist/components/CdsInput/CdsInputDescription.vue.d.ts +3 -3
- package/dist/components/CdsInput/CdsInputLabel.vue.d.ts +3 -3
- package/dist/components/CdsLayout/CdsLayout.vue.d.ts +12 -1
- package/dist/components/CdsLayout/context.d.ts +1 -1
- package/dist/components/CdsLink/CdsLink.vue.d.ts +15 -3
- package/dist/components/CdsList/CdsList.vue.d.ts +31 -19
- package/dist/components/CdsList/CdsListGroup.vue.d.ts +7 -7
- package/dist/components/CdsList/CdsListItem.vue.d.ts +12 -12
- package/dist/components/CdsList/composable/list.d.ts +1 -1
- package/dist/components/CdsLoader/CdsLoader.vue.d.ts +12 -0
- package/dist/components/CdsMenu/CdsMenu.vue.d.ts +18 -7
- package/dist/components/CdsModal/CdsModal.vue.d.ts +14 -3
- package/dist/components/CdsNotification/CdsNotification.vue.d.ts +38 -27
- package/dist/components/CdsNotification/CdsNotificationAlert.vue.d.ts +33 -22
- package/dist/components/CdsNotification/composable/notification.d.ts +4 -4
- package/dist/components/CdsOverlay/CdsOverlay.vue.d.ts +11 -5
- package/dist/components/CdsOverlay/composable/activator.d.ts +1 -1
- package/dist/components/CdsOverlay/composable/locationStrategies.d.ts +16 -16
- package/dist/components/CdsOverlay/constants.d.ts +2 -0
- package/dist/components/CdsPagination/CdsPagination.vue.d.ts +12 -1
- package/dist/components/CdsProgress/CdsProgress.vue.d.ts +12 -1
- package/dist/components/CdsRadioButton/CdsRadio.vue.d.ts +26 -11
- package/dist/components/CdsRadioButton/CdsRadioButton.vue.d.ts +13 -0
- package/dist/components/CdsSelect/CdsSelect.vue.d.ts +81 -61
- package/dist/components/CdsSidebar/CdsSidebar.vue.d.ts +30 -8
- package/dist/components/CdsSkeletonLoader/CdsSkeletonLoader.vue.d.ts +11 -0
- package/dist/components/CdsSlideGroup/CdsSlideGroup.vue.d.ts +19 -19
- package/dist/components/CdsStages/CdsStages.vue.d.ts +13 -1
- package/dist/components/CdsStatus/CdsStatus.vue.d.ts +20 -8
- package/dist/components/CdsSteps/CdsSteps.vue.d.ts +30 -23
- package/dist/components/CdsSteps/CdsStepsItem.vue.d.ts +3 -3
- package/dist/components/CdsSteps/context.d.ts +1 -1
- package/dist/components/CdsTable/CdsTable.vue.d.ts +96 -37
- package/dist/components/CdsTable/components/Footer/Footer.d.ts +1 -1
- package/dist/components/CdsTable/components/Header/DragHandle.d.ts +1 -1
- package/dist/components/CdsTable/components/Table/InternalTable.d.ts +60 -24
- package/dist/components/CdsTable/components/TableProvider.d.ts +71 -24
- package/dist/components/CdsTable/composable/filter.d.ts +1 -1
- package/dist/components/CdsTable/composable/flat.d.ts +1 -1
- package/dist/components/CdsTable/composable/pagination.d.ts +1 -1
- package/dist/components/CdsTable/composable/scroll.d.ts +4607 -0
- package/dist/components/CdsTable/composable/selection.d.ts +1 -1
- package/dist/components/CdsTable/composable/sorter.d.ts +1 -1
- package/dist/components/CdsTable/composable/sticky.d.ts +1 -1
- package/dist/components/CdsTable/composable/table.d.ts +32 -14
- package/dist/components/CdsTable/constants.d.ts +1 -0
- package/dist/components/CdsTable/context/summary.d.ts +1 -1
- package/dist/components/CdsTable/context/table.d.ts +1 -1
- package/dist/components/CdsTable/interface.d.ts +4 -4
- package/dist/components/CdsTable/utils/index.d.ts +1 -0
- package/dist/components/CdsTable/utils/vnode.d.ts +10 -0
- package/dist/components/CdsTabs/CdsTab.vue.d.ts +13 -13
- package/dist/components/CdsTabs/CdsTabs.vue.d.ts +50 -39
- package/dist/components/CdsTag/CdsTag.vue.d.ts +15 -3
- package/dist/components/CdsTextArea/CdsTextArea.vue.d.ts +101 -89
- package/dist/components/CdsTextInput/CdsTextInput.vue.d.ts +93 -57
- package/dist/components/CdsTimePicker/CdsTimePicker.vue.d.ts +11 -0
- package/dist/components/CdsTimePicker/composable/time.d.ts +2 -2
- package/dist/components/CdsToggle/CdsToggle.vue.d.ts +13 -8
- package/dist/components/CdsToolbar/CdsToolbar.vue.d.ts +53 -0
- package/dist/components/CdsTooltip/CdsTooltip.vue.d.ts +21 -10
- package/dist/components/CdsUploader/CdsUploader.vue.d.ts +61 -40
- package/dist/components/CdsUploader/components/AjaxUploader.d.ts +15 -15
- package/dist/components/CdsUploader/components/UploadList/ListItem.d.ts +40 -22
- package/dist/components/CdsUploader/components/UploadList/UploadList.d.ts +39 -21
- package/dist/components/CdsUploader/composable/upload.d.ts +25 -15
- package/dist/components/CdsUploader/index.d.ts +1 -0
- package/dist/components/CdsUploader/interface.d.ts +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/composable/appearance.d.ts +2 -2
- package/dist/composable/datetime.d.ts +4 -4
- package/dist/composable/delay.d.ts +2 -2
- package/dist/composable/direction.d.ts +1 -1
- package/dist/composable/domObserver.d.ts +5 -0
- package/dist/composable/field.d.ts +7 -5
- package/dist/composable/filter.d.ts +30 -0
- package/dist/composable/form.d.ts +2 -2
- package/dist/composable/group.d.ts +3 -3
- package/dist/composable/icon.d.ts +3 -3
- package/dist/composable/index.d.ts +5 -1
- package/dist/composable/invertColor.d.ts +19 -0
- package/dist/composable/layout.d.ts +20 -20
- package/dist/composable/loading.d.ts +2 -2
- package/dist/composable/menu.d.ts +1 -1
- package/dist/composable/nested/nested.d.ts +2 -2
- package/dist/{components/CdsDropdown/composable → composable}/scrolling.d.ts +2 -2
- package/dist/composable/select.d.ts +36 -8
- package/dist/composable/size.d.ts +1 -1
- package/dist/composable/tag.d.ts +0 -3
- package/dist/composable/text.d.ts +2 -2
- package/dist/composable/theme.d.ts +82 -0
- package/dist/composable/transparent.d.ts +19 -0
- package/dist/composable/validation.d.ts +2 -2
- package/dist/composable/variant.d.ts +1 -1
- package/dist/create.d.ts +5 -1
- package/dist/directives/index.d.ts +1 -0
- package/dist/directives/intersect/index.d.ts +19 -0
- package/dist/globals.d.ts +8 -0
- package/dist/locale/index.d.ts +1 -1
- package/dist/themes/b2b.d.ts +26 -0
- package/dist/themes/cds.d.ts +26 -0
- package/dist/themes/dark.d.ts +26 -0
- package/dist/themes/index.d.ts +5 -0
- package/dist/themes/promo.d.ts +26 -0
- package/dist/themes/themes.d.ts +10 -0
- package/dist/utils/colors.d.ts +368 -0
- package/dist/utils/colorsUtils/APCA.d.ts +7 -0
- package/dist/utils/colorsUtils/index.d.ts +1 -0
- package/dist/utils/colorsUtils/transformCIELAB.d.ts +3 -0
- package/dist/utils/colorsUtils/transformSRGB.d.ts +3 -0
- package/dist/utils/colorsUtils/utils.d.ts +41 -0
- package/dist/utils/date/date.d.ts +12 -12
- package/dist/utils/helpers.d.ts +30 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/propsFactory.d.ts +1 -1
- package/nuxt.js +2 -1
- package/package.json +1 -1
- package/src/scss/modules/grid/_css-grid.scss +12 -19
- package/src/scss/modules/grid/_flex-grid.scss +9 -5
- package/src/scss/modules/grid/_mixins.scss +27 -33
- package/src/scss/themes/b2b/tokens.json +104 -104
- package/src/scss/themes/cds/tokens.json +104 -104
- package/src/scss/themes/index.ts +1 -1
- package/src/scss/utility/display.scss +56 -5
- package/src/scss/utility/flexbox.scss +26 -28
- package/src/scss/utility/index.scss +1 -2
- package/src/scss/utility/layout.scss +65 -3
- package/src/scss/utility/spacing.scss +46 -86
- package/src/scss/utility/typography.scss +48 -1
- package/src/scss/utility/variables/display.scss +10 -0
- package/src/scss/utility/variables/exports/_display.scss +7 -0
- package/src/scss/utility/variables/exports/_flex.scss +13 -0
- package/src/scss/utility/variables/exports/_overflow.scss +7 -0
- package/src/scss/utility/variables/exports/_position.scss +7 -0
- package/src/scss/utility/variables/exports/_spacing.scss +14 -0
- package/src/scss/utility/variables/exports/_typography.scss +22 -0
- package/src/scss/utility/variables/exports/_visibility.scss +7 -0
- package/src/scss/utility/variables/exports/_widthHeight.scss +7 -0
- package/src/scss/utility/variables/flex.scss +140 -0
- package/src/scss/utility/variables/index.scss +12 -0
- package/src/scss/utility/variables/overflow.scss +6 -0
- package/src/scss/utility/variables/position.scss +7 -0
- package/src/scss/utility/variables/spacing.scss +37 -0
- package/src/scss/utility/{variables.scss → variables/typography.scss} +48 -71
- package/src/scss/utility/variables/visibility.scss +5 -0
- package/src/scss/utility/variables/widthHeight.scss +69 -0
- package/dist/components/CdsDropdown/composable/index.d.ts +0 -1
- package/dist/composable/dark.d.ts +0 -19
- package/dist/plugins/index.d.ts +0 -2
- package/src/scss/utility/generatedFiles/generatedStyles.json +0 -1
- package/src/scss/utility/generatedFiles/generatedStyles.scss +0 -300
package/dist/utils/helpers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentPublicInstance, ComponentInternalInstance, ComputedGetter, InjectionKey, PropType, Ref, ToRefs, VNodeProps, VNodeChild, AllowedComponentProps, Component } from 'vue';
|
|
2
1
|
import type { TItemKey } from '../composable';
|
|
2
|
+
import type { ComponentPublicInstance, ComponentInternalInstance, ComputedGetter, InjectionKey, PropType, Ref, ToRefs, VNodeProps, VNodeChild, AllowedComponentProps, Component } from 'vue';
|
|
3
3
|
export declare const preventedScrollClass = "cds-scroll-blocked";
|
|
4
4
|
export declare const keyNames: Readonly<{
|
|
5
5
|
enter: "Enter";
|
|
@@ -99,6 +99,22 @@ export declare function getNestedValue(obj: any, path: (string | number)[], fall
|
|
|
99
99
|
* @param fallback
|
|
100
100
|
*/
|
|
101
101
|
export declare function getObjectValueByPath(obj: any, path: string, fallback?: any): any;
|
|
102
|
+
/**
|
|
103
|
+
* This function is used to get the value of a property from an item. The property can be a string, an array, a function, or a boolean.
|
|
104
|
+
* If the property is a string, it will be used as a path to retrieve the value from the item.
|
|
105
|
+
* If the property is an array, it will be used as a nested path to retrieve the value from the item.
|
|
106
|
+
* If the property is a function, it will be called with the item and the fallback value as arguments, and its return value will be used.
|
|
107
|
+
* If the property is a boolean, and it's true, the item itself will be returned.
|
|
108
|
+
* If the property is null, undefined, or a boolean that's not true, the fallback value will be returned.
|
|
109
|
+
* If the item is not an object, and the property is not a function, the fallback value will be returned.
|
|
110
|
+
* If the property is not a string, an array, or a function, the fallback value will be returned.
|
|
111
|
+
* If the value retrieved from the item is undefined, the fallback value will be returned.
|
|
112
|
+
*
|
|
113
|
+
* @param item - The item from which to get the property value.
|
|
114
|
+
* @param property - The property to get from the item. Can be a string, an array, a function, or a boolean.
|
|
115
|
+
* @param fallback - The value to return if the property is not found or its value is undefined.
|
|
116
|
+
* @returns The value of the property from the item, or the fallback value.
|
|
117
|
+
*/
|
|
102
118
|
export declare function getPropertyFromItem(item: any, property: SelectItemKey, fallback?: any): any;
|
|
103
119
|
/**
|
|
104
120
|
* This function is used to return the scroll position of the given element.
|
|
@@ -142,6 +158,7 @@ export declare const isOn: (key: string) => boolean;
|
|
|
142
158
|
export declare const EventProp: PropType<(...args: any[]) => any>;
|
|
143
159
|
export declare function isComponentInstance(obj: any): obj is ComponentPublicInstance;
|
|
144
160
|
export declare function isFixedPosition(el?: HTMLElement): boolean;
|
|
161
|
+
export declare function padEnd(str: string, length: number, char?: string): string;
|
|
145
162
|
export declare function padStart(string: number | string, targetLength: number, padString: string): string;
|
|
146
163
|
export declare function pad(n: string | number, length?: number): string;
|
|
147
164
|
export declare function refElement<T extends Record<string, any> | undefined>(obj: T): Exclude<T, ComponentPublicInstance> | HTMLElement;
|
|
@@ -163,6 +180,18 @@ export declare function matchesSelector<T>(el: T | Element | undefined, selector
|
|
|
163
180
|
* @param delay
|
|
164
181
|
*/
|
|
165
182
|
export declare function debounce(fn: Function, delay: number): (...args: any[]) => void;
|
|
183
|
+
/**
|
|
184
|
+
* Pluralize a word based on a number.
|
|
185
|
+
* @param n
|
|
186
|
+
* @param opts
|
|
187
|
+
*/
|
|
188
|
+
export declare function plurals(n: number, opts: string[]): string;
|
|
189
|
+
/**
|
|
190
|
+
* Chunk a string into an array of strings.
|
|
191
|
+
* @param str
|
|
192
|
+
* @param size
|
|
193
|
+
*/
|
|
194
|
+
export declare function chunk(str: string, size?: number): string[];
|
|
166
195
|
export declare function noop(): void;
|
|
167
196
|
/**
|
|
168
197
|
* Types
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PropType } from 'vue';
|
|
2
1
|
import type { Prop, ComponentObjectPropsOptions } from '../shims-vue';
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
3
|
/**
|
|
4
4
|
* Creates a factory function for props definitions.
|
|
5
5
|
* This is used to define props in a composable then override
|
package/nuxt.js
CHANGED
package/package.json
CHANGED
|
@@ -75,20 +75,18 @@
|
|
|
75
75
|
--cds-grid-column-hang: calc(var(--cds-grid-gutter) / 2);
|
|
76
76
|
|
|
77
77
|
display: grid;
|
|
78
|
-
width: 100%;
|
|
79
|
-
max-width: get-grid-width($breakpoints, largest-breakpoint-name($breakpoints));
|
|
80
|
-
padding-right: var(--cds-grid-margin);
|
|
81
|
-
padding-left: var(--cds-grid-margin);
|
|
82
|
-
margin-right: auto;
|
|
83
|
-
margin-left: auto;
|
|
84
78
|
grid-template-columns: repeat(var(--cds-grid-columns), minmax(0, 1fr));
|
|
79
|
+
inline-size: 100%;
|
|
80
|
+
margin-inline: auto;
|
|
81
|
+
padding-inline: var(--cds-grid-margin);
|
|
82
|
+
max-inline-size: get-grid-width($breakpoints, largest-breakpoint-name($breakpoints));
|
|
85
83
|
}
|
|
86
84
|
|
|
87
85
|
// -----------------------------------------------------------------------------
|
|
88
86
|
// Full width
|
|
89
87
|
// -----------------------------------------------------------------------------
|
|
90
|
-
.#{$prefix}--css-grid--
|
|
91
|
-
max-
|
|
88
|
+
.#{$prefix}--css-grid--wide {
|
|
89
|
+
max-inline-size: 100%;
|
|
92
90
|
}
|
|
93
91
|
|
|
94
92
|
// -----------------------------------------------------------------------------
|
|
@@ -105,12 +103,10 @@
|
|
|
105
103
|
--cds-grid-mode-start: var(--cds-grid-gutter-start);
|
|
106
104
|
--cds-grid-mode-end: var(--cds-grid-gutter-end);
|
|
107
105
|
|
|
108
|
-
margin-
|
|
109
|
-
margin-left: var(--cds-grid-gutter-start);
|
|
106
|
+
margin-inline: var(--cds-grid-gutter-start) var(--cds-grid-gutter-end);
|
|
110
107
|
|
|
111
108
|
[dir='rtl'] & {
|
|
112
|
-
margin-
|
|
113
|
-
margin-left: var(--cds-grid-gutter-end);
|
|
109
|
+
margin-inline: var(--cds-grid-gutter-end) var(--cds-grid-gutter-start);
|
|
114
110
|
}
|
|
115
111
|
}
|
|
116
112
|
|
|
@@ -134,13 +130,11 @@
|
|
|
134
130
|
// -----------------------------------------------------------------------------
|
|
135
131
|
.#{$prefix}--subgrid {
|
|
136
132
|
display: grid;
|
|
137
|
-
margin-right: calc(var(--cds-grid-mode-end) * -1);
|
|
138
|
-
margin-left: calc(var(--cds-grid-mode-start) * -1);
|
|
139
133
|
grid-template-columns: repeat(var(--cds-grid-columns), minmax(0, 1fr));
|
|
134
|
+
margin-inline: calc(var(--cds-grid-mode-start) * -1) calc(var(--cds-grid-mode-end) * -1);
|
|
140
135
|
|
|
141
136
|
[dir='rtl'] & {
|
|
142
|
-
margin-
|
|
143
|
-
margin-left: calc(var(--cds-grid-mode-end) * -1);
|
|
137
|
+
margin-inline: calc(var(--cds-grid-mode-end) * -1) calc(var(--cds-grid-mode-start) * -1);
|
|
144
138
|
}
|
|
145
139
|
}
|
|
146
140
|
|
|
@@ -171,11 +165,10 @@
|
|
|
171
165
|
// Helper class to allow for text alignment in columns where the leading
|
|
172
166
|
// gutter is missing (like narrow) or is reduced (like in condensed).
|
|
173
167
|
.#{$prefix}--grid-column-hang {
|
|
174
|
-
margin-
|
|
168
|
+
margin-inline-start: var(--cds-grid-column-hang);
|
|
175
169
|
|
|
176
170
|
[dir='rtl'] & {
|
|
177
|
-
margin-
|
|
178
|
-
margin-left: initial;
|
|
171
|
+
margin-inline: initial var(--cds-grid-column-hang);
|
|
179
172
|
}
|
|
180
173
|
}
|
|
181
174
|
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
|
|
4
4
|
@import 'mixins';
|
|
5
5
|
|
|
6
|
+
/// Generate the CSS for a grid for the given breakpoints and gutters
|
|
7
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - The default breakpoints
|
|
8
|
+
/// @param {Number} $grid-gutter [$grid-gutter] - The default gutters
|
|
9
|
+
/// @param {Number} $condensed-gutter [$grid-gutter-condensed] - The condensed mode gutter
|
|
10
|
+
/// @access public
|
|
11
|
+
/// @group @cds/grid
|
|
6
12
|
@mixin flex-grid(
|
|
7
13
|
$breakpoints: $grid-breakpoints,
|
|
8
14
|
$grid-gutter: $grid-gutter,
|
|
@@ -14,7 +20,7 @@
|
|
|
14
20
|
|
|
15
21
|
@include cds-largest-breakpoint($breakpoints) {
|
|
16
22
|
.#{$prefix}-grid--wide {
|
|
17
|
-
max-
|
|
23
|
+
max-inline-size: 100%;
|
|
18
24
|
}
|
|
19
25
|
}
|
|
20
26
|
|
|
@@ -24,13 +30,11 @@
|
|
|
24
30
|
|
|
25
31
|
.#{$prefix}-row-padding [class*='#{$prefix}-col'],
|
|
26
32
|
.#{$prefix}-col-padding {
|
|
27
|
-
padding-
|
|
28
|
-
padding-bottom: $grid-gutter * 0.5;
|
|
33
|
+
padding-block: $grid-gutter * 0.5;
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
.#{$prefix}-grid-condensed [class*='#{$prefix}-col'] {
|
|
32
|
-
padding-
|
|
33
|
-
padding-bottom: $condensed-gutter * 0.5;
|
|
37
|
+
padding-block: $condensed-gutter * 0.5;
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
@include -make-grid-columns($breakpoints, $grid-gutter);
|
|
@@ -24,8 +24,7 @@
|
|
|
24
24
|
/// @access private
|
|
25
25
|
/// @group @cds/grid
|
|
26
26
|
@mixin -make-container($breakpoints: $grid-breakpoints) {
|
|
27
|
-
margin-
|
|
28
|
-
margin-left: auto;
|
|
27
|
+
margin-inline: auto;
|
|
29
28
|
|
|
30
29
|
@include -set-largest-breakpoint($breakpoints);
|
|
31
30
|
|
|
@@ -38,15 +37,13 @@
|
|
|
38
37
|
|
|
39
38
|
@if $prev-margin != $margin {
|
|
40
39
|
@include cds-breakpoint($name) {
|
|
41
|
-
padding-
|
|
42
|
-
padding-left: #{($grid-gutter * 0.5) + $margin};
|
|
43
|
-
}
|
|
44
|
-
} @else {
|
|
45
|
-
@include cds-breakpoint($name) {
|
|
46
|
-
padding-right: #{($grid-gutter * 0.5) + $margin};
|
|
47
|
-
padding-left: #{($grid-gutter * 0.5) + $margin};
|
|
40
|
+
padding-inline: #{($grid-gutter * 0.5) + $margin};
|
|
48
41
|
}
|
|
49
42
|
}
|
|
43
|
+
} @else {
|
|
44
|
+
@include cds-breakpoint($name) {
|
|
45
|
+
padding-inline: #{($grid-gutter * 0.5) + $margin};
|
|
46
|
+
}
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
49
|
}
|
|
@@ -57,7 +54,7 @@
|
|
|
57
54
|
/// @group @cds/grid
|
|
58
55
|
@mixin -set-largest-breakpoint($breakpoints: $grid-breakpoints) {
|
|
59
56
|
$largest-breakpoint: -last-map-item($breakpoints);
|
|
60
|
-
max-
|
|
57
|
+
max-inline-size: map.get($largest-breakpoint, 'width');
|
|
61
58
|
}
|
|
62
59
|
|
|
63
60
|
/// Add in the max-widths for each breakpoint to the container
|
|
@@ -67,7 +64,7 @@
|
|
|
67
64
|
@mixin -make-container-max-widths($breakpoints: $grid-breakpoints) {
|
|
68
65
|
@each $name, $value in $breakpoints {
|
|
69
66
|
@include cds-breakpoint($name) {
|
|
70
|
-
max-
|
|
67
|
+
max-inline-size: map.get($value, width);
|
|
71
68
|
}
|
|
72
69
|
}
|
|
73
70
|
}
|
|
@@ -88,22 +85,19 @@
|
|
|
88
85
|
// Prevent columns from becoming too narrow when at smaller grid tiers by
|
|
89
86
|
// always setting `width: 100%;`. This works because we use `flex` values
|
|
90
87
|
// later on to override this initial width.
|
|
91
|
-
|
|
92
|
-
padding-
|
|
93
|
-
padding-left: ($gutter * 0.5);
|
|
88
|
+
inline-size: 100%;
|
|
89
|
+
padding-inline: $gutter * 0.5;
|
|
94
90
|
|
|
95
91
|
// For our condensed use-case, our gutters collapse to 2px solid, 1px on each side.
|
|
96
92
|
.#{$prefix}-row-condensed &,
|
|
97
93
|
.#{$prefix}-grid-condensed & {
|
|
98
|
-
padding-
|
|
99
|
-
padding-left: ($condensed-gutter * 0.5);
|
|
94
|
+
padding-inline: $condensed-gutter * 0.5;
|
|
100
95
|
}
|
|
101
96
|
|
|
102
97
|
// For our narrow use-case, our container hangs 16px into the gutter
|
|
103
98
|
.#{$prefix}-row-narrow &,
|
|
104
99
|
.#{$prefix}-grid-narrow & {
|
|
105
|
-
padding-
|
|
106
|
-
padding-left: 0;
|
|
100
|
+
padding-inline: 0 $gutter * 0.5;
|
|
107
101
|
}
|
|
108
102
|
}
|
|
109
103
|
|
|
@@ -122,8 +116,8 @@
|
|
|
122
116
|
// Add a `max-width` to ensure content within each column does not blow out
|
|
123
117
|
// the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
|
|
124
118
|
// do not appear to require this.
|
|
125
|
-
max-width: math.percentage(math.div($span, $columns));
|
|
126
119
|
flex: 0 0 math.percentage(math.div($span, $columns));
|
|
120
|
+
max-inline-size: math.percentage(math.div($span, $columns));
|
|
127
121
|
}
|
|
128
122
|
}
|
|
129
123
|
|
|
@@ -137,9 +131,9 @@
|
|
|
137
131
|
$offset: math.div($span, $columns);
|
|
138
132
|
|
|
139
133
|
@if $offset == 0 {
|
|
140
|
-
margin-
|
|
134
|
+
margin-inline-start: 0;
|
|
141
135
|
} @else {
|
|
142
|
-
margin-
|
|
136
|
+
margin-inline-start: math.percentage($offset);
|
|
143
137
|
}
|
|
144
138
|
}
|
|
145
139
|
|
|
@@ -181,17 +175,19 @@
|
|
|
181
175
|
// Provide basic `.col-{bp}` classes for equal-width flexbox columns
|
|
182
176
|
.#{$prefix}-col,
|
|
183
177
|
.#{$prefix}-col#{$infix} {
|
|
184
|
-
max-width: 100%;
|
|
185
178
|
flex-basis: 0;
|
|
186
179
|
flex-grow: 1;
|
|
180
|
+
max-inline-size: 100%;
|
|
187
181
|
}
|
|
188
182
|
|
|
189
183
|
.#{$prefix}-col-auto,
|
|
190
184
|
.#{$prefix}-col#{$infix}-auto {
|
|
191
|
-
|
|
185
|
+
@include -make-col-ready($gutter);
|
|
186
|
+
|
|
192
187
|
// Reset earlier grid tiers
|
|
193
|
-
|
|
194
|
-
|
|
188
|
+
width: auto;
|
|
189
|
+
max-inline-size: 100%;
|
|
190
|
+
flex: 0 0 auto;
|
|
195
191
|
}
|
|
196
192
|
|
|
197
193
|
@for $i from 0 through $columns {
|
|
@@ -231,8 +227,7 @@
|
|
|
231
227
|
@mixin -make-row($gutter: $grid-gutter) {
|
|
232
228
|
display: flex;
|
|
233
229
|
flex-wrap: wrap;
|
|
234
|
-
margin-
|
|
235
|
-
margin-left: -1 * $gutter * 0.5;
|
|
230
|
+
margin-inline: -1 * $gutter * 0.5;
|
|
236
231
|
}
|
|
237
232
|
|
|
238
233
|
|
|
@@ -247,18 +242,17 @@
|
|
|
247
242
|
@mixin -no-gutter {
|
|
248
243
|
.#{$prefix}-no-gutter,
|
|
249
244
|
.#{$prefix}-row.#{$prefix}-no-gutter [class*='#{$prefix}-col'] {
|
|
250
|
-
padding-
|
|
251
|
-
padding-left: 0;
|
|
245
|
+
padding-inline: 0;
|
|
252
246
|
}
|
|
253
247
|
|
|
254
248
|
.#{$prefix}-no-gutter--start,
|
|
255
249
|
.#{$prefix}-row.#{$prefix}-no-gutter--start [class*='#{$prefix}-col'] {
|
|
256
|
-
padding-
|
|
250
|
+
padding-inline-start: 0;
|
|
257
251
|
}
|
|
258
252
|
|
|
259
253
|
.#{$prefix}-no-gutter--end,
|
|
260
254
|
.#{$prefix}-row.#{$prefix}-no-gutter--end [class*='#{$prefix}-col'] {
|
|
261
|
-
padding-
|
|
255
|
+
padding-inline-end: 0;
|
|
262
256
|
}
|
|
263
257
|
}
|
|
264
258
|
|
|
@@ -273,11 +267,11 @@
|
|
|
273
267
|
/// @group @carbon/grid
|
|
274
268
|
@mixin -hang($gutter: $grid-gutter) {
|
|
275
269
|
.#{$prefix}-hang--start {
|
|
276
|
-
padding-
|
|
270
|
+
padding-inline-start: $gutter * 0.5;
|
|
277
271
|
}
|
|
278
272
|
|
|
279
273
|
.#{$prefix}-hang--end {
|
|
280
|
-
padding-
|
|
274
|
+
padding-inline-end: $gutter * 0.5;
|
|
281
275
|
}
|
|
282
276
|
}
|
|
283
277
|
|