@economic/taco 0.0.31-alpha.0 → 0.0.31-alpha.1
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/esm/_virtual/_rollupPluginBabelHelpers.js +19 -1
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
- package/dist/esm/components/Badge/Badge.js +14 -14
- package/dist/esm/components/Badge/Badge.js.map +1 -1
- package/dist/esm/components/Banner/Banner.js +5 -7
- package/dist/esm/components/Banner/Banner.js.map +1 -1
- package/dist/esm/components/Button/Button.js +13 -12
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/Calendar/Calendar.js +71 -56
- package/dist/esm/components/Calendar/Calendar.js.map +1 -1
- package/dist/esm/components/Checkbox/Checkbox.js +18 -15
- package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/components/Combobox/Combobox.js +25 -23
- package/dist/esm/components/Combobox/Combobox.js.map +1 -1
- package/dist/esm/components/Datepicker/Datepicker.js +52 -48
- package/dist/esm/components/Datepicker/Datepicker.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.js +58 -39
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/Field/Field.js +12 -10
- package/dist/esm/components/Field/Field.js.map +1 -1
- package/dist/esm/components/Form/Form.js +8 -6
- package/dist/esm/components/Form/Form.js.map +1 -1
- package/dist/esm/components/Group/Group.js +8 -6
- package/dist/esm/components/Group/Group.js.map +1 -1
- package/dist/esm/components/Hanger/Hanger.js +33 -25
- package/dist/esm/components/Hanger/Hanger.js.map +1 -1
- package/dist/esm/components/Icon/Icon.js +8 -7
- package/dist/esm/components/Icon/Icon.js.map +1 -1
- package/dist/esm/components/IconButton/IconButton.js +11 -9
- package/dist/esm/components/IconButton/IconButton.js.map +1 -1
- package/dist/esm/components/Input/Input.js +24 -26
- package/dist/esm/components/Input/Input.js.map +1 -1
- package/dist/esm/components/Listbox/Listbox.js +25 -24
- package/dist/esm/components/Listbox/Listbox.js.map +1 -1
- package/dist/esm/components/Menu/Menu.js +43 -20
- package/dist/esm/components/Menu/Menu.js.map +1 -1
- package/dist/esm/components/Navigation/Navigation.js +44 -35
- package/dist/esm/components/Navigation/Navigation.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js +56 -39
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/Popover/Popover.js +34 -29
- package/dist/esm/components/Popover/Popover.js.map +1 -1
- package/dist/esm/components/Progress/Progress.js +15 -11
- package/dist/esm/components/Progress/Progress.js.map +1 -1
- package/dist/esm/components/Provider/Provider.js +18 -13
- package/dist/esm/components/Provider/Provider.js.map +1 -1
- package/dist/esm/components/RadioGroup/RadioGroup.js +57 -45
- package/dist/esm/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js +11 -10
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/components/Select/Select.js +31 -30
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Spinner/Spinner.js +19 -12
- package/dist/esm/components/Spinner/Spinner.js.map +1 -1
- package/dist/esm/components/Switch/Switch.js +10 -9
- package/dist/esm/components/Switch/Switch.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js +27 -25
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/Textarea/Textarea.js +9 -11
- package/dist/esm/components/Textarea/Textarea.js.map +1 -1
- package/dist/esm/components/Toast/Toaster.js +118 -88
- package/dist/esm/components/Toast/Toaster.js.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js +8 -7
- package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/components/Tour/Tour.js +50 -44
- package/dist/esm/components/Tour/Tour.js.map +1 -1
- package/dist/esm/components/Treeview/Treeview.js +36 -26
- package/dist/esm/components/Treeview/Treeview.js.map +1 -1
- package/dist/esm/components/VisuallyHidden/VisuallyHidden.js +1 -1
- package/dist/esm/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/dist/taco.cjs.development.js +1007 -813
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/dist/utils/tailwind.d.ts +1 -1
- package/package.json +3 -3
@@ -36,6 +36,39 @@ var PrimitiveSwitch = require('@radix-ui/react-switch');
|
|
36
36
|
var Joyride = require('react-joyride');
|
37
37
|
var Joyride__default = _interopDefault(Joyride);
|
38
38
|
|
39
|
+
function _extends() {
|
40
|
+
_extends = Object.assign || function (target) {
|
41
|
+
for (var i = 1; i < arguments.length; i++) {
|
42
|
+
var source = arguments[i];
|
43
|
+
|
44
|
+
for (var key in source) {
|
45
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
46
|
+
target[key] = source[key];
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
return target;
|
52
|
+
};
|
53
|
+
|
54
|
+
return _extends.apply(this, arguments);
|
55
|
+
}
|
56
|
+
|
57
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
58
|
+
if (source == null) return {};
|
59
|
+
var target = {};
|
60
|
+
var sourceKeys = Object.keys(source);
|
61
|
+
var key, i;
|
62
|
+
|
63
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
64
|
+
key = sourceKeys[i];
|
65
|
+
if (excluded.indexOf(key) >= 0) continue;
|
66
|
+
target[key] = source[key];
|
67
|
+
}
|
68
|
+
|
69
|
+
return target;
|
70
|
+
}
|
71
|
+
|
39
72
|
function IconAccountPreview(props, svgRef) {
|
40
73
|
return React.createElement("svg", Object.assign({
|
41
74
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -3089,17 +3122,17 @@ const icons = {
|
|
3089
3122
|
zoom: Zoom
|
3090
3123
|
};
|
3091
3124
|
|
3092
|
-
|
3125
|
+
var _excluded = ["name"];
|
3126
|
+
var Icon = /*#__PURE__*/React__default.forwardRef(function Icon(props, ref) {
|
3093
3127
|
var _props$className;
|
3094
3128
|
|
3095
|
-
|
3096
|
-
|
3097
|
-
|
3098
|
-
|
3099
|
-
const Component = icons[name];
|
3129
|
+
var name = props.name,
|
3130
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
3131
|
+
|
3132
|
+
var Component = icons[name];
|
3100
3133
|
/* 24x24 _at the base body font_ - must be em so that they scale with font size - tailwind spacing uses rem */
|
3101
3134
|
|
3102
|
-
|
3135
|
+
var className = cn('inline-flex h-[1.715em] w-[1.715em]', props.className, {
|
3103
3136
|
'p-[3px]': (_props$className = props.className) === null || _props$className === void 0 ? void 0 : _props$className.includes('rounded-full')
|
3104
3137
|
});
|
3105
3138
|
return Component ? React__default.createElement(Component, Object.assign({}, otherProps, {
|
@@ -3111,12 +3144,14 @@ const Icon = /*#__PURE__*/React__default.forwardRef(function Icon(props, ref) {
|
|
3111
3144
|
})) : null;
|
3112
3145
|
});
|
3113
3146
|
|
3114
|
-
|
3147
|
+
var _excluded$1 = ["id"],
|
3148
|
+
_excluded2 = ["id", "defaultId", "onChange", "as"];
|
3149
|
+
var AccordionContext = /*#__PURE__*/React__default.createContext({
|
3115
3150
|
as: 'h2'
|
3116
3151
|
});
|
3117
|
-
|
3118
|
-
|
3119
|
-
|
3152
|
+
var StyledTrigger = /*#__PURE__*/React__default.forwardRef(function AccordionStyledTrigger(props, ref) {
|
3153
|
+
var isExpanded = !!props['aria-expanded'];
|
3154
|
+
var className = cn('w-full inline-flex justify-between items-center align-middle', 'focus:rounded-sm focus:border-blue focus:yt-focus', props.className);
|
3120
3155
|
return React__default.createElement("button", Object.assign({}, props, {
|
3121
3156
|
ref: ref,
|
3122
3157
|
className: className
|
@@ -3124,13 +3159,12 @@ const StyledTrigger = /*#__PURE__*/React__default.forwardRef(function AccordionS
|
|
3124
3159
|
name: isExpanded ? 'chevron-up' : 'chevron-down'
|
3125
3160
|
}));
|
3126
3161
|
});
|
3127
|
-
|
3128
|
-
|
3129
|
-
|
3130
|
-
|
3131
|
-
|
3132
|
-
|
3133
|
-
} = React__default.useContext(AccordionContext);
|
3162
|
+
var Trigger = /*#__PURE__*/React__default.forwardRef(function AccordionTrigger(props, ref) {
|
3163
|
+
var children = props.children;
|
3164
|
+
|
3165
|
+
var _React$useContext = React__default.useContext(AccordionContext),
|
3166
|
+
Heading = _React$useContext.as;
|
3167
|
+
|
3134
3168
|
return React__default.createElement(AccordionPrimitive.Header, {
|
3135
3169
|
asChild: true
|
3136
3170
|
}, React__default.createElement(Heading, {
|
@@ -3140,34 +3174,35 @@ const Trigger = /*#__PURE__*/React__default.forwardRef(function AccordionTrigger
|
|
3140
3174
|
asChild: true
|
3141
3175
|
}, React__default.createElement(StyledTrigger, null, children))));
|
3142
3176
|
});
|
3143
|
-
|
3177
|
+
var Content = /*#__PURE__*/React__default.forwardRef(function AccordionContent(props, ref) {
|
3144
3178
|
return React__default.createElement(AccordionPrimitive.Content, Object.assign({}, props, {
|
3145
3179
|
ref: ref
|
3146
3180
|
}));
|
3147
3181
|
});
|
3148
3182
|
|
3149
|
-
|
3150
|
-
|
3151
|
-
|
3152
|
-
|
3153
|
-
} = props;
|
3183
|
+
var Item = function Item(props) {
|
3184
|
+
var id = props.id,
|
3185
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$1);
|
3186
|
+
|
3154
3187
|
return React__default.createElement(AccordionPrimitive.Item, Object.assign({}, otherProps, {
|
3155
3188
|
value: id
|
3156
3189
|
}));
|
3157
3190
|
};
|
3158
3191
|
|
3159
|
-
|
3160
|
-
|
3161
|
-
|
3162
|
-
|
3163
|
-
|
3164
|
-
|
3165
|
-
|
3166
|
-
|
3167
|
-
|
3168
|
-
|
3169
|
-
|
3170
|
-
|
3192
|
+
var Accordion = function Accordion(props) {
|
3193
|
+
var id = props.id,
|
3194
|
+
defaultId = props.defaultId,
|
3195
|
+
onChange = props.onChange,
|
3196
|
+
_props$as = props.as,
|
3197
|
+
as = _props$as === void 0 ? 'h2' : _props$as,
|
3198
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded2);
|
3199
|
+
|
3200
|
+
var context = React__default.useMemo(function () {
|
3201
|
+
return {
|
3202
|
+
as: as
|
3203
|
+
};
|
3204
|
+
}, [as]);
|
3205
|
+
var valueProps;
|
3171
3206
|
|
3172
3207
|
if (defaultId) {
|
3173
3208
|
valueProps = {
|
@@ -3180,8 +3215,8 @@ const Accordion = props => {
|
|
3180
3215
|
};
|
3181
3216
|
}
|
3182
3217
|
|
3183
|
-
|
3184
|
-
|
3218
|
+
var type = Array.isArray(valueProps.defaultValue) || Array.isArray(valueProps.value) ? 'multiple' : 'single';
|
3219
|
+
var className = cn('divide-y divide-grey', props.className);
|
3185
3220
|
return React__default.createElement(AccordionContext.Provider, {
|
3186
3221
|
value: context
|
3187
3222
|
}, React__default.createElement(AccordionPrimitive.Root, Object.assign({}, otherProps, valueProps, {
|
@@ -3202,7 +3237,7 @@ var Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(props, ref) {
|
|
3202
3237
|
}));
|
3203
3238
|
});
|
3204
3239
|
|
3205
|
-
|
3240
|
+
var VisuallyHidden = /*#__PURE__*/React.forwardRef(function VisuallyHidden(props, ref) {
|
3206
3241
|
return React.createElement("span", Object.assign({}, props, {
|
3207
3242
|
className: "sr-only",
|
3208
3243
|
ref: ref
|
@@ -3248,20 +3283,19 @@ const getOutlineClasses = state => {
|
|
3248
3283
|
}
|
3249
3284
|
};
|
3250
3285
|
|
3251
|
-
|
3252
|
-
|
3253
|
-
|
3254
|
-
|
3255
|
-
|
3256
|
-
|
3257
|
-
|
3258
|
-
|
3259
|
-
|
3260
|
-
|
3261
|
-
|
3262
|
-
|
3263
|
-
|
3264
|
-
}, props.className);
|
3286
|
+
var _excluded$2 = ["children", "compact", "outline", "state"];
|
3287
|
+
var Badge = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {
|
3288
|
+
var _cn;
|
3289
|
+
|
3290
|
+
var children = props.children,
|
3291
|
+
_props$compact = props.compact,
|
3292
|
+
compact = _props$compact === void 0 ? false : _props$compact,
|
3293
|
+
_props$outline = props.outline,
|
3294
|
+
outline = _props$outline === void 0 ? false : _props$outline,
|
3295
|
+
state = props.state,
|
3296
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$2);
|
3297
|
+
|
3298
|
+
var className = cn('rounded-full border font-bold text-xs uppercase overflow-hidden whitespace-nowrap inline-flex items-center justify-center h-5', (_cn = {}, _cn[getOutlineClasses(state)] = outline, _cn["border-transparent " + getStateClasses(state)] = !outline, _cn['h-2 w-2 min-w-0'] = compact, _cn['h-5 py-0 px-[0.354rem]'] = !compact, _cn), props.className);
|
3265
3299
|
return React.createElement("span", Object.assign({}, otherProps, {
|
3266
3300
|
"aria-atomic": "true",
|
3267
3301
|
"aria-live": "polite",
|
@@ -3321,13 +3355,13 @@ const Button = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
|
3321
3355
|
}), React.Children.count(props.children) > 1 ? React.Children.map(props.children, child => typeof child === 'string' ? React.createElement("span", null, child) : child) : props.children);
|
3322
3356
|
});
|
3323
3357
|
|
3324
|
-
|
3325
|
-
|
3326
|
-
|
3327
|
-
|
3328
|
-
|
3329
|
-
|
3330
|
-
|
3358
|
+
var _excluded$3 = ["title", "children", "placement"];
|
3359
|
+
var Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(props, ref) {
|
3360
|
+
var title = props.title,
|
3361
|
+
children = props.children,
|
3362
|
+
placement = props.placement,
|
3363
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$3);
|
3364
|
+
|
3331
3365
|
return React.createElement(TooltipPrimitive.Root, {
|
3332
3366
|
delayDuration: 50
|
3333
3367
|
}, React.createElement(TooltipPrimitive.Trigger, {
|
@@ -3419,13 +3453,14 @@ const createButton = (props, className, ref) => {
|
|
3419
3453
|
return button;
|
3420
3454
|
};
|
3421
3455
|
|
3422
|
-
|
3423
|
-
|
3424
|
-
|
3425
|
-
|
3426
|
-
|
3427
|
-
|
3428
|
-
|
3456
|
+
var _excluded$4 = ["icon", "rounded"];
|
3457
|
+
var IconButton = /*#__PURE__*/React.forwardRef(function IconButton(props, ref) {
|
3458
|
+
var icon = props.icon,
|
3459
|
+
_props$rounded = props.rounded,
|
3460
|
+
rounded = _props$rounded === void 0 ? false : _props$rounded,
|
3461
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$4);
|
3462
|
+
|
3463
|
+
var className = cn('w-8', getButtonClasses(), getAppearanceClasses(otherProps.appearance, true), {
|
3429
3464
|
'rounded-full': rounded,
|
3430
3465
|
rounded: !rounded,
|
3431
3466
|
'cursor-not-allowed opacity-50': props.disabled,
|
@@ -3436,22 +3471,20 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(props, ref)
|
|
3436
3471
|
return null;
|
3437
3472
|
}
|
3438
3473
|
|
3439
|
-
return createButton({
|
3474
|
+
return createButton(_extends({}, otherProps, {
|
3440
3475
|
children: React.createElement(Icon, {
|
3441
3476
|
name: icon,
|
3442
3477
|
className: "m-0 p-0"
|
3443
3478
|
}),
|
3444
3479
|
'data-taco': 'icon-button'
|
3445
|
-
}, className, ref);
|
3480
|
+
}), className, ref);
|
3446
3481
|
});
|
3447
3482
|
|
3448
|
-
|
3449
|
-
|
3450
|
-
|
3451
|
-
|
3452
|
-
|
3453
|
-
} = props;
|
3454
|
-
const className = cn('bg-white relative flex items-center px-4 h-12 shadow-lg z-10', props.className);
|
3483
|
+
var Banner = /*#__PURE__*/React.forwardRef(function Banner(props, ref) {
|
3484
|
+
var children = props.children,
|
3485
|
+
state = props.state,
|
3486
|
+
onClose = props.onClose;
|
3487
|
+
var className = cn('bg-white relative flex items-center px-4 h-12 shadow-lg z-10', props.className);
|
3455
3488
|
return React.createElement("div", {
|
3456
3489
|
className: className,
|
3457
3490
|
"data-taco": "banner",
|
@@ -3464,32 +3497,32 @@ const Banner = /*#__PURE__*/React.forwardRef(function Banner(props, ref) {
|
|
3464
3497
|
}) : null);
|
3465
3498
|
});
|
3466
3499
|
|
3467
|
-
|
3468
|
-
|
3469
|
-
|
3470
|
-
|
3471
|
-
|
3472
|
-
|
3500
|
+
var _excluded$5 = ["fluid"];
|
3501
|
+
var Button$1 = /*#__PURE__*/React.forwardRef(function Button(props, ref) {
|
3502
|
+
var fluid = props.fluid,
|
3503
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$5);
|
3504
|
+
|
3505
|
+
var className = cn(getButtonClasses(), getAppearanceClasses(otherProps.appearance), 'rounded px-3', {
|
3473
3506
|
'cursor-not-allowed opacity-50': props.disabled,
|
3474
3507
|
'focus:yt-focus active:focus:yt-focus': !props.disabled,
|
3475
3508
|
'w-full': fluid
|
3476
3509
|
}, props.className);
|
3477
|
-
|
3510
|
+
var children = otherProps.children; // add a chevron icon to menu buttons
|
3478
3511
|
|
3479
3512
|
if (typeof otherProps.menu === 'function') {
|
3480
|
-
children = Array.isArray(children) ? [
|
3513
|
+
children = Array.isArray(children) ? [].concat(children, [React.createElement(Icon, {
|
3481
3514
|
key: "chevron-down",
|
3482
3515
|
name: "chevron-down"
|
3483
|
-
})] : [children, React.createElement(Icon, {
|
3516
|
+
})]) : [children, React.createElement(Icon, {
|
3484
3517
|
key: "chevron-down",
|
3485
3518
|
name: "chevron-down"
|
3486
3519
|
})];
|
3487
3520
|
}
|
3488
3521
|
|
3489
|
-
return createButton({
|
3490
|
-
children,
|
3522
|
+
return createButton(_extends({}, otherProps, {
|
3523
|
+
children: children,
|
3491
3524
|
'data-taco': 'button'
|
3492
|
-
}, className, ref);
|
3525
|
+
}), className, ref);
|
3493
3526
|
});
|
3494
3527
|
|
3495
3528
|
function useTimer(duration = 0, callback) {
|
@@ -3538,21 +3571,27 @@ function useTimer(duration = 0, callback) {
|
|
3538
3571
|
};
|
3539
3572
|
}
|
3540
3573
|
|
3541
|
-
|
3542
|
-
|
3543
|
-
|
3544
|
-
|
3545
|
-
|
3546
|
-
|
3547
|
-
|
3548
|
-
React__default.
|
3549
|
-
|
3574
|
+
var _excluded$6 = ["delay", "label"];
|
3575
|
+
var Spinner$1 = /*#__PURE__*/React__default.forwardRef(function Spinner(props, ref) {
|
3576
|
+
var _props$delay = props.delay,
|
3577
|
+
delay = _props$delay === void 0 ? 500 : _props$delay,
|
3578
|
+
label = props.label,
|
3579
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$6);
|
3580
|
+
|
3581
|
+
var _React$useState = React__default.useState(!delay),
|
3582
|
+
visible = _React$useState[0],
|
3583
|
+
setVisibility = _React$useState[1];
|
3584
|
+
|
3585
|
+
React__default.useEffect(function () {
|
3586
|
+
var timeout;
|
3550
3587
|
|
3551
3588
|
if (delay) {
|
3552
|
-
timeout = window.setTimeout(
|
3589
|
+
timeout = window.setTimeout(function () {
|
3590
|
+
return setVisibility(true);
|
3591
|
+
}, delay);
|
3553
3592
|
}
|
3554
3593
|
|
3555
|
-
return ()
|
3594
|
+
return function () {
|
3556
3595
|
if (timeout) {
|
3557
3596
|
clearTimeout(timeout);
|
3558
3597
|
}
|
@@ -3563,7 +3602,7 @@ const Spinner$1 = /*#__PURE__*/React__default.forwardRef(function Spinner(props,
|
|
3563
3602
|
return null;
|
3564
3603
|
}
|
3565
3604
|
|
3566
|
-
|
3605
|
+
var className = cn('inline-flex flex-col relative items-center', otherProps.className);
|
3567
3606
|
return React__default.createElement("div", Object.assign({}, otherProps, {
|
3568
3607
|
className: className,
|
3569
3608
|
"data-taco": "spinner",
|
@@ -3689,49 +3728,62 @@ const Toast = ({
|
|
3689
3728
|
}));
|
3690
3729
|
};
|
3691
3730
|
|
3692
|
-
|
3693
|
-
|
3731
|
+
var _excluded$7 = ["children"];
|
3732
|
+
var DEFAULT_AUTO_CLOSE_TIMEOUT = 7500;
|
3733
|
+
var ToastContext = /*#__PURE__*/React.createContext({});
|
3694
3734
|
|
3695
|
-
|
3696
|
-
|
3697
|
-
|
3735
|
+
var insertToastWithoutDuplicates = function insertToastWithoutDuplicates(currentToasts, id, content, options, close) {
|
3736
|
+
var nextToasts = [].concat(currentToasts);
|
3737
|
+
var existingToastIndex = currentToasts.findIndex(function (toast) {
|
3738
|
+
return JSON.stringify(toast.content) === JSON.stringify(content);
|
3739
|
+
});
|
3698
3740
|
|
3699
3741
|
if (existingToastIndex > -1) {
|
3700
3742
|
nextToasts[existingToastIndex].lastDuplicateId = id;
|
3701
3743
|
nextToasts[existingToastIndex].lastUpdated = Date.now();
|
3702
3744
|
} else {
|
3703
3745
|
nextToasts.push({
|
3704
|
-
id,
|
3746
|
+
id: id,
|
3705
3747
|
content: typeof content === 'function' ? content(close) : content,
|
3706
|
-
options
|
3748
|
+
options: options
|
3707
3749
|
});
|
3708
3750
|
}
|
3709
3751
|
|
3710
3752
|
return nextToasts;
|
3711
3753
|
};
|
3712
3754
|
|
3713
|
-
|
3714
|
-
children,
|
3715
|
-
|
3716
|
-
}) => {
|
3717
|
-
const [toasts, setToasts] = React.useState([]);
|
3755
|
+
var ToastProvider = function ToastProvider(_ref) {
|
3756
|
+
var children = _ref.children,
|
3757
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
3718
3758
|
|
3719
|
-
|
3720
|
-
|
3759
|
+
var _React$useState = React.useState([]),
|
3760
|
+
toasts = _React$useState[0],
|
3761
|
+
setToasts = _React$useState[1];
|
3762
|
+
|
3763
|
+
var handleClose = function handleClose(id) {
|
3764
|
+
setToasts(function (currentToasts) {
|
3765
|
+
return currentToasts.filter(function (toast) {
|
3766
|
+
return toast.id !== id;
|
3767
|
+
});
|
3768
|
+
});
|
3721
3769
|
}; // memoize (useCallback) this function,
|
3722
3770
|
// it is the value of the context provider and we don't want it to trigger state tree re-renders on provider children
|
3723
3771
|
|
3724
3772
|
|
3725
|
-
|
3726
|
-
|
3773
|
+
var toaster = React.useCallback(function (content, options) {
|
3774
|
+
var id = uuid.v4();
|
3727
3775
|
|
3728
|
-
|
3776
|
+
var close = function close() {
|
3777
|
+
return handleClose(id);
|
3778
|
+
};
|
3729
3779
|
|
3730
|
-
setToasts(
|
3780
|
+
setToasts(function (currentToasts) {
|
3781
|
+
return insertToastWithoutDuplicates(currentToasts, id, content, options, close);
|
3782
|
+
});
|
3731
3783
|
|
3732
|
-
|
3733
|
-
setToasts(currentToasts
|
3734
|
-
|
3784
|
+
var update = function update(content, options) {
|
3785
|
+
setToasts(function (currentToasts) {
|
3786
|
+
var nextToasts = currentToasts.filter(function (toast) {
|
3735
3787
|
if (toast.lastDuplicateId) {
|
3736
3788
|
return toast.lastDuplicateId !== id;
|
3737
3789
|
}
|
@@ -3742,70 +3794,80 @@ const ToastProvider = ({
|
|
3742
3794
|
});
|
3743
3795
|
};
|
3744
3796
|
|
3745
|
-
|
3746
|
-
update(content, {
|
3747
|
-
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT
|
3748
|
-
|
3797
|
+
var success = function success(content, options) {
|
3798
|
+
update(content, _extends({
|
3799
|
+
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT
|
3800
|
+
}, options, {
|
3749
3801
|
type: 'success'
|
3750
|
-
});
|
3802
|
+
}));
|
3751
3803
|
};
|
3752
3804
|
|
3753
|
-
|
3754
|
-
update(content, {
|
3805
|
+
var error = function error(content, options) {
|
3806
|
+
update(content, _extends({}, options, {
|
3755
3807
|
type: 'error'
|
3756
|
-
});
|
3808
|
+
}));
|
3757
3809
|
};
|
3758
3810
|
|
3759
|
-
|
3760
|
-
update(content, {
|
3811
|
+
var warning = function warning(content, options) {
|
3812
|
+
update(content, _extends({}, options, {
|
3761
3813
|
type: 'warning'
|
3762
|
-
});
|
3814
|
+
}));
|
3763
3815
|
};
|
3764
3816
|
|
3765
|
-
|
3766
|
-
update(content, {
|
3817
|
+
var information = function information(content, options) {
|
3818
|
+
update(content, _extends({}, options, {
|
3767
3819
|
type: 'information'
|
3768
|
-
});
|
3820
|
+
}));
|
3769
3821
|
};
|
3770
3822
|
|
3771
|
-
|
3772
|
-
update(content, {
|
3823
|
+
var loading = function loading(content, options) {
|
3824
|
+
update(content, _extends({}, options, {
|
3773
3825
|
type: 'loading'
|
3774
|
-
});
|
3826
|
+
}));
|
3775
3827
|
};
|
3776
3828
|
|
3777
3829
|
return {
|
3778
|
-
success,
|
3779
|
-
error,
|
3780
|
-
warning,
|
3781
|
-
information,
|
3782
|
-
loading,
|
3783
|
-
close
|
3830
|
+
success: success,
|
3831
|
+
error: error,
|
3832
|
+
warning: warning,
|
3833
|
+
information: information,
|
3834
|
+
loading: loading,
|
3835
|
+
close: close
|
3784
3836
|
};
|
3785
3837
|
}, []); // no need to rebind these every render, do them once in an effect
|
3786
3838
|
|
3787
|
-
React.useEffect(()
|
3788
|
-
toaster.success = (content, options)
|
3789
|
-
|
3790
|
-
|
3791
|
-
|
3792
|
-
|
3839
|
+
React.useEffect(function () {
|
3840
|
+
toaster.success = function (content, options) {
|
3841
|
+
return toaster(content, _extends({
|
3842
|
+
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT
|
3843
|
+
}, options, {
|
3844
|
+
type: 'success'
|
3845
|
+
}));
|
3846
|
+
};
|
3793
3847
|
|
3794
|
-
toaster.error = (content, options)
|
3795
|
-
|
3796
|
-
|
3848
|
+
toaster.error = function (content, options) {
|
3849
|
+
return toaster(content, _extends({}, options, {
|
3850
|
+
type: 'error'
|
3851
|
+
}));
|
3852
|
+
};
|
3797
3853
|
|
3798
|
-
toaster.warning = (content, options)
|
3799
|
-
|
3800
|
-
|
3854
|
+
toaster.warning = function (content, options) {
|
3855
|
+
return toaster(content, _extends({}, options, {
|
3856
|
+
type: 'warning'
|
3857
|
+
}));
|
3858
|
+
};
|
3801
3859
|
|
3802
|
-
toaster.information = (content, options)
|
3803
|
-
|
3804
|
-
|
3860
|
+
toaster.information = function (content, options) {
|
3861
|
+
return toaster(content, _extends({}, options, {
|
3862
|
+
type: 'information'
|
3863
|
+
}));
|
3864
|
+
};
|
3805
3865
|
|
3806
|
-
toaster.loading = (content, options)
|
3807
|
-
|
3808
|
-
|
3866
|
+
toaster.loading = function (content, options) {
|
3867
|
+
return toaster(content, _extends({}, options, {
|
3868
|
+
type: 'loading'
|
3869
|
+
}));
|
3870
|
+
};
|
3809
3871
|
}, []);
|
3810
3872
|
return React.createElement(ToastContext.Provider, Object.assign({}, props, {
|
3811
3873
|
value: toaster
|
@@ -3815,37 +3877,43 @@ const ToastProvider = ({
|
|
3815
3877
|
role: "log"
|
3816
3878
|
}, React.createElement(framerMotion.AnimatePresence, {
|
3817
3879
|
initial: false
|
3818
|
-
}, toasts.map(
|
3819
|
-
|
3820
|
-
|
3821
|
-
type: 'spring',
|
3822
|
-
damping: 20,
|
3823
|
-
stiffness: 300
|
3824
|
-
},
|
3825
|
-
initial: {
|
3826
|
-
opacity: 0,
|
3827
|
-
y: 10,
|
3828
|
-
scale: 0.5
|
3829
|
-
},
|
3830
|
-
animate: {
|
3831
|
-
opacity: 1,
|
3832
|
-
y: 0,
|
3833
|
-
scale: 1
|
3834
|
-
},
|
3835
|
-
exit: {
|
3836
|
-
opacity: 0,
|
3837
|
-
scale: 0.5,
|
3880
|
+
}, toasts.map(function (toast) {
|
3881
|
+
return React.createElement(framerMotion.motion.div, {
|
3882
|
+
key: toast.id,
|
3838
3883
|
transition: {
|
3839
|
-
|
3884
|
+
type: 'spring',
|
3885
|
+
damping: 20,
|
3886
|
+
stiffness: 300
|
3887
|
+
},
|
3888
|
+
initial: {
|
3889
|
+
opacity: 0,
|
3890
|
+
y: 10,
|
3891
|
+
scale: 0.5
|
3892
|
+
},
|
3893
|
+
animate: {
|
3894
|
+
opacity: 1,
|
3895
|
+
y: 0,
|
3896
|
+
scale: 1
|
3897
|
+
},
|
3898
|
+
exit: {
|
3899
|
+
opacity: 0,
|
3900
|
+
scale: 0.5,
|
3901
|
+
transition: {
|
3902
|
+
duration: 0.2
|
3903
|
+
}
|
3840
3904
|
}
|
3841
|
-
}
|
3842
|
-
|
3843
|
-
|
3844
|
-
|
3905
|
+
}, React.createElement(Toast, Object.assign({}, toast, {
|
3906
|
+
onClose: function onClose() {
|
3907
|
+
return handleClose(toast.id);
|
3908
|
+
}
|
3909
|
+
})));
|
3910
|
+
}))));
|
3911
|
+
};
|
3912
|
+
var useToast = function useToast() {
|
3913
|
+
return React.useContext(ToastContext);
|
3845
3914
|
};
|
3846
|
-
const useToast = () => React.useContext(ToastContext);
|
3847
3915
|
|
3848
|
-
|
3916
|
+
var defaultLocalisationTexts = {
|
3849
3917
|
calendar: {
|
3850
3918
|
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
3851
3919
|
weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
@@ -3920,62 +3988,67 @@ const defaultLocalisationTexts = {
|
|
3920
3988
|
inputLabel: 'Search...'
|
3921
3989
|
}
|
3922
3990
|
};
|
3923
|
-
|
3991
|
+
var defaultLocalizationContext = {
|
3924
3992
|
locale: 'en-GB',
|
3925
3993
|
texts: defaultLocalisationTexts,
|
3926
3994
|
formatting: {
|
3927
3995
|
date: 'dd.mm.yy'
|
3928
3996
|
}
|
3929
3997
|
};
|
3930
|
-
|
3998
|
+
var Context = /*#__PURE__*/React.createContext({
|
3931
3999
|
localization: defaultLocalizationContext
|
3932
4000
|
});
|
3933
|
-
|
3934
|
-
|
3935
|
-
|
3936
|
-
|
3937
|
-
|
3938
|
-
|
3939
|
-
|
3940
|
-
|
4001
|
+
var Provider = function Provider(props) {
|
4002
|
+
var children = props.children,
|
4003
|
+
_props$localization = props.localization,
|
4004
|
+
localization = _props$localization === void 0 ? defaultLocalizationContext : _props$localization;
|
4005
|
+
var value = React.useMemo(function () {
|
4006
|
+
return {
|
4007
|
+
localization: localization
|
4008
|
+
};
|
4009
|
+
}, [localization]);
|
3941
4010
|
return React.createElement(Context.Provider, {
|
3942
4011
|
value: value
|
3943
4012
|
}, React.createElement(ToastProvider, null, children));
|
3944
4013
|
};
|
3945
|
-
|
3946
|
-
|
4014
|
+
var useTaco = function useTaco() {
|
4015
|
+
return React.useContext(Context);
|
4016
|
+
};
|
4017
|
+
var useLocalization = function useLocalization() {
|
4018
|
+
return useTaco().localization;
|
4019
|
+
};
|
3947
4020
|
|
3948
|
-
|
3949
|
-
className: "dot"
|
3950
|
-
}) : day.getDate();
|
4021
|
+
var _excluded$8 = ["onChange", "value"];
|
3951
4022
|
|
3952
|
-
|
3953
|
-
|
4023
|
+
var renderDay = function renderDay(day, modifiers) {
|
4024
|
+
return modifiers.disabled ? React.createElement("span", {
|
4025
|
+
className: "dot"
|
4026
|
+
}) : day.getDate();
|
4027
|
+
};
|
4028
|
+
|
4029
|
+
var thisYear = /*#__PURE__*/new Date().getFullYear();
|
4030
|
+
var years = [];
|
3954
4031
|
|
3955
|
-
for (
|
4032
|
+
for (var i = thisYear - 10; i <= thisYear + 10; i += 1) {
|
3956
4033
|
years.push(i);
|
3957
4034
|
}
|
3958
4035
|
|
3959
|
-
|
3960
|
-
onMonthChange,
|
3961
|
-
|
3962
|
-
|
3963
|
-
|
3964
|
-
|
3965
|
-
const {
|
3966
|
-
texts: {
|
3967
|
-
calendar: {
|
3968
|
-
actions,
|
3969
|
-
months
|
3970
|
-
}
|
3971
|
-
}
|
3972
|
-
} = useLocalization();
|
4036
|
+
var Navbar = /*#__PURE__*/React.memo(function (_ref) {
|
4037
|
+
var onMonthChange = _ref.onMonthChange,
|
4038
|
+
onNextClick = _ref.onNextClick,
|
4039
|
+
onPreviousClick = _ref.onPreviousClick,
|
4040
|
+
_ref$value = _ref.value,
|
4041
|
+
value = _ref$value === void 0 ? new Date() : _ref$value;
|
3973
4042
|
|
3974
|
-
|
3975
|
-
|
3976
|
-
|
3977
|
-
|
3978
|
-
|
4043
|
+
var _useLocalization = useLocalization(),
|
4044
|
+
_useLocalization$text = _useLocalization.texts.calendar,
|
4045
|
+
actions = _useLocalization$text.actions,
|
4046
|
+
months = _useLocalization$text.months;
|
4047
|
+
|
4048
|
+
var handleChange = function handleChange(event) {
|
4049
|
+
var _event$target$form = event.target.form,
|
4050
|
+
year = _event$target$form.year,
|
4051
|
+
month = _event$target$form.month;
|
3979
4052
|
onMonthChange(new Date(year.value, month.value));
|
3980
4053
|
};
|
3981
4054
|
|
@@ -3988,49 +4061,59 @@ const Navbar = /*#__PURE__*/React.memo(({
|
|
3988
4061
|
name: "month",
|
3989
4062
|
onChange: handleChange,
|
3990
4063
|
value: value.getMonth()
|
3991
|
-
}, months.map((month, i)
|
3992
|
-
|
3993
|
-
|
3994
|
-
|
4064
|
+
}, months.map(function (month, i) {
|
4065
|
+
return React.createElement("option", {
|
4066
|
+
key: month,
|
4067
|
+
value: i
|
4068
|
+
}, month);
|
4069
|
+
})), React.createElement("select", {
|
3995
4070
|
className: "h-8 px-2",
|
3996
4071
|
name: "year",
|
3997
4072
|
onChange: handleChange,
|
3998
4073
|
value: value.getFullYear()
|
3999
|
-
}, years.map(
|
4000
|
-
|
4001
|
-
|
4002
|
-
|
4074
|
+
}, years.map(function (year) {
|
4075
|
+
return React.createElement("option", {
|
4076
|
+
key: year,
|
4077
|
+
value: year
|
4078
|
+
}, String(year));
|
4079
|
+
}))), React.createElement("div", null, React.createElement(IconButton, {
|
4003
4080
|
appearance: "discrete",
|
4004
4081
|
icon: "chevron-left",
|
4005
4082
|
"aria-label": actions.previousMonth,
|
4006
|
-
onClick: ()
|
4083
|
+
onClick: function onClick() {
|
4084
|
+
return onPreviousClick();
|
4085
|
+
},
|
4007
4086
|
rounded: true
|
4008
4087
|
}), React.createElement(IconButton, {
|
4009
4088
|
appearance: "discrete",
|
4010
4089
|
icon: "chevron-right",
|
4011
4090
|
"aria-label": actions.nextMonth,
|
4012
|
-
onClick: ()
|
4091
|
+
onClick: function onClick() {
|
4092
|
+
return onNextClick();
|
4093
|
+
},
|
4013
4094
|
rounded: true
|
4014
4095
|
})));
|
4015
4096
|
});
|
4016
|
-
|
4017
|
-
|
4018
|
-
|
4019
|
-
|
4020
|
-
|
4021
|
-
|
4022
|
-
|
4023
|
-
|
4024
|
-
|
4025
|
-
|
4026
|
-
|
4027
|
-
|
4097
|
+
var Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
4098
|
+
var handleChange = props.onChange,
|
4099
|
+
value = props.value,
|
4100
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$8);
|
4101
|
+
|
4102
|
+
var _useLocalization2 = useLocalization(),
|
4103
|
+
locale = _useLocalization2.locale,
|
4104
|
+
texts = _useLocalization2.texts;
|
4105
|
+
|
4106
|
+
var _React$useState = React.useState(value !== null && value !== void 0 ? value : new Date()),
|
4107
|
+
visibleMonth = _React$useState[0],
|
4108
|
+
setVisibleMonth = _React$useState[1];
|
4109
|
+
|
4110
|
+
React.useEffect(function () {
|
4028
4111
|
if (visibleMonth !== value) {
|
4029
4112
|
setVisibleMonth(value !== null && value !== void 0 ? value : new Date());
|
4030
4113
|
}
|
4031
4114
|
}, [value]);
|
4032
4115
|
|
4033
|
-
|
4116
|
+
var handleDayClick = function handleDayClick(date, modifiers, event) {
|
4034
4117
|
if (modifiers.outside || modifiers.disabled) {
|
4035
4118
|
return;
|
4036
4119
|
}
|
@@ -4038,8 +4121,8 @@ const Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4038
4121
|
handleChange(date, event);
|
4039
4122
|
};
|
4040
4123
|
|
4041
|
-
|
4042
|
-
|
4124
|
+
var handleCalendarClickToday = function handleCalendarClickToday() {
|
4125
|
+
var today = new Date(); // set to midday to avoid UTC offset causing dates to be mismatched server side
|
4043
4126
|
|
4044
4127
|
today.setHours(12);
|
4045
4128
|
today.setMinutes(0);
|
@@ -4047,7 +4130,7 @@ const Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4047
4130
|
handleChange(today);
|
4048
4131
|
};
|
4049
4132
|
|
4050
|
-
|
4133
|
+
var className = cn('flex bg-white text-xs p-4', otherProps.className);
|
4051
4134
|
return React.createElement("div", {
|
4052
4135
|
"data-taco": "calendar"
|
4053
4136
|
}, React.createElement(ReactDayPicker, Object.assign({}, otherProps, {
|
@@ -4058,14 +4141,18 @@ const Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4058
4141
|
firstDayOfWeek: 1,
|
4059
4142
|
months: texts.calendar.months,
|
4060
4143
|
weekdaysShort: texts.calendar.weekdaysShort,
|
4061
|
-
navbarElement:
|
4062
|
-
|
4063
|
-
|
4064
|
-
|
4144
|
+
navbarElement: function navbarElement(navProps) {
|
4145
|
+
return React.createElement(Navbar, Object.assign({}, navProps, {
|
4146
|
+
onMonthChange: setVisibleMonth,
|
4147
|
+
value: visibleMonth
|
4148
|
+
}));
|
4149
|
+
},
|
4065
4150
|
onDayClick: handleDayClick,
|
4066
4151
|
onMonthChange: setVisibleMonth,
|
4067
4152
|
onTodayButtonClick: handleCalendarClickToday,
|
4068
|
-
captionElement: ()
|
4153
|
+
captionElement: function captionElement() {
|
4154
|
+
return null;
|
4155
|
+
},
|
4069
4156
|
todayButton: texts.calendar.actions.today,
|
4070
4157
|
showOutsideDays: true,
|
4071
4158
|
renderDay: renderDay,
|
@@ -4074,30 +4161,32 @@ const Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
|
|
4074
4161
|
})));
|
4075
4162
|
});
|
4076
4163
|
|
4077
|
-
|
4078
|
-
|
4079
|
-
|
4080
|
-
|
4081
|
-
|
4082
|
-
|
4083
|
-
|
4084
|
-
|
4085
|
-
|
4086
|
-
|
4087
|
-
|
4164
|
+
var _excluded$9 = ["checked", "highlighted", "indeterminate", "invalid", "label", "onChange"];
|
4165
|
+
var Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
4166
|
+
var checked = props.checked,
|
4167
|
+
highlighted = props.highlighted,
|
4168
|
+
indeterminate = props.indeterminate,
|
4169
|
+
invalid = props.invalid,
|
4170
|
+
label = props.label,
|
4171
|
+
onChange = props.onChange,
|
4172
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$9);
|
4173
|
+
|
4174
|
+
var className = cn('bg-white h-5 w-5 border rounded text-sm flex-shrink-0 self-start mt-[0.1rem]', {
|
4088
4175
|
'mr-2': !!label,
|
4089
4176
|
'border-grey-dark text-blue focus:border-blue focus:yt-focus': !props.disabled && !invalid,
|
4090
4177
|
'border-grey text-blue-light cursor-not-allowed': props.disabled,
|
4091
4178
|
'bg-[rgba(255,255,0,0.2)] disabled:bg-[rgba(255,255,0,0.075)]': highlighted,
|
4092
4179
|
'border-red text-red focus:border-red focus:yt-focus-red': invalid && !props.disabled
|
4093
4180
|
});
|
4094
|
-
|
4181
|
+
var handleChange;
|
4095
4182
|
|
4096
4183
|
if (onChange) {
|
4097
|
-
handleChange =
|
4184
|
+
handleChange = function handleChange(checked) {
|
4185
|
+
return onChange(checked === 'indeterminate' ? false : checked);
|
4186
|
+
};
|
4098
4187
|
}
|
4099
4188
|
|
4100
|
-
|
4189
|
+
var element = React.createElement(CheckboxPrimitive.Root, Object.assign({}, otherProps, {
|
4101
4190
|
"data-taco": "checkbox",
|
4102
4191
|
checked: indeterminate ? 'indeterminate' : checked,
|
4103
4192
|
className: className,
|
@@ -4111,7 +4200,7 @@ const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
|
|
4111
4200
|
})));
|
4112
4201
|
|
4113
4202
|
if (label) {
|
4114
|
-
|
4203
|
+
var labelClassName = cn('flex items-center cursor-pointer', {
|
4115
4204
|
'cursor-not-allowed text-grey-dark': props.disabled
|
4116
4205
|
}, props.className);
|
4117
4206
|
return React.createElement("label", {
|
@@ -4154,22 +4243,21 @@ const getButtonStateClasses = invalid => {
|
|
4154
4243
|
return '!border-grey-dark focus:!border-blue-light peer-focus:!border-blue-light peer-focus:peer-active:!border-blue-dark';
|
4155
4244
|
};
|
4156
4245
|
|
4157
|
-
|
4158
|
-
|
4159
|
-
|
4160
|
-
|
4161
|
-
|
4162
|
-
|
4163
|
-
|
4164
|
-
|
4165
|
-
|
4166
|
-
|
4167
|
-
|
4168
|
-
|
4169
|
-
const className = cn(getInputClasses(props), 'min-h-[theme(spacing.8)] pointer-events-all', {
|
4246
|
+
var _excluded$a = ["button", "icon", "highlighted", "invalid", "onKeyDown", "autoFocus"];
|
4247
|
+
var Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
4248
|
+
var button = props.button,
|
4249
|
+
icon = props.icon,
|
4250
|
+
invalid = props.invalid,
|
4251
|
+
onKeyDown = props.onKeyDown,
|
4252
|
+
autoFocus = props.autoFocus,
|
4253
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$a);
|
4254
|
+
|
4255
|
+
var inputRef = useProxiedRef(ref);
|
4256
|
+
var hasContainer = button || icon;
|
4257
|
+
var className = cn(getInputClasses(props), 'min-h-[theme(spacing.8)] pointer-events-all', {
|
4170
4258
|
'pr-8': !!hasContainer
|
4171
4259
|
}, !hasContainer && otherProps.className);
|
4172
|
-
React.useEffect(()
|
4260
|
+
React.useEffect(function () {
|
4173
4261
|
if (autoFocus && inputRef.current) {
|
4174
4262
|
inputRef.current.focus();
|
4175
4263
|
}
|
@@ -4177,10 +4265,10 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4177
4265
|
// if it has scroll height then the browser reverts to native scrolling behaviour only
|
4178
4266
|
// so we manually override it to ensure _our_ desired behaviour remains intact
|
4179
4267
|
|
4180
|
-
|
4268
|
+
var handleKeyDown = function handleKeyDown(event) {
|
4181
4269
|
if (event.key === 'Home' || event.key === 'End') {
|
4182
4270
|
event.preventDefault();
|
4183
|
-
|
4271
|
+
var position = event.key === 'End' ? event.currentTarget.value.length : 0;
|
4184
4272
|
event.currentTarget.setSelectionRange(position, position);
|
4185
4273
|
}
|
4186
4274
|
|
@@ -4189,7 +4277,7 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4189
4277
|
}
|
4190
4278
|
};
|
4191
4279
|
|
4192
|
-
|
4280
|
+
var input = React.createElement("input", Object.assign({}, otherProps, {
|
4193
4281
|
className: className,
|
4194
4282
|
"data-taco": "input",
|
4195
4283
|
onKeyDown: handleKeyDown,
|
@@ -4197,21 +4285,19 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4197
4285
|
}));
|
4198
4286
|
|
4199
4287
|
if (hasContainer) {
|
4200
|
-
|
4288
|
+
var extra;
|
4201
4289
|
|
4202
4290
|
if (button) {
|
4203
|
-
var _button$props$disable;
|
4291
|
+
var _button$props$disable, _cn;
|
4204
4292
|
|
4205
|
-
|
4206
|
-
|
4207
|
-
[getButtonStateClasses(invalid)]: !props.disabled
|
4208
|
-
}, button.props.className);
|
4293
|
+
var disabled = (_button$props$disable = button.props.disabled) !== null && _button$props$disable !== void 0 ? _button$props$disable : otherProps.disabled;
|
4294
|
+
var buttonClassName = cn('items-center flex justify-center border absolute rounded-l-none rounded-r right-0 h-full focus:rounded focus:outline-none', (_cn = {}, _cn[getButtonStateClasses(invalid)] = !props.disabled, _cn), button.props.className);
|
4209
4295
|
extra = React.cloneElement(button, {
|
4210
4296
|
className: buttonClassName,
|
4211
|
-
disabled
|
4297
|
+
disabled: disabled
|
4212
4298
|
});
|
4213
4299
|
} else if (icon) {
|
4214
|
-
|
4300
|
+
var iconClassName = cn('items-center flex justify-center absolute pointer-events-none mr-1 p-px right-0 w-5 top-1/2 -translate-y-1/2', {
|
4215
4301
|
'text-grey-dark': props.disabled,
|
4216
4302
|
'text-grey-darkest': !props.disabled
|
4217
4303
|
});
|
@@ -4223,7 +4309,7 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
4223
4309
|
});
|
4224
4310
|
}
|
4225
4311
|
|
4226
|
-
|
4312
|
+
var containerClassName = cn('bg-white inline-flex relative rounded w-full', otherProps.className);
|
4227
4313
|
return React.createElement("div", {
|
4228
4314
|
className: containerClassName,
|
4229
4315
|
"data-taco": "input-container"
|
@@ -4997,26 +5083,27 @@ var useBoundingClientRectListener = function useBoundingClientRectListener(ref)
|
|
4997
5083
|
return dimensions;
|
4998
5084
|
};
|
4999
5085
|
|
5000
|
-
|
5001
|
-
|
5002
|
-
|
5003
|
-
|
5004
|
-
|
5005
|
-
|
5006
|
-
|
5007
|
-
|
5008
|
-
|
5009
|
-
|
5010
|
-
|
5011
|
-
|
5012
|
-
|
5013
|
-
|
5014
|
-
|
5015
|
-
|
5016
|
-
|
5017
|
-
|
5018
|
-
|
5019
|
-
|
5086
|
+
var _excluded$b = ["className", "dialog", "style"];
|
5087
|
+
var Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
5088
|
+
var externalClassName = props.className,
|
5089
|
+
dialog = props.dialog,
|
5090
|
+
style = props.style,
|
5091
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$b);
|
5092
|
+
|
5093
|
+
var _useCombobox = useCombobox(otherProps, ref),
|
5094
|
+
combobox = _useCombobox.combobox,
|
5095
|
+
button = _useCombobox.button,
|
5096
|
+
input = _useCombobox.input,
|
5097
|
+
popover = _useCombobox.popover,
|
5098
|
+
list = _useCombobox.list;
|
5099
|
+
|
5100
|
+
var internalRef = React.useRef(null);
|
5101
|
+
|
5102
|
+
var _useLocalization = useLocalization(),
|
5103
|
+
texts = _useLocalization.texts;
|
5104
|
+
|
5105
|
+
var selectDimensions = useBoundingClientRectListener(internalRef);
|
5106
|
+
var className = cn('inline-flex relative', {
|
5020
5107
|
'yt-combobox--inline': props.inline
|
5021
5108
|
}, externalClassName);
|
5022
5109
|
return React.createElement("span", {
|
@@ -5035,7 +5122,7 @@ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5035
5122
|
appearance: "discrete",
|
5036
5123
|
className: "!border-l-0 focus:!border-none focus:!shadow-none active:!border-none",
|
5037
5124
|
icon: popover.open ? 'chevron-up' : 'chevron-down',
|
5038
|
-
onClick: ()
|
5125
|
+
onClick: function onClick() {
|
5039
5126
|
var _input$ref$current;
|
5040
5127
|
|
5041
5128
|
popover.onOpenChange(true);
|
@@ -5046,7 +5133,7 @@ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5046
5133
|
icon: "list-search",
|
5047
5134
|
disabled: props.readOnly || props.disabled,
|
5048
5135
|
dialog: dialog,
|
5049
|
-
onFocus: event
|
5136
|
+
onFocus: function onFocus(event) {
|
5050
5137
|
var _input$ref$current2;
|
5051
5138
|
|
5052
5139
|
// Prevents the default focus behaviour of showing the tooltip, on parent tooltip element
|
@@ -5059,7 +5146,7 @@ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
5059
5146
|
}) : undefined
|
5060
5147
|
})))), React.createElement(PopoverPrimitive.Content, {
|
5061
5148
|
align: "start",
|
5062
|
-
onOpenAutoFocus: event
|
5149
|
+
onOpenAutoFocus: function onOpenAutoFocus(event) {
|
5063
5150
|
event.preventDefault();
|
5064
5151
|
},
|
5065
5152
|
sideOffset: 4
|
@@ -5293,18 +5380,19 @@ function mergeRefs(refs) {
|
|
5293
5380
|
};
|
5294
5381
|
}
|
5295
5382
|
|
5296
|
-
|
5383
|
+
var _excluded$c = ["children", "trigger"];
|
5384
|
+
var PopoverContext = /*#__PURE__*/React.createContext({
|
5297
5385
|
props: {},
|
5298
5386
|
ref: null
|
5299
5387
|
});
|
5300
|
-
|
5388
|
+
var Trigger$1 = /*#__PURE__*/React.forwardRef(function PopoverTrigger(props, ref) {
|
5301
5389
|
var _props$children;
|
5302
5390
|
|
5303
|
-
|
5304
|
-
|
5391
|
+
var context = React.useContext(PopoverContext);
|
5392
|
+
var children = props.children;
|
5305
5393
|
|
5306
5394
|
if (React.isValidElement(props.children) && typeof ((_props$children = props.children) === null || _props$children === void 0 ? void 0 : _props$children.type) === 'function') {
|
5307
|
-
console.warn(
|
5395
|
+
console.warn("Popover.Trigger requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '" + props.children.type.name + "' in React.forwardRef()? Taco has wrapped '" + props.children.type.name + "' in a 'span' to maintain functionality, but this may cause unintended behaviour");
|
5308
5396
|
children = React.createElement("span", null, props.children);
|
5309
5397
|
}
|
5310
5398
|
|
@@ -5314,22 +5402,22 @@ const Trigger$1 = /*#__PURE__*/React.forwardRef(function PopoverTrigger(props, r
|
|
5314
5402
|
asChild: true
|
5315
5403
|
}));
|
5316
5404
|
});
|
5317
|
-
|
5318
|
-
children,
|
5319
|
-
|
5320
|
-
|
5321
|
-
|
5405
|
+
var RenderPropWrapper = /*#__PURE__*/React.forwardRef(function RenderPropWrapper(_ref, ref) {
|
5406
|
+
var children = _ref.children,
|
5407
|
+
onClick = _ref.onClick;
|
5408
|
+
|
5409
|
+
var close = function close() {
|
5322
5410
|
onClick(new CustomEvent('hide'));
|
5323
5411
|
};
|
5324
5412
|
|
5325
5413
|
return children({
|
5326
|
-
close,
|
5327
|
-
ref
|
5414
|
+
close: close,
|
5415
|
+
ref: ref
|
5328
5416
|
});
|
5329
5417
|
});
|
5330
|
-
|
5331
|
-
|
5332
|
-
|
5418
|
+
var Content$1 = /*#__PURE__*/React.forwardRef(function PopoverContent(props, ref) {
|
5419
|
+
var className = cn('bg-white focus:border-blue-light', props.className);
|
5420
|
+
var output;
|
5333
5421
|
|
5334
5422
|
if (typeof props.children === 'function') {
|
5335
5423
|
output = React.createElement(PopoverPrimitive.Close, {
|
@@ -5347,20 +5435,23 @@ const Content$1 = /*#__PURE__*/React.forwardRef(function PopoverContent(props, r
|
|
5347
5435
|
className: "text-white"
|
5348
5436
|
}));
|
5349
5437
|
});
|
5350
|
-
|
5351
|
-
|
5352
|
-
|
5353
|
-
|
5354
|
-
|
5355
|
-
|
5356
|
-
|
5357
|
-
|
5358
|
-
|
5359
|
-
|
5360
|
-
|
5361
|
-
|
5362
|
-
|
5363
|
-
|
5438
|
+
var Close$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
5439
|
+
return React.createElement(PopoverPrimitive.Close, Object.assign({}, props, {
|
5440
|
+
ref: ref,
|
5441
|
+
asChild: true
|
5442
|
+
}));
|
5443
|
+
});
|
5444
|
+
var Popover = /*#__PURE__*/React.forwardRef(function Popover(props, ref) {
|
5445
|
+
var children = props.children,
|
5446
|
+
trigger = props.trigger,
|
5447
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$c);
|
5448
|
+
|
5449
|
+
var context = React.useMemo(function () {
|
5450
|
+
return {
|
5451
|
+
props: otherProps,
|
5452
|
+
ref: ref
|
5453
|
+
};
|
5454
|
+
}, [otherProps]);
|
5364
5455
|
return React.createElement(PopoverContext.Provider, {
|
5365
5456
|
value: context
|
5366
5457
|
}, React.createElement(PopoverPrimitive.Root, null, trigger && React.createElement(Trigger$1, null, trigger), children));
|
@@ -5369,25 +5460,25 @@ Popover.Trigger = Trigger$1;
|
|
5369
5460
|
Popover.Content = Content$1;
|
5370
5461
|
Popover.Close = Close$1;
|
5371
5462
|
|
5372
|
-
|
5463
|
+
var _excluded$d = ["className", "onReset", "style", "shortcuts", "shortcutsText"];
|
5464
|
+
var Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref) {
|
5373
5465
|
var _input$disabled;
|
5374
5466
|
|
5375
|
-
|
5376
|
-
|
5377
|
-
|
5378
|
-
|
5379
|
-
|
5380
|
-
|
5381
|
-
|
5382
|
-
|
5383
|
-
|
5384
|
-
|
5385
|
-
|
5386
|
-
|
5387
|
-
|
5388
|
-
|
5389
|
-
|
5390
|
-
const className = cn('inline-flex w-full text-black font-normal', externalClassName);
|
5467
|
+
var externalClassName = props.className,
|
5468
|
+
handleReset = props.onReset,
|
5469
|
+
style = props.style,
|
5470
|
+
shortcuts = props.shortcuts,
|
5471
|
+
shortcutsText = props.shortcutsText,
|
5472
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$d);
|
5473
|
+
|
5474
|
+
var _useDatepicker = useDatepicker(otherProps, ref),
|
5475
|
+
calendar = _useDatepicker.calendar,
|
5476
|
+
input = _useDatepicker.input;
|
5477
|
+
|
5478
|
+
var _useLocalization = useLocalization(),
|
5479
|
+
texts = _useLocalization.texts;
|
5480
|
+
|
5481
|
+
var className = cn('inline-flex w-full text-black font-normal', externalClassName);
|
5391
5482
|
return React.createElement("span", {
|
5392
5483
|
className: className,
|
5393
5484
|
"data-taco": "datepicker",
|
@@ -5397,37 +5488,40 @@ const Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref)
|
|
5397
5488
|
"aria-label": texts.datepicker.expand,
|
5398
5489
|
disabled: (_input$disabled = input.disabled) !== null && _input$disabled !== void 0 ? _input$disabled : input.readOnly,
|
5399
5490
|
icon: "calendar"
|
5400
|
-
})), React.createElement(Popover.Content, null, ({
|
5401
|
-
close
|
5402
|
-
|
5403
|
-
|
5404
|
-
|
5405
|
-
|
5406
|
-
|
5407
|
-
|
5408
|
-
|
5409
|
-
|
5410
|
-
|
5411
|
-
|
5412
|
-
|
5413
|
-
|
5414
|
-
|
5415
|
-
|
5416
|
-
|
5417
|
-
|
5418
|
-
|
5419
|
-
|
5420
|
-
|
5421
|
-
|
5422
|
-
|
5423
|
-
|
5424
|
-
|
5425
|
-
|
5426
|
-
|
5427
|
-
|
5428
|
-
|
5429
|
-
|
5430
|
-
|
5491
|
+
})), React.createElement(Popover.Content, null, function (_ref) {
|
5492
|
+
var close = _ref.close;
|
5493
|
+
return React.createElement("div", {
|
5494
|
+
className: "flex -m-3"
|
5495
|
+
}, React.createElement(Calendar$1, Object.assign({}, calendar, {
|
5496
|
+
onChange: function onChange(date, event) {
|
5497
|
+
calendar.onChange(date, event);
|
5498
|
+
close();
|
5499
|
+
},
|
5500
|
+
tabIndex: -1
|
5501
|
+
})), shortcuts && React.createElement("div", {
|
5502
|
+
className: "border-l border-grey-dark flex flex-col"
|
5503
|
+
}, React.createElement("span", {
|
5504
|
+
className: "font-semibold text-xs m-4 flex items-center h-8 w-32 mb-3"
|
5505
|
+
}, shortcutsText !== null && shortcutsText !== void 0 ? shortcutsText : texts.datepicker.shortcuts), React.createElement("ul", null, shortcuts.map(function (shortcut, i) {
|
5506
|
+
return React.createElement("li", {
|
5507
|
+
key: i
|
5508
|
+
}, React.createElement("button", {
|
5509
|
+
className: "w-full px-4 py-1 flex items-start hover:bg-grey-light text-xs",
|
5510
|
+
onClick: function onClick(event) {
|
5511
|
+
event.persist();
|
5512
|
+
shortcut.onClick(event);
|
5513
|
+
close();
|
5514
|
+
}
|
5515
|
+
}, shortcut.text));
|
5516
|
+
})), handleReset && React.createElement("button", {
|
5517
|
+
className: "text-blue hover:text-blue-light inline-flex border-none bg-transparent text-xs cursor-pointer mt-auto my-4 mx-auto",
|
5518
|
+
onClick: function onClick(event) {
|
5519
|
+
event.persist();
|
5520
|
+
handleReset(event);
|
5521
|
+
close();
|
5522
|
+
}
|
5523
|
+
}, texts.datepicker.clear)));
|
5524
|
+
}))
|
5431
5525
|
})));
|
5432
5526
|
});
|
5433
5527
|
|
@@ -5670,12 +5764,14 @@ const Extra = /*#__PURE__*/React.forwardRef(function DialogExtra(props, ref) {
|
|
5670
5764
|
});
|
5671
5765
|
Extra.displayName = 'DialogExtra';
|
5672
5766
|
|
5673
|
-
|
5674
|
-
|
5675
|
-
|
5676
|
-
|
5677
|
-
|
5678
|
-
|
5767
|
+
var _excluded$e = ["children", "closeOnEscape", "defaultOpen", "draggable", "onChange", "onClose", "open", "showCloseButton", "size", "trigger"];
|
5768
|
+
|
5769
|
+
var useSeparatedChildren = function useSeparatedChildren(initialChildren) {
|
5770
|
+
return React.useMemo(function () {
|
5771
|
+
var children = [];
|
5772
|
+
var drawer;
|
5773
|
+
var extra;
|
5774
|
+
React.Children.toArray(initialChildren).forEach(function (child) {
|
5679
5775
|
var _child$type, _child$type2;
|
5680
5776
|
|
5681
5777
|
if (((_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === Drawer.displayName) {
|
@@ -5690,39 +5786,55 @@ const useSeparatedChildren = initialChildren => {
|
|
5690
5786
|
}, [initialChildren]);
|
5691
5787
|
};
|
5692
5788
|
|
5693
|
-
|
5694
|
-
|
5695
|
-
|
5696
|
-
|
5697
|
-
|
5698
|
-
|
5699
|
-
|
5700
|
-
|
5701
|
-
|
5702
|
-
|
5703
|
-
|
5704
|
-
|
5705
|
-
|
5706
|
-
|
5707
|
-
|
5708
|
-
|
5709
|
-
|
5710
|
-
|
5711
|
-
|
5712
|
-
|
5713
|
-
|
5714
|
-
|
5715
|
-
|
5716
|
-
|
5717
|
-
|
5718
|
-
|
5719
|
-
|
5720
|
-
|
5721
|
-
|
5722
|
-
|
5723
|
-
|
5724
|
-
|
5725
|
-
|
5789
|
+
var Dialog = /*#__PURE__*/React.forwardRef(function Dialog(props, ref) {
|
5790
|
+
var initialChildren = props.children,
|
5791
|
+
_props$closeOnEscape = props.closeOnEscape,
|
5792
|
+
closeOnEscape = _props$closeOnEscape === void 0 ? true : _props$closeOnEscape,
|
5793
|
+
defaultOpen = props.defaultOpen,
|
5794
|
+
_props$draggable = props.draggable,
|
5795
|
+
draggable = _props$draggable === void 0 ? false : _props$draggable,
|
5796
|
+
onChange = props.onChange,
|
5797
|
+
onClose = props.onClose,
|
5798
|
+
open = props.open,
|
5799
|
+
_props$showCloseButto = props.showCloseButton,
|
5800
|
+
showCloseButton = _props$showCloseButto === void 0 ? true : _props$showCloseButto,
|
5801
|
+
_props$size = props.size,
|
5802
|
+
size = _props$size === void 0 ? 'sm' : _props$size,
|
5803
|
+
trigger = props.trigger,
|
5804
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$e);
|
5805
|
+
|
5806
|
+
var _useSeparatedChildren = useSeparatedChildren(initialChildren),
|
5807
|
+
children = _useSeparatedChildren[0],
|
5808
|
+
drawer = _useSeparatedChildren[1],
|
5809
|
+
extra = _useSeparatedChildren[2];
|
5810
|
+
|
5811
|
+
var _React$useState = React.useState(false),
|
5812
|
+
drawerOpen = _React$useState[0],
|
5813
|
+
setDrawerOpen = _React$useState[1];
|
5814
|
+
|
5815
|
+
var context = React.useMemo(function () {
|
5816
|
+
return {
|
5817
|
+
closeOnEscape: closeOnEscape,
|
5818
|
+
draggable: draggable,
|
5819
|
+
drawer: {
|
5820
|
+
open: drawerOpen,
|
5821
|
+
toggle: function toggle() {
|
5822
|
+
return setDrawerOpen(function (isDrawerOpen) {
|
5823
|
+
return !isDrawerOpen;
|
5824
|
+
});
|
5825
|
+
}
|
5826
|
+
},
|
5827
|
+
elements: {
|
5828
|
+
drawer: drawer,
|
5829
|
+
extra: extra
|
5830
|
+
},
|
5831
|
+
onClose: onClose,
|
5832
|
+
props: otherProps,
|
5833
|
+
showCloseButton: showCloseButton,
|
5834
|
+
size: size,
|
5835
|
+
ref: ref
|
5836
|
+
};
|
5837
|
+
}, [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]);
|
5726
5838
|
return React.createElement(DialogContext.Provider, {
|
5727
5839
|
value: context
|
5728
5840
|
}, React.createElement(DialogPrimitive.Root, {
|
@@ -5739,18 +5851,19 @@ Dialog.Extra = Extra;
|
|
5739
5851
|
Dialog.Drawer = Drawer;
|
5740
5852
|
Dialog.Close = Close$2;
|
5741
5853
|
|
5742
|
-
|
5743
|
-
|
5744
|
-
|
5745
|
-
|
5746
|
-
|
5747
|
-
|
5748
|
-
|
5749
|
-
|
5750
|
-
|
5854
|
+
var _excluded$f = ["disabled", "children", "invalid", "message"];
|
5855
|
+
var Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
|
5856
|
+
var disabled = props.disabled,
|
5857
|
+
children = props.children,
|
5858
|
+
_props$invalid = props.invalid,
|
5859
|
+
invalid = _props$invalid === void 0 ? false : _props$invalid,
|
5860
|
+
message = props.message,
|
5861
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$f);
|
5862
|
+
|
5863
|
+
var className = cn('flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]', {
|
5751
5864
|
'text-grey-dark': disabled
|
5752
5865
|
}, props.className);
|
5753
|
-
|
5866
|
+
var messageClassName = cn('h-4 text-xs text-left leading-normal font-normal truncate -mb-4', {
|
5754
5867
|
'text-grey-darkest': !invalid,
|
5755
5868
|
'text-red': invalid,
|
5756
5869
|
'opacity-50': disabled
|
@@ -5765,12 +5878,13 @@ const Field = /*#__PURE__*/React.forwardRef(function Field(props, ref) {
|
|
5765
5878
|
}, message));
|
5766
5879
|
});
|
5767
5880
|
|
5768
|
-
|
5769
|
-
|
5770
|
-
|
5771
|
-
|
5772
|
-
|
5773
|
-
|
5881
|
+
var _excluded$g = ["horizontal"];
|
5882
|
+
var Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
|
5883
|
+
var _props$horizontal = props.horizontal,
|
5884
|
+
horizontal = _props$horizontal === void 0 ? false : _props$horizontal,
|
5885
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$g);
|
5886
|
+
|
5887
|
+
var className = cn('yt-form', {
|
5774
5888
|
'yt-form--horizontal flex flex-wrap': horizontal
|
5775
5889
|
}, props.className);
|
5776
5890
|
return React.createElement("form", Object.assign({}, otherProps, {
|
@@ -5780,12 +5894,13 @@ const Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
|
|
5780
5894
|
}));
|
5781
5895
|
});
|
5782
5896
|
|
5783
|
-
|
5784
|
-
|
5785
|
-
|
5786
|
-
|
5787
|
-
|
5788
|
-
|
5897
|
+
var _excluded$h = ["as"];
|
5898
|
+
var Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
|
5899
|
+
var _props$as = props.as,
|
5900
|
+
Tag = _props$as === void 0 ? 'span' : _props$as,
|
5901
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$h);
|
5902
|
+
|
5903
|
+
var className = cn('flex ', props.className);
|
5789
5904
|
return React.createElement(Tag, Object.assign({}, otherProps, {
|
5790
5905
|
className: className,
|
5791
5906
|
"data-taco": "group",
|
@@ -5793,18 +5908,19 @@ const Group = /*#__PURE__*/React.forwardRef(function Group(props, ref) {
|
|
5793
5908
|
}));
|
5794
5909
|
});
|
5795
5910
|
|
5796
|
-
|
5911
|
+
var _excluded$i = ["anchor", "children", "defaultOpen"];
|
5912
|
+
var HangerContext = /*#__PURE__*/React.createContext({
|
5797
5913
|
props: {},
|
5798
5914
|
ref: null
|
5799
5915
|
});
|
5800
|
-
|
5916
|
+
var Anchor = /*#__PURE__*/React.forwardRef(function HangerAnchor(props, ref) {
|
5801
5917
|
var _props$children;
|
5802
5918
|
|
5803
|
-
|
5804
|
-
|
5919
|
+
var context = React.useContext(HangerContext);
|
5920
|
+
var children = props.children;
|
5805
5921
|
|
5806
5922
|
if (React.isValidElement(props.children) && typeof ((_props$children = props.children) === null || _props$children === void 0 ? void 0 : _props$children.type) === 'function') {
|
5807
|
-
console.warn(
|
5923
|
+
console.warn("Hanger.Anchor requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '" + props.children.type.name + "' in React.forwardRef()? Taco has wrapped '" + props.children.type.name + "' in a 'span' to maintain functionality, but this may cause unintended behaviour");
|
5808
5924
|
children = React.createElement("span", null, props.children);
|
5809
5925
|
}
|
5810
5926
|
|
@@ -5814,14 +5930,15 @@ const Anchor = /*#__PURE__*/React.forwardRef(function HangerAnchor(props, ref) {
|
|
5814
5930
|
asChild: true
|
5815
5931
|
}));
|
5816
5932
|
});
|
5817
|
-
|
5818
|
-
|
5819
|
-
|
5820
|
-
|
5821
|
-
|
5822
|
-
const className = cn('wcag-blue border border-transparent rounded p-3 pr-12 yt-shadow z-[996] focus:border-transparent', props.className);
|
5933
|
+
var Content$3 = /*#__PURE__*/React.forwardRef(function HangerContent(props, ref) {
|
5934
|
+
var context = React.useContext(HangerContext);
|
5935
|
+
|
5936
|
+
var _useLocalization = useLocalization(),
|
5937
|
+
texts = _useLocalization.texts;
|
5823
5938
|
|
5824
|
-
|
5939
|
+
var className = cn('wcag-blue border border-transparent rounded p-3 pr-12 yt-shadow z-[996] focus:border-transparent', props.className);
|
5940
|
+
|
5941
|
+
var handleInteractOutside = function handleInteractOutside(event) {
|
5825
5942
|
event.preventDefault();
|
5826
5943
|
};
|
5827
5944
|
|
@@ -5843,20 +5960,25 @@ const Content$3 = /*#__PURE__*/React.forwardRef(function HangerContent(props, re
|
|
5843
5960
|
onClick: context.props.onClose
|
5844
5961
|
})));
|
5845
5962
|
});
|
5846
|
-
|
5847
|
-
|
5848
|
-
|
5849
|
-
|
5850
|
-
|
5851
|
-
|
5852
|
-
|
5853
|
-
|
5854
|
-
|
5855
|
-
|
5856
|
-
|
5963
|
+
var Hanger = /*#__PURE__*/React.forwardRef(function Hanger(props, ref) {
|
5964
|
+
var anchor = props.anchor,
|
5965
|
+
children = props.children,
|
5966
|
+
_props$defaultOpen = props.defaultOpen,
|
5967
|
+
defaultOpen = _props$defaultOpen === void 0 ? true : _props$defaultOpen,
|
5968
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$i);
|
5969
|
+
|
5970
|
+
var context = React.useMemo(function () {
|
5971
|
+
return {
|
5972
|
+
props: otherProps,
|
5973
|
+
ref: ref
|
5974
|
+
};
|
5975
|
+
}, [otherProps]); // we do this to ensure hangers are mounted after their containers, e.g. if the container is another portal
|
5857
5976
|
|
5858
|
-
|
5859
|
-
|
5977
|
+
var _React$useState = React.useState(false),
|
5978
|
+
open = _React$useState[0],
|
5979
|
+
setOpen = _React$useState[1];
|
5980
|
+
|
5981
|
+
React.useEffect(function () {
|
5860
5982
|
if (defaultOpen) {
|
5861
5983
|
setOpen(defaultOpen);
|
5862
5984
|
}
|
@@ -6215,49 +6337,49 @@ const useMultiListbox = ({
|
|
6215
6337
|
};
|
6216
6338
|
};
|
6217
6339
|
|
6218
|
-
|
6219
|
-
|
6220
|
-
|
6221
|
-
|
6222
|
-
|
6223
|
-
|
6224
|
-
|
6225
|
-
|
6226
|
-
|
6227
|
-
|
6340
|
+
var _excluded$j = ["className"],
|
6341
|
+
_excluded2$1 = ["className"];
|
6342
|
+
var Listbox = /*#__PURE__*/React.forwardRef(function Listbox(props, ref) {
|
6343
|
+
var externalClassName = props.className,
|
6344
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$j);
|
6345
|
+
|
6346
|
+
var _useListbox = useListbox(otherProps, ref),
|
6347
|
+
list = _useListbox.list,
|
6348
|
+
input = _useListbox.input;
|
6349
|
+
|
6350
|
+
var className = cn('bg-white inline-flex relative w-full', externalClassName);
|
6228
6351
|
return React.createElement("span", {
|
6229
6352
|
"data-taco": "listbox",
|
6230
6353
|
className: className
|
6231
6354
|
}, React.createElement(ScrollableList, Object.assign({}, list, {
|
6232
|
-
style: {
|
6355
|
+
style: _extends({}, list.style, {
|
6233
6356
|
maxHeight: 'calc(12rem + 2px)'
|
6234
6357
|
/* (6 * option height) + listbox border */
|
6235
6358
|
|
6236
|
-
}
|
6359
|
+
})
|
6237
6360
|
})), React.createElement("input", Object.assign({}, input, {
|
6238
6361
|
className: "hidden",
|
6239
6362
|
type: "text"
|
6240
6363
|
})));
|
6241
6364
|
});
|
6242
|
-
|
6243
|
-
|
6244
|
-
|
6245
|
-
|
6246
|
-
|
6247
|
-
|
6248
|
-
|
6249
|
-
|
6250
|
-
|
6251
|
-
const className = cn('bg-white inline-flex relative w-full', externalClassName);
|
6365
|
+
var MultiListbox = /*#__PURE__*/React.forwardRef(function Listbox(props, ref) {
|
6366
|
+
var externalClassName = props.className,
|
6367
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded2$1);
|
6368
|
+
|
6369
|
+
var _useMultiListbox = useMultiListbox(otherProps, ref),
|
6370
|
+
list = _useMultiListbox.list,
|
6371
|
+
input = _useMultiListbox.input;
|
6372
|
+
|
6373
|
+
var className = cn('bg-white inline-flex relative w-full', externalClassName);
|
6252
6374
|
return React.createElement("span", {
|
6253
6375
|
"data-taco": "listbox",
|
6254
6376
|
className: className
|
6255
6377
|
}, React.createElement(ScrollableList, Object.assign({}, list, {
|
6256
|
-
style: {
|
6378
|
+
style: _extends({}, list.style, {
|
6257
6379
|
maxHeight: 'calc(12rem + 2px + 2px)'
|
6258
6380
|
/* (6 * option height) + listbox border + ALL_OPTIONS bottom border */
|
6259
6381
|
|
6260
|
-
}
|
6382
|
+
})
|
6261
6383
|
})), React.createElement("input", Object.assign({}, input, {
|
6262
6384
|
className: "hidden",
|
6263
6385
|
type: "text"
|
@@ -6520,26 +6642,34 @@ const Checkbox$1 = props => {
|
|
6520
6642
|
})), children);
|
6521
6643
|
};
|
6522
6644
|
|
6523
|
-
|
6524
|
-
|
6525
|
-
|
6645
|
+
var _excluded$k = ["children", "value"],
|
6646
|
+
_excluded2$2 = ["children", "defaultValue", "disabled", "invalid", "onChange", "orientation", "value"];
|
6647
|
+
var getRadioGroupItemValueAsString = function getRadioGroupItemValueAsString(value) {
|
6648
|
+
return value === null ? '' : String(value);
|
6649
|
+
};
|
6650
|
+
var findByValue$1 = function findByValue(values, valueAsString) {
|
6651
|
+
return values.find(function (value) {
|
6652
|
+
return getRadioGroupItemValueAsString(value) === valueAsString;
|
6653
|
+
});
|
6654
|
+
};
|
6655
|
+
var RadioGroupContext = /*#__PURE__*/React.createContext({
|
6526
6656
|
disabled: false,
|
6527
6657
|
invalid: false
|
6528
6658
|
});
|
6529
|
-
|
6530
|
-
|
6531
|
-
|
6532
|
-
|
6533
|
-
|
6534
|
-
|
6535
|
-
|
6536
|
-
|
6537
|
-
|
6659
|
+
var RadioGroupItem = /*#__PURE__*/React.forwardRef(function RadioGroupItem(props, ref) {
|
6660
|
+
var context = React.useContext(RadioGroupContext);
|
6661
|
+
|
6662
|
+
var children = props.children,
|
6663
|
+
value = props.value,
|
6664
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$k);
|
6665
|
+
|
6666
|
+
var disabled = context.disabled || props.disabled;
|
6667
|
+
var className = cn('flex flex-shrink-0 self-start items-center justify-center h-4 w-4 mr-2 mt-[0.2rem] rounded-full bg-white border-2 ', {
|
6538
6668
|
'border-grey-dark focus:border-blue focus:yt-focus aria-checked:bg-blue aria-checked:border-blue': !disabled && !context.invalid,
|
6539
6669
|
'border-grey cursor-not-allowed aria-checked:bg-grey-dark aria-checked:border-grey-dark': disabled,
|
6540
6670
|
'border-red text-red focus:border-red focus:yt-focus-red aria-checked:bg-red aria-checked:border-red': context.invalid && !disabled
|
6541
6671
|
});
|
6542
|
-
|
6672
|
+
var labelClassName = cn('flex items-center cursor-pointer', {
|
6543
6673
|
'cursor-not-allowed text-grey-dark': disabled
|
6544
6674
|
}, props.className);
|
6545
6675
|
return React.createElement("label", {
|
@@ -6553,34 +6683,38 @@ const RadioGroupItem = /*#__PURE__*/React.forwardRef(function RadioGroupItem(pro
|
|
6553
6683
|
className: "h-2 w-2 rounded-full bg-white"
|
6554
6684
|
})), children);
|
6555
6685
|
});
|
6556
|
-
|
6557
|
-
|
6558
|
-
|
6559
|
-
|
6560
|
-
|
6561
|
-
|
6562
|
-
|
6563
|
-
|
6564
|
-
|
6565
|
-
|
6566
|
-
|
6567
|
-
|
6568
|
-
|
6569
|
-
React.Children.forEach(children, child
|
6686
|
+
var useRadioGroup = function useRadioGroup(props) {
|
6687
|
+
var children = props.children,
|
6688
|
+
defaultValue = props.defaultValue,
|
6689
|
+
disabled = props.disabled,
|
6690
|
+
invalid = props.invalid,
|
6691
|
+
onChange = props.onChange,
|
6692
|
+
_props$orientation = props.orientation,
|
6693
|
+
orientation = _props$orientation === void 0 ? 'vertical' : _props$orientation,
|
6694
|
+
value = props.value,
|
6695
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded2$2);
|
6696
|
+
|
6697
|
+
var values = React.useMemo(function () {
|
6698
|
+
var radioGroupItemValues = [];
|
6699
|
+
React.Children.forEach(children, function (child) {
|
6570
6700
|
if (React.isValidElement(child)) {
|
6571
6701
|
radioGroupItemValues.push(child.props.value);
|
6572
6702
|
}
|
6573
6703
|
});
|
6574
6704
|
return radioGroupItemValues;
|
6575
6705
|
}, [children]);
|
6576
|
-
|
6577
|
-
|
6578
|
-
|
6579
|
-
|
6580
|
-
|
6706
|
+
var context = React.useMemo(function () {
|
6707
|
+
return {
|
6708
|
+
disabled: disabled !== null && disabled !== void 0 ? disabled : false,
|
6709
|
+
invalid: invalid !== null && invalid !== void 0 ? invalid : false
|
6710
|
+
};
|
6711
|
+
}, [disabled, invalid]);
|
6712
|
+
var valueProps;
|
6581
6713
|
|
6582
6714
|
if (onChange !== undefined) {
|
6583
|
-
|
6715
|
+
var handleChange = function handleChange(value) {
|
6716
|
+
return onChange(findByValue$1(values, value));
|
6717
|
+
};
|
6584
6718
|
|
6585
6719
|
valueProps = {
|
6586
6720
|
onValueChange: handleChange,
|
@@ -6593,20 +6727,19 @@ const useRadioGroup = props => {
|
|
6593
6727
|
}
|
6594
6728
|
|
6595
6729
|
return {
|
6596
|
-
context,
|
6597
|
-
props: {
|
6598
|
-
|
6599
|
-
|
6600
|
-
|
6601
|
-
}
|
6730
|
+
context: context,
|
6731
|
+
props: _extends({}, otherProps, valueProps, {
|
6732
|
+
children: children,
|
6733
|
+
orientation: orientation
|
6734
|
+
})
|
6602
6735
|
};
|
6603
6736
|
};
|
6604
|
-
|
6605
|
-
|
6606
|
-
|
6607
|
-
|
6608
|
-
|
6609
|
-
|
6737
|
+
var RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref) {
|
6738
|
+
var _useRadioGroup = useRadioGroup(props),
|
6739
|
+
context = _useRadioGroup.context,
|
6740
|
+
otherProps = _useRadioGroup.props;
|
6741
|
+
|
6742
|
+
var className = cn('flex items-start', {
|
6610
6743
|
'flex-wrap space-x-4': otherProps.orientation === 'horizontal',
|
6611
6744
|
'flex-col space-y-2': otherProps.orientation === 'vertical'
|
6612
6745
|
}, otherProps.className);
|
@@ -6719,26 +6852,48 @@ const Header = props => {
|
|
6719
6852
|
}));
|
6720
6853
|
};
|
6721
6854
|
|
6722
|
-
|
6723
|
-
|
6724
|
-
|
6725
|
-
|
6726
|
-
|
6727
|
-
|
6728
|
-
|
6729
|
-
|
6730
|
-
|
6731
|
-
|
6732
|
-
|
6733
|
-
|
6734
|
-
|
6735
|
-
|
6736
|
-
|
6737
|
-
|
6738
|
-
|
6739
|
-
|
6740
|
-
|
6741
|
-
|
6855
|
+
var _excluded$l = ["appearance", "children", "trigger"];
|
6856
|
+
var Menu = function Menu(externalProps) {
|
6857
|
+
var externalAppearance = externalProps.appearance,
|
6858
|
+
children = externalProps.children,
|
6859
|
+
trigger = externalProps.trigger,
|
6860
|
+
props = _objectWithoutPropertiesLoose(externalProps, _excluded$l);
|
6861
|
+
|
6862
|
+
var _React$useState = React.useState(false),
|
6863
|
+
open = _React$useState[0],
|
6864
|
+
setOpen = _React$useState[1];
|
6865
|
+
|
6866
|
+
var _React$useState2 = React.useState(externalAppearance !== null && externalAppearance !== void 0 ? externalAppearance : 'default'),
|
6867
|
+
appearance = _React$useState2[0],
|
6868
|
+
_setAppearance = _React$useState2[1];
|
6869
|
+
|
6870
|
+
var _React$useState3 = React.useState(false),
|
6871
|
+
indented = _React$useState3[0],
|
6872
|
+
setIndented = _React$useState3[1];
|
6873
|
+
|
6874
|
+
var _React$useState4 = React.useState(undefined),
|
6875
|
+
minWidth = _React$useState4[0],
|
6876
|
+
_setMinWidth = _React$useState4[1];
|
6877
|
+
|
6878
|
+
var context = React.useMemo(function () {
|
6879
|
+
return {
|
6880
|
+
appearance: appearance,
|
6881
|
+
setAppearance: function setAppearance(appearance) {
|
6882
|
+
return _setAppearance(appearance);
|
6883
|
+
},
|
6884
|
+
indented: indented,
|
6885
|
+
registerIndentation: function registerIndentation() {
|
6886
|
+
return setIndented(true);
|
6887
|
+
},
|
6888
|
+
minWidth: minWidth,
|
6889
|
+
setMinWidth: function setMinWidth(width) {
|
6890
|
+
return _setMinWidth(width);
|
6891
|
+
},
|
6892
|
+
close: function close() {
|
6893
|
+
return setOpen(false);
|
6894
|
+
}
|
6895
|
+
};
|
6896
|
+
}, [indented, minWidth, appearance]);
|
6742
6897
|
return React.createElement(MenuContext.Provider, {
|
6743
6898
|
value: context
|
6744
6899
|
}, React.createElement(DropdownMenuPrimitive.Root, Object.assign({}, props, {
|
@@ -6756,39 +6911,44 @@ Menu.Separator = Separator;
|
|
6756
6911
|
Menu.Header = Header;
|
6757
6912
|
Menu.RadioGroup = RadioGroup$1;
|
6758
6913
|
|
6759
|
-
|
6914
|
+
var _excluded$m = ["children", "className", "expanded", "title", "fixed", "onClick"];
|
6915
|
+
var TreeviewItem = /*#__PURE__*/React__default.forwardRef(function TreeviewItem(props, ref) {
|
6760
6916
|
return React__default.createElement("a", Object.assign({}, props, {
|
6761
6917
|
ref: ref
|
6762
6918
|
}));
|
6763
6919
|
});
|
6764
|
-
|
6765
|
-
|
6766
|
-
|
6767
|
-
|
6768
|
-
|
6769
|
-
|
6770
|
-
|
6771
|
-
|
6772
|
-
|
6773
|
-
|
6774
|
-
|
6775
|
-
|
6920
|
+
var TreeviewGroup = /*#__PURE__*/React__default.forwardRef(function TreeviewGroup(props, ref) {
|
6921
|
+
var children = props.children,
|
6922
|
+
externalClassName = props.className,
|
6923
|
+
_props$expanded = props.expanded,
|
6924
|
+
initialExpanded = _props$expanded === void 0 ? false : _props$expanded,
|
6925
|
+
title = props.title,
|
6926
|
+
fixed = props.fixed,
|
6927
|
+
onClick = props.onClick,
|
6928
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$m);
|
6929
|
+
|
6930
|
+
var _React$useState = React__default.useState(fixed || initialExpanded),
|
6931
|
+
expanded = _React$useState[0],
|
6932
|
+
setExpanded = _React$useState[1];
|
6933
|
+
|
6934
|
+
React__default.useEffect(function () {
|
6776
6935
|
if (!fixed) {
|
6777
6936
|
setExpanded(fixed || initialExpanded);
|
6778
6937
|
}
|
6779
6938
|
}, [fixed, initialExpanded]);
|
6780
|
-
|
6939
|
+
var listClassName = cn('flex-col mb-0', {
|
6781
6940
|
flex: expanded,
|
6782
6941
|
hidden: !expanded
|
6783
6942
|
});
|
6784
|
-
|
6943
|
+
|
6944
|
+
var itemProps = _extends({}, otherProps, {
|
6785
6945
|
'aria-expanded': expanded,
|
6786
6946
|
role: 'treeitem',
|
6787
6947
|
tabIndex: -1
|
6788
|
-
};
|
6948
|
+
});
|
6789
6949
|
|
6790
|
-
|
6791
|
-
|
6950
|
+
var handleClick = function handleClick(event) {
|
6951
|
+
var nextState = !expanded;
|
6792
6952
|
|
6793
6953
|
if (!fixed) {
|
6794
6954
|
setExpanded(nextState);
|
@@ -6799,7 +6959,7 @@ const TreeviewGroup = /*#__PURE__*/React__default.forwardRef(function TreeviewGr
|
|
6799
6959
|
}
|
6800
6960
|
};
|
6801
6961
|
|
6802
|
-
|
6962
|
+
var className = typeof externalClassName === 'function' ? externalClassName(expanded) : externalClassName;
|
6803
6963
|
return React__default.createElement("div", Object.assign({}, itemProps, {
|
6804
6964
|
className: className,
|
6805
6965
|
ref: ref
|
@@ -6808,14 +6968,18 @@ const TreeviewGroup = /*#__PURE__*/React__default.forwardRef(function TreeviewGr
|
|
6808
6968
|
}, typeof title === 'function' ? title(expanded) : title), React__default.createElement("ul", {
|
6809
6969
|
role: "group",
|
6810
6970
|
className: listClassName
|
6811
|
-
}, React__default.Children.toArray(children).filter(
|
6812
|
-
|
6813
|
-
|
6814
|
-
|
6815
|
-
|
6816
|
-
|
6971
|
+
}, React__default.Children.toArray(children).filter(function (item) {
|
6972
|
+
return !!item;
|
6973
|
+
}).map(function (item, i) {
|
6974
|
+
return React__default.createElement("li", {
|
6975
|
+
key: i,
|
6976
|
+
role: "none"
|
6977
|
+
}, React__default.cloneElement(item, {
|
6978
|
+
role: 'treeitem'
|
6979
|
+
}));
|
6980
|
+
})));
|
6817
6981
|
});
|
6818
|
-
|
6982
|
+
var Treeview = /*#__PURE__*/React__default.forwardRef(function Treeview(props, ref) {
|
6819
6983
|
return React__default.createElement("div", Object.assign({}, props, {
|
6820
6984
|
ref: ref,
|
6821
6985
|
role: "tree"
|
@@ -6858,20 +7022,25 @@ const useDropTarget = onDrop => {
|
|
6858
7022
|
return [isDraggedOver, props];
|
6859
7023
|
};
|
6860
7024
|
|
6861
|
-
|
6862
|
-
|
6863
|
-
|
6864
|
-
|
6865
|
-
|
6866
|
-
|
6867
|
-
|
6868
|
-
|
6869
|
-
|
6870
|
-
|
6871
|
-
|
6872
|
-
|
6873
|
-
|
6874
|
-
|
7025
|
+
var _excluded$n = ["active", "children", "onDrop", "postfix", "prefix", "role"],
|
7026
|
+
_excluded2$3 = ["children"];
|
7027
|
+
var Item$2 = /*#__PURE__*/React__default.forwardRef(function Item(props, ref) {
|
7028
|
+
var active = props.active,
|
7029
|
+
children = props.children,
|
7030
|
+
onDrop = props.onDrop,
|
7031
|
+
postfix = props.postfix,
|
7032
|
+
prefix = props.prefix,
|
7033
|
+
role = props.role,
|
7034
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$n);
|
7035
|
+
|
7036
|
+
var proxyRef = useProxiedRef(ref);
|
7037
|
+
|
7038
|
+
var _useDropTarget = useDropTarget(onDrop),
|
7039
|
+
isDraggedOver = _useDropTarget[0],
|
7040
|
+
dropTargetProps = _useDropTarget[1];
|
7041
|
+
|
7042
|
+
var isTreeitem = role === 'treeitem';
|
7043
|
+
var className = cn('yt-navigation__item cursor-pointer', {
|
6875
7044
|
'w-full mb-px py-1 px-3 flex items-center hover:bg-grey-dark': isTreeitem,
|
6876
7045
|
'bg-white w-full h-10 px-3 flex-shrink-0 flex items-center justify-between cursor-pointer': !isTreeitem,
|
6877
7046
|
'yt-navigation__item--active': active && !isDraggedOver,
|
@@ -6879,7 +7048,7 @@ const Item$2 = /*#__PURE__*/React__default.forwardRef(function Item(props, ref)
|
|
6879
7048
|
'yt-navigation__item--dropping bg-blue': isDraggedOver
|
6880
7049
|
}, props.className);
|
6881
7050
|
|
6882
|
-
|
7051
|
+
var handleClick = function handleClick(event) {
|
6883
7052
|
if (event.target instanceof HTMLAnchorElement || event.target instanceof HTMLButtonElement) {
|
6884
7053
|
return;
|
6885
7054
|
}
|
@@ -6902,19 +7071,19 @@ const Item$2 = /*#__PURE__*/React__default.forwardRef(function Item(props, ref)
|
|
6902
7071
|
className: "yt-navigation__item__postfix ml-1"
|
6903
7072
|
}, postfix));
|
6904
7073
|
});
|
6905
|
-
|
7074
|
+
var Panel = /*#__PURE__*/React__default.forwardRef(function Panel(props, ref) {
|
6906
7075
|
return React__default.createElement("div", Object.assign({}, props, {
|
6907
7076
|
className: cn('w-full bg-white p-3', props.className),
|
6908
7077
|
ref: ref
|
6909
7078
|
}));
|
6910
7079
|
});
|
6911
|
-
|
6912
|
-
|
7080
|
+
var MenuGroup = /*#__PURE__*/React__default.forwardRef(function MenuGroup(props, ref) {
|
7081
|
+
var className = cn('flex-shrink-0 space-y-1 outline-none', {
|
6913
7082
|
'bg-white pb-2': props.fixed
|
6914
7083
|
}, props.className);
|
6915
7084
|
|
6916
|
-
|
6917
|
-
|
7085
|
+
var title = function title(expanded) {
|
7086
|
+
var className = cn('bg-white h-10 pl-3 pr-1 flex items-center justify-between w-full', {
|
6918
7087
|
'mb-1': expanded,
|
6919
7088
|
'cursor-pointer hover:text-blue': !props.fixed
|
6920
7089
|
});
|
@@ -6931,14 +7100,16 @@ const MenuGroup = /*#__PURE__*/React__default.forwardRef(function MenuGroup(prop
|
|
6931
7100
|
ref: ref
|
6932
7101
|
}));
|
6933
7102
|
});
|
6934
|
-
|
6935
|
-
|
6936
|
-
|
6937
|
-
React__default.Children.toArray(props.children).filter(
|
7103
|
+
var Menu$1 = /*#__PURE__*/React__default.forwardRef(function Menu(props, ref) {
|
7104
|
+
var scrollableAreas = React__default.useMemo(function () {
|
7105
|
+
var scrollableAreas = [];
|
7106
|
+
React__default.Children.toArray(props.children).filter(function (child) {
|
7107
|
+
return !!child;
|
7108
|
+
}).map(function (child) {
|
6938
7109
|
if (child.props.fixed) {
|
6939
7110
|
scrollableAreas.push(child);
|
6940
7111
|
} else {
|
6941
|
-
|
7112
|
+
var x = scrollableAreas[scrollableAreas.length - 1];
|
6942
7113
|
|
6943
7114
|
if (Array.isArray(x)) {
|
6944
7115
|
x.push(child);
|
@@ -6952,18 +7123,19 @@ const Menu$1 = /*#__PURE__*/React__default.forwardRef(function Menu(props, ref)
|
|
6952
7123
|
return React__default.createElement(Treeview, Object.assign({}, props, {
|
6953
7124
|
className: cn('divide-grey-light flex flex-grow flex-col divide-y-2 overflow-y-auto', props.className),
|
6954
7125
|
ref: ref
|
6955
|
-
}), scrollableAreas.map((area, i)
|
6956
|
-
|
6957
|
-
|
6958
|
-
|
7126
|
+
}), scrollableAreas.map(function (area, i) {
|
7127
|
+
return Array.isArray(area) ? React__default.createElement("div", {
|
7128
|
+
className: "divide-grey-light flex h-0 flex-auto flex-shrink-0 flex-grow flex-col divide-y-2 overflow-y-auto",
|
7129
|
+
key: i
|
7130
|
+
}, area) : area;
|
7131
|
+
}));
|
6959
7132
|
});
|
6960
7133
|
Menu$1.Group = MenuGroup;
|
6961
|
-
|
6962
|
-
|
6963
|
-
|
6964
|
-
|
6965
|
-
|
6966
|
-
const className = cn('h-full flex flex-col bg-grey-light divide-y-2 divide-grey-light', props.className);
|
7134
|
+
var Navigation = /*#__PURE__*/React__default.forwardRef(function Navigation(props, ref) {
|
7135
|
+
var children = props.children,
|
7136
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded2$3);
|
7137
|
+
|
7138
|
+
var className = cn('h-full flex flex-col bg-grey-light divide-y-2 divide-grey-light', props.className);
|
6967
7139
|
return React__default.createElement("div", Object.assign({}, otherProps, {
|
6968
7140
|
className: className,
|
6969
7141
|
"data-taco": "navigation",
|
@@ -7204,52 +7376,54 @@ const useSelect = ({
|
|
7204
7376
|
};
|
7205
7377
|
};
|
7206
7378
|
|
7207
|
-
|
7208
|
-
|
7209
|
-
|
7210
|
-
|
7211
|
-
|
7212
|
-
|
7213
|
-
|
7214
|
-
|
7215
|
-
|
7216
|
-
|
7217
|
-
|
7218
|
-
|
7219
|
-
|
7220
|
-
|
7221
|
-
|
7222
|
-
|
7223
|
-
|
7224
|
-
|
7225
|
-
|
7379
|
+
var _excluded$o = ["autoFocus", "className", "highlighted", "style"],
|
7380
|
+
_excluded2$4 = ["editable"];
|
7381
|
+
var BaseSelect = /*#__PURE__*/React.forwardRef(function BaseSelect(props, ref) {
|
7382
|
+
var autoFocus = props.autoFocus,
|
7383
|
+
externalClassName = props.className,
|
7384
|
+
style = props.style,
|
7385
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$o);
|
7386
|
+
|
7387
|
+
var _useSelect = useSelect(otherProps, ref),
|
7388
|
+
button = _useSelect.button,
|
7389
|
+
listbox = _useSelect.listbox,
|
7390
|
+
popover = _useSelect.popover,
|
7391
|
+
input = _useSelect.input,
|
7392
|
+
text = _useSelect.text,
|
7393
|
+
_useSelect$more = _useSelect.more,
|
7394
|
+
more = _useSelect$more === void 0 ? 0 : _useSelect$more;
|
7395
|
+
|
7396
|
+
var internalRef = React.useRef(null);
|
7397
|
+
var selectDimensions = useBoundingClientRectListener(internalRef);
|
7398
|
+
var className = cn('inline-flex relative w-full', {
|
7226
7399
|
'yt-select--readonly': props.readOnly
|
7227
7400
|
}, externalClassName);
|
7228
|
-
|
7401
|
+
var inputClassname = cn(getInputClasses(props), 'h-8 text-left pr-0', {
|
7229
7402
|
'border-blue': popover.open
|
7230
7403
|
});
|
7231
|
-
React.useEffect(()
|
7404
|
+
React.useEffect(function () {
|
7232
7405
|
if (autoFocus && internalRef.current) {
|
7233
7406
|
internalRef.current.focus();
|
7234
7407
|
}
|
7235
7408
|
}, []);
|
7236
7409
|
|
7237
|
-
|
7410
|
+
var renderMultiSelection = function renderMultiSelection() {
|
7238
7411
|
return React.createElement(React.Fragment, null, React.createElement("span", {
|
7239
7412
|
className: "flex-grow truncate text-left"
|
7240
7413
|
}, text), more > 0 && React.createElement(Badge, {
|
7241
7414
|
className: "ml-2"
|
7242
|
-
},
|
7415
|
+
}, "+" + more));
|
7243
7416
|
};
|
7244
7417
|
|
7245
|
-
|
7418
|
+
var commonListboxProps = _extends({}, listbox, {
|
7246
7419
|
className: 'w-auto',
|
7247
7420
|
invalid: undefined,
|
7248
7421
|
style: {
|
7249
7422
|
minWidth: selectDimensions === null || selectDimensions === void 0 ? void 0 : selectDimensions.width
|
7250
7423
|
},
|
7251
7424
|
tabIndex: popover.open ? 0 : -1
|
7252
|
-
};
|
7425
|
+
});
|
7426
|
+
|
7253
7427
|
return React.createElement("span", {
|
7254
7428
|
className: className,
|
7255
7429
|
"data-taco": "select",
|
@@ -7272,11 +7446,9 @@ const BaseSelect = /*#__PURE__*/React.forwardRef(function BaseSelect(props, ref)
|
|
7272
7446
|
type: "text"
|
7273
7447
|
}))));
|
7274
7448
|
});
|
7275
|
-
|
7276
|
-
|
7277
|
-
|
7278
|
-
...otherProps
|
7279
|
-
} = props;
|
7449
|
+
var Select = /*#__PURE__*/React.forwardRef(function Select(props, ref) {
|
7450
|
+
var editable = props.editable,
|
7451
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded2$4);
|
7280
7452
|
|
7281
7453
|
if (editable) {
|
7282
7454
|
return React.createElement(Combobox, Object.assign({}, otherProps, {
|
@@ -7347,41 +7519,47 @@ const usePagination = (initialPageIndex = 0, initialPageSize = 10) => {
|
|
7347
7519
|
};
|
7348
7520
|
};
|
7349
7521
|
|
7350
|
-
|
7351
|
-
|
7352
|
-
|
7522
|
+
var _excluded$p = ["length", "pageIndex", "pageSize", "pageSizes", "setPageIndex", "setPageSize", "showPageControls", "showPageNumbers", "showPageSize", "dangerouslyHijackGlobalKeyboardNavigation"];
|
7523
|
+
|
7524
|
+
var getShowingLabel = function getShowingLabel(length, pageIndex, pageSize, texts) {
|
7525
|
+
var minItemIndex = pageIndex * pageSize + 1;
|
7526
|
+
var maxItemIndex = (pageIndex + 1) * pageSize;
|
7353
7527
|
return texts.pagination.showingXofYofTotal.replace('[X]', length === 0 ? '0' : String(minItemIndex)).replace('[Y]', String(maxItemIndex > length ? length : maxItemIndex)).replace('[total]', String(length));
|
7354
7528
|
};
|
7355
7529
|
|
7356
|
-
|
7357
|
-
|
7358
|
-
|
7359
|
-
|
7360
|
-
|
7361
|
-
|
7362
|
-
|
7363
|
-
|
7364
|
-
|
7365
|
-
|
7366
|
-
|
7367
|
-
|
7368
|
-
|
7369
|
-
|
7370
|
-
|
7371
|
-
|
7372
|
-
|
7373
|
-
|
7374
|
-
|
7530
|
+
var Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref) {
|
7531
|
+
var length = props.length,
|
7532
|
+
pageIndex = props.pageIndex,
|
7533
|
+
pageSize = props.pageSize,
|
7534
|
+
_props$pageSizes = props.pageSizes,
|
7535
|
+
pageSizes = _props$pageSizes === void 0 ? [10, 25, 50, 100, 500] : _props$pageSizes,
|
7536
|
+
setPageIndex = props.setPageIndex,
|
7537
|
+
setPageSize = props.setPageSize,
|
7538
|
+
_props$showPageContro = props.showPageControls,
|
7539
|
+
showPageControls = _props$showPageContro === void 0 ? true : _props$showPageContro,
|
7540
|
+
_props$showPageNumber = props.showPageNumbers,
|
7541
|
+
showPageNumbers = _props$showPageNumber === void 0 ? true : _props$showPageNumber,
|
7542
|
+
_props$showPageSize = props.showPageSize,
|
7543
|
+
showPageSize = _props$showPageSize === void 0 ? true : _props$showPageSize,
|
7544
|
+
_props$dangerouslyHij = props.dangerouslyHijackGlobalKeyboardNavigation,
|
7545
|
+
dangerouslyHijackGlobalKeyboardNavigation = _props$dangerouslyHij === void 0 ? false : _props$dangerouslyHij,
|
7546
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$p);
|
7547
|
+
|
7548
|
+
var _useLocalization = useLocalization(),
|
7549
|
+
texts = _useLocalization.texts;
|
7550
|
+
|
7551
|
+
var maxPageIndex = Math.ceil(length / pageSize) - 1;
|
7552
|
+
var showShortcutTexts = dangerouslyHijackGlobalKeyboardNavigation;
|
7375
7553
|
usePaginationShortcuts({
|
7376
|
-
setPageIndex,
|
7377
|
-
maxPageIndex,
|
7378
|
-
pageIndex,
|
7379
|
-
dangerouslyHijackGlobalKeyboardNavigation
|
7554
|
+
setPageIndex: setPageIndex,
|
7555
|
+
maxPageIndex: maxPageIndex,
|
7556
|
+
pageIndex: pageIndex,
|
7557
|
+
dangerouslyHijackGlobalKeyboardNavigation: dangerouslyHijackGlobalKeyboardNavigation
|
7380
7558
|
});
|
7381
|
-
|
7382
|
-
|
7383
|
-
|
7384
|
-
|
7559
|
+
var pageCount = Math.ceil(length / pageSize);
|
7560
|
+
var canPreviousPage = pageIndex > 0;
|
7561
|
+
var canNextPage = pageIndex < pageCount - 1;
|
7562
|
+
var className = cn('inline-flex relative justify-between items-center', props.className);
|
7385
7563
|
return React.createElement("div", Object.assign({}, otherProps, {
|
7386
7564
|
className: className,
|
7387
7565
|
"data-taco": "pagination",
|
@@ -7391,11 +7569,13 @@ const Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref)
|
|
7391
7569
|
}, getShowingLabel(length, pageIndex, pageSize, texts), React.createElement(Select, {
|
7392
7570
|
"aria-label": texts.pagination.pageSize,
|
7393
7571
|
className: "ml-4 !w-20",
|
7394
|
-
data: pageSizes.map(pageSize
|
7395
|
-
|
7396
|
-
|
7397
|
-
|
7398
|
-
|
7572
|
+
data: pageSizes.map(function (pageSize) {
|
7573
|
+
return {
|
7574
|
+
text: String(pageSize),
|
7575
|
+
value: pageSize
|
7576
|
+
};
|
7577
|
+
}),
|
7578
|
+
onChange: function onChange(event) {
|
7399
7579
|
setPageIndex(0);
|
7400
7580
|
setPageSize(Number(event.target.value));
|
7401
7581
|
},
|
@@ -7407,14 +7587,18 @@ const Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref)
|
|
7407
7587
|
appearance: "default",
|
7408
7588
|
disabled: !canPreviousPage,
|
7409
7589
|
icon: "arrow-start",
|
7410
|
-
onClick: ()
|
7590
|
+
onClick: function onClick() {
|
7591
|
+
return setPageIndex(0);
|
7592
|
+
},
|
7411
7593
|
"aria-label": showShortcutTexts ? texts.pagination.actions.firstPageWithShortcut : texts.pagination.actions.firstPage,
|
7412
7594
|
tooltip: showShortcutTexts ? texts.pagination.actions.firstPageWithShortcut : texts.pagination.actions.firstPage
|
7413
7595
|
}), React.createElement(IconButton, {
|
7414
7596
|
appearance: "default",
|
7415
7597
|
disabled: !canPreviousPage,
|
7416
7598
|
icon: "arrow-left",
|
7417
|
-
onClick: ()
|
7599
|
+
onClick: function onClick() {
|
7600
|
+
return setPageIndex(pageIndex - 1);
|
7601
|
+
},
|
7418
7602
|
"aria-label": showShortcutTexts ? texts.pagination.actions.previousPageWithShortcut : texts.pagination.actions.previousPage,
|
7419
7603
|
tooltip: showShortcutTexts ? texts.pagination.actions.previousPageWithShortcut : texts.pagination.actions.previousPage
|
7420
7604
|
}), showPageNumbers && pageCount > 0 && React.createElement(PageNumbers, {
|
@@ -7425,36 +7609,43 @@ const Pagination = /*#__PURE__*/React.forwardRef(function Pagination(props, ref)
|
|
7425
7609
|
appearance: "default",
|
7426
7610
|
disabled: !canNextPage,
|
7427
7611
|
icon: "arrow-right",
|
7428
|
-
onClick: ()
|
7612
|
+
onClick: function onClick() {
|
7613
|
+
return setPageIndex(pageIndex + 1);
|
7614
|
+
},
|
7429
7615
|
"aria-label": showShortcutTexts ? texts.pagination.actions.nextPageWithShortcut : texts.pagination.actions.nextPage,
|
7430
7616
|
tooltip: showShortcutTexts ? texts.pagination.actions.nextPageWithShortcut : texts.pagination.actions.nextPage
|
7431
7617
|
}), React.createElement(IconButton, {
|
7432
7618
|
appearance: "default",
|
7433
7619
|
disabled: !canNextPage,
|
7434
7620
|
icon: "arrow-end",
|
7435
|
-
onClick: ()
|
7621
|
+
onClick: function onClick() {
|
7622
|
+
return setPageIndex(pageCount - 1);
|
7623
|
+
},
|
7436
7624
|
"aria-label": showShortcutTexts ? texts.pagination.actions.lastPageWithShortcut : texts.pagination.actions.lastPage,
|
7437
7625
|
tooltip: showShortcutTexts ? texts.pagination.actions.lastPageWithShortcut : texts.pagination.actions.lastPage
|
7438
7626
|
})));
|
7439
7627
|
});
|
7440
7628
|
|
7441
|
-
|
7442
|
-
|
7443
|
-
|
7444
|
-
|
7445
|
-
|
7629
|
+
var _excluded$q = ["duration"];
|
7630
|
+
var Progress = function Progress(_ref) {
|
7631
|
+
var _cn;
|
7632
|
+
|
7633
|
+
var _ref$duration = _ref.duration,
|
7634
|
+
duration = _ref$duration === void 0 ? undefined : _ref$duration,
|
7635
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
|
7636
|
+
|
7637
|
+
var style;
|
7446
7638
|
|
7447
7639
|
if (duration) {
|
7448
7640
|
style = {
|
7449
|
-
animationDuration:
|
7641
|
+
animationDuration: duration + "ms"
|
7450
7642
|
};
|
7451
7643
|
}
|
7452
7644
|
|
7453
|
-
|
7454
|
-
|
7455
|
-
"w-full before:h-1 before:bg-grey-dark before:block before:animate-[progress-indeterminate_2s_cubic-bezier(0.4,0,0.2,1)_infinite] before:content-[' ']": !duration
|
7456
|
-
|
7457
|
-
});
|
7645
|
+
var className = cn('bg-grey-light rounded block h-1 overflow-hidden w-full', props.className);
|
7646
|
+
var progressClassName = cn('yt-progress__bar block h-1', (_cn = {
|
7647
|
+
"w-full before:h-1 before:bg-grey-dark before:block before:animate-[progress-indeterminate_2s_cubic-bezier(0.4,0,0.2,1)_infinite] before:content-[' ']": !duration
|
7648
|
+
}, _cn["w-0 bg-grey-dark animate-[progress_linear]"] = duration, _cn));
|
7458
7649
|
return React__default.createElement("span", Object.assign({}, props, {
|
7459
7650
|
"data-taco": "progress",
|
7460
7651
|
className: className
|
@@ -9064,16 +9255,19 @@ const useTableRowCreation = (data, tableRef) => {
|
|
9064
9255
|
};
|
9065
9256
|
};
|
9066
9257
|
|
9067
|
-
|
9068
|
-
|
9069
|
-
id
|
9070
|
-
|
9071
|
-
|
9072
|
-
|
9073
|
-
|
9074
|
-
|
9075
|
-
|
9076
|
-
|
9258
|
+
var _excluded$r = ["id", "defaultId", "children", "onChange", "orientation"],
|
9259
|
+
_excluded2$5 = ["id", "disabled"],
|
9260
|
+
_excluded3 = ["id"];
|
9261
|
+
var Tabs = /*#__PURE__*/React.forwardRef(function Tabs(props, ref) {
|
9262
|
+
var id = props.id,
|
9263
|
+
defaultId = props.defaultId,
|
9264
|
+
children = props.children,
|
9265
|
+
onChange = props.onChange,
|
9266
|
+
_props$orientation = props.orientation,
|
9267
|
+
orientation = _props$orientation === void 0 ? 'horizontal' : _props$orientation,
|
9268
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$r);
|
9269
|
+
|
9270
|
+
var className = cn('yt-tabs', "yt-tabs--" + orientation, {
|
9077
9271
|
'flex w-full': orientation === 'vertical'
|
9078
9272
|
}, props.className);
|
9079
9273
|
return React.createElement(TabsPrimitive.Root, Object.assign({}, otherProps, {
|
@@ -9087,20 +9281,19 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(props, ref) {
|
|
9087
9281
|
value: id
|
9088
9282
|
}), children);
|
9089
9283
|
});
|
9090
|
-
|
9091
|
-
|
9284
|
+
var TabList = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
9285
|
+
var className = cn('yt-tab__list border-b border-grey-light flex flex-row m-0 mb-4', props.className);
|
9092
9286
|
return React.createElement(TabsPrimitive.List, Object.assign({}, props, {
|
9093
9287
|
className: className,
|
9094
9288
|
ref: ref
|
9095
9289
|
}));
|
9096
9290
|
});
|
9097
|
-
|
9098
|
-
|
9099
|
-
|
9100
|
-
|
9101
|
-
|
9102
|
-
|
9103
|
-
const className = cn('yt-tab bg-transparent border-b-2 border-transparent text-grey-darkest m-0 py-2 px-4', disabled ? 'cursor-not-allowed !text-grey' : 'cursor-pointer rounded-t hover:border-grey-light hover:text-black active:yt-focus active:border-blue focus:yt-focus focus:border-blue', props.className);
|
9291
|
+
var TabTrigger = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
9292
|
+
var id = props.id,
|
9293
|
+
disabled = props.disabled,
|
9294
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded2$5);
|
9295
|
+
|
9296
|
+
var className = cn('yt-tab bg-transparent border-b-2 border-transparent text-grey-darkest m-0 py-2 px-4', disabled ? 'cursor-not-allowed !text-grey' : 'cursor-pointer rounded-t hover:border-grey-light hover:text-black active:yt-focus active:border-blue focus:yt-focus focus:border-blue', props.className);
|
9104
9297
|
return React.createElement(TabsPrimitive.Trigger, Object.assign({}, otherProps, {
|
9105
9298
|
className: className,
|
9106
9299
|
disabled: disabled,
|
@@ -9111,12 +9304,11 @@ const TabTrigger = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
|
9111
9304
|
value: id
|
9112
9305
|
}));
|
9113
9306
|
});
|
9114
|
-
|
9115
|
-
|
9116
|
-
|
9117
|
-
|
9118
|
-
|
9119
|
-
const className = cn('yt-tab__panel outline-none', props.className);
|
9307
|
+
var TabContent = /*#__PURE__*/React.forwardRef(function Tab(props, ref) {
|
9308
|
+
var id = props.id,
|
9309
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded3);
|
9310
|
+
|
9311
|
+
var className = cn('yt-tab__panel outline-none', props.className);
|
9120
9312
|
return React.createElement(TabsPrimitive.Content, Object.assign({}, otherProps, {
|
9121
9313
|
className: className,
|
9122
9314
|
ref: ref,
|
@@ -9127,22 +9319,19 @@ Tabs.List = TabList;
|
|
9127
9319
|
Tabs.Trigger = TabTrigger;
|
9128
9320
|
Tabs.Content = TabContent;
|
9129
9321
|
|
9130
|
-
|
9131
|
-
|
9132
|
-
|
9133
|
-
|
9134
|
-
|
9135
|
-
|
9136
|
-
...otherProps
|
9137
|
-
} = props;
|
9138
|
-
const classNames = cn(getInputClasses(props), 'py-1 min-h-[75px] disabled:resize-none', props.className); // home and end keys only navigate to the start/end of textarea value if the textarea container does not scroll
|
9322
|
+
var _excluded$s = ["defaultValue", "highlighted", "invalid", "onKeyDown"];
|
9323
|
+
var Textarea = /*#__PURE__*/React.forwardRef(function Textarea(props, ref) {
|
9324
|
+
var onKeyDown = props.onKeyDown,
|
9325
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$s);
|
9326
|
+
|
9327
|
+
var classNames = cn(getInputClasses(props), 'py-1 min-h-[75px] disabled:resize-none', props.className); // home and end keys only navigate to the start/end of textarea value if the textarea container does not scroll
|
9139
9328
|
// if it has scroll height then the browser reverts to native scrolling behaviour only
|
9140
9329
|
// so we manually override it to ensure _our_ desired behaviour remains intact
|
9141
9330
|
|
9142
|
-
|
9331
|
+
var handleKeyDown = function handleKeyDown(event) {
|
9143
9332
|
if (event.key === 'Home' || event.key === 'End') {
|
9144
9333
|
event.preventDefault();
|
9145
|
-
|
9334
|
+
var position = event.key === 'End' ? event.currentTarget.value.length : 0;
|
9146
9335
|
event.currentTarget.setSelectionRange(position, position);
|
9147
9336
|
event.currentTarget.scrollTop = event.key === 'End' ? event.currentTarget.scrollHeight : 0;
|
9148
9337
|
}
|
@@ -9160,18 +9349,18 @@ const Textarea = /*#__PURE__*/React.forwardRef(function Textarea(props, ref) {
|
|
9160
9349
|
}));
|
9161
9350
|
});
|
9162
9351
|
|
9163
|
-
|
9164
|
-
|
9165
|
-
|
9166
|
-
|
9167
|
-
|
9168
|
-
|
9169
|
-
|
9352
|
+
var _excluded$t = ["label", "onChange"];
|
9353
|
+
var Switch = /*#__PURE__*/React.forwardRef(function Switch(props, ref) {
|
9354
|
+
var label = props.label,
|
9355
|
+
onChange = props.onChange,
|
9356
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$t);
|
9357
|
+
|
9358
|
+
var className = cn('group h-6 w-10 flex rounded-full inline-flex', {
|
9170
9359
|
'mr-2': !!label,
|
9171
9360
|
'bg-grey-darker aria-checked:bg-blue focus:yt-focus': !props.disabled,
|
9172
9361
|
'bg-grey-light cursor-not-allowed aria-checked:bg-blue-light': props.disabled
|
9173
9362
|
}, props.className);
|
9174
|
-
|
9363
|
+
var element = React.createElement(PrimitiveSwitch.Root, Object.assign({}, otherProps, {
|
9175
9364
|
className: className,
|
9176
9365
|
onCheckedChange: onChange,
|
9177
9366
|
ref: ref
|
@@ -9180,7 +9369,7 @@ const Switch = /*#__PURE__*/React.forwardRef(function Switch(props, ref) {
|
|
9180
9369
|
}));
|
9181
9370
|
|
9182
9371
|
if (label) {
|
9183
|
-
|
9372
|
+
var labelClassName = cn('flex items-center cursor-pointer', {
|
9184
9373
|
'cursor-not-allowed text-grey-dark': props.disabled
|
9185
9374
|
});
|
9186
9375
|
return React.createElement("label", {
|
@@ -9191,22 +9380,23 @@ const Switch = /*#__PURE__*/React.forwardRef(function Switch(props, ref) {
|
|
9191
9380
|
return element;
|
9192
9381
|
});
|
9193
9382
|
|
9194
|
-
|
9195
|
-
|
9196
|
-
|
9197
|
-
|
9198
|
-
|
9199
|
-
|
9200
|
-
|
9201
|
-
|
9202
|
-
|
9203
|
-
|
9204
|
-
|
9205
|
-
|
9206
|
-
|
9207
|
-
|
9208
|
-
React.
|
9209
|
-
|
9383
|
+
var _excluded$u = ["autoStart", "onComplete", "onClose", "onReady", "spotlightClicks", "disableCloseOnEsc", "disableScrollParentFix"];
|
9384
|
+
|
9385
|
+
var Tooltip$1 = function Tooltip(_ref) {
|
9386
|
+
var continuous = _ref.continuous,
|
9387
|
+
index = _ref.index,
|
9388
|
+
isLastStep = _ref.isLastStep,
|
9389
|
+
step = _ref.step,
|
9390
|
+
backProps = _ref.backProps,
|
9391
|
+
primaryProps = _ref.primaryProps,
|
9392
|
+
skipProps = _ref.skipProps,
|
9393
|
+
tooltipProps = _ref.tooltipProps,
|
9394
|
+
size = _ref.size,
|
9395
|
+
locale = _ref.locale,
|
9396
|
+
disableTourSkipOnEsc = _ref.disableTourSkipOnEsc;
|
9397
|
+
var skipButtonRef = React.useRef(null);
|
9398
|
+
React.useEffect(function () {
|
9399
|
+
var onWindowKeyDown = function onWindowKeyDown(event) {
|
9210
9400
|
if (!disableTourSkipOnEsc) {
|
9211
9401
|
if (event.keyCode === keycode('esc') && skipButtonRef.current !== null) {
|
9212
9402
|
event.preventDefault();
|
@@ -9217,7 +9407,7 @@ const Tooltip$1 = ({
|
|
9217
9407
|
};
|
9218
9408
|
|
9219
9409
|
window.addEventListener('keydown', onWindowKeyDown);
|
9220
|
-
return ()
|
9410
|
+
return function () {
|
9221
9411
|
window.removeEventListener('keydown', onWindowKeyDown);
|
9222
9412
|
};
|
9223
9413
|
}, []);
|
@@ -9236,30 +9426,30 @@ const Tooltip$1 = ({
|
|
9236
9426
|
appearance: "discrete"
|
9237
9427
|
}), locale.back), React.createElement(Button$1, Object.assign({}, primaryProps, {
|
9238
9428
|
appearance: "primary"
|
9239
|
-
}), continuous ? isLastStep ?
|
9429
|
+
}), continuous ? isLastStep ? locale.last + " (" + (index + 1) + "/" + size + ")" : locale.next + " (" + (index + 1) + "/" + size + ")" : locale.close)));
|
9240
9430
|
}; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
9241
9431
|
|
9242
9432
|
|
9243
|
-
|
9244
|
-
|
9245
|
-
|
9246
|
-
|
9247
|
-
|
9248
|
-
|
9249
|
-
|
9250
|
-
|
9251
|
-
|
9252
|
-
|
9253
|
-
|
9254
|
-
|
9255
|
-
|
9256
|
-
|
9257
|
-
|
9258
|
-
|
9259
|
-
|
9260
|
-
|
9261
|
-
return React.Children.map(props.children, child
|
9262
|
-
|
9433
|
+
var TourStep = function TourStep(_props) {
|
9434
|
+
return null;
|
9435
|
+
};
|
9436
|
+
var Tour = function Tour(props) {
|
9437
|
+
var _useLocalization = useLocalization(),
|
9438
|
+
tour = _useLocalization.texts.tour;
|
9439
|
+
|
9440
|
+
var run = props.autoStart,
|
9441
|
+
onComplete = props.onComplete,
|
9442
|
+
onClose = props.onClose,
|
9443
|
+
onReady = props.onReady,
|
9444
|
+
spotlightClicks = props.spotlightClicks,
|
9445
|
+
disableTourSkipOnEsc = props.disableCloseOnEsc,
|
9446
|
+
_props$disableScrollP = props.disableScrollParentFix,
|
9447
|
+
disableScrollParentFix = _props$disableScrollP === void 0 ? false : _props$disableScrollP,
|
9448
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded$u);
|
9449
|
+
|
9450
|
+
var steps = React.useMemo(function () {
|
9451
|
+
return React.Children.map(props.children, function (child) {
|
9452
|
+
var step = {
|
9263
9453
|
disableBeacon: !child.props.showBeacon,
|
9264
9454
|
target: child.props.selector,
|
9265
9455
|
placement: child.props.position,
|
@@ -9269,10 +9459,12 @@ const Tour = props => {
|
|
9269
9459
|
return step;
|
9270
9460
|
});
|
9271
9461
|
}, [props.children]);
|
9272
|
-
|
9462
|
+
var getStep = React.useCallback(function (selector) {
|
9273
9463
|
var _props$children$find;
|
9274
9464
|
|
9275
|
-
return (_props$children$find = props.children.find(
|
9465
|
+
return (_props$children$find = props.children.find(function (child) {
|
9466
|
+
return child.props.selector === selector;
|
9467
|
+
})) === null || _props$children$find === void 0 ? void 0 : _props$children$find.props;
|
9276
9468
|
}, [props.children]);
|
9277
9469
|
|
9278
9470
|
function callback(state) {
|
@@ -9302,10 +9494,12 @@ const Tour = props => {
|
|
9302
9494
|
floaterProps: {
|
9303
9495
|
disableAnimation: true
|
9304
9496
|
},
|
9305
|
-
tooltipComponent:
|
9306
|
-
|
9307
|
-
|
9308
|
-
|
9497
|
+
tooltipComponent: function tooltipComponent(tooltipProps) {
|
9498
|
+
return React.createElement(Tooltip$1, Object.assign({}, tooltipProps, {
|
9499
|
+
locale: tour,
|
9500
|
+
disableTourSkipOnEsc: disableTourSkipOnEsc
|
9501
|
+
}));
|
9502
|
+
},
|
9309
9503
|
locale: tour,
|
9310
9504
|
spotlightPadding: 8,
|
9311
9505
|
spotlightClicks: spotlightClicks,
|
@@ -9346,22 +9540,22 @@ var useOnClickOutside = function useOnClickOutside(ref, callback) {
|
|
9346
9540
|
}, [ref, callback]);
|
9347
9541
|
};
|
9348
9542
|
|
9349
|
-
|
9350
|
-
|
9351
|
-
|
9352
|
-
|
9353
|
-
|
9354
|
-
|
9355
|
-
|
9543
|
+
var _excluded$v = ["onSearch"];
|
9544
|
+
var SearchInput = /*#__PURE__*/React.forwardRef(function SearchInput(_ref, ref) {
|
9545
|
+
var onSearch = _ref.onSearch,
|
9546
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$v);
|
9547
|
+
|
9548
|
+
var _useLocalization = useLocalization(),
|
9549
|
+
texts = _useLocalization.texts;
|
9356
9550
|
|
9357
|
-
|
9551
|
+
var handleClick = function handleClick() {
|
9358
9552
|
if (!props.disabled) {
|
9359
9553
|
onSearch === null || onSearch === void 0 ? void 0 : onSearch(props.value);
|
9360
9554
|
}
|
9361
9555
|
};
|
9362
9556
|
|
9363
|
-
|
9364
|
-
|
9557
|
+
var handleKeyDown = function handleKeyDown(event) {
|
9558
|
+
var isEnterKeyPressed = event.keyCode === keycode('enter');
|
9365
9559
|
|
9366
9560
|
if (isEnterKeyPressed) {
|
9367
9561
|
handleClick();
|