@wpmoo/ui 1.0.0-rc.3 → 1.0.0-rc.5

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 (82) hide show
  1. package/ASSET_LICENSE.md +3 -1
  2. package/README.md +55 -123
  3. package/certification.json +14 -2
  4. package/dist/assets/css/moo-ui.css +189 -122
  5. package/dist/assets/css/moo-ui.min.css +3 -3
  6. package/dist/assets/css/moo.css +72 -17
  7. package/dist/assets/css/moo.min.css +3 -3
  8. package/dist/js/chart.js +1 -1
  9. package/dist/js/chart.min.js +1 -1
  10. package/dist/js/combobox.js +71 -18
  11. package/dist/js/context-menu.js +1 -1
  12. package/dist/js/datatable.js +135 -25
  13. package/dist/js/datepicker.js +1 -1
  14. package/dist/js/datepicker.min.js +1 -1
  15. package/dist/js/moo-ui.js +19047 -0
  16. package/dist/js/moo-ui.min.js +27 -0
  17. package/dist/js/sidebar.js +1 -1
  18. package/dist/js/slider.js +1 -1
  19. package/package.json +18 -6
  20. package/scss/_components.scss +73 -0
  21. package/scss/_settings.scss +8 -0
  22. package/scss/components/_accordion.scss +65 -0
  23. package/scss/components/_alert.scss +94 -0
  24. package/scss/components/_avatar.scss +154 -0
  25. package/scss/components/_badge.scss +33 -0
  26. package/scss/components/_breadcrumb.scss +130 -0
  27. package/scss/components/_button.scss +228 -0
  28. package/scss/components/_button_group.scss +81 -0
  29. package/scss/components/_card.scss +142 -0
  30. package/scss/components/_checkbox.scss +115 -0
  31. package/scss/components/_close_button.scss +59 -0
  32. package/scss/components/_collapsible.scss +43 -0
  33. package/scss/components/_combobox.scss +258 -0
  34. package/scss/components/_context-menu.scss +28 -0
  35. package/scss/components/_datatable.scss +1082 -0
  36. package/scss/components/_datepicker.scss +236 -0
  37. package/scss/components/_dialog.scss +66 -0
  38. package/scss/components/_dropdown.scss +202 -0
  39. package/scss/components/_field.scss +125 -0
  40. package/scss/components/_input.scss +35 -0
  41. package/scss/components/_input_group.scss +201 -0
  42. package/scss/components/_kbd.scss +10 -0
  43. package/scss/components/_menubar.scss +16 -0
  44. package/scss/components/_navigation.scss +41 -0
  45. package/scss/components/_pagination.scss +70 -0
  46. package/scss/components/_popover.scss +47 -0
  47. package/scss/components/_progress.scss +7 -0
  48. package/scss/components/_radio_group.scss +9 -0
  49. package/scss/components/_select.scss +7 -0
  50. package/scss/components/_separator.scss +15 -0
  51. package/scss/components/_sheet.scss +32 -0
  52. package/scss/components/_sidebar.scss +7 -0
  53. package/scss/components/_skeleton.scss +17 -0
  54. package/scss/components/_slider.scss +214 -0
  55. package/scss/components/_spinner.scss +17 -0
  56. package/scss/components/_switch.scss +25 -0
  57. package/scss/components/_table.scss +7 -0
  58. package/scss/components/_tabs.scss +139 -0
  59. package/scss/components/_textarea.scss +7 -0
  60. package/scss/components/_toast.scss +119 -0
  61. package/scss/components/_toggle_group.scss +19 -0
  62. package/scss/components/_tooltip.scss +83 -0
  63. package/scss/components/sidebar/_collapsed.scss +187 -0
  64. package/scss/components/sidebar/_identity.scss +72 -0
  65. package/scss/components/sidebar/_inset.scss +59 -0
  66. package/scss/components/sidebar/_layout.scss +176 -0
  67. package/scss/components/sidebar/_menus.scss +236 -0
  68. package/scss/foundations/_core_global_primitives.scss +5 -0
  69. package/scss/foundations/_core_state_layer.scss +25 -0
  70. package/scss/foundations/_focus.scss +139 -0
  71. package/scss/foundations/_overlay_backdrop.scss +19 -0
  72. package/scss/moo-core.scss +47 -0
  73. package/scss/moo-ui.scss +50 -0
  74. package/scss/settings/_bootstrap_overrides.scss +11 -0
  75. package/scss/settings/_component_variables.scss +480 -0
  76. package/scss/settings/_forms.scss +65 -0
  77. package/scss/settings/_palette.scss +132 -0
  78. package/scss/themes/_scoped_core.scss +239 -0
  79. package/scss/themes/_standalone_root.scss +119 -0
  80. package/scss/utilities/_scroll_fade.scss +193 -0
  81. package/scss/utilities/_scroll_fade_primitives.scss +43 -0
  82. package/THIRD_PARTY_NOTICES.md +0 -53
