@inglorious/ui 7.2.1 → 7.2.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inglorious/ui",
3
- "version": "7.2.1",
3
+ "version": "7.2.3",
4
4
  "description": "A design system for Inglorious Web with render-function components and customizable themes",
5
5
  "author": "Matteo Antony Mistretta <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
6
6
  "license": "MIT",
@@ -305,10 +305,10 @@
305
305
  "**/*.css"
306
306
  ],
307
307
  "peerDependencies": {
308
- "@inglorious/charts": "10.0.3",
308
+ "@inglorious/charts": "10.0.4",
309
309
  "@inglorious/store": "11.0.2",
310
310
  "@inglorious/utils": "4.0.0",
311
- "@inglorious/web": "6.5.0"
311
+ "@inglorious/web": "6.5.1"
312
312
  },
313
313
  "devDependencies": {
314
314
  "@fontsource/material-symbols-outlined": "^5.3.5",
@@ -317,7 +317,7 @@
317
317
  "@inglorious/store": "11.0.2",
318
318
  "@inglorious/vite-plugin-jsx": "2.0.2",
319
319
  "@inglorious/vite-plugin-vue": "1.0.3",
320
- "@inglorious/web": "6.5.0",
320
+ "@inglorious/web": "6.5.1",
321
321
  "@storybook/addon-docs": "^10.6.0",
322
322
  "@storybook/web-components-vite": "^10.6.0",
323
323
  "happy-dom": "^20.14.0",
@@ -56,8 +56,8 @@ export default {
56
56
  },
57
57
  }
58
58
 
