@central-design-system/components 2.30.0 → 3.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/dist/cds.css +1 -111
  2. package/dist/cds.d.ts +31 -0
  3. package/dist/cds.es.js +2159 -0
  4. package/dist/cds.umd.js +1 -0
  5. package/dist/components/CdsBadge/CdsBadge.vue.d.ts +32 -0
  6. package/dist/components/CdsButton/CdsButton.vue.d.ts +140 -0
  7. package/dist/components/CdsDrawer/CdsDrawer.vue.d.ts +179 -0
  8. package/dist/components/CdsGrid/CdsCol.vue.d.ts +73 -0
  9. package/dist/components/CdsGrid/CdsGrid.vue.d.ts +55 -0
  10. package/dist/components/CdsGrid/CdsRow.vue.d.ts +37 -0
  11. package/dist/components/CdsGrid/composable/column.d.ts +84 -0
  12. package/dist/components/CdsGrid/composable/grid.d.ts +24 -0
  13. package/dist/components/CdsGrid/composable/index.d.ts +4 -0
  14. package/dist/components/CdsGrid/composable/subgrid.d.ts +20 -0
  15. package/dist/components/CdsGrid/composable/wide.d.ts +12 -0
  16. package/dist/components/CdsGrid/mode/CSSGrid.d.ts +5 -0
  17. package/dist/components/CdsGrid/mode/FlexGrid.d.ts +5 -0
  18. package/dist/components/CdsGrid/types.d.ts +27 -0
  19. package/dist/components/CdsIcon/CdsIcon.vue.d.ts +44 -0
  20. package/dist/components/CdsIcon/index.d.ts +1 -0
  21. package/dist/components/CdsLink/CdsLink.vue.d.ts +50 -0
  22. package/dist/components/CdsList/CdsList.vue.d.ts +170 -0
  23. package/dist/components/CdsList/CdsListGroup.vue.d.ts +125 -0
  24. package/dist/components/CdsList/CdsListItem.vue.d.ts +172 -0
  25. package/dist/components/CdsList/composable/depth.d.ts +3 -0
  26. package/dist/components/CdsList/composable/index.d.ts +2 -0
  27. package/dist/components/CdsList/composable/list.d.ts +19 -0
  28. package/dist/components/CdsList/index.d.ts +3 -0
  29. package/dist/components/CdsLoader/CdsLoader.vue.d.ts +62 -0
  30. package/dist/components/CdsLoader/index.d.ts +1 -0
  31. package/dist/components/CdsStatus/CdsStatus.vue.d.ts +46 -0
  32. package/dist/components/CdsTag/CdsTag.vue.d.ts +96 -0
  33. package/dist/components/index.d.ts +18 -0
  34. package/dist/composable/appearance.d.ts +24 -0
  35. package/dist/composable/color.d.ts +21 -0
  36. package/dist/composable/dark.d.ts +19 -0
  37. package/dist/composable/disabled.d.ts +19 -0
  38. package/dist/composable/focus.d.ts +12 -0
  39. package/dist/composable/icon.d.ts +32 -0
  40. package/dist/composable/index.d.ts +17 -0
  41. package/dist/composable/items.d.ts +78 -0
  42. package/dist/composable/link.d.ts +36 -0
  43. package/dist/composable/loading.d.ts +19 -0
  44. package/dist/composable/nested/nested.d.ts +85 -0
  45. package/dist/composable/nested/openStrategies.d.ts +25 -0
  46. package/dist/composable/nested/selectStrategies.d.ts +21 -0
  47. package/dist/composable/proxyModel.d.ts +8 -0
  48. package/dist/composable/render.d.ts +2 -0
  49. package/dist/composable/size.d.ts +24 -0
  50. package/dist/composable/status.d.ts +21 -0
  51. package/dist/composable/tag.d.ts +16 -0
  52. package/dist/composable/text.d.ts +17 -0
  53. package/dist/composable/toggleScope.d.ts +2 -0
  54. package/dist/directives/index.d.ts +2 -0
  55. package/dist/plugins/index.d.ts +2 -0
  56. package/dist/shims-vue.d.ts +24 -0
  57. package/dist/transitions/createTransition.d.ts +9 -0
  58. package/dist/transitions/expandTransition.d.ts +19 -0
  59. package/dist/transitions/index.d.ts +14 -0
  60. package/dist/types/CdsOptions.d.ts +3 -0
  61. package/dist/utils/changeCase/lowerCase.d.ts +8 -0
  62. package/dist/utils/changeCase/noCase.d.ts +10 -0
  63. package/dist/utils/changeCase/paramCase.d.ts +3 -0
  64. package/dist/utils/changeCase/pascalCase.d.ts +5 -0
  65. package/dist/utils/getCurrentInstance.d.ts +13 -0
  66. package/dist/utils/helpers.d.ts +49 -0
  67. package/dist/utils/index.d.ts +7 -0
  68. package/dist/utils/propsFactory.d.ts +52 -0
  69. package/nuxt.js +13 -0
  70. package/package.json +37 -80
  71. package/src/scss/index.scss +10 -0
  72. package/{dist/mixins/scss → src/scss/mixins}/layout/_convert.scss +4 -2
  73. package/{dist/mixins/scss → src/scss/mixins}/layout/_layout.scss +0 -0
  74. package/{dist/mixins/scss → src/scss/mixins}/layout/_mini-unit.scss +0 -0
  75. package/{dist/mixins/scss → src/scss/mixins}/layout/_spacing.scss +0 -0
  76. package/src/scss/mixins/layout/exports/_mini-unit.module.scss +5 -0
  77. package/src/scss/mixins/layout/exports/_spacing-all.module.scss +3 -0
  78. package/src/scss/mixins/layout/exports/_spacing-fluid.module.scss +8 -0
  79. package/src/scss/mixins/layout/exports/_spacing-layout.module.scss +11 -0
  80. package/src/scss/mixins/layout/exports/_spacing.module.scss +16 -0
  81. package/{dist/mixins/scss → src/scss/mixins}/layout/index.scss +0 -2
  82. package/{dist/mixins/scss → src/scss/mixins}/motion.scss +0 -0
  83. package/{dist/mixins/scss → src/scss/mixins}/typo.scss +0 -67
  84. package/src/scss/modules/_reset.scss +113 -0
  85. package/src/scss/modules/_transition.scss +26 -0
  86. package/src/scss/modules/_typography.scss +36 -0
  87. package/src/scss/modules/_variables.scss +9 -0
  88. package/src/scss/modules/grid/_aspect-ratio.scss +62 -0
  89. package/src/scss/modules/grid/_breakpoint.scss +195 -0
  90. package/src/scss/modules/grid/_config.scss +88 -0
  91. package/src/scss/modules/grid/_css-grid.scss +445 -0
  92. package/src/scss/modules/grid/_flex-grid.scss +39 -0
  93. package/src/scss/modules/grid/_mixins.scss +307 -0
  94. package/src/scss/modules/grid/exports/_config.module.scss +9 -0
  95. package/src/scss/modules/grid/index.scss +5 -0
  96. package/src/scss/themes/b2b/tokens-map.scss +139 -0
  97. package/src/scss/themes/b2b/tokens.json +2190 -0
  98. package/{dist/tokens → src/scss/themes}/b2b/variables.css +0 -0
  99. package/src/scss/themes/cds/tokens-map.scss +138 -0
  100. package/src/scss/themes/cds/tokens.json +2184 -0
  101. package/{dist/tokens → src/scss/themes}/cds/variables.css +0 -1
  102. package/src/scss/themes/index.ts +43 -0
  103. package/src/scss/utility/display.scss +13 -0
  104. package/src/scss/utility/flexbox.scss +37 -0
  105. package/src/scss/utility/generatedFiles/generatedStyles.json +1 -0
  106. package/src/scss/utility/generatedFiles/generatedStyles.scss +300 -0
  107. package/src/scss/utility/index.scss +7 -0
  108. package/src/scss/utility/layout.scss +11 -0
  109. package/src/scss/utility/lists.scss +76 -0
  110. package/src/scss/utility/spacing.scss +89 -0
  111. package/src/scss/utility/typography.scss +16 -0
  112. package/src/scss/utility/variables.scss +116 -0
  113. package/README.md +0 -87
  114. package/build/utils/postInstall.js +0 -20
  115. package/build/utils/print.js +0 -38
  116. package/dist/CdsAccordion/index.js +0 -8
  117. package/dist/CdsAccordion/styles.css +0 -11
  118. package/dist/CdsBadge/index.js +0 -8
  119. package/dist/CdsBadge/styles.css +0 -9
  120. package/dist/CdsBreadcrumbs/index.js +0 -8
  121. package/dist/CdsBreadcrumbs/styles.css +0 -11
  122. package/dist/CdsButton/index.js +0 -8
  123. package/dist/CdsButton/styles.css +0 -11
  124. package/dist/CdsCheckbox/index.js +0 -8
  125. package/dist/CdsCheckbox/styles.css +0 -15
  126. package/dist/CdsCombobox/index.js +0 -8
  127. package/dist/CdsCombobox/styles.css +0 -15
  128. package/dist/CdsContainer/index.js +0 -8
  129. package/dist/CdsContainer/styles.css +0 -11
  130. package/dist/CdsContentSwitcher/index.js +0 -8
  131. package/dist/CdsContentSwitcher/styles.css +0 -15
  132. package/dist/CdsDataTable/index.js +0 -8
  133. package/dist/CdsDataTable/styles.css +0 -21
  134. package/dist/CdsDatePicker/index.js +0 -24
  135. package/dist/CdsDatePicker/styles.css +0 -15
  136. package/dist/CdsDrawer/index.js +0 -8
  137. package/dist/CdsDrawer/styles.css +0 -17
  138. package/dist/CdsDropdown/index.js +0 -8
  139. package/dist/CdsDropdown/styles.css +0 -15
  140. package/dist/CdsEmptyState/index.js +0 -8
  141. package/dist/CdsEmptyState/styles.css +0 -9
  142. package/dist/CdsFooter/index.js +0 -8
  143. package/dist/CdsFooter/styles.css +0 -17
  144. package/dist/CdsForm/index.js +0 -8
  145. package/dist/CdsForm/styles.css +0 -15
  146. package/dist/CdsGrid/index.js +0 -8
  147. package/dist/CdsGrid/styles.css +0 -9
  148. package/dist/CdsHeader/index.js +0 -8
  149. package/dist/CdsHeader/styles.css +0 -11
  150. package/dist/CdsIcon/index.js +0 -8
  151. package/dist/CdsIcon/styles.css +0 -9
  152. package/dist/CdsImage/index.js +0 -8
  153. package/dist/CdsImage/styles.css +0 -9
  154. package/dist/CdsInput/index.js +0 -8
  155. package/dist/CdsInput/styles.css +0 -13
  156. package/dist/CdsLink/index.js +0 -8
  157. package/dist/CdsLink/styles.css +0 -9
  158. package/dist/CdsList/index.js +0 -8
  159. package/dist/CdsList/styles.css +0 -9
  160. package/dist/CdsLoading/index.js +0 -8
  161. package/dist/CdsLoading/styles.css +0 -9
  162. package/dist/CdsModal/index.js +0 -8
  163. package/dist/CdsModal/styles.css +0 -15
  164. package/dist/CdsMultiselect/index.js +0 -8
  165. package/dist/CdsMultiselect/styles.css +0 -17
  166. package/dist/CdsNotification/index.js +0 -8
  167. package/dist/CdsNotification/styles.css +0 -21
  168. package/dist/CdsOverflowMenu/index.js +0 -8
  169. package/dist/CdsOverflowMenu/styles.css +0 -21
  170. package/dist/CdsPagination/index.js +0 -8
  171. package/dist/CdsPagination/styles.css +0 -13
  172. package/dist/CdsRadioButton/index.js +0 -8
  173. package/dist/CdsRadioButton/styles.css +0 -15
  174. package/dist/CdsSearch/index.js +0 -8
  175. package/dist/CdsSearch/styles.css +0 -19
  176. package/dist/CdsSelect/index.js +0 -8
  177. package/dist/CdsSelect/styles.css +0 -15
  178. package/dist/CdsSidebar/index.js +0 -8
  179. package/dist/CdsSidebar/styles.css +0 -15
  180. package/dist/CdsSkeleton/index.js +0 -8
  181. package/dist/CdsSkeleton/styles.css +0 -9
  182. package/dist/CdsStages/index.js +0 -8
  183. package/dist/CdsStages/styles.css +0 -9
  184. package/dist/CdsStatus/index.js +0 -8
  185. package/dist/CdsStatus/styles.css +0 -15
  186. package/dist/CdsSteps/index.js +0 -8
  187. package/dist/CdsSteps/styles.css +0 -19
  188. package/dist/CdsTable/index.js +0 -16
  189. package/dist/CdsTable/styles.css +0 -21
  190. package/dist/CdsTabs/index.js +0 -8
  191. package/dist/CdsTabs/styles.css +0 -9
  192. package/dist/CdsTag/index.js +0 -8
  193. package/dist/CdsTag/styles.css +0 -11
  194. package/dist/CdsTextArea/index.js +0 -8
  195. package/dist/CdsTextArea/styles.css +0 -17
  196. package/dist/CdsTextInput/index.js +0 -8
  197. package/dist/CdsTextInput/styles.css +0 -15
  198. package/dist/CdsToggle/index.js +0 -8
  199. package/dist/CdsToggle/styles.css +0 -9
  200. package/dist/CdsTooltip/index.js +0 -8
  201. package/dist/CdsTooltip/styles.css +0 -13
  202. package/dist/CdsUploader/index.js +0 -14
  203. package/dist/CdsUploader/styles.css +0 -25
  204. package/dist/cds.js +0 -38
  205. package/dist/cds.min.css +0 -7
  206. package/dist/cds.min.js +0 -38
  207. package/dist/index.html +0 -60
  208. package/dist/mixins/scss/layout/_breakpoint.scss +0 -237
  209. package/dist/mixins/scss/layout/_key-height.scss +0 -90
  210. package/dist/mixins/scss/layout/_spacing-export.scss +0 -34
  211. package/dist/mixins/scss/layout/_utilities.scss +0 -33
  212. package/dist/types/CdsAccordion.ts +0 -4
  213. package/dist/types/CdsAccordionItem.ts +0 -10
  214. package/dist/types/CdsBreadcrumbs.ts +0 -11
  215. package/dist/types/CdsBreadcrumbsItem.ts +0 -12
  216. package/dist/types/CdsButton.ts +0 -30
  217. package/dist/types/CdsCheckbox.ts +0 -20
  218. package/dist/types/CdsCheckboxGroup.ts +0 -14
  219. package/dist/types/CdsCol.ts +0 -38
  220. package/dist/types/CdsCombobox.ts +0 -42
  221. package/dist/types/CdsContainer.ts +0 -32
  222. package/dist/types/CdsContentSwitcher.ts +0 -4
  223. package/dist/types/CdsContentSwitcherButton.ts +0 -21
  224. package/dist/types/CdsDataTable.ts +0 -48
  225. package/dist/types/CdsDatePicker.ts +0 -40
  226. package/dist/types/CdsDrawer.ts +0 -25
  227. package/dist/types/CdsDrawerGroup.ts +0 -8
  228. package/dist/types/CdsDrawerItem.ts +0 -12
  229. package/dist/types/CdsDrawerLabel.ts +0 -4
  230. package/dist/types/CdsDropdown.ts +0 -14
  231. package/dist/types/CdsEmptyState.ts +0 -10
  232. package/dist/types/CdsFooter.ts +0 -17
  233. package/dist/types/CdsFooterService.ts +0 -16
  234. package/dist/types/CdsForm.ts +0 -4
  235. package/dist/types/CdsFormGroup.ts +0 -8
  236. package/dist/types/CdsFormItem.ts +0 -4
  237. package/dist/types/CdsGrid.ts +0 -16
  238. package/dist/types/CdsHeader.ts +0 -27
  239. package/dist/types/CdsHeaderService.ts +0 -4
  240. package/dist/types/CdsIcon.ts +0 -6
  241. package/dist/types/CdsLink.ts +0 -22
  242. package/dist/types/CdsList.ts +0 -6
  243. package/dist/types/CdsLoading.ts +0 -14
  244. package/dist/types/CdsModal.ts +0 -17
  245. package/dist/types/CdsMultiselect.ts +0 -33
  246. package/dist/types/CdsNotification.ts +0 -22
  247. package/dist/types/CdsOverflowMenu.ts +0 -16
  248. package/dist/types/CdsPagination.ts +0 -12
  249. package/dist/types/CdsRadioButton.ts +0 -29
  250. package/dist/types/CdsRow.ts +0 -18
  251. package/dist/types/CdsSearch.ts +0 -24
  252. package/dist/types/CdsSelect.ts +0 -37
  253. package/dist/types/CdsSkeleton.ts +0 -14
  254. package/dist/types/CdsStages.ts +0 -10
  255. package/dist/types/CdsStatus.ts +0 -22
  256. package/dist/types/CdsSteps.ts +0 -22
  257. package/dist/types/CdsStepsItem.ts +0 -12
  258. package/dist/types/CdsTable.ts +0 -46
  259. package/dist/types/CdsTabs.ts +0 -19
  260. package/dist/types/CdsTabsItem.ts +0 -18
  261. package/dist/types/CdsTag.ts +0 -20
  262. package/dist/types/CdsTextArea.ts +0 -26
  263. package/dist/types/CdsTextInput.ts +0 -32
  264. package/dist/types/CdsToggle.ts +0 -18
  265. package/dist/types/CdsTooltip.ts +0 -18
  266. package/dist/types/CdsTooltipDefinition.ts +0 -16
  267. package/dist/types/CdsTooltipInteractive.ts +0 -11
  268. package/dist/types/CdsUploader.ts +0 -44
  269. package/dist/types/Sidebar.ts +0 -17
  270. package/dist/types/types.ts +0 -2
  271. package/dist/utils/convertRemToPx.js +0 -9
  272. package/dist/utils/deepFind.js +0 -14
  273. package/dist/utils/expiringStorage.js +0 -28
  274. package/dist/utils/helpers.js +0 -33
  275. package/dist/utils/index.js +0 -1
  276. package/dist/utils/isCorrectTag.js +0 -5
  277. package/dist/utils/isRightProps.js +0 -5
  278. package/dist/utils/memoize.js +0 -8
  279. package/dist/utils/suffixPropName.js +0 -12
  280. package/dist/utils/test/deepFind.test.js +0 -18
  281. package/dist/utils/test/isCorrectTag.test.js +0 -9
  282. package/dist/utils/test/isCorrectTagDataSet.js +0 -51
  283. package/dist/utils/validationProps.js +0 -7
