@ostack.tech/ui 1.2.0-beta.1 → 1.3.0-beta.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 (118) hide show
  1. package/dist/ostack-ui.css +867 -240
  2. package/dist/ostack-ui.js +8740 -6419
  3. package/dist/ostack-ui.js.map +1 -1
  4. package/package.json +1 -1
  5. package/scss/_utils.scss +2 -1
  6. package/scss/components/ButtonGroup/_ButtonGroup.scss +7 -4
  7. package/scss/components/Calendar/_Calendar.scss +0 -1
  8. package/scss/components/Card/_Card.scss +16 -7
  9. package/scss/components/Code/_Code.scss +3 -3
  10. package/scss/components/Container/_Container.scss +3 -3
  11. package/scss/components/ControlCode/_ControlCode.scss +1 -1
  12. package/scss/components/DataTable/_DataTable.scss +8 -8
  13. package/scss/components/DescriptionList/_DescriptionList.scss +1 -1
  14. package/scss/components/Feedback/_Feedback.scss +12 -9
  15. package/scss/components/Field/_Field.scss +3 -3
  16. package/scss/components/FieldGroup/_FieldGroup.scss +2 -1
  17. package/scss/components/Form/_Form.scss +2 -2
  18. package/scss/components/Grid/_Grid.scss +11 -11
  19. package/scss/components/Heading/_Heading-variables.scss +4 -1
  20. package/scss/components/Heading/_Heading.scss +22 -10
  21. package/scss/components/HelperText/_HelperText.scss +9 -7
  22. package/scss/components/Icon/_Icon-variables.scss +1 -0
  23. package/scss/components/Icon/_Icon.scss +2 -6
  24. package/scss/components/Keyboard/_Keyboard-variables.scss +4 -2
  25. package/scss/components/Keyboard/_Keyboard.scss +8 -4
  26. package/scss/components/Label/_Label-variables.scss +4 -0
  27. package/scss/components/Label/_Label.scss +13 -4
  28. package/scss/components/Link/_Link-variables.scss +1 -1
  29. package/scss/components/Link/_Link.scss +12 -3
  30. package/scss/components/Mark/_Mark.scss +2 -1
  31. package/scss/components/Spinner/_Spinner-variables.scss +1 -1
  32. package/scss/components/Spinner/_Spinner.scss +0 -7
  33. package/scss/components/Stack/_Stack.scss +20 -10
  34. package/scss/components/Stepper/_Stepper-variables.scss +0 -4
  35. package/scss/components/Stepper/_Stepper.scss +1 -6
  36. package/scss/components/Tabs/_Tabs-variables.scss +0 -1
  37. package/scss/components/Tabs/_Tabs.scss +4 -3
  38. package/scss/components/Tag/_Tag-variables.scss +1 -0
  39. package/scss/components/Tag/_Tag.scss +4 -3
  40. package/scss/components/Text/_Text-variables.scss +4 -0
  41. package/scss/components/Text/_Text.scss +19 -0
  42. package/scss/index.scss +5 -0
  43. package/scss/scss/helpers/_margin-utils.scss +35 -0
  44. package/scss/scss/helpers/_padding-utils.scss +35 -0
  45. package/scss/scss/helpers/_print-utils.scss +1 -1
  46. package/scss/scss/helpers/_sizing-utils.scss +45 -0
  47. package/scss/scss/helpers/_text-utils.scss +43 -0
  48. package/scss/scss/placeholders/checkable-group/_checkable-group.scss +2 -2
  49. package/scss/scss/placeholders/control/_control.scss +1 -9
  50. package/scss/scss/placeholders/menu/_menu.scss +2 -1
  51. package/scss/scss/placeholders/popover/_popover.scss +2 -2
  52. package/scss/scss/utils/_responsive-values.scss +7 -8
  53. package/types/components/Actions/Action.d.ts +1 -1
  54. package/types/components/Actions/Actions.d.ts +1 -1
  55. package/types/components/Alert/Alert.d.ts +3 -2
  56. package/types/components/Box/Box.d.ts +37 -0
  57. package/types/components/Box/index.d.ts +1 -0
  58. package/types/components/Button/Button.d.ts +3 -2
  59. package/types/components/ButtonGroup/ButtonGroup.d.ts +3 -2
  60. package/types/components/Calendar/Calendar.d.ts +3 -2
  61. package/types/components/Card/Card.d.ts +3 -2
  62. package/types/components/Card/CardTitle.d.ts +3 -2
  63. package/types/components/Checkbox/Checkbox.d.ts +2 -1
  64. package/types/components/CheckboxGroup/CheckboxGroup.d.ts +3 -2
  65. package/types/components/Code/Code.d.ts +4 -2
  66. package/types/components/Container/Container.d.ts +3 -2
  67. package/types/components/Control/Control.d.ts +13 -13
  68. package/types/components/ControlCode/ControlCode.d.ts +3 -2
  69. package/types/components/DataTable/DataTablePagination.d.ts +3 -2
  70. package/types/components/DataTable/DataTableRowsPerPage.d.ts +3 -2
  71. package/types/components/DateRangeInput/DateRangeInput.d.ts +5 -6
  72. package/types/components/Feedback/Feedback.d.ts +6 -4
  73. package/types/components/Feedback/FeedbackList.d.ts +3 -2
  74. package/types/components/Field/Field.d.ts +5 -10
  75. package/types/components/FieldGroup/FieldGroup.d.ts +3 -2
  76. package/types/components/FieldGroup/FieldGroupTitle.d.ts +3 -2
  77. package/types/components/Form/Form.d.ts +3 -8
  78. package/types/components/Grid/Grid.d.ts +4 -4
  79. package/types/components/Grid/GridContext.d.ts +1 -1
  80. package/types/components/Heading/Heading.d.ts +12 -3
  81. package/types/components/HelperText/HelperText.d.ts +4 -2
  82. package/types/components/Icon/Icon.d.ts +9 -4
  83. package/types/components/IconButton/IconButton.d.ts +3 -2
  84. package/types/components/Keybinds/Keybinds.d.ts +3 -2
  85. package/types/components/Keyboard/Keyboard.d.ts +17 -4
  86. package/types/components/Label/Label.d.ts +11 -2
  87. package/types/components/Link/Link.d.ts +4 -2
  88. package/types/components/Mark/Mark.d.ts +7 -5
  89. package/types/components/MenuList/MenuList.d.ts +3 -2
  90. package/types/components/Popover/Popover.d.ts +1 -1
  91. package/types/components/Popover/PopoverContent.d.ts +4 -2
  92. package/types/components/Printer/PrinterContent.d.ts +3 -9
  93. package/types/components/RadioGroup/Radio.d.ts +2 -1
  94. package/types/components/RadioGroup/RadioGroup.d.ts +3 -2
  95. package/types/components/Root/Root.d.ts +3 -8
  96. package/types/components/Root/RootElement.d.ts +2 -2
  97. package/types/components/Separator/Separator.d.ts +2 -1
  98. package/types/components/Spinner/Spinner.d.ts +7 -4
  99. package/types/components/Stack/Stack.d.ts +5 -10
  100. package/types/components/Stack/StackContext.d.ts +1 -1
  101. package/types/components/Stepper/StepContent.d.ts +3 -8
  102. package/types/components/Stepper/StepList.d.ts +3 -2
  103. package/types/components/Stepper/Stepper.d.ts +9 -13
  104. package/types/components/Table/Table.d.ts +2 -1
  105. package/types/components/Tabs/TabContent.d.ts +3 -2
  106. package/types/components/Tabs/TabList.d.ts +2 -1
  107. package/types/components/Tabs/Tabs.d.ts +6 -4
  108. package/types/components/Tag/Tag.d.ts +4 -2
  109. package/types/components/Text/Text.d.ts +48 -0
  110. package/types/components/Text/index.d.ts +1 -0
  111. package/types/index.d.ts +7 -1
  112. package/types/utils/responsiveValues.d.ts +41 -0
  113. package/types/utils/useMarginProps.d.ts +46 -0
  114. package/types/utils/usePaddingProps.d.ts +46 -0
  115. package/types/utils/useSizingProps.d.ts +23 -0
  116. package/types/utils/useTextProps.d.ts +50 -0
  117. package/types/utils/changeCase.d.ts +0 -2
  118. package/types/utils/useResponsiveValues.d.ts +0 -41
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ostack.tech/ui",
3
- "version": "1.2.0-beta.1",
3
+ "version": "1.3.0-beta.0",
4
4
  "description": "ostack/UI component library.",
