@muraldevkit/ui-toolkit 1.10.1 → 1.11.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.
@@ -0,0 +1,108 @@
1
+ ////
2
+ /// Select component styles
3
+ /// @group select
4
+ ////
5
+
6
+ @use '~@muraldevkit/ds-foundation/src/styles/_mixins' as *;
7
+ @use '../MrlSelect/variables.scss' as selectItem;
8
+ @use '../styles.scss' as *;
9
+ @use './variables.scss';
10
+
11
+ .mrl-select {
12
+ display: block;
13
+ position: relative;
14
+ }
15
+
16
+ .mrl-select-trigger {
17
+ @include mrl-text-inputs;
18
+
19
+ align-items: center;
20
+ box-sizing: border-box;
21
+ cursor: pointer;
22
+ display: flex;
23
+ justify-content: space-between;
24
+
25
+ // we can consistently overwrite this in the select component since
26
+ // there is always an icon
27
+ padding-right: var(--mrl-input-icon-offset);
28
+ position: relative;
29
+
30
+ // FYI, This overwrites the width set in mrl-text-inputs
31
+ width: auto;
32
+ }
33
+
34
+ /// -- Focus State --
35
+ .mrl-select:focus-within > .mrl-select-trigger {
36
+ border-color: var(--mrl-text-input-border-color-focus);
37
+ }
38
+
39
+ .mrl-select:focus-within > .mrl-select-trigger::after {
40
+ @include mrl-focus-pseudo-element($border-width: 'var(--mrl-text-input-border-width)');
41
+ }
42
+
43
+ .mrl-select:focus-visible {
44
+ outline: none;
45
+ }
46
+
47
+ /// -- Custom trigger content --
48
+ // We don't target classes here because the content in this span
49
+ // is a clone copy from the selected selectItem
50
+ .mrl-select-trigger span {
51
+ display: flex;
52
+ }
53
+
54
+ .mrl-select-trigger span mrl-svg {
55
+ @include mrl-selectItem-icon;
56
+ }
57
+
58
+ /// -- Select trigger indicator (icon) --
59
+ .mrl-select-trigger-indicator {
60
+ color: var(--mrl-trigger-indicator-color);
61
+ margin-left: var(--mrl-input-icon-offset);
62
+ }
63
+
64
+ .mrl-select-trigger-indicator.mrl-is--open {
65
+ transform: rotate(180deg);
66
+ }
67
+
68
+ .mrl-select:focus-within .mrl-select-trigger-indicator {
69
+ color: var(--mrl-trigger-indicator-color-focus);
70
+ }
71
+
72
+ .mrl-select-trigger:hover .mrl-select-trigger-indicator {
73
+ color: var(--mrl-trigger-indicator-color-hover);
74
+ }
75
+
76
+ /// -- Inline kind --
77
+ /// @todo this is just variables but it's currently being overwritten
78
+ /// by the mrl-text-inputs mixin earlier in this file.
79
+ .mrl-select-trigger--inline {
80
+ @include mrl-inline-input-vars;
81
+ }
82
+
83
+ /// -- Large size --
84
+ /// @todo this is just variables but it's currently being overwritten
85
+ /// by the mrl-text-inputs mixin earlier in this file.
86
+ .mrl-select-trigger--large {
87
+ --mrl-text-input-height: var(--mrl-spacing-09);
88
+ }
89
+
90
+ // -- Disabled state --
91
+ // The mixin for text inputs doesn't work in this use case because
92
+ // of the nested behavior of the HTML
93
+ // -- disabling for better code readability
94
+ /* stylelint-disable no-descending-specificity */
95
+ .mrl-select--disabled {
96
+ .mrl-select-trigger {
97
+ border-color: var(--mrl-text-input-border-color-disabled);
98
+ color: var(--mrl-text-input-color-disabled);
99
+ pointer-events: none;
100
+ }
101
+
102
+ // when set on the host, the style is not being inherited properly
103
+ .mrl-select-trigger-indicator {
104
+ color: var(--mrl-text-input-color-disabled);
105
+ cursor: default;
106
+ pointer-events: none;
107
+ }
108
+ }
@@ -0,0 +1,57 @@
1
+ ////
2
+ /// Select Item component styles
3
+ /// @group select-item
4
+ ////
5
+
6
+ @use '~@muraldevkit/ds-foundation/src/styles/_mixins' as *;
7
+ @use '../styles.scss' as *;
8
+ @use './variables.scss';
9
+
10
+ .mrl-select-item {
11
+ display: block;
12
+ }
13
+
14
+ .mrl-selectItem {
15
+ // The menu uses the token --mrl-select-item-text-affordance to calculate the
16
+ // max height. If you change this mixin, you must also change the token
17
+ // within the `../variables.scss` file.
18
+ @include mrl-text-static($size: 'small', $kind: 'title-secondary');
19
+
20
+ background: var(--mrl-select-item-background);
21
+ border-radius: var(--mrl-select-item-border-radius);
22
+ color: var(--mrl-select-item-color);
23
+ cursor: pointer;
24
+ display: flex;
25
+
26
+ // @todo - this does not align to any contextual tokens. We need
27
+ // to have a better audit of them to understand how things are being designed
28
+ // so developers have better luck finding something that works.
29
+ padding: var(--mrl-select-item-padding-vertical) var(--mrl-select-item-padding-horizontal);
30
+ position: relative;
31
+ }
32
+
33
+ .mrl-selectItem-selectedIcon {
34
+ position: absolute;
35
+ right: var(--mrl-select-item-icon-spacing);
36
+ width: var(--mrl-select-item-icon-size);
37
+ }
38
+
39
+ // State: Selected
40
+ $spacing: var(--mrl-select-item-icon-spacing);
41
+ $item: var(var(--mrl-select-item-icon-size));
42
+ $icon: var(var(-mrl-select-item-icon-spacing));
43
+
44
+ .mrl-is--selected {
45
+ padding-right: calc($spacing + $item + $icon);
46
+ }
47
+
48
+ .mrl-is--focused {
49
+ outline: 5px auto Highlight;
50
+ outline: 5px auto -webkit-focus-ring-color;
51
+ }
52
+
53
+ // State: Disabled
54
+ .mrl-selectItem[aria-disabled='true'],
55
+ .mrl-selectItem[aria-disabled='true']:hover {
56
+ cursor: default;
57
+ }
@@ -0,0 +1,44 @@
1
+ ////
2
+ /// Select Menu component styles
3
+ /// @group select-menu
4
+ ////
5
+
6
+ @use '~@muraldevkit/ds-foundation/src/styles/contextual-variables/z-index' as *;
7
+ @use '../variables.scss';
8
+
9
+ $affordance: var(--mrl-select-item-text-affordance);
10
+ $item-padding: var(--mrl-select-item-padding-vertical);
11
+ $space: var(--mrl-select-item-spacing-stack);
12
+
13
+ .mrl-selectMenu {
14
+ // sass-lint:disable-block border-zero
15
+ $mrl-selectItem-height: calc($affordance + ($item-padding * 2) + $space);
16
+
17
+ background: var(--mrl-color-background);
18
+ border-radius: var(--mrl-radii-03);
19
+ box-shadow: var(--mrl-shadow-01);
20
+
21
+ // Since the aria updates happen at the Select component level
22
+ // The show/hide feature of the menu resides in those files
23
+ display: none;
24
+ left: 0;
25
+ max-height: calc($mrl-selectItem-height * 6);
26
+ overflow-y: auto;
27
+ padding: var(--mrl-spacing-03);
28
+ position: absolute;
29
+ right: 0;
30
+ z-index: $mrl-zIndex-menus-contextual;
31
+ }
32
+
33
+ // Menu positions
34
+ .mrl-selectMenu--bottom {
35
+ top: calc(100% + var(--mrl-spacing-02));
36
+ }
37
+
38
+ .mrl-selectMenu-bottom--top {
39
+ bottom: calc(100% + var(--mrl-spacing-02));
40
+ }
41
+
42
+ .mrl-selectMenu--open {
43
+ display: block;
44
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muraldevkit/ui-toolkit",
3
- "version": "1.10.1",
3
+ "version": "1.11.0",
4
4
  "description": "Mural's UI Toolkit",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",