@@ -0,0 +1,307 @@
1
+ @use 'sass:list';
2
+ @use 'sass:meta';
3
+ @use 'sass:math';
4
+ @use 'sass:map';
5
+
6
+ @use 'config' as *;
7
+ @use 'breakpoint' as *;
8
+
9
+ /// Contents of the mixins
10
+ // * Grid
11
+ // * Columns
12
+ // * Rows
13
+ // * No gutter
14
+ // * Hang
15
+ // * Functions
16
+
17
+ // -----------------------------------------------------------------------------
18
+ // Grid
19
+ // -----------------------------------------------------------------------------
20
+
21
+ /// Create the container for a grid. Will cause full-bleed for the grid unless
22
+ /// max-width properties are added with `make-container-max-width`
23
+ /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
24
+ /// @access private
25
+ /// @group @cds/grid
26
+ @mixin -make-container($breakpoints: $grid-breakpoints) {
27
+ margin-right: auto;
28
+ margin-left: auto;
29
+
30
+ @include -set-largest-breakpoint($breakpoints);
31
+
32
+ @each $name, $value in $breakpoints {
33
+ $prev-breakpoint: map.get($breakpoints, breakpoint-prev($name));
34
+ $margin: map.get($value, margin);
35
+
36
+ @if $prev-breakpoint {
37
+ $prev-margin: map.get($prev-breakpoint, margin);
38
+
39
+ @if $prev-margin != $margin {
40
+ @include cds-breakpoint($name) {
41
+ padding-right: #{($grid-gutter * 0.5) + $margin};
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};
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+
54
+ /// Get the last breakpoint width and set max-width to its value
55
+ /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
56
+ /// @access private
57
+ /// @group @cds/grid
58
+ @mixin -set-largest-breakpoint($breakpoints: $grid-breakpoints) {
59
+ $largest-breakpoint: -last-map-item($breakpoints);
60
+ max-width: map.get($largest-breakpoint, 'width');
61
+ }
62
+
63
+ /// Add in the max-widths for each breakpoint to the container
64
+ /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
65
+ /// @access private
66
+ /// @group @cds/grid
67
+ @mixin -make-container-max-widths($breakpoints: $grid-breakpoints) {
68
+ @each $name, $value in $breakpoints {
69
+ @include cds-breakpoint($name) {
70
+ max-width: map.get($value, width);
71
+ }
72
+ }
73
+ }
74
+
75
+
76
+ // -----------------------------------------------------------------------------
77
+ // Columns
78
+ // -----------------------------------------------------------------------------
79
+
80
+ /// Used to initialize the default properties for a column class, most notably
81
+ /// for setting width and default gutters when a column's breakpoint has not been
82
+ /// hit yet.
83
+ /// @param {Number} $gutter [$grid-gutter] - The gutter for the grid system
84
+ /// @param {Number} $collapsed-gutter [$grid-gutter-condensed] - The condensed mode gutter
85
+ /// @access private
86
+ /// @group @cds/grid
87
+ @mixin -make-col-ready($gutter: $grid-gutter, $condensed-gutter: $grid-gutter-condensed) {
88
+ // Prevent columns from becoming too narrow when at smaller grid tiers by
89
+ // always setting `width: 100%;`. This works because we use `flex` values
90
+ // later on to override this initial width.
91
+ width: 100%;
92
+ padding-right: ($gutter * 0.5);
93
+ padding-left: ($gutter * 0.5);
94
+
95
+ // For our condensed use-case, our gutters collapse to 2px solid, 1px on each side.
96
+ .#{$prefix}-row-condensed &,
97
+ .#{$prefix}-grid-condensed & {
98
+ padding-right: ($condensed-gutter * 0.5);
99
+ padding-left: ($condensed-gutter * 0.5);
100
+ }
101
+
102
+ // For our narrow use-case, our container hangs 16px into the gutter
103
+ .#{$prefix}-row-narrow &,
104
+ .#{$prefix}-grid-narrow & {
105
+ padding-right: ($gutter * 0.5);
106
+ padding-left: 0;
107
+ }
108
+ }
109
+
110
+ /// Define the width of the column for a given span and column count.
111
+ /// A width of 0 will hide the column entirely.
112
+ /// @param {Number} $span - The number of columns covered
113
+ /// @param {Number} $columns - The total number of columns available
114
+ /// @access private
115
+ /// @group @cds/grid
116
+ @mixin -make-col($span, $columns) {
117
+ @if $span == 0 {
118
+ display: none;
119
+ } @else {
120
+ // Explicitly include `display: block` to override
121
+ display: block;
122
+ // Add a `max-width` to ensure content within each column does not blow out
123
+ // the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
124
+ // do not appear to require this.
125
+ max-width: math.percentage(math.div($span, $columns));
126
+ flex: 0 0 math.percentage(math.div($span, $columns));
127
+ }
128
+ }
129
+
130
+ /// Create a column offset for a given span and column count.
131
+ /// @param {Number} $span - The number of columns the offset should cover
132
+ /// @param {Number} $columns - The total number of columns available
133
+ /// @access private
134
+ /// @group @cds/grid
135
+ @mixin -make-col-offset($span, $columns) {
136
+ $offset: 0;
137
+ $offset: math.div($span, $columns);
138
+
139
+ @if $offset == 0 {
140
+ margin-left: 0;
141
+ } @else {
142
+ margin-left: math.percentage($offset);
143
+ }
144
+ }
145
+
146
+ /// Create a column order for a given span and column count.
147
+ /// @param {Number} $span - The number of columns the order should cover
148
+ /// @access private
149
+ /// @group @cds/grid
150
+ @mixin -make-col-order($span) {
151
+ order: $span;
152
+ }
153
+
154
+ /// Output the CSS required for all the columns in a given grid system.
155
+ /// @param {Map} $breakpoints [$grid-breakpoints] - The breakpoints in the grid system
156
+ /// @param {Number} $gutter [$grid-gutter] - The gutter for the grid system
157
+ /// @access private
158
+ /// @group @cds/grid
159
+ @mixin -make-grid-columns($breakpoints: $grid-breakpoints, $gutter: $grid-gutter) {
160
+ .#{$prefix}-col {
161
+ @include -make-col-ready($gutter);
162
+ }
163
+
164
+ @each $breakpoint in map-keys($breakpoints) {
165
+ $infix: breakpoint-infix($breakpoint);
166
+ $columns: map.get(map.get($breakpoints, $breakpoint), columns);
167
+
168
+ // Allow columns to stretch full width below their breakpoints
169
+ @for $i from 0 through $columns {
170
+ .#{$prefix}-col#{$infix}-#{$i} {
171
+ @include -make-col-ready($gutter);
172
+ }
173
+ }
174
+
175
+ .#{$prefix}-col#{$infix},
176
+ .#{$prefix}-col#{$infix}-auto {
177
+ @include -make-col-ready($gutter);
178
+ }
179
+
180
+ @include cds-breakpoint($breakpoint, $breakpoints) {
181
+ // Provide basic `.col-{bp}` classes for equal-width flexbox columns
182
+ .#{$prefix}-col,
183
+ .#{$prefix}-col#{$infix} {
184
+ max-width: 100%;
185
+ flex-basis: 0;
186
+ flex-grow: 1;
187
+ }
188
+
189
+ .#{$prefix}-col-auto,
190
+ .#{$prefix}-col#{$infix}-auto {
191
+ width: auto;
192
+ // Reset earlier grid tiers
193
+ max-width: 100%;
194
+ flex: 1 0 0;
195
+ }
196
+
197
+ @for $i from 0 through $columns {
198
+ .#{$prefix}-col#{$infix}-#{$i} {
199
+ @include -make-col($i, $columns);
200
+ }
201
+ }
202
+
203
+ @for $i from 0 through ($columns - 1) {
204
+ @if not($infix == '') {
205
+ .#{$prefix}-offset#{$infix}-#{$i} {
206
+ @include -make-col-offset($i, $columns);
207
+ }
208
+ }
209
+ }
210
+
211
+ @for $i from 0 through ($columns - 1) {
212
+ @if not($infix == '') {
213
+ .#{$prefix}-order#{$infix}-#{$i} {
214
+ @include -make-col-order($i);
215
+ }
216
+ }
217
+ }
218
+ }
219
+ }
220
+ }
221
+
222
+
223
+ // -----------------------------------------------------------------------------
224
+ // Rows
225
+ // -----------------------------------------------------------------------------
226
+
227
+ /// Define the properties for a selector assigned to a row in the grid system.
228
+ /// @param {Number} $gutter [$grid-gutter] - The gutter in the grid system
229
+ /// @access private
230
+ /// @group @cds/grid
231
+ @mixin -make-row($gutter: $grid-gutter) {
232
+ display: flex;
233
+ flex-wrap: wrap;
234
+ margin-right: -1 * $gutter * 0.5;
235
+ margin-left: -1 * $gutter * 0.5;
236
+ }
237
+
238
+
239
+ // -----------------------------------------------------------------------------
240
+ // No gutter
241
+ // -----------------------------------------------------------------------------
242
+
243
+ /// Add `no-gutter` and `no-gutter-{start,end}` classes to the output CSS. These
244
+ /// classes are useful for dropping the gutter in fluid situations.
245
+ /// @access private
246
+ /// @group @cds/grid
247
+ @mixin -no-gutter {
248
+ .#{$prefix}-no-gutter,
249
+ .#{$prefix}-row.#{$prefix}-no-gutter [class*='#{$prefix}-col'] {
250
+ padding-right: 0;
251
+ padding-left: 0;
252
+ }
253
+
254
+ .#{$prefix}-no-gutter--start,
255
+ .#{$prefix}-row.#{$prefix}-no-gutter--start [class*='#{$prefix}-col'] {
256
+ padding-left: 0;
257
+ }
258
+
259
+ .#{$prefix}-no-gutter--end,
260
+ .#{$prefix}-row.#{$prefix}-no-gutter--end [class*='#{$prefix}-col'] {
261
+ padding-right: 0;
262
+ }
263
+ }
264
+
265
+
266
+ // -----------------------------------------------------------------------------
267
+ // Hang
268
+ // -----------------------------------------------------------------------------
269
+ /// Add `hang--start` and `hang--end` classes for a given gutter. These classes are
270
+ /// used alongside `no-gutter--start` and `no-gutter--end` to "hang" type.
271
+ /// @param {Number} $gutter [$grid-gutter] - The gutter in the grid system
272
+ /// @access private
273
+ /// @group @carbon/grid
274
+ @mixin -hang($gutter: $grid-gutter) {
275
+ .#{$prefix}-hang--start {
276
+ padding-left: $gutter * 0.5;
277
+ }
278
+
279
+ .#{$prefix}-hang--end {
280
+ padding-right: $gutter * 0.5;
281
+ }
282
+ }
283
+
284
+ // -----------------------------------------------------------------------------
285
+ // Functions
286
+ // -----------------------------------------------------------------------------
287
+
288
+ /// Pass in a map, and get the last one in the list back
289
+ /// @access public
290
+ /// @param {Map} $map - Map
291
+ /// @return {*} Desired value
292
+ /// @group @cds/layout
293
+ @function -last-map-item($map) {
294
+ $total-length: list.length($map);
295
+ @return map-get($map, -key-by-index($map, $total-length));
296
+ }
297
+
298
+ /// Provide a map and index, and get back the relevant key value
299
+ /// @access public
300
+ /// @param {Map} $map - Map
301
+ /// @param {Integer} $index - Key chain
302
+ /// @return {String} Desired value
303
+ /// @group @cds/layout
304
+ @function -key-by-index($map, $index) {
305
+ $keys: map.keys($map);
306
+ @return nth($keys, $index);
307
+ }
@@ -0,0 +1,9 @@
1
+ @import '../_config';
2
+
3
+ :export {
4
+ prefix: $prefix;
5
+ flex-grid-columns: $flex-grid-columns;
6
+ grid-gutter: $grid-gutter;
7
+ grid-gutter-condensed: $grid-gutter-condensed;
8
+ breakpoints: map-keys($grid-breakpoints);
9
+ }
@@ -0,0 +1,5 @@
1
+ @forward 'config';
2
+ @forward 'breakpoint';
3
+ @forward 'css-grid';
4
+ @forward 'flex-grid';
5
+ @forward 'aspect-ratio';
@@ -0,0 +1,139 @@
1
+
2
+ $tokens: (
3
+ 'cds-border-element-01': 1px solid,
4
+ 'cds-border-element-02': 2px solid,
5
+ 'cds-border-radius-s': 3px,
6
+ 'cds-border-radius-m': 6px,
7
+ 'cds-border-radius-l': 9px,
8
+ 'cds-color-background-page-primary': #ffffff,
9
+ 'cds-color-background-page-secondary': #f5f5f5,
10
+ 'cds-color-background-container-primary': #f5f5f5,
11
+ 'cds-color-background-container-secondary': #ffffff,
12
+ 'cds-color-background-field-primary': #ffffff,
13
+ 'cds-color-background-field-secondary': #f5f5f5,
14
+ 'cds-color-background-element-primary': #000000,
15
+ 'cds-color-background-inverse': #000000,
16
+ 'cds-color-border-element-primary': #bebebe,
17
+ 'cds-color-border-element-secondary': #ebebeb,
18
+ 'cds-color-disabled-01': #ebebeb,
19
+ 'cds-color-disabled-02': #bebebe,
20
+ 'cds-color-feedback-error-10': #ffefef,
21
+ 'cds-color-feedback-error-20': #ffe0e0,
22
+ 'cds-color-feedback-error-100': #ff6666,
23
+ 'cds-color-feedback-warning-10': #fff8e5,
24
+ 'cds-color-feedback-warning-20': #fff2cc,
25
+ 'cds-color-feedback-warning-100': #ffc000,
26
+ 'cds-color-feedback-success-10': #effaec,
27
+ 'cds-color-feedback-success-20': #e0f5da,
28
+ 'cds-color-feedback-success-100': #66cd46,
29
+ 'cds-color-feedback-info-10': #f2f2f2,
30
+ 'cds-color-feedback-info-20': #e7e7e7,
31
+ 'cds-color-feedback-info-100': #858585,
32
+ 'cds-color-feedback-progress-10': #e5f3f9,
33
+ 'cds-color-feedback-progress-20': #cce7f3,
34
+ 'cds-color-feedback-progress-100': #0087c4,
35
+ 'cds-color-icon-default': #000000,
36
+ 'cds-color-icon-inverse': #ffffff,
37
+ 'cds-color-interactive-01-default': #7acaff,
38
+ 'cds-color-interactive-01-hover': #48a6e4,
39
+ 'cds-color-interactive-01-focus': #7acaff,
40
+ 'cds-color-interactive-01-active': #2e8cca,
41
+ 'cds-color-interactive-01-above': #000000,
42
+ 'cds-color-interactive-02-default': #f5f5f5,
43
+ 'cds-color-interactive-02-hover': #e8f6ff,
44
+ 'cds-color-interactive-02-focus': #7acaff,
45
+ 'cds-color-interactive-02-active': #e5e5e5,
46
+ 'cds-color-interactive-02-above': #000000,
47
+ 'cds-color-link-default': #096aaa,
48
+ 'cds-color-link-visited': #280099,
49
+ 'cds-color-neutral-0': #ffffff,
50
+ 'cds-color-neutral-4': #f5f5f5,
51
+ 'cds-color-neutral-8': #ebebeb,
52
+ 'cds-color-neutral-10': #e5e5e5,
53
+ 'cds-color-neutral-15': #dadada,
54
+ 'cds-color-neutral-25': #bebebe,
55
+ 'cds-color-neutral-40': #999999,
56
+ 'cds-color-neutral-48': #858585,
57
+ 'cds-color-neutral-66': #555555,
58
+ 'cds-color-neutral-100': #000000,
59
+ 'cds-color-overlay-01': rgba(85, 85, 85, 0.65),
60
+ 'cds-color-overlay-02': rgba(245, 245, 245, 0.65),
61
+ 'cds-color-text-primary': #000000,
62
+ 'cds-color-text-secondary': #bebebe,
63
+ 'cds-color-text-label': #000000,
64
+ 'cds-color-text-description': #555555,
65
+ 'cds-color-text-placeholder': #bebebe,
66
+ 'cds-color-text-inverse': #ffffff,
67
+ 'cds-font-base': 16px,
68
+ // Font family
69
+ 'cds-font-family-sans': Arial,
70
+ // Font size
71
+ 'cds-font-family-size': 0.875rem,
72
+ // Font size
73
+ 'cds-font-body-size-xs': 0.75rem,
74
+ // Font size
75
+ 'cds-font-body-size-s': 0.875rem,
76
+ // Font size
77
+ 'cds-font-body-size-m': 1rem,
78
+ // Font size
79
+ 'cds-font-body-size-l': 1.5rem,
80
+ // Font size
81
+ 'cds-font-heading-1': 2rem,
82
+ // Font size
83
+ 'cds-font-heading-2': 1.75rem,
84
+ // Font size
85
+ 'cds-font-heading-3': 1.5rem,
86
+ // Font size
87
+ 'cds-font-heading-4': 1.125rem,
88
+ // Font size
89
+ 'cds-font-heading-5': 0.875rem,
90
+ // Font size
91
+ 'cds-font-heading-6': 0.75rem,
92
+ // Font size
93
+ 'cds-font-heading-eyebrow': 0.625rem,
94
+ // Font size
95
+ 'cds-font-display-1': 4.375rem,
96
+ // Font size
97
+ 'cds-font-display-2': 3.375rem,
98
+ // Font Weight
99
+ 'cds-font-weight-bold': 700,
100
+ // Font Weight
101
+ 'cds-font-weight-semi-bold': 600,
102
+ // Font Weight
103
+ 'cds-font-weight-normal': 400,
104
+ // Font Weight
105
+ 'cds-font-weight-light': 300,
106
+ // Line height
107
+ 'cds-font-height-body': 130%,
108
+ // Line height
109
+ 'cds-font-height-heading': 120%,
110
+ // Line height
111
+ 'cds-font-height-display': 120%,
112
+ // Line height
113
+ 'cds-font-height-helper': 130%,
114
+ // Font margin
115
+ 'cds-font-margin-heading-1': 0 0 1.5rem,
116
+ // Font margin
117
+ 'cds-font-margin-heading-2': 3rem 0 1rem,
118
+ // Font margin
119
+ 'cds-font-margin-heading-3': 2rem 0 1rem,
120
+ // Font margin
121
+ 'cds-font-margin-heading-4': 1.5rem 0 .75rem,
122
+ // Font margin
123
+ 'cds-font-margin-heading-5': 1rem 0 .5rem,
124
+ // Font margin
125
+ 'cds-font-margin-heading-6': 1rem 0 .5rem,
126
+ // Font margin
127
+ 'cds-font-margin-display-1': 0 0 1.5rem,
128
+ // Font margin
129
+ 'cds-font-margin-display-2': 0 0 1rem,
130
+ // Font margin
131
+ 'cds-font-margin-s': 0 0 1rem,
132
+ 'cds-box-shadow-header': 0px 1px 4px rgba(0, 0, 0, 0.2),
133
+ 'cds-box-shadow-footer': 0px -1px 4px rgba(0, 0, 0, 0.2),
134
+ 'cds-box-shadow-sidebar-left': 1px 0px 4px rgba(0, 0, 0, 0.2),
135
+ 'cds-box-shadow-sidebar-right': -1px 0px 4px rgba(0, 0, 0, 0.2),
136
+ 'cds-box-shadow-menu': 0px 2px 6px rgba(0, 0, 0, 0.2),
137
+ 'cds-box-shadow-modal': 0px 2px 6px rgba(0, 0, 0, 0.2),
138
+ 'cds-box-shadow-notification': 0px 2px 6px rgba(0, 0, 0, 0.2)
139
+ );