5
5
  "homepage": "https://ui.ostack.tech/",
6
6
  "author": {
package/scss/_utils.scss CHANGED
@@ -40,7 +40,6 @@
40
40
  @forward "components/DropdownMenu/DropdownMenu-variables";
41
41
  @forward "components/Field/Field-variables";
42
42
  @forward "components/FieldGroup/FieldGroup-variables";
43
- @forward "components/Heading/Heading-variables";
44
43
  @forward "components/HelperText/HelperText-variables";
45
44
  @forward "components/Feedback/Feedback-variables";
46
45
  @forward "components/Icon/Icon-variables";
@@ -60,4 +59,6 @@
60
59
  @forward "components/Table/Table-variables";
61
60
  @forward "components/Tabs/Tabs-variables";
62
61
  @forward "components/Tag/Tag-variables";
62
+ @forward "components/Text/Text-variables";
63
+ @forward "components/Heading/Heading-variables";
63
64
  @forward "components/Tooltip/Tooltip-variables";
@@ -30,11 +30,14 @@
30
30
  @each $variant in $button-variants {
31
31
  &--#{$variant} {
32
32
  &:not(:first-child) {
33
- margin-left: map.get($button-group-margin-x-by-variant, $variant);
33
+ $-margin-left: map.get($button-group-margin-x-by-variant, $variant);
34
+ @if $-margin-left != null {
35
+ margin-left: var(--#{$prefix}ml, $-margin-left);
36
+ }
34
37
 
35
- $separator-width: map.get($button-group-separator-width-by-variant, $variant);
36
- @if $separator-width != null and $separator-width != NULL {
37
- border-left: $separator-width solid
38
+ $-separator-width: map.get($button-group-separator-width-by-variant, $variant);
39
+ @if $-separator-width != null and $-separator-width != NULL {
40
+ border-left: $-separator-width solid
38
41
  map.get($button-group-separator-color-by-variant, $variant);
39
42
  }
40
43
  }
@@ -6,7 +6,6 @@
6
6
  @use "../../scss/utils/transition" as *;
7
7
 
8
8
  .#{$prefix}calendar {
9
- margin: 0;
10
9
  font-size: $calendar-font-size;
11
10
  line-height: $calendar-line-height;
12
11
  width: fit-content;
@@ -50,8 +50,8 @@
50
50
  align-items: $card-header-align-items;
51
51
 
52
52
  > #{$collapsible-trigger} {
53
- margin-top: calc(var(--#{$prefix}card-padding-y) * -1);
54
- margin-bottom: calc(var(--#{$prefix}card-padding-y) * -1);
53
+ margin-top: var(--#{$prefix}mt, calc(var(--#{$prefix}card-padding-y) * -1));
54
+ margin-bottom: var(--#{$prefix}mb, calc(var(--#{$prefix}card-padding-y) * -1));
55
55
  min-height: $card-collapsible-trigger-min-size;
56
56
  min-width: $card-collapsible-trigger-min-size;
57
57
  font-size: $card-collapsible-trigger-font-size;
@@ -60,8 +60,16 @@
60
60
  > #{$tabs-tab-list-root} {
61
61
  flex-grow: 1;
62
62
  z-index: var(--#{$prefix}z-index-docked);
63
- margin: calc(var(--#{$prefix}card-padding-y) * -1 + $card-tabs-tab-list-margin-y-offset)
64
- calc(var(--#{$prefix}card-padding-x) * -1);
63
+ margin: var(
64
+ --#{$prefix}mt,
65
+ calc(var(--#{$prefix}card-padding-y) * -1 + $card-tabs-tab-list-margin-y-offset)
66
+ )
67
+ var(--#{$prefix}mr, calc(var(--#{$prefix}card-padding-x) * -1))
68
+ var(
69
+ --#{$prefix}mb,
70
+ calc(var(--#{$prefix}card-padding-y) * -1 + $card-tabs-tab-list-margin-y-offset)
71
+ )
72
+ var(--#{$prefix}ml, calc(var(--#{$prefix}card-padding-x) * -1));
65
73
  padding-left: max(
66
74
  var(--#{$prefix}card-padding-x) - var(--#{$prefix}tabs-tab-padding-x),
67
75
  var(--#{$prefix}tabs-tab-margin-x, 0)
@@ -75,7 +83,8 @@
75
83
 
76
84
  &__title {
77
85
  flex: 1;
78
- margin: 0;
86
+ margin-top: var(--#{$prefix}mt, 0);
87
+ margin-bottom: var(--#{$prefix}mb, 0);
79
88
  font-size: $card-title-font-size;
80
89
  line-height: $card-title-line-height;
81
90
  font-weight: $card-title-font-weight;
@@ -83,7 +92,7 @@
83
92
  }
84
93
 
85
94
  :is(&__body, &__footer) > &__title {
86
- margin-bottom: calc(var(--#{$prefix}card-merged-section-padding-y) * 2);
95
+ margin-bottom: var(--#{$prefix}mb, calc(var(--#{$prefix}card-merged-section-padding-y) * 2));
87
96
  }
88
97
 
89
98
  &__footer {
@@ -92,7 +101,7 @@
92
101
  justify-content: $card-footer-justify-content;
93
102
 
94
103
  & > :is(#{$button}, #{$icon-button}):not(:first-child) {
95
- margin-left: $card-footer-button-margin-x;
104
+ margin-left: var(--#{$prefix}ml, $card-footer-button-margin-x);
96
105
  }
97
106
  }
98
107
 
@@ -6,9 +6,9 @@
6
6
  border-radius: $code-border-radius;
7
7
 
8
8
  font-family: $code-font-family;
9
- font-weight: $code-font-weight;
10
- font-size: $code-font-size;
11
- line-height: $code-line-height;
9
+ font-weight: var(--#{$prefix}font-weight, $code-font-weight);
10
+ font-size: var(--#{$prefix}font-size, $code-font-size);
11
+ line-height: var(--#{$prefix}line-height, $code-line-height);
12
12
  word-wrap: break-word;
13
13
  white-space: pre-wrap;
14
14
 
@@ -11,8 +11,8 @@ $container: ".#{$prefix}container";
11
11
  var(--#{$prefix}container-max-width, 100%),
12
12
  var(--#{$prefix}container-fluid-max-width, 100%)
13
13
  );
14
- margin-left: auto;
15
- margin-right: auto;
14
+ margin-left: var(--#{$prefix}ml, auto);
15
+ margin-right: var(--#{$prefix}mr, auto);
16
16
  padding-left: var(--#{$prefix}container-left-gutter);
17
17
  padding-right: var(--#{$prefix}container-right-gutter);
18
18
 
@@ -21,7 +21,7 @@ $container: ".#{$prefix}container";
21
21
  }
22
22
 
23
23
  @include responsive-values(
24
- --#{$prefix}container,
24
+ #{$prefix}container-,
25
25
  (
26
26
  left-gutter: $container-default-gutter,
27
27
  right-gutter: $container-default-gutter,
@@ -63,6 +63,6 @@
63
63
 
64
64
  // Add spacing to a label that exists after the control code
65
65
  & + #{$label-container} {
66
- margin-left: $control-code-label-margin-x;
66
+ margin-left: var(--#{$prefix}ml, $control-code-label-margin-x);
67
67
  }
68
68
  }
@@ -89,25 +89,25 @@
89
89
 
90
90
  // Add spacing to children
91
91
  & > *:not(&__content-container) {
92
- margin-bottom: $data-table-child-gap-y;
92
+ margin-bottom: var(--#{$prefix}mb, $data-table-child-gap-y);
93
93
  }
94
94
  & > &__content-container ~ * {
95
- margin-top: $data-table-child-gap-y;
96
- margin-bottom: 0;
95
+ margin-top: var(--#{$prefix}mt, $data-table-child-gap-y);
96
+ margin-bottom: var(--#{$prefix}mb, 0);
97
97
  }
98
98
  & > *:not(&__content-container):not(:first-child) {
99
- margin-left: $data-table-child-gap-x;
99
+ margin-left: var(--#{$prefix}ml, $data-table-child-gap-x);
100
100
  }
101
101
  & > &__content-container + * {
102
- margin-left: 0 !important;
102
+ margin-left: var(--#{$prefix}ml, 0) !important;
103
103
  }
104
104
 
105
105
  // Some elements prefer to be right-aligned
106
106
  & > [data-prefer-right-alignment] {
107
- margin-left: auto !important;
107
+ margin-left: var(--#{$prefix}ml, auto) !important;
108
108
  }
109
109
  & > [data-prefer-right-alignment] + [data-prefer-right-alignment] {
110
- margin-left: $data-table-child-gap-x !important;
110
+ margin-left: var(--#{$prefix}ml, $data-table-child-gap-x) !important;
111
111
  }
112
112
 
113
113
  // Label styles
@@ -118,7 +118,7 @@
118
118
  align-self: flex-start;
119
119
  }
120
120
  & > .#{$prefix}control-code + .#{$prefix}label__container {
121
- margin-left: $control-code-label-margin-x;
121
+ margin-left: var(--#{$prefix}ml, $control-code-label-margin-x);
122
122
  }
123
123
 
124
124
  @include media-breakpoint-down(sm) {
@@ -2,7 +2,7 @@
2
2
  @use "../../scss/base-variables" as *;
3
3
 
4
4
  .#{$prefix}description-list {
5
- margin-bottom: 0;
5
+ margin-bottom: var(--#{$prefix}mb, 0);
6
6
 
7
7
  font-size: $description-list-font-size;
8
8
  line-height: $description-list-line-height;
@@ -3,14 +3,16 @@
3
3
  @use "../../scss/utils/transition" as *;
4
4
 
5
5
  .#{$prefix}feedback {
6
- font-size: $feedback-font-size;
7
- line-height: $feedback-line-height;
8
- font-weight: $feedback-font-weight;
6
+ font-size: var(--#{$prefix}font-size, $feedback-font-size);
7
+ line-height: var(--#{$prefix}line-height, $feedback-line-height);
8
+ @if $feedback-font-weight != null {
9
+ font-weight: var(--#{$prefix}font-weight, $feedback-font-weight);
10
+ }
9
11
  color: $feedback-color;
10
12
 
11
13
  @if $feedback-text-align == right {
12
14
  :not(.#{$prefix}checkbox__root, .#{$prefix}checkbox-group, .#{$prefix}radio-group) ~ & {
13
- text-align: $feedback-text-align;
15
+ text-align: var(--#{$prefix}text-align, $feedback-text-align);
14
16
  }
15
17
  }
16
18
 
@@ -19,29 +21,30 @@
19
21
  // Top margin
20
22
  &:not(:first-child),
21
23
  &__list:not(:first-child) {
22
- margin-top: $feedback-margin-top !important;
24
+ margin-top: var(--#{$prefix}mt, $feedback-margin-top) !important;
23
25
  }
24
26
 
25
27
  // Spacing between feedbacks/helper texts
26
28
  :is(&, &__list:not(:empty), .#{$prefix}helper-text) + :is(&, &__list) {
27
- margin-top: $feedback-gap-y !important;
29
+ margin-top: var(--#{$prefix}mt, $feedback-gap-y) !important;
28
30
  }
29
31
 
30
32
  // Left margin due to control code
31
33
  [data-has-code] ~ & {
32
- margin-left: $feedback-has-code-margin-left;
34
+ margin-left: var(--#{$prefix}ml, $feedback-has-code-margin-left);
33
35
  }
34
36
 
35
37
  // Add padding instead of margin so that we can use `margin-left: auto;` when
36
38
  // right-aligning feedbacks
37
39
  [data-has-code] ~ &__list {
38
- padding-left: $feedback-has-code-margin-left;
40
+ padding-left: var(--#{$prefix}ml, $feedback-has-code-margin-left);
39
41
  }
40
42
 
41
43
  // List
42
44
  &__list {
43
45
  width: fit-content;
44
- margin: 0;
46
+ margin-top: var(--#{$prefix}mt, 0);
47
+ margin-bottom: var(--#{$prefix}mb, 0);
45
48
  padding: 0;
46
49
 
47
50
  &:empty {
@@ -2,12 +2,12 @@
2
2
  @use "../../scss/base-variables" as *;
3
3
 
4
4
  .#{$prefix}field {
5
- width: 100%;
5
+ width: var(--#{$prefix}w, 100%);
6
6
  break-inside: avoid;
7
7
 
8
- // Add spacing to labels and
8
+ // Add spacing to labels and codes
9
9
  & > :is(.#{$prefix}control-code, .#{$prefix}label__container) {
10
- margin-bottom: $field-spacing-y;
10
+ margin-bottom: var(--#{$prefix}mb, $field-spacing-y);
11
11
  }
12
12
 
13
13
  // Left margin due to control code
@@ -40,7 +40,8 @@
40
40
  }
41
41
 
42
42
  &__title {
43
- margin: 0;
43
+ margin-top: var(--#{$prefix}mt, 0);
44
+ margin-bottom: var(--#{$prefix}mb, 0);
44
45
 
45
46
  font-size: $field-group-title-font-size;
46
47
  line-height: $field-group-title-line-height;
@@ -1,6 +1,6 @@
1
1
  @use "../../scss/base-variables" as *;
2
2
 
3
3
  .#{$prefix}form {
4
- min-width: 0;
5
- width: 100%;
4
+ min-width: var(--#{$prefix}min-w, 0);
5
+ width: var(--#{$prefix}w, 100%);
6
6
  }
@@ -11,18 +11,18 @@
11
11
  $default-row-gap: spacing(5);
12
12
  $default-column-gap: spacing(5);
13
13
 
14
- min-width: 0;
14
+ min-width: var(--#{$prefix}min-w, 0);
15
15
 
16
16
  // Grid container
17
17
  &__container {
18
18
  display: flex;
19
19
  flex-wrap: wrap;
20
- margin-top: calc(var(--#{$prefix}grid-row-gap) * -1);
21
- margin-left: calc(var(--#{$prefix}grid-column-gap) / -2);
22
- margin-right: calc(var(--#{$prefix}grid-column-gap) / -2);
20
+ margin-top: calc(var(--#{$prefix}mt, 0px) + var(--#{$prefix}grid-row-gap) * -1);
21
+ margin-left: calc(var(--#{$prefix}ml, 0px) + var(--#{$prefix}grid-column-gap) / -2);
22
+ margin-right: calc(var(--#{$prefix}mr, 0px) + var(--#{$prefix}grid-column-gap) / -2);
23
23
 
24
24
  @include responsive-values(
25
- --#{$prefix}grid,
25
+ #{$prefix}grid-,
26
26
  (
27
27
  row-gap: $default-row-gap,
28
28
  column-gap: $default-column-gap,
@@ -32,10 +32,10 @@
32
32
 
33
33
  // Grid item
34
34
  &__item {
35
- max-width: 100%;
36
- padding-top: var(--#{$prefix}grid-container-row-gap);
37
- padding-left: calc(var(--#{$prefix}grid-container-column-gap) / 2);
38
- padding-right: calc(var(--#{$prefix}grid-container-column-gap) / 2);
35
+ max-width: var(--#{$prefix}max-w, 100%);
36
+ padding-top: calc(var(--#{$prefix}pt, 0px) + var(--#{$prefix}grid-container-row-gap));
37
+ padding-left: calc(var(--#{$prefix}pl, 0px) + var(--#{$prefix}grid-container-column-gap) / 2);
38
+ padding-right: calc(var(--#{$prefix}pr, 0px) + var(--#{$prefix}grid-container-column-gap) / 2);
39
39
 
40
40
  @include toggle(flex, grid-item-auto-size, 1 1 0, 0 0 auto);
41
41
  @include toggle(
@@ -52,7 +52,7 @@
52
52
  );
53
53
 
54
54
  @include responsive-values(
55
- --#{$prefix}grid,
55
+ #{$prefix}grid-,
56
56
  (
57
57
  container-columns: $default-columns,
58
58
  container-row-gap: $default-row-gap,
@@ -65,7 +65,7 @@
65
65
  );
66
66
 
67
67
  &#{$grid}__container {
68
- max-width: none;
68
+ max-width: var(--#{$prefix}max-w, none);
69
69
 
70
70
  // When we have nested containers, we need to increase the size of the
71
71
  // item to offset the extra margin
@@ -1,9 +1,12 @@
1
1
  @use "../../scss/base-variables" as *;
2
2
  @use "../../scss/utils/spacing" as *;
3
+ @use "../Text/Text-variables" as *;
3
4
 
4
- $heading-margin-top: null !default;
5
+ $heading-margin-top: 0 !default;
5
6
  $heading-margin-bottom: spacing(2) !default;
6
7
  $heading-font-weight: $font-weight-bold !default;
8
+ $heading-accent-color: $text-accent-color !default;
9
+ $heading-high-contrast-accent-color: $text-high-contrast-accent-color !default;
7
10
 
8
11
  // Level 1
9
12
  $heading-1-font-size: var(--#{$prefix}font-size-4xl) !default;
@@ -2,27 +2,39 @@
2
2
 
3
3
  @use "Heading-variables" as *;
4
4
  @use "../../scss/base-variables" as *;
5
+ @use "../../scss/utils/declare-var" as *;
5
6
 
6
7
  .#{$prefix}heading {
7
- $heading: &;
8
-
9
- margin-top: 0;
10
- margin-bottom: 0;
8
+ margin-top: var(--#{$prefix}mt, 0);
9
+ margin-bottom: var(--#{$prefix}mb, 0);
11
10
  &:not(:first-child) {
12
- margin-top: $heading-margin-top;
11
+ margin-top: var(--#{$prefix}mt, $heading-margin-top);
13
12
  }
14
13
  &:not(:last-child) {
15
- margin-bottom: $heading-margin-bottom;
14
+ margin-bottom: var(--#{$prefix}mb, $heading-margin-bottom);
15
+ }
16
+ font-weight: var(--#{$prefix}font-weight, $heading-font-weight);
17
+ color: var(--#{$prefix}heading-color);
18
+
19
+ // Accent
20
+ &[data-accent] {
21
+ @include declare-var(--#{$prefix}heading-color, $heading-accent-color);
22
+ }
23
+ &--high-contrast[data-accent] {
24
+ @include declare-var(--#{$prefix}heading-color, $heading-high-contrast-accent-color);
16
25
  }
17
- font-weight: $heading-font-weight;
18
26
 
19
27
  // Levels
20
28
  @each $level in $heading-levels {
21
29
  &--#{$level} {
22
- font-size: map.get($heading-font-size-by-level, $level);
23
- line-height: map.get($heading-line-height-by-level, $level);
30
+ font-size: var(--#{$prefix}font-size, map.get($heading-font-size-by-level, $level));
31
+ line-height: var(--#{$prefix}line-height, map.get($heading-line-height-by-level, $level));
24
32
  text-transform: map.get($heading-text-transform-by-level, $level);
25
- color: map.get($heading-color-by-level, $level);
33
+
34
+ $-level-color: map.get($heading-color-by-level, $level);
35
+ @if $-level-color != null {
36
+ color: var(--#{$prefix}heading-color, $-level-color);
37
+ }
26
38
  }
27
39
  }
28
40
  }
@@ -2,29 +2,31 @@
2
2
  @use "../../scss/base-variables" as *;
3
3
 
4
4
  .#{$prefix}helper-text {
5
- font-size: $helper-text-font-size;
6
- line-height: $helper-text-line-height;
7
- font-weight: $helper-text-font-weight;
5
+ font-size: var(--#{$prefix}font-size, $helper-text-font-size);
6
+ line-height: var(--#{$prefix}line-height, $helper-text-line-height);
7
+ @if $helper-text-font-weight != null {
8
+ font-weight: var(--#{$prefix}font-weight, $helper-text-font-weight);
9
+ }
8
10
  color: $helper-text-color;
9
11
 
10
12
  @if $helper-text-text-align == right {
11
13
  :not(.#{$prefix}checkbox__root):not(.#{$prefix}checkbox-group):not(.#{$prefix}radio-group) + & {
12
- text-align: $helper-text-text-align;
14
+ text-align: var(--#{$prefix}text-align, $helper-text-text-align);
13
15
  }
14
16
  }
15
17
 
16
18
  // Top margin
17
19
  &:not(:first-child) {
18
- margin-top: $helper-text-margin-top !important;
20
+ margin-top: var(--#{$prefix}mt, $helper-text-margin-top) !important;
19
21
  }
20
22
 
21
23
  // Spacing between feedbacks/helper texts
22
24
  :is(&, .#{$prefix}feedback__list:not(:empty), .#{$prefix}feedback) + & {
23
- margin-top: $helper-text-gap-y !important;
25
+ margin-top: var(--#{$prefix}mt, $helper-text-gap-y) !important;
24
26
  }
25
27
 
26
28
  // Left margin due to control code
27
29
  [data-has-code] ~ & {
28
- margin-left: $helper-text-has-code-margin-left;
30
+ margin-left: var(--#{$prefix}ml, $helper-text-has-code-margin-left);
29
31
  }
30
32
  }
@@ -1,3 +1,4 @@
1
1
  @use "../../scss/base-variables" as *;
2
2
 
3
3
  $icon-accent-color: var(--#{$prefix}accent-a11) !default;
4
+ $icon-high-contrast-accent-color: var(--#{$prefix}accent-a12) !default;
@@ -7,11 +7,7 @@
7
7
  &[data-accent] {
8
8
  color: $icon-accent-color;
9
9
  }
10
-
11
- // Sizes
12
- @each $size, $font-size in $font-size-by-size {
13
- &--#{$size} {
14
- font-size: $font-size;
15
- }
10
+ &--high-contrast[data-accent] {
11
+ color: $icon-high-contrast-accent-color;
16
12
  }
17
13
  }
@@ -11,8 +11,10 @@ $keyboard-font-size: 0.875em !default;
11
11
  $keyboard-line-height: 1.25 !default;
12
12
  $keyboard-word-wrap: break-word !default;
13
13
 
14
- $keyboard-border-width: 1px 1px 2px !default;
14
+ $keyboard-border-width: 1px 1px max(2px, 0.125em) !default;
15
15
  $keyboard-border-style: solid !default;
16
16
  $keyboard-border-color: css-transparentize(currentColor, 0.125) !default;
17
17
  $keyboard-background-color: css-transparentize(currentColor, 0.065) !default;
18
- $keyboard-color: null !default;
18
+
19
+ // Accent
20
+ $keyboard-accent-color: var(--#{$prefix}accent-a11) !default;
@@ -8,14 +8,18 @@
8
8
  border-radius: $keyboard-border-radius;
9
9
 
10
10
  font-family: $keyboard-font-family;
11
- font-weight: $keyboard-font-weight;
12
- font-size: $keyboard-font-size;
13
- line-height: $keyboard-line-height;
11
+ font-size: var(--#{$prefix}font-size, $keyboard-font-size);
12
+ line-height: var(--#{$prefix}line-height, $keyboard-line-height);
13
+ font-weight: var(--#{$prefix}font-weight, $keyboard-font-weight);
14
14
  word-wrap: $keyboard-word-wrap;
15
15
 
16
16
  border-width: $keyboard-border-width;
17
17
  border-style: $keyboard-border-style;
18
18
  border-color: $keyboard-border-color;
19
19
  background-color: $keyboard-background-color;
20
- color: $keyboard-color;
20
+
21
+ // Accent
22
+ &[data-accent] {
23
+ color: $keyboard-accent-color;
24
+ }
21
25
  }
@@ -6,6 +6,10 @@ $label-line-height: var(--#{$prefix}line-height-sm) !default;
6
6
  $label-font-weight: $font-weight-medium !default;
7
7
  $label-color: null !default;
8
8
 
9
+ // Accent
10
+ $label-accent-color: var(--#{$prefix}accent-a11) !default;
11
+ $label-high-contrast-accent-color: var(--#{$prefix}accent-a12) !default;
12
+
9
13
  // Required icon
10
14
  $label-required-icon-margin: spacing(1) !default;
11
15
  $label-required-icon-top: -0.75em !default;
@@ -4,20 +4,29 @@
4
4
  @use "../../scss/utils/transition" as *;
5
5
 
6
6
  .#{$prefix}label {
7
- display: inline-block;
7
+ flex: 1;
8
8
  margin-top: 0;
9
9
  margin-bottom: 0;
10
10
 
11
11
  cursor: default;
12
12
  color: $label-color;
13
13
 
14
- font-size: $label-font-size;
15
- font-weight: $label-font-weight;
16
- line-height: $label-line-height;
14
+ font-size: var(--#{$prefix}font-size, $label-font-size);
15
+ line-height: var(--#{$prefix}line-height, $label-line-height);
16
+ font-weight: var(--#{$prefix}font-weight, $label-font-weight);
17
17
 
18
18
  @include accessible-transition();
19
19
 
20
+ // Accent
21
+ &[data-accent] {
22
+ color: $label-accent-color;
23
+ }
24
+ &--high-contrast[data-accent] {
25
+ color: $label-high-contrast-accent-color;
26
+ }
27
+
20
28
  &__container {
29
+ min-width: 0;
21
30
  display: inline-flex;
22
31
  align-items: center;
23
32
  }
@@ -6,7 +6,7 @@ $link-color: var(--#{$prefix}accent-a11) !default;
6
6
  $link-text-decoration-line: none !default;
7
7
  $link-text-decoration-style: null !default;
8
8
  $link-text-decoration-color: var(--#{$prefix}accent-a6) !default;
9
- $link-text-decoration-thickness: min(2px, max(1px, 0.05em)) !default;
9
+ $link-text-decoration-thickness: max(1px, 0.05em) !default;
10
10
  $link-text-underline-offset: calc(0.025em + 2px) !default;
11
11
  $link-font-weight: null !default;
12
12
 
@@ -1,9 +1,9 @@
1
1
  @use "Link-variables" as *;
2
2
  @use "../../scss/base-variables" as *;
3
+ @use "../../scss/utils/button-reset" as *;
3
4
 
4
5
  .#{$prefix}link {
5
6
  &:is(:any-link, button) {
6
- all: unset;
7
7
  box-sizing: border-box;
8
8
  cursor: $link-cursor;
9
9
 
@@ -13,7 +13,7 @@
13
13
  text-decoration-color: $link-text-decoration-color;
14
14
  text-decoration-thickness: $link-text-decoration-thickness;
15
15
  text-underline-offset: $link-text-underline-offset;
16
- font-weight: $link-font-weight;
16
+ font-weight: var(--#{prefix}font-weight, $link-font-weight);
17
17
 
18
18
  &:hover {
19
19
  color: $link-hover-color;
@@ -28,12 +28,21 @@
28
28
  }
29
29
  }
30
30
 
31
+ &:is(button) {
32
+ @include button-reset();
33
+
34
+ padding: 0;
35
+ background-color: transparent;
36
+ border: none;
37
+ font: inherit;
38
+ }
39
+
31
40
  // Alert variant
32
41
  &--alert:is(:any-link, button) {
33
42
  color: $link-alert-color;
34
43
  text-decoration-line: $link-alert-text-decoration-line;
35
44
  text-decoration-color: $link-alert-text-decoration-color;
36
- font-weight: $link-alert-font-weight;
45
+ font-weight: var(--#{prefix}font-weight, $link-alert-font-weight);
37
46
 
38
47
  &:hover {
39
48
  color: $link-alert-hover-color;
@@ -3,7 +3,8 @@
3
3
 
4
4
  .#{$prefix}mark {
5
5
  padding: $mark-padding-y $mark-padding-x;
6
- margin: 0 calc($mark-padding-x * -1);
6
+ margin: var(--#{$prefix}mt, 0) calc(var(--#{$prefix}mr, 0px) + $mark-padding-x * -1)
7
+ var(--#{$prefix}mb, 0) calc(var(--#{$prefix}ml, 0px) + $mark-padding-x * -1);
7
8
  border-radius: $mark-border-radius;
8
9
 
9
10
  background-color: $mark-background-color;
@@ -1,5 +1,5 @@
1
1
  @use "../../scss/base-variables" as *;
2
2
 
3
- // Accent
3
+ // Colour
4
4
  $spinner-accent-track-color: var(--#{$prefix}accent-a5) !default;
5
5
  $spinner-accent-indicator-color: var(--#{$prefix}accent-a11) !default;
@@ -11,11 +11,4 @@
11
11
  @include declare-var(--#{$prefix}spinner-track-color, $spinner-accent-track-color);
12
12
  @include declare-var(--#{$prefix}spinner-indicator-color, $spinner-accent-indicator-color);
13
13
  }
14
-
15
- // Sizes
16
- @each $size, $font-size in $font-size-by-size {
17
- &--#{$size} {
18
- font-size: $font-size;
19
- }
20
- }
21
14
  }