tide-design-system 2.0.28 → 2.0.30
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/dist/css/dynamic-buttons.css +2 -2
- package/dist/style.css +1 -1
- package/dist/tide-design-system.cjs +2 -2
- package/dist/tide-design-system.esm.d.ts +198 -11
- package/dist/tide-design-system.esm.js +593 -542
- package/index.ts +77 -3
- package/package.json +1 -1
- package/src/assets/css/dynamic-buttons.css +2 -2
- package/src/components/TideInputSelect.vue +17 -0
- package/src/stories/TideInputSelect.stories.ts +50 -2
- package/src/types/Field.ts +3 -2
- package/src/types/Form.ts +2 -2
- package/src/types/Select.ts +1 -2
package/index.ts
CHANGED
|
@@ -32,27 +32,62 @@ import TideToggle from '@/components/TideToggle.vue';
|
|
|
32
32
|
import type { Alert } from '@/types/Alert';
|
|
33
33
|
import type { Badge, BadgePremium, BadgeTrustedYears } from '@/types/Badge';
|
|
34
34
|
import type { BreadCrumb } from '@/types/BreadCrumb';
|
|
35
|
-
import type { Breakpoint, CssUtility } from '@/types/Styles';
|
|
36
35
|
import type { Detail } from '@/types/Detail';
|
|
37
36
|
import type { Element, ElementTextAsIcon } from '@/types/Element';
|
|
37
|
+
import type { FacetComponentIdRange, RangeData } from '@/types/FacetRange';
|
|
38
|
+
import type {
|
|
39
|
+
BooleanField,
|
|
40
|
+
BooleanValue,
|
|
41
|
+
CheckboxField,
|
|
42
|
+
Field,
|
|
43
|
+
GenericField,
|
|
44
|
+
GenericInput,
|
|
45
|
+
SelectField,
|
|
46
|
+
StringField,
|
|
47
|
+
StringValue,
|
|
48
|
+
TextField,
|
|
49
|
+
TextareaField,
|
|
50
|
+
} from '@/types/Field';
|
|
51
|
+
import type {
|
|
52
|
+
BooleanInput,
|
|
53
|
+
CheckboxInput,
|
|
54
|
+
FormValueTransformer,
|
|
55
|
+
Input,
|
|
56
|
+
SelectInput,
|
|
57
|
+
StringInput,
|
|
58
|
+
TextInput,
|
|
59
|
+
TextareaInput,
|
|
60
|
+
} from '@/types/Form';
|
|
61
|
+
import type { Formatted } from '@/types/Formatted';
|
|
38
62
|
import type { Icon } from '@/types/Icon';
|
|
39
63
|
import type { Link } from '@/types/Link';
|
|
64
|
+
import type { ImageSlideType, ListingMedia, MediaSlideType, VideoSlideType, VrSlideType } from '@/types/ListingMedia';
|
|
65
|
+
import type { Orientation } from '@/types/Orientation';
|
|
40
66
|
import type { Priority } from '@/types/Priority';
|
|
67
|
+
import type { Raw } from '@/types/Raw';
|
|
41
68
|
import type { Realm } from '@/types/Realm';
|
|
69
|
+
import type { RealmConfig } from '@/types/RealmConfig';
|
|
70
|
+
import type { SelectOption, SelectOptionGroup } from '@/types/Select';
|
|
42
71
|
import type { Size } from '@/types/Size';
|
|
72
|
+
import type { Breakpoint, CssUtility } from '@/types/Styles';
|
|
43
73
|
import type { Tab } from '@/types/Tab';
|
|
44
74
|
import type { Target } from '@/types/Target';
|
|
45
|
-
import type {
|
|
75
|
+
import type { TextInputType } from '@/types/TextInput';
|
|
76
|
+
import type { ValidationError, ValidationResult, ValidationLength, Validator } from '@/types/Validation';
|
|
46
77
|
|
|
47
78
|
import { ALERT } from '@/types/Alert';
|
|
48
79
|
import { BADGE, BADGE_PREMIUM, BADGE_TRUSTED } from '@/types/Badge';
|
|
49
80
|
import { BREAKPOINT, CSS } from '@/types/Styles';
|
|
50
81
|
import { ELEMENT, ELEMENT_TEXT_AS_ICON } from '@/types/Element';
|
|
82
|
+
import { FORMAT, FORMAT_REGEX } from '@/types/Formatted';
|
|
51
83
|
import { ICON } from '@/types/Icon';
|
|
84
|
+
import { MEDIA_SLIDE_TYPES } from '@/types/ListingMedia';
|
|
85
|
+
import { ORIENTATION } from '@/types/Orientation';
|
|
52
86
|
import { PRIORITY } from '@/types/Priority';
|
|
53
87
|
import { REALM } from '@/types/Realm';
|
|
54
88
|
import { SIZE } from '@/types/Size';
|
|
55
89
|
import { TARGET } from '@/types/Target';
|
|
90
|
+
import { TEXT_INPUT_TYPE } from '@/types/TextInput';
|
|
56
91
|
import { VALIDATOR } from '@/types/Validation';
|
|
57
92
|
|
|
58
93
|
import '@/assets/css/main.css';
|
|
@@ -62,22 +97,56 @@ export type {
|
|
|
62
97
|
Badge,
|
|
63
98
|
BadgePremium,
|
|
64
99
|
BadgeTrustedYears,
|
|
100
|
+
BooleanField,
|
|
101
|
+
BooleanInput,
|
|
102
|
+
BooleanValue,
|
|
65
103
|
BreadCrumb,
|
|
66
104
|
Breakpoint,
|
|
105
|
+
CheckboxField,
|
|
106
|
+
CheckboxInput,
|
|
67
107
|
CssUtility,
|
|
68
108
|
Detail,
|
|
69
109
|
Element,
|
|
70
110
|
ElementTextAsIcon,
|
|
111
|
+
FacetComponentIdRange,
|
|
112
|
+
Field,
|
|
113
|
+
FormValueTransformer,
|
|
114
|
+
Formatted,
|
|
115
|
+
GenericField,
|
|
116
|
+
GenericInput,
|
|
71
117
|
Icon,
|
|
118
|
+
ImageSlideType,
|
|
119
|
+
Input,
|
|
72
120
|
Link,
|
|
121
|
+
ListingMedia,
|
|
122
|
+
MediaSlideType,
|
|
123
|
+
Orientation,
|
|
73
124
|
Priority,
|
|
125
|
+
RangeData,
|
|
126
|
+
Raw,
|
|
74
127
|
Realm,
|
|
128
|
+
RealmConfig,
|
|
129
|
+
SelectField,
|
|
130
|
+
SelectInput,
|
|
131
|
+
SelectOptionGroup,
|
|
132
|
+
SelectOption,
|
|
75
133
|
Size,
|
|
134
|
+
StringField,
|
|
135
|
+
StringInput,
|
|
136
|
+
StringValue,
|
|
76
137
|
Tab,
|
|
77
138
|
Target,
|
|
139
|
+
TextField,
|
|
140
|
+
TextInput,
|
|
141
|
+
TextInputType,
|
|
142
|
+
TextareaField,
|
|
143
|
+
TextareaInput,
|
|
78
144
|
ValidationError,
|
|
79
|
-
ValidationResult,
|
|
80
145
|
ValidationLength,
|
|
146
|
+
ValidationResult,
|
|
147
|
+
Validator,
|
|
148
|
+
VideoSlideType,
|
|
149
|
+
VrSlideType,
|
|
81
150
|
};
|
|
82
151
|
|
|
83
152
|
export {
|
|
@@ -89,11 +158,16 @@ export {
|
|
|
89
158
|
CSS,
|
|
90
159
|
ELEMENT,
|
|
91
160
|
ELEMENT_TEXT_AS_ICON,
|
|
161
|
+
FORMAT,
|
|
162
|
+
FORMAT_REGEX,
|
|
92
163
|
ICON,
|
|
164
|
+
MEDIA_SLIDE_TYPES,
|
|
165
|
+
ORIENTATION,
|
|
93
166
|
PRIORITY,
|
|
94
167
|
REALM,
|
|
95
168
|
SIZE,
|
|
96
169
|
TARGET,
|
|
170
|
+
TEXT_INPUT_TYPE,
|
|
97
171
|
TideAccordionItem,
|
|
98
172
|
TideAlert,
|
|
99
173
|
TideBackgroundImage,
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.tide-button-secondary {
|
|
21
|
-
background:
|
|
21
|
+
background: var(--tide-surface);
|
|
22
22
|
border: 2px solid var(--tide-primary);
|
|
23
23
|
color: var(--tide-primary);
|
|
24
24
|
}
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
a.tide-button-primary:hover,
|
|
45
45
|
button.tide-button-primary:enabled:hover {
|
|
46
46
|
border: 2px solid var(--tide-primary);
|
|
47
|
-
background:
|
|
47
|
+
background: var(--tide-white);
|
|
48
48
|
color: var(--tide-primary);
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -115,6 +115,23 @@
|
|
|
115
115
|
:id="uniqueId"
|
|
116
116
|
v-model="value"
|
|
117
117
|
>
|
|
118
|
+
<component
|
|
119
|
+
:class="[CSS.WIDTH.FULL, CSS.BG.SURFACE.DEFAULT]"
|
|
120
|
+
:key="optgroup.label"
|
|
121
|
+
:label="optgroup.label"
|
|
122
|
+
:is="optgroup.options ? 'optgroup' : 'option'"
|
|
123
|
+
v-for="optgroup in props.optgroups"
|
|
124
|
+
>
|
|
125
|
+
<option
|
|
126
|
+
:class="[CSS.WIDTH.FULL, CSS.BG.SURFACE.DEFAULT]"
|
|
127
|
+
:key="option.value"
|
|
128
|
+
:value="option.value"
|
|
129
|
+
v-for="option in optgroup.options"
|
|
130
|
+
>
|
|
131
|
+
{{ option.label }}
|
|
132
|
+
</option>
|
|
133
|
+
</component>
|
|
134
|
+
|
|
118
135
|
<option
|
|
119
136
|
:class="[CSS.WIDTH.FULL, CSS.BG.SURFACE.DEFAULT]"
|
|
120
137
|
:key="option.value"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { action } from '@storybook/addon-actions';
|
|
2
2
|
|
|
3
|
-
import type { SelectOption } from '@/types/Select';
|
|
3
|
+
import type { SelectOption, SelectOptionGroup } from '@/types/Select';
|
|
4
4
|
|
|
5
5
|
import TideInputSelect from '@/components/TideInputSelect.vue';
|
|
6
6
|
import {
|
|
@@ -19,6 +19,43 @@ const options = {
|
|
|
19
19
|
'Option 3': 3,
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
+
const selectOptionGroups: SelectOptionGroup[] = [
|
|
23
|
+
{
|
|
24
|
+
label: 'Group A',
|
|
25
|
+
options: [
|
|
26
|
+
{
|
|
27
|
+
label: 'Option 1',
|
|
28
|
+
value: 1,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: 'Option 2',
|
|
32
|
+
value: 2,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: 'Option 3',
|
|
36
|
+
value: 3,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: 'Group B',
|
|
42
|
+
options: [
|
|
43
|
+
{
|
|
44
|
+
label: 'Option 4',
|
|
45
|
+
value: 4,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: 'Option 5',
|
|
49
|
+
value: 5,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: 'Option 6',
|
|
53
|
+
value: 6,
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
|
|
22
59
|
const selectOptions: SelectOption[] = [
|
|
23
60
|
{
|
|
24
61
|
label: 'Option 1',
|
|
@@ -87,10 +124,20 @@ export default {
|
|
|
87
124
|
type: { summary: 'string' },
|
|
88
125
|
},
|
|
89
126
|
},
|
|
127
|
+
optgroups: {
|
|
128
|
+
...formatArgType({ selectOptionGroups }),
|
|
129
|
+
control: 'object',
|
|
130
|
+
description: 'Determines grouped values found inside Select',
|
|
131
|
+
isCustom: true,
|
|
132
|
+
table: {
|
|
133
|
+
defaultValue: { summary: '[]' },
|
|
134
|
+
type: { summary: 'SelectOptionGroup[]' },
|
|
135
|
+
},
|
|
136
|
+
},
|
|
90
137
|
options: {
|
|
91
138
|
...formatArgType({ selectOptions }),
|
|
92
139
|
control: 'object',
|
|
93
|
-
description: 'Determines values found inside Select',
|
|
140
|
+
description: 'Determines ungrouped values found inside Select',
|
|
94
141
|
isCustom: true,
|
|
95
142
|
table: {
|
|
96
143
|
defaultValue: { summary: '[]' },
|
|
@@ -130,6 +177,7 @@ export default {
|
|
|
130
177
|
inputId: '',
|
|
131
178
|
label: 'Input label',
|
|
132
179
|
name: '',
|
|
180
|
+
optgroups: selectOptionGroups,
|
|
133
181
|
options: selectOptions,
|
|
134
182
|
required: undefined,
|
|
135
183
|
supportingText: '',
|
package/src/types/Field.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FormValueTransformer } from '@/types/Form';
|
|
2
|
-
import type { SelectOption } from '@/types/Select';
|
|
2
|
+
import type { SelectOptionGroup, SelectOption } from '@/types/Select';
|
|
3
3
|
import type { TextInputType } from '@/types/TextInput';
|
|
4
4
|
import type { ValidationError, Validator } from '@/types/Validation';
|
|
5
5
|
|
|
@@ -25,7 +25,8 @@ interface GenericInput {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
interface SelectField extends GenericInput, StringValue {
|
|
28
|
-
|
|
28
|
+
optgroups?: SelectOptionGroup[];
|
|
29
|
+
options?: SelectOption[];
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
interface StringValue {
|
package/src/types/Form.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SelectOptionGroup, SelectOption } from '@/types/Select';
|
|
2
2
|
import type { TextInputType } from '@/types/TextInput';
|
|
3
3
|
import type { ValidationError, Validator } from '@/types/Validation';
|
|
4
4
|
|
|
@@ -24,7 +24,7 @@ export type SelectInput = GenericInput &
|
|
|
24
24
|
StringValue & {
|
|
25
25
|
options?: SelectOption[] | readonly SelectOption[];
|
|
26
26
|
placeholder?: string;
|
|
27
|
-
optgroups?:
|
|
27
|
+
optgroups?: SelectOptionGroup[];
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
export type TextInput = GenericInput &
|