59
- export const SingleClosed = {}
60
- SingleClosed.args = {
59
+ export const Default = {}
60
+ Default.args = {
61
61
  id: "combobox",
62
62
  type: "Combobox",
63
63
  label: "Country",
@@ -79,14 +79,76 @@ SingleClosed.args = {
79
79
 
80
80
  export const SingleOpen = {}
81
81
  SingleOpen.args = {
82
- ...SingleClosed.args,
82
+ ...Default.args,
83
83
  isOpen: true,
84
84
  }
85
85
 
86
86
  export const MultiOpen = {}
87
87
  MultiOpen.args = {
88
- ...SingleClosed.args,
88
+ ...Default.args,
89
89
  isMulti: true,
90
90
  selectedValue: ["it", "fr"],
91
91
  isOpen: true,
92
92
  }
93
+
94
+ export const WithHint = {}
95
+ WithHint.args = {
96
+ ...Default.args,
97
+ hint: "Please select a country",
98
+ }
99
+
100
+ export const WithError = {}
101
+ WithError.args = {
102
+ ...Default.args,
103
+ error: "You cannot select this one!",
104
+ }
105
+
106
+ export const WithHintAndError = {}
107
+ WithHintAndError.args = {
108
+ ...WithHint.args,
109
+ error: "You cannot select this one!",
110
+ }
111
+
112
+ export const Required = {}
113
+ Required.args = {
114
+ ...Default.args,
115
+ isRequired: true,
116
+ }
117
+
118
+ export const Disabled = {}
119
+ Disabled.args = {
120
+ ...Default.args,
121
+ isDisabled: true,
122
+ }
123
+
124
+ export const DisabledOption = {}
125
+ DisabledOption.args = {
126
+ ...Default.args,
127
+ options: Default.args.options.map((option, index) =>
128
+ index % 2 ? { ...option, isDisabled: true } : option,
129
+ ),
130
+ }
131
+
132
+ export const Small = {}
133
+ Small.args = {
134
+ ...Default.args,
135
+ size: "sm",
136
+ }
137
+
138
+ export const Medium = {}
139
+ Medium.args = {
140
+ ...Default.args,
141
+ size: "md",
142
+ }
143
+
144
+ export const Large = {}
145
+ Large.args = {
146
+ ...Default.args,
147
+ size: "lg",
148
+ }
149
+
150
+ export const FullWidth = {}
151
+ FullWidth.args = {
152
+ ...Default.args,
153
+ isFullWidth: true,
154
+ }
@@ -1,11 +1,11 @@
1
1
  @import "../../data-display/chip/style.css";
2
2
 
3
3
  .iw-combobox {
4
- position: relative;
5
4
  display: inline-flex;
6
5
  flex-direction: column;
7
6
  gap: var(--iw-space-1);
8
7
  font-family: var(--iw-font-family-sans);
8
+ position: relative; /* required for dropdown positioning */
9
9
 
10
10
  &.iw-combobox-full-width {
11
11
  width: 100%;
@@ -13,20 +13,40 @@
13
13
 
14
14
  .iw-combobox-label {
15
15
  font-size: var(--iw-font-size-sm);
16
+ font-weight: var(--iw-font-weight-normal);
16
17
  color: var(--iw-color-text);
17
18
  line-height: var(--iw-line-height-normal);
18
19
  }
19
20
 
20
- .iw-combobox-control {
21
- height: 2.25rem;
21
+ .iw-combobox-required {
22
+ color: var(--iw-color-error);
23
+ margin-left: var(--iw-space-1);
24
+ }
25
+
26
+ .iw-combobox-hint,
27
+ .iw-combobox-error-message {
28
+ font-size: var(--iw-font-size-sm);
29
+ line-height: var(--iw-line-height-normal);
30
+ }
31
+
32
+ .iw-combobox-hint {
33
+ color: var(--iw-color-text-muted);
34
+ }
35
+
36
+ .iw-combobox-error-message {
37
+ color: var(--iw-color-error);
38
+ }
39
+
40
+ .iw-combobox-frame {
22
41
  display: flex;
23
42
  align-items: center;
43
+ /* The gap spaces the text from the arrow, as it does for Input's icons. */
24
44
  gap: var(--iw-space-2);
25
- padding: 0 var(--iw-space-10) 0 var(--iw-space-3);
45
+ padding: 0 var(--iw-space-3);
26
46
  border: 1px solid var(--iw-input-border);
27
47
  border-radius: var(--iw-input-radius);
28
- background: var(--iw-input-bg);
29
48
  color: var(--iw-input-text);
49
+ background-color: var(--iw-input-bg);
30
50
  cursor: pointer;
31
51
  user-select: none;
32
52
  transition:
@@ -34,11 +54,32 @@
34
54
  box-shadow var(--iw-transition-fast),
35
55
  background-color var(--iw-transition-fast);
36
56
 
37
- &:hover {
57
+ &.iw-combobox-sm {
58
+ height: 2rem;
59
+ font-size: var(--iw-font-size-sm);
60
+ }
61
+
62
+ &.iw-combobox-md {
63
+ height: 2.25rem;
64
+ font-size: var(--iw-font-size-base);
65
+ }
66
+
67
+ &.iw-combobox-lg {
68
+ height: 2.75rem;
69
+ font-size: var(--iw-font-size-lg);
70
+ }
71
+
72
+ &:hover:not(.iw-combobox-frame-disabled) {
38
73
  border-color: var(--iw-input-border-hover);
39
74
  background: var(--iw-input-bg-hover);
40
75
  }
41
76
 
77
+ &:focus-within:not(.iw-combobox-frame-disabled) {
78
+ background-color: var(--iw-input-bg-focus);
79
+ border-color: var(--iw-input-border-focus);
80
+ box-shadow: var(--iw-input-shadow-focus);
81
+ }
82
+
42
83
  /* The control is focusable so it can be opened from the keyboard. */
43
84
  &:focus-visible {
44
85
  outline: none;
@@ -46,7 +87,7 @@
46
87
  box-shadow: var(--iw-input-shadow-focus);
47
88
  }
48
89
 
49
- &.iw-combobox-control-open {
90
+ &.iw-combobox-frame-open {
50
91
  border-color: var(--iw-input-border-focus);
51
92
  box-shadow: var(--iw-input-shadow-focus);
52
93
  background: var(--iw-input-bg-focus);
@@ -54,14 +95,23 @@
54
95
  border-bottom-right-radius: 0;
55
96
  }
56
97
 
57
- &.iw-combobox-control-disabled {
98
+ &.iw-combobox-frame-disabled {
58
99
  opacity: 0.6;
59
100
  cursor: not-allowed;
60
101
  }
61
102
 
62
- .iw-combobox-value,
63
- .iw-combobox-placeholder,
64
- .iw-combobox-multi-value {
103
+ &.iw-combobox-frame-error {
104
+ border-color: var(--iw-color-error);
105
+
106
+ &:focus-visible {
107
+ border-color: var(--iw-color-error);
108
+ }
109
+ }
110
+
111
+ /* The text element, whatever it is showing. Same role as
112
+ .iw-input-control in Input, so the shared rules live here and the
113
+ variant classes only add what is specific to them. */
114
+ .iw-combobox-control {
65
115
  flex: 1;
66
116
  min-width: 0;
67
117
  }
@@ -114,19 +164,20 @@
114
164
  display: inline-flex;
115
165
  align-items: center;
116
166
  justify-content: center;
167
+ font-size: var(--iw-font-size-sm);
168
+ line-height: 1;
169
+ /* A flex child, like Input's icons and the Select arrow. Absolutely
170
+ positioning it anchored to .iw-combobox rather than the frame, so
171
+ the glyph drifted whenever a label sat above the control, and it
172
+ needed a reserved padding strip to stop text running under it. The
173
+ row's gap does both. */
174
+ flex: none;
117
175
  pointer-events: none;
118
- position: absolute;
119
- right: var(--iw-space-3);
120
176
  color: var(--iw-color-text-muted);
121
177
  transition: transform var(--iw-transition-fast);
122
-
123
- span {
124
- font-size: 0.65rem;
125
- line-height: 1;
126
- }
127
178
  }
128
179
 
129
- &.iw-combobox-control-open .iw-combobox-arrow {
180
+ &.iw-combobox-frame-open .iw-combobox-arrow {
130
181
  transform: rotate(180deg);
131
182
  }
132
183
  }
@@ -198,13 +249,13 @@
198
249
  }
199
250
  }
200
251
 
201
- &.iw-combobox-sm .iw-combobox-control {
252
+ &.iw-combobox-sm .iw-combobox-frame {
202
253
  height: 2rem;
203
- padding: 0 var(--iw-space-8) 0 var(--iw-space-2);
254
+ padding: 0 var(--iw-space-2);
204
255
  }
205
256
 
206
- &.iw-combobox-lg .iw-combobox-control {
257
+ &.iw-combobox-lg .iw-combobox-frame {
207
258
  height: 2.75rem;
208
- padding: 0 var(--iw-space-12) 0 var(--iw-space-4);
259
+ padding: 0 var(--iw-space-4);
209
260
  }
210
261
  }