@@ -0,0 +1,258 @@
1
+ // Bootstrap has no native Combobox component. The Basic pass composes a
2
+ // form-control with a dropdown-menu and keeps only the missing positioning
3
+ // and inline affordance in this component namespace.
4
+ .combobox {
5
+ --moo-combobox-width: #{$moo-combobox-width};
6
+ --moo-combobox-multiple-width: #{$moo-combobox-multiple-width};
7
+ --moo-combobox-menu-max-height: #{$moo-combobox-menu-max-height};
8
+ --moo-combobox-option-line-height: #{$moo-combobox-option-line-height};
9
+ --moo-combobox-description-font-size: #{$moo-combobox-description-font-size};
10
+
11
+ width: 100%;
12
+ max-width: var(--moo-combobox-width);
13
+ }
14
+
15
+ .combobox--multiple {
16
+ max-width: var(--moo-combobox-multiple-width);
17
+ }
18
+
19
+ .combobox-control {
20
+ position: relative;
21
+ width: 100%;
22
+ }
23
+
24
+ .combobox-control:has(.combobox-input:disabled) {
25
+ opacity: var(--moo-disabled-control-opacity);
26
+ }
27
+
28
+ .combobox-control:has(.combobox-input:disabled) .combobox-input:disabled {
29
+ opacity: 1;
30
+ }
31
+
32
+ .combobox-input {
33
+ padding-inline-end: calc(#{$input-padding-x} + #{$input-height});
34
+ }
35
+
36
+ .combobox-input.is-invalid {
37
+ padding-inline-end: calc(#{$input-padding-x} + #{$input-height});
38
+ background-image: none;
39
+ }
40
+
41
+ .combobox-indicator {
42
+ position: absolute;
43
+ inset-block: 0;
44
+ inset-inline-end: 0;
45
+ display: flex;
46
+ align-items: center;
47
+ justify-content: center;
48
+ width: $input-height;
49
+ color: var(--bs-secondary-color);
50
+ pointer-events: none;
51
+ }
52
+
53
+ .combobox-indicator > [data-icon] {
54
+ width: 1rem;
55
+ height: 1rem;
56
+ flex: 0 0 auto;
57
+ }
58
+
59
+ .combobox-clear {
60
+ position: absolute;
61
+ inset-block: 0;
62
+ inset-inline-end: 0;
63
+ display: flex;
64
+ width: $input-height;
65
+ align-items: center;
66
+ justify-content: center;
67
+ padding: 0;
68
+ border: 0;
69
+ background: transparent;
70
+ color: var(--bs-secondary-color);
71
+ cursor: pointer;
72
+ }
73
+
74
+ .combobox-clear:hover,
75
+ .combobox-clear:focus-visible {
76
+ color: var(--bs-body-color);
77
+ }
78
+
79
+ .combobox-clear > [data-icon] {
80
+ width: $small-font-size;
81
+ height: $small-font-size;
82
+ flex: 0 0 auto;
83
+ }
84
+
85
+ .combobox-chips {
86
+ display: flex;
87
+ min-height: $input-height;
88
+ align-items: center;
89
+ gap: $spacer * 0.25;
90
+ flex-wrap: wrap;
91
+ padding-block: $input-padding-y;
92
+ padding-inline: $input-padding-x;
93
+ cursor: text;
94
+ }
95
+
96
+ // .combobox-chips's focus-visible ring lives in foundations/_focus.scss,
97
+ // next to the other compound-control rings, instead of here -- see that
98
+ // file's comment for why.
99
+
100
+ .combobox-value {
101
+ display: flex;
102
+ min-width: 0;
103
+ align-items: center;
104
+ gap: $spacer * 0.25;
105
+ flex-wrap: wrap;
106
+ }
107
+
108
+ .combobox-chip {
109
+ display: inline-flex;
110
+ max-width: 100%;
111
+ align-items: center;
112
+ gap: $spacer * 0.25;
113
+ cursor: default;
114
+ }
115
+
116
+ .combobox-chip__label {
117
+ min-width: 0;
118
+ overflow: hidden;
119
+ text-overflow: ellipsis;
120
+ }
121
+
122
+ .combobox-chip__remove {
123
+ display: inline-flex;
124
+ align-items: center;
125
+ justify-content: center;
126
+ padding: 0;
127
+ border: 0;
128
+ border-radius: var(--bs-border-radius-pill);
129
+ background: transparent;
130
+ color: inherit;
131
+ cursor: pointer;
132
+ opacity: 0.65;
133
+ }
134
+
135
+ .combobox-chip__remove:hover,
136
+ .combobox-chip__remove:focus-visible {
137
+ opacity: 1;
138
+ }
139
+
140
+ .combobox-chip__remove > [data-icon] {
141
+ width: $font-size-base;
142
+ height: $font-size-base;
143
+ flex: 0 0 auto;
144
+ }
145
+
146
+ .combobox-chips-input {
147
+ min-width: $input-height * 2.5;
148
+ flex: 1 1 $input-height * 2.5;
149
+ padding: 0;
150
+ border: 0;
151
+ outline: 0;
152
+ background: transparent;
153
+ color: inherit;
154
+ }
155
+
156
+ .combobox-chips-input::placeholder {
157
+ color: var(--bs-tertiary-color);
158
+ }
159
+
160
+ .combobox-menu {
161
+ position: absolute;
162
+ inset-block-start: calc(100% + #{$dropdown-spacer});
163
+ inset-inline-start: 0;
164
+ z-index: $zindex-dropdown;
165
+ width: max-content;
166
+ min-width: 100%;
167
+ max-width: calc(100vw - #{$spacer});
168
+ max-height: var(--moo-combobox-menu-max-height);
169
+ overflow-y: auto;
170
+ overscroll-behavior: contain;
171
+ scrollbar-width: none;
172
+ }
173
+
174
+ .combobox-menu::-webkit-scrollbar {
175
+ display: none;
176
+ }
177
+
178
+ .combobox-option {
179
+ display: grid;
180
+ grid-template-columns: minmax(0, 1fr) $spacer;
181
+ align-items: center;
182
+ gap: $spacer * 0.5;
183
+ padding-inline-end: $dropdown-item-padding-x;
184
+ line-height: var(--moo-combobox-option-line-height);
185
+ }
186
+
187
+ .combobox-option__content {
188
+ display: flex;
189
+ min-width: 0;
190
+ flex: 1 1 auto;
191
+ flex-direction: column;
192
+ }
193
+
194
+ .combobox:not(.combobox--multiple) .combobox-option[aria-selected="true"],
195
+ .combobox-option[aria-current="true"] {
196
+ background-color: var(--bs-dropdown-link-hover-bg);
197
+ }
198
+
199
+ .combobox:not(.combobox--multiple)
200
+ .combobox-menu:has(.combobox-option:not([aria-selected="true"]):hover)
201
+ .combobox-option[aria-selected="true"]:not(:hover):not([aria-current="true"]),
202
+ .combobox:not(.combobox--multiple)
203
+ .combobox-menu:has(.combobox-option[aria-current="true"]:not([aria-selected="true"]))
204
+ .combobox-option[aria-selected="true"]:not([aria-current="true"]) {
205
+ background-color: transparent;
206
+ }
207
+
208
+ .combobox-option[aria-selected="true"] {
209
+ font-weight: $font-weight-medium;
210
+ }
211
+
212
+ .combobox-option__label {
213
+ min-width: 0;
214
+ overflow: hidden;
215
+ text-overflow: ellipsis;
216
+ }
217
+
218
+ .combobox--custom-items .combobox-option__label {
219
+ font-weight: $font-weight-medium;
220
+ }
221
+
222
+ .combobox-option__description {
223
+ min-width: 0;
224
+ overflow: hidden;
225
+ color: var(--bs-secondary-color);
226
+ font-size: var(--moo-combobox-description-font-size);
227
+ line-height: $line-height-base;
228
+ text-overflow: ellipsis;
229
+ }
230
+
231
+ .combobox-option__check {
232
+ display: inline-flex;
233
+ justify-self: end;
234
+ visibility: hidden;
235
+ }
236
+
237
+ .combobox-option[aria-selected="true"] .combobox-option__check {
238
+ visibility: visible;
239
+ }
240
+
241
+ .combobox-option__check > [data-icon] {
242
+ width: 1rem;
243
+ height: 1rem;
244
+ flex: 0 0 auto;
245
+ }
246
+
247
+ .combobox-group-label {
248
+ padding: ($spacer * 0.375) ($spacer * 0.5);
249
+ font-size: var(--moo-combobox-description-font-size);
250
+ font-weight: $font-weight-normal;
251
+ line-height: $spacer;
252
+ }
253
+
254
+ .combobox-empty {
255
+ padding: $dropdown-item-padding-y $dropdown-item-padding-x;
256
+ color: var(--bs-secondary-color);
257
+ text-align: center;
258
+ }
@@ -0,0 +1,28 @@
1
+ // Bootstrap has no native context-menu or "explicit fallback trigger"
2
+ // concept, so there is no Bootstrap token to consume here: the fallback
3
+ // button is a Moo-owned corner affordance layered over arbitrary surface
4
+ // content, verified in the browser to otherwise fall into normal block flow
5
+ // below the surface instead of reading as a menu trigger for it.
6
+ .context-menu {
7
+ position: relative;
8
+ }
9
+
10
+ .context-menu-trigger:not([data-context-menu-fallback]) {
11
+ cursor: default;
12
+ }
13
+
14
+ .context-menu-trigger[data-context-menu-fallback] {
15
+ position: absolute;
16
+ inset-block-start: 0.5rem;
17
+ inset-inline-end: 0.5rem;
18
+ }
19
+
20
+ // A pointer-driven open focuses the menu container itself, not an item, so
21
+ // :hover carries the highlight instead of a focus ring competing with it
22
+ // (verified in the browser: focusing the first item unconditionally left a
23
+ // stray ring on it while a different item was hovered). The shared
24
+ // [tabindex]:focus-visible ring in foundations/_focus.scss otherwise applies
25
+ // here too, since a tabindex="-1" container still matches that selector.
26
+ ul.context-menu-menu:focus-visible {
27
+ outline: 0;
28
+ }