@pingux/astro 1.37.2 → 1.38.0-alpha.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.
- package/CHANGELOG.md +0 -12
- package/lib/cjs/components/Chip/Chip.js +11 -2
- package/lib/cjs/components/Chip/Chip.stories.js +51 -2
- package/lib/cjs/components/Chip/Chip.test.js +17 -0
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +23 -17
- package/lib/cjs/components/MultivaluesField/MultivaluesField.stories.js +236 -65
- package/lib/cjs/styles/variants/boxes.js +17 -1
- package/lib/cjs/styles/variants/buttons.js +26 -3
- package/lib/components/Chip/Chip.js +11 -2
- package/lib/components/Chip/Chip.stories.js +47 -0
- package/lib/components/Chip/Chip.test.js +15 -0
- package/lib/components/MultivaluesField/MultivaluesField.js +22 -17
- package/lib/components/MultivaluesField/MultivaluesField.stories.js +224 -56
- package/lib/styles/variants/boxes.js +17 -1
- package/lib/styles/variants/buttons.js +26 -3
- package/package.json +1 -1
- package/NOTICE.html +0 -4665
@@ -6,8 +6,8 @@ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/inst
|
|
6
6
|
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
7
7
|
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
8
8
|
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
9
|
-
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
10
9
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
10
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
11
11
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
12
12
|
|
13
13
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
@@ -15,7 +15,7 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
|
|
15
15
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
16
16
|
|
17
17
|
import React, { useState } from 'react';
|
18
|
-
import { Box, Item, MultivaluesField, OverlayProvider } from '../../';
|
18
|
+
import { Box, Item, MultivaluesField, OverlayProvider, Icon } from '../../';
|
19
19
|
import { ariaAttributeBaseArgTypes } from '../../utils/devUtils/props/ariaAttributes';
|
20
20
|
import statuses from '../../utils/devUtils/constants/statuses';
|
21
21
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
@@ -90,6 +90,96 @@ export default {
|
|
90
90
|
}
|
91
91
|
}
|
92
92
|
};
|
93
|
+
|
94
|
+
var VariableIcon = function VariableIcon(props) {
|
95
|
+
return ___EmotionJSX("svg", _extends({
|
96
|
+
width: "16",
|
97
|
+
height: "16",
|
98
|
+
viewBox: "0 0 16 16",
|
99
|
+
fill: "none",
|
100
|
+
xmlns: "http://www.w3.org/2000/svg"
|
101
|
+
}, props), ___EmotionJSX("g", {
|
102
|
+
clipPath: "url(#clip0_709_18965)"
|
103
|
+
}, ___EmotionJSX("circle", {
|
104
|
+
cx: "8",
|
105
|
+
cy: "8",
|
106
|
+
r: "7.5",
|
107
|
+
fill: "white",
|
108
|
+
stroke: "#7AC7F2"
|
109
|
+
}), ___EmotionJSX("path", {
|
110
|
+
d: "M11.5042 4.25C12.0833 5.37917 12.3125 6.68333 12.1667 8C12.0833 9.31667 11.625 10.6208 10.8458 11.75L10.2083 11.3333C10.8792 10.3208 11.2708 9.16667 11.3333 8C11.475 6.83333 11.2875 5.67917 10.7917 4.66667L11.5042 4.25ZM5.15416 4.25L5.79166 4.66667C5.12083 5.67917 4.72916 6.83333 4.66666 8C4.525 9.16667 4.71666 10.3208 5.20833 11.3333L4.50416 11.75C3.92083 10.6208 3.6875 9.32083 3.83333 8C3.91666 6.68333 4.375 5.37917 5.15416 4.25ZM8.03333 7.45L9 6.10417H10.0542L8.47916 8.1875L9.39583 10.2375H8.45416L7.87916 8.83333L6.86666 10.2208H5.81666L7.44166 8.0875L6.55416 6.10417H7.5L8.03333 7.45Z",
|
111
|
+
fill: "#7AC7F2"
|
112
|
+
})), ___EmotionJSX("defs", null, ___EmotionJSX("clipPath", {
|
113
|
+
id: "clip0_709_18965"
|
114
|
+
}, ___EmotionJSX("rect", {
|
115
|
+
width: "16",
|
116
|
+
height: "16",
|
117
|
+
fill: "white"
|
118
|
+
}))));
|
119
|
+
};
|
120
|
+
|
121
|
+
var HTMLIcon = function HTMLIcon(props) {
|
122
|
+
return ___EmotionJSX("svg", _extends({
|
123
|
+
width: "16",
|
124
|
+
height: "16",
|
125
|
+
viewBox: "0 0 16 16",
|
126
|
+
fill: "none",
|
127
|
+
xmlns: "http://www.w3.org/2000/svg"
|
128
|
+
}, props), ___EmotionJSX("g", {
|
129
|
+
clipPath: "url(#clip0_709_18936)"
|
130
|
+
}, ___EmotionJSX("circle", {
|
131
|
+
cx: "8",
|
132
|
+
cy: "8",
|
133
|
+
r: "7.5",
|
134
|
+
fill: "white",
|
135
|
+
stroke: "#2E5EA6"
|
136
|
+
}), ___EmotionJSX("g", {
|
137
|
+
clipPath: "url(#clip1_709_18936)"
|
138
|
+
}, ___EmotionJSX("path", {
|
139
|
+
d: "M9.81667 8.83325C9.85 8.55825 9.875 8.28325 9.875 7.99992C9.875 7.71659 9.85 7.44159 9.81667 7.16659H11.225C11.2917 7.43325 11.3333 7.71242 11.3333 7.99992C11.3333 8.28742 11.2917 8.56659 11.225 8.83325H9.81667ZM9.07917 11.1499C9.32917 10.6874 9.52084 10.1874 9.65417 9.66659H10.8833C10.4833 10.3541 9.84584 10.8874 9.07917 11.1499ZM8.975 8.83325H7.025C6.98334 8.55825 6.95834 8.28325 6.95834 7.99992C6.95834 7.71659 6.98334 7.43742 7.025 7.16659H8.975C9.0125 7.43742 9.04167 7.71659 9.04167 7.99992C9.04167 8.28325 9.0125 8.55825 8.975 8.83325ZM8 11.3166C7.65417 10.8166 7.375 10.2624 7.20417 9.66659H8.79584C8.625 10.2624 8.34584 10.8166 8 11.3166ZM6.33334 6.33325H5.11667C5.5125 5.64159 6.15417 5.10825 6.91667 4.84992C6.66667 5.31242 6.47917 5.81242 6.33334 6.33325ZM5.11667 9.66659H6.33334C6.47917 10.1874 6.66667 10.6874 6.91667 11.1499C6.15417 10.8874 5.5125 10.3541 5.11667 9.66659ZM4.775 8.83325C4.70834 8.56659 4.66667 8.28742 4.66667 7.99992C4.66667 7.71242 4.70834 7.43325 4.775 7.16659H6.18334C6.15 7.44159 6.125 7.71659 6.125 7.99992C6.125 8.28325 6.15 8.55825 6.18334 8.83325H4.775ZM8 4.67909C8.34584 5.17909 8.625 5.73742 8.79584 6.33325H7.20417C7.375 5.73742 7.65417 5.17909 8 4.67909ZM10.8833 6.33325H9.65417C9.52084 5.81242 9.32917 5.31242 9.07917 4.84992C9.84584 5.11242 10.4833 5.64159 10.8833 6.33325ZM8 3.83325C5.69584 3.83325 3.83334 5.70825 3.83334 7.99992C3.83334 9.10499 4.27232 10.1648 5.05372 10.9462C5.44064 11.3331 5.89996 11.64 6.40549 11.8494C6.91101 12.0588 7.45283 12.1666 8 12.1666C9.10507 12.1666 10.1649 11.7276 10.9463 10.9462C11.7277 10.1648 12.1667 9.10499 12.1667 7.99992C12.1667 7.45274 12.0589 6.91093 11.8495 6.4054C11.6401 5.89988 11.3332 5.44055 10.9463 5.05364C10.5594 4.66673 10.1 4.35982 9.59452 4.15042C9.08899 3.94103 8.54718 3.83325 8 3.83325Z",
|
140
|
+
fill: "#4660A2"
|
141
|
+
}))), ___EmotionJSX("g", {
|
142
|
+
clipPath: "url(#clip2_709_18936)"
|
143
|
+
}, ___EmotionJSX("circle", {
|
144
|
+
cx: "8",
|
145
|
+
cy: "8",
|
146
|
+
r: "7.5",
|
147
|
+
fill: "white",
|
148
|
+
stroke: "#2E5EA6"
|
149
|
+
}), ___EmotionJSX("g", {
|
150
|
+
clipPath: "url(#clip3_709_18936)"
|
151
|
+
}, ___EmotionJSX("path", {
|
152
|
+
d: "M9.81667 8.83325C9.85 8.55825 9.875 8.28325 9.875 7.99992C9.875 7.71659 9.85 7.44159 9.81667 7.16659H11.225C11.2917 7.43325 11.3333 7.71242 11.3333 7.99992C11.3333 8.28742 11.2917 8.56659 11.225 8.83325H9.81667ZM9.07917 11.1499C9.32917 10.6874 9.52084 10.1874 9.65417 9.66659H10.8833C10.4833 10.3541 9.84584 10.8874 9.07917 11.1499ZM8.975 8.83325H7.025C6.98334 8.55825 6.95834 8.28325 6.95834 7.99992C6.95834 7.71659 6.98334 7.43742 7.025 7.16659H8.975C9.0125 7.43742 9.04167 7.71659 9.04167 7.99992C9.04167 8.28325 9.0125 8.55825 8.975 8.83325ZM8 11.3166C7.65417 10.8166 7.375 10.2624 7.20417 9.66659H8.79584C8.625 10.2624 8.34584 10.8166 8 11.3166ZM6.33334 6.33325H5.11667C5.5125 5.64159 6.15417 5.10825 6.91667 4.84992C6.66667 5.31242 6.47917 5.81242 6.33334 6.33325ZM5.11667 9.66659H6.33334C6.47917 10.1874 6.66667 10.6874 6.91667 11.1499C6.15417 10.8874 5.5125 10.3541 5.11667 9.66659ZM4.775 8.83325C4.70834 8.56659 4.66667 8.28742 4.66667 7.99992C4.66667 7.71242 4.70834 7.43325 4.775 7.16659H6.18334C6.15 7.44159 6.125 7.71659 6.125 7.99992C6.125 8.28325 6.15 8.55825 6.18334 8.83325H4.775ZM8 4.67909C8.34584 5.17909 8.625 5.73742 8.79584 6.33325H7.20417C7.375 5.73742 7.65417 5.17909 8 4.67909ZM10.8833 6.33325H9.65417C9.52084 5.81242 9.32917 5.31242 9.07917 4.84992C9.84584 5.11242 10.4833 5.64159 10.8833 6.33325ZM8 3.83325C5.69584 3.83325 3.83334 5.70825 3.83334 7.99992C3.83334 9.10499 4.27232 10.1648 5.05372 10.9462C5.44064 11.3331 5.89996 11.64 6.40549 11.8494C6.91101 12.0588 7.45283 12.1666 8 12.1666C9.10507 12.1666 10.1649 11.7276 10.9463 10.9462C11.7277 10.1648 12.1667 9.10499 12.1667 7.99992C12.1667 7.45274 12.0589 6.91093 11.8495 6.4054C11.6401 5.89988 11.3332 5.44055 10.9463 5.05364C10.5594 4.66673 10.1 4.35982 9.59452 4.15042C9.08899 3.94103 8.54718 3.83325 8 3.83325Z",
|
153
|
+
fill: "#4660A2"
|
154
|
+
}))), ___EmotionJSX("defs", null, ___EmotionJSX("clipPath", {
|
155
|
+
id: "clip0_709_18936"
|
156
|
+
}, ___EmotionJSX("rect", {
|
157
|
+
width: "16",
|
158
|
+
height: "16",
|
159
|
+
fill: "white"
|
160
|
+
})), ___EmotionJSX("clipPath", {
|
161
|
+
id: "clip1_709_18936"
|
162
|
+
}, ___EmotionJSX("rect", {
|
163
|
+
width: "10",
|
164
|
+
height: "10",
|
165
|
+
fill: "white",
|
166
|
+
transform: "translate(3 3)"
|
167
|
+
})), ___EmotionJSX("clipPath", {
|
168
|
+
id: "clip2_709_18936"
|
169
|
+
}, ___EmotionJSX("rect", {
|
170
|
+
width: "16",
|
171
|
+
height: "16",
|
172
|
+
fill: "white"
|
173
|
+
})), ___EmotionJSX("clipPath", {
|
174
|
+
id: "clip3_709_18936"
|
175
|
+
}, ___EmotionJSX("rect", {
|
176
|
+
width: "10",
|
177
|
+
height: "10",
|
178
|
+
fill: "white",
|
179
|
+
transform: "translate(3 3)"
|
180
|
+
}))));
|
181
|
+
};
|
182
|
+
|
93
183
|
var items = [{
|
94
184
|
id: 1,
|
95
185
|
name: 'Aardvark',
|
@@ -119,6 +209,58 @@ var items = [{
|
|
119
209
|
name: 'Shark',
|
120
210
|
key: 'Shark'
|
121
211
|
}];
|
212
|
+
var itemsWithSlots = [{
|
213
|
+
id: 1,
|
214
|
+
name: 'Aardvark',
|
215
|
+
key: 'Aardvark',
|
216
|
+
chipProps: {
|
217
|
+
variant: 'boxes.itemChipWithSlot',
|
218
|
+
bg: 'white'
|
219
|
+
},
|
220
|
+
buttonProps: {
|
221
|
+
variant: 'buttons.chipWithSlotDeleteButton'
|
222
|
+
},
|
223
|
+
slots: {
|
224
|
+
leftIcon: ___EmotionJSX(Icon, {
|
225
|
+
icon: VariableIcon,
|
226
|
+
size: 16
|
227
|
+
})
|
228
|
+
}
|
229
|
+
}, {
|
230
|
+
id: 2,
|
231
|
+
name: 'Kangaroo',
|
232
|
+
key: 'Kangaroo',
|
233
|
+
chipProps: {
|
234
|
+
variant: 'boxes.itemChipWithSlot',
|
235
|
+
bg: 'white'
|
236
|
+
},
|
237
|
+
buttonProps: {
|
238
|
+
variant: 'buttons.chipWithSlotDeleteButton'
|
239
|
+
},
|
240
|
+
slots: {
|
241
|
+
leftIcon: ___EmotionJSX(Icon, {
|
242
|
+
icon: HTMLIcon,
|
243
|
+
size: 16
|
244
|
+
})
|
245
|
+
}
|
246
|
+
}, {
|
247
|
+
id: 3,
|
248
|
+
name: 'Snake',
|
249
|
+
key: 'Snake',
|
250
|
+
chipProps: {
|
251
|
+
variant: 'boxes.itemChipWithSlot',
|
252
|
+
bg: 'white'
|
253
|
+
},
|
254
|
+
buttonProps: {
|
255
|
+
variant: 'buttons.chipWithSlotDeleteButton'
|
256
|
+
},
|
257
|
+
slots: {
|
258
|
+
leftIcon: ___EmotionJSX(Icon, {
|
259
|
+
icon: HTMLIcon,
|
260
|
+
size: 16
|
261
|
+
})
|
262
|
+
}
|
263
|
+
}];
|
122
264
|
|
123
265
|
var setOverlayStyle = function setOverlayStyle(direction, isOpen, mr, ml, mt) {
|
124
266
|
return {
|
@@ -154,7 +296,7 @@ export var Default = function Default(args) {
|
|
154
296
|
}, item.name);
|
155
297
|
}));
|
156
298
|
};
|
157
|
-
export var
|
299
|
+
export var Uncontrolled = function Uncontrolled(args) {
|
158
300
|
var _useState3 = useState(false),
|
159
301
|
_useState4 = _slicedToArray(_useState3, 2),
|
160
302
|
isOpen = _useState4[0],
|
@@ -170,8 +312,8 @@ export var WithCustomValues = function WithCustomValues(args) {
|
|
170
312
|
, {
|
171
313
|
style: setOverlayStyle(direction, isOpen, '50%', '50%', '20%')
|
172
314
|
}, ___EmotionJSX(MultivaluesField, _extends({
|
173
|
-
|
174
|
-
|
315
|
+
defaultSelectedKeys: ['Aardvark', 'Snake'],
|
316
|
+
items: items
|
175
317
|
}, args, {
|
176
318
|
onOpenChange: onOpenChange
|
177
319
|
}), function (item) {
|
@@ -181,16 +323,16 @@ export var WithCustomValues = function WithCustomValues(args) {
|
|
181
323
|
}, item.name);
|
182
324
|
}));
|
183
325
|
};
|
184
|
-
|
185
|
-
|
186
|
-
defaultValue: 'non-restrictive'
|
187
|
-
}
|
188
|
-
};
|
189
|
-
export var WithDisabledKeys = function WithDisabledKeys(args) {
|
190
|
-
var _useState5 = useState(false),
|
326
|
+
export var Controlled = function Controlled(args) {
|
327
|
+
var _useState5 = useState(['Aardvark', 'Snake']),
|
191
328
|
_useState6 = _slicedToArray(_useState5, 2),
|
192
|
-
|
193
|
-
|
329
|
+
selectedKeys = _useState6[0],
|
330
|
+
setSelectedKeys = _useState6[1];
|
331
|
+
|
332
|
+
var _useState7 = useState(false),
|
333
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
334
|
+
isOpen = _useState8[0],
|
335
|
+
setIsOpen = _useState8[1];
|
194
336
|
|
195
337
|
var direction = args.direction;
|
196
338
|
|
@@ -202,9 +344,11 @@ export var WithDisabledKeys = function WithDisabledKeys(args) {
|
|
202
344
|
, {
|
203
345
|
style: setOverlayStyle(direction, isOpen, '50%', '50%', '20%')
|
204
346
|
}, ___EmotionJSX(MultivaluesField, _extends({
|
205
|
-
|
206
|
-
items: items
|
347
|
+
label: "Field Label"
|
207
348
|
}, args, {
|
349
|
+
items: items,
|
350
|
+
onSelectionChange: setSelectedKeys,
|
351
|
+
selectedKeys: selectedKeys,
|
208
352
|
onOpenChange: onOpenChange
|
209
353
|
}), function (item) {
|
210
354
|
return ___EmotionJSX(Item, {
|
@@ -213,11 +357,11 @@ export var WithDisabledKeys = function WithDisabledKeys(args) {
|
|
213
357
|
}, item.name);
|
214
358
|
}));
|
215
359
|
};
|
216
|
-
export var
|
217
|
-
var
|
218
|
-
|
219
|
-
isOpen =
|
220
|
-
setIsOpen =
|
360
|
+
export var Error = function Error(args) {
|
361
|
+
var _useState9 = useState(false),
|
362
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
363
|
+
isOpen = _useState10[0],
|
364
|
+
setIsOpen = _useState10[1];
|
221
365
|
|
222
366
|
var direction = args.direction;
|
223
367
|
|
@@ -228,10 +372,10 @@ export var Uncontrolled = function Uncontrolled(args) {
|
|
228
372
|
return ___EmotionJSX(OverlayProvider // note: spacing for demo purpose only so that the select list renders in the correct place
|
229
373
|
, {
|
230
374
|
style: setOverlayStyle(direction, isOpen, '50%', '50%', '20%')
|
231
|
-
}, ___EmotionJSX(MultivaluesField, _extends({
|
232
|
-
|
233
|
-
|
234
|
-
|
375
|
+
}, ___EmotionJSX(MultivaluesField, _extends({}, args, {
|
376
|
+
items: items,
|
377
|
+
helperText: "Here is some helpful text...",
|
378
|
+
status: "error",
|
235
379
|
onOpenChange: onOpenChange
|
236
380
|
}), function (item) {
|
237
381
|
return ___EmotionJSX(Item, {
|
@@ -240,12 +384,7 @@ export var Uncontrolled = function Uncontrolled(args) {
|
|
240
384
|
}, item.name);
|
241
385
|
}));
|
242
386
|
};
|
243
|
-
export var
|
244
|
-
var _useState9 = useState(['Aardvark', 'Snake']),
|
245
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
246
|
-
selectedKeys = _useState10[0],
|
247
|
-
setSelectedKeys = _useState10[1];
|
248
|
-
|
387
|
+
export var ReadOnlyField = function ReadOnlyField(args) {
|
249
388
|
var _useState11 = useState(false),
|
250
389
|
_useState12 = _slicedToArray(_useState11, 2),
|
251
390
|
isOpen = _useState12[0],
|
@@ -261,11 +400,9 @@ export var Controlled = function Controlled(args) {
|
|
261
400
|
, {
|
262
401
|
style: setOverlayStyle(direction, isOpen, '50%', '50%', '20%')
|
263
402
|
}, ___EmotionJSX(MultivaluesField, _extends({
|
264
|
-
|
403
|
+
items: items
|
265
404
|
}, args, {
|
266
|
-
|
267
|
-
onSelectionChange: setSelectedKeys,
|
268
|
-
selectedKeys: selectedKeys,
|
405
|
+
isReadOnly: true,
|
269
406
|
onOpenChange: onOpenChange
|
270
407
|
}), function (item) {
|
271
408
|
return ___EmotionJSX(Item, {
|
@@ -274,7 +411,7 @@ export var Controlled = function Controlled(args) {
|
|
274
411
|
}, item.name);
|
275
412
|
}));
|
276
413
|
};
|
277
|
-
export var
|
414
|
+
export var ReadOnlyValues = function ReadOnlyValues(args) {
|
278
415
|
var _useState13 = useState(false),
|
279
416
|
_useState14 = _slicedToArray(_useState13, 2),
|
280
417
|
isOpen = _useState14[0],
|
@@ -286,18 +423,11 @@ export var WithCustomSize = function WithCustomSize(args) {
|
|
286
423
|
setIsOpen(true);
|
287
424
|
};
|
288
425
|
|
289
|
-
return ___EmotionJSX(
|
290
|
-
sx: {
|
291
|
-
width: '100%',
|
292
|
-
alignItems: 'center',
|
293
|
-
justifyContent: 'center'
|
294
|
-
}
|
295
|
-
}, ___EmotionJSX(Box, {
|
296
|
-
width: 300
|
297
|
-
}, ___EmotionJSX(OverlayProvider // note: spacing for demo purpose only so that the select list renders in the correct place
|
426
|
+
return ___EmotionJSX(OverlayProvider // note: spacing for demo purpose only so that the select list renders in the correct place
|
298
427
|
, {
|
299
|
-
style: setOverlayStyle(direction, isOpen, '
|
428
|
+
style: setOverlayStyle(direction, isOpen, '50%', '50%', '20%')
|
300
429
|
}, ___EmotionJSX(MultivaluesField, _extends({
|
430
|
+
readOnlyKeys: ['Aardvark', 'Snake'],
|
301
431
|
items: items
|
302
432
|
}, args, {
|
303
433
|
onOpenChange: onOpenChange
|
@@ -306,9 +436,9 @@ export var WithCustomSize = function WithCustomSize(args) {
|
|
306
436
|
key: item.key,
|
307
437
|
"data-id": item.name
|
308
438
|
}, item.name);
|
309
|
-
}))
|
439
|
+
}));
|
310
440
|
};
|
311
|
-
export var
|
441
|
+
export var DisabledKeys = function DisabledKeys(args) {
|
312
442
|
var _useState15 = useState(false),
|
313
443
|
_useState16 = _slicedToArray(_useState15, 2),
|
314
444
|
isOpen = _useState16[0],
|
@@ -324,7 +454,7 @@ export var WithReadOnlyValues = function WithReadOnlyValues(args) {
|
|
324
454
|
, {
|
325
455
|
style: setOverlayStyle(direction, isOpen, '50%', '50%', '20%')
|
326
456
|
}, ___EmotionJSX(MultivaluesField, _extends({
|
327
|
-
|
457
|
+
disabledKeys: ['Aardvark'],
|
328
458
|
items: items
|
329
459
|
}, args, {
|
330
460
|
onOpenChange: onOpenChange
|
@@ -335,7 +465,7 @@ export var WithReadOnlyValues = function WithReadOnlyValues(args) {
|
|
335
465
|
}, item.name);
|
336
466
|
}));
|
337
467
|
};
|
338
|
-
export var
|
468
|
+
export var CustomValues = function CustomValues(args) {
|
339
469
|
var _useState17 = useState(false),
|
340
470
|
_useState18 = _slicedToArray(_useState17, 2),
|
341
471
|
isOpen = _useState18[0],
|
@@ -350,10 +480,10 @@ export var Error = function Error(args) {
|
|
350
480
|
return ___EmotionJSX(OverlayProvider // note: spacing for demo purpose only so that the select list renders in the correct place
|
351
481
|
, {
|
352
482
|
style: setOverlayStyle(direction, isOpen, '50%', '50%', '20%')
|
353
|
-
}, ___EmotionJSX(MultivaluesField, _extends({
|
483
|
+
}, ___EmotionJSX(MultivaluesField, _extends({
|
354
484
|
items: items,
|
355
|
-
|
356
|
-
|
485
|
+
mode: "non-restrictive"
|
486
|
+
}, args, {
|
357
487
|
onOpenChange: onOpenChange
|
358
488
|
}), function (item) {
|
359
489
|
return ___EmotionJSX(Item, {
|
@@ -362,7 +492,12 @@ export var Error = function Error(args) {
|
|
362
492
|
}, item.name);
|
363
493
|
}));
|
364
494
|
};
|
365
|
-
|
495
|
+
CustomValues.argTypes = {
|
496
|
+
mode: {
|
497
|
+
defaultValue: 'non-restrictive'
|
498
|
+
}
|
499
|
+
};
|
500
|
+
export var IconSlotsInChip = function IconSlotsInChip(args) {
|
366
501
|
var _useState19 = useState(false),
|
367
502
|
_useState20 = _slicedToArray(_useState19, 2),
|
368
503
|
isOpen = _useState20[0],
|
@@ -378,9 +513,8 @@ export var ReadOnlyField = function ReadOnlyField(args) {
|
|
378
513
|
, {
|
379
514
|
style: setOverlayStyle(direction, isOpen, '50%', '50%', '20%')
|
380
515
|
}, ___EmotionJSX(MultivaluesField, _extends({
|
381
|
-
items:
|
516
|
+
items: itemsWithSlots
|
382
517
|
}, args, {
|
383
|
-
isReadOnly: true,
|
384
518
|
onOpenChange: onOpenChange
|
385
519
|
}), function (item) {
|
386
520
|
return ___EmotionJSX(Item, {
|
@@ -388,4 +522,38 @@ export var ReadOnlyField = function ReadOnlyField(args) {
|
|
388
522
|
"data-id": item.name
|
389
523
|
}, item.name);
|
390
524
|
}));
|
525
|
+
};
|
526
|
+
export var CustomSize = function CustomSize(args) {
|
527
|
+
var _useState21 = useState(false),
|
528
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
529
|
+
isOpen = _useState22[0],
|
530
|
+
setIsOpen = _useState22[1];
|
531
|
+
|
532
|
+
var direction = args.direction;
|
533
|
+
|
534
|
+
var onOpenChange = function onOpenChange() {
|
535
|
+
setIsOpen(true);
|
536
|
+
};
|
537
|
+
|
538
|
+
return ___EmotionJSX(Box, {
|
539
|
+
sx: {
|
540
|
+
width: '100%',
|
541
|
+
alignItems: 'center',
|
542
|
+
justifyContent: 'center'
|
543
|
+
}
|
544
|
+
}, ___EmotionJSX(Box, {
|
545
|
+
width: 300
|
546
|
+
}, ___EmotionJSX(OverlayProvider // note: spacing for demo purpose only so that the select list renders in the correct place
|
547
|
+
, {
|
548
|
+
style: setOverlayStyle(direction, isOpen, '25%', '25%', '75%')
|
549
|
+
}, ___EmotionJSX(MultivaluesField, _extends({
|
550
|
+
items: items
|
551
|
+
}, args, {
|
552
|
+
onOpenChange: onOpenChange
|
553
|
+
}), function (item) {
|
554
|
+
return ___EmotionJSX(Item, {
|
555
|
+
key: item.key,
|
556
|
+
"data-id": item.name
|
557
|
+
}, item.name);
|
558
|
+
}))));
|
391
559
|
};
|
@@ -173,7 +173,10 @@ var multivaluesChip = _objectSpread(_objectSpread({}, chip), {}, {
|
|
173
173
|
cursor: 'default',
|
174
174
|
m: 5,
|
175
175
|
mr: 10,
|
176
|
-
ml: 0
|
176
|
+
ml: 0,
|
177
|
+
'& span': {
|
178
|
+
mr: '2px'
|
179
|
+
}
|
177
180
|
});
|
178
181
|
|
179
182
|
var selectedItemChip = _objectSpread(_objectSpread({}, multivaluesChip), {}, {
|
@@ -188,6 +191,18 @@ var readOnlyChip = _objectSpread(_objectSpread({}, multivaluesChip), {}, {
|
|
188
191
|
borderColor: 'neutral.80'
|
189
192
|
});
|
190
193
|
|
194
|
+
var itemChipWithSlot = _objectSpread(_objectSpread({}, readOnlyChip), {}, {
|
195
|
+
p: 3,
|
196
|
+
my: 0,
|
197
|
+
backgroundColor: 'white',
|
198
|
+
'& span': {
|
199
|
+
color: 'text.primary',
|
200
|
+
mr: '2px',
|
201
|
+
lineHeight: '16px'
|
202
|
+
},
|
203
|
+
maxHeight: '22px'
|
204
|
+
});
|
205
|
+
|
191
206
|
var inputInContainerSlot = {
|
192
207
|
position: 'absolute',
|
193
208
|
bg: 'transparent',
|
@@ -386,6 +401,7 @@ export default {
|
|
386
401
|
environmentChip: environmentChip,
|
387
402
|
expandableRow: expandableRow,
|
388
403
|
inputInContainerSlot: inputInContainerSlot,
|
404
|
+
itemChipWithSlot: itemChipWithSlot,
|
389
405
|
textFieldInContainerSlot: textFieldInContainerSlot,
|
390
406
|
fileInputFieldWrapper: fileInputFieldWrapper,
|
391
407
|
listItem: listItem,
|
@@ -413,13 +413,16 @@ var quiet = {
|
|
413
413
|
all: 'unset',
|
414
414
|
display: 'flex'
|
415
415
|
};
|
416
|
-
var
|
416
|
+
var chipDeleteStandard = {
|
417
417
|
borderRadius: '50%',
|
418
418
|
cursor: 'pointer',
|
419
419
|
height: 14,
|
420
|
-
mx: '3px !important',
|
421
420
|
p: 0,
|
422
421
|
width: 14,
|
422
|
+
mx: '3px !important'
|
423
|
+
};
|
424
|
+
|
425
|
+
var chipDeleteButton = _objectSpread(_objectSpread({}, chipDeleteStandard), {}, {
|
423
426
|
'&.is-focused, &.is-hovered': _objectSpread({
|
424
427
|
bg: 'accent.40'
|
425
428
|
}, focusWithCroppedOutline),
|
@@ -427,7 +430,26 @@ var chipDeleteButton = {
|
|
427
430
|
bg: 'accent.20',
|
428
431
|
borderColor: 'accent.20'
|
429
432
|
}
|
430
|
-
};
|
433
|
+
});
|
434
|
+
|
435
|
+
var chipWithSlotDeleteButton = _objectSpread(_objectSpread({}, chipDeleteStandard), {}, {
|
436
|
+
path: {
|
437
|
+
fill: 'neutral.40'
|
438
|
+
},
|
439
|
+
'&.is-focused': _objectSpread({}, defaultFocus),
|
440
|
+
'&.is-hovered': {
|
441
|
+
backgroundColor: '#e5e9f8 !important',
|
442
|
+
path: {
|
443
|
+
fill: 'neutral.40'
|
444
|
+
}
|
445
|
+
},
|
446
|
+
'&.is-pressed': {
|
447
|
+
'path': {
|
448
|
+
fill: 'white'
|
449
|
+
},
|
450
|
+
bg: '#4462ED !important'
|
451
|
+
}
|
452
|
+
});
|
431
453
|
|
432
454
|
var rocker = _objectSpread(_objectSpread({}, base), {}, {
|
433
455
|
border: '0',
|
@@ -719,6 +741,7 @@ var navBarSectionButton = _objectSpread(_objectSpread({}, quiet), {}, {
|
|
719
741
|
export default {
|
720
742
|
accordionHeader: accordionHeader,
|
721
743
|
chipDeleteButton: chipDeleteButton,
|
744
|
+
chipWithSlotDeleteButton: chipWithSlotDeleteButton,
|
722
745
|
close: close,
|
723
746
|
colorField: colorField,
|
724
747
|
comboBox: comboBox,
|