@economic/taco 1.17.4 → 1.18.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/components/Icon/components/index.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Menu/components/Item.d.ts +1 -1
- package/dist/components/Menu/components/Link.d.ts +1 -1
- package/dist/components/Progress/Progress.stories.d.ts +1 -0
- package/dist/components/Select2/Select2.stories.d.ts +1 -0
- package/dist/components/Select2/components/Option.d.ts +1 -1
- package/dist/components/Select2/components/Search.d.ts +1 -1
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/esm/index.css +9 -9
- package/dist/esm/packages/taco/src/components/Button/util.js +3 -3
- package/dist/esm/packages/taco/src/components/Button/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js +1 -1
- package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Content.js +2 -2
- package/dist/esm/packages/taco/src/components/Dialog/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Extra.js +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Extra.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/index.js +0 -2
- package/dist/esm/packages/taco/src/components/Icon/components/index.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Item.js +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Item.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js +19 -0
- package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/utilities.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/utilities.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/renderRow.js +2 -2
- package/dist/esm/packages/taco/src/components/Table/util/renderRow.js.map +1 -1
- package/dist/index.css +9 -9
- package/dist/taco.cjs.development.js +34 -32
- 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/package.json +2 -2
- package/types.json +3 -4
- package/dist/components/Icon/components/Spinner.d.ts +0 -3
- package/dist/esm/packages/taco/src/components/Icon/components/Spinner.js +0 -20
- package/dist/esm/packages/taco/src/components/Icon/components/Spinner.js.map +0 -1
@@ -2577,22 +2577,6 @@ function IconSortBy(props, svgRef) {
|
|
2577
2577
|
}
|
2578
2578
|
var SortBy = /*#__PURE__*/React.forwardRef(IconSortBy);
|
2579
2579
|
|
2580
|
-
function IconSpinner(props, svgRef) {
|
2581
|
-
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
2582
|
-
xmlns: "http://www.w3.org/2000/svg",
|
2583
|
-
viewBox: "0 0 24 24",
|
2584
|
-
ref: svgRef
|
2585
|
-
}, props), /*#__PURE__*/React.createElement("g", {
|
2586
|
-
fill: "currentColor",
|
2587
|
-
fillRule: "evenodd"
|
2588
|
-
}, /*#__PURE__*/React.createElement("path", {
|
2589
|
-
d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm0 1.5a8.5 8.5 0 110 17 8.5 8.5 0 010-17z"
|
2590
|
-
}), /*#__PURE__*/React.createElement("path", {
|
2591
|
-
d: "M12 2a.75.75 0 110 1.5 8.5 8.5 0 108.5 8.5.75.75 0 111.5 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2z"
|
2592
|
-
})));
|
2593
|
-
}
|
2594
|
-
var Spinner = /*#__PURE__*/React.forwardRef(IconSpinner);
|
2595
|
-
|
2596
2580
|
function IconStarSolid(props, svgRef) {
|
2597
2581
|
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
2598
2582
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -3116,7 +3100,6 @@ const icons = {
|
|
3116
3100
|
sliders: Sliders,
|
3117
3101
|
smartpay: Smartpay,
|
3118
3102
|
'sort-by': SortBy,
|
3119
|
-
spinner: Spinner,
|
3120
3103
|
'star-solid': StarSolid,
|
3121
3104
|
star: Star,
|
3122
3105
|
subscriptions: Subscriptions,
|
@@ -3385,9 +3368,9 @@ const getButtonClasses = () => {
|
|
3385
3368
|
const getAppearanceClasses = (value, icon = false) => {
|
3386
3369
|
switch (value) {
|
3387
3370
|
case 'primary':
|
3388
|
-
return `
|
3371
|
+
return `wcag-blue-500 focus:bg-blue-500 focus:text-white focus:yt-focus active:bg-blue-700 active:text-white hover:bg-blue-300 hover:text-white hover:focus:bg-blue-300 hover:focus:border-blue-300 hover:focus:text-white disabled:hover:wcag-blue-500 disabled:hover:hover:border-blue-500`;
|
3389
3372
|
case 'danger':
|
3390
|
-
return `
|
3373
|
+
return `wcag-red-500 focus:bg-red-500 focus:text-white focus:yt-focus-red active:bg-red-700 active:text-white hover:bg-red-300 hover:text-white hover:focus:bg-red-300 hover:focus:text-white disabled:hover:wcag-red-500`;
|
3391
3374
|
case 'ghost':
|
3392
3375
|
return `bg-white shadow-[inset_0_0_0_1px_theme(colors.blue.500)] text-blue-500 focus:bg-transparent focus:text-blue-500 active:bg-blue-100 focus:!shadow-[inset_0_0_0_1px_theme(colors.blue.500),0_0_0_2px_rgba(0,99,255,0.25)] active:text-blue-700 hover:bg-blue-100 hover:shadow-[inset_0_0_0_1px_theme(colors.blue.300)] hover:text-blue-300 hover:focus:bg-blue-100 hover:focus:!shadow-[inset_0_0_0_1px_theme(colors.blue.300),0_0_0_2px_rgba(0,99,255,0.25)] hover:focus:text-blue-300`;
|
3393
3376
|
case 'discrete':
|
@@ -3398,7 +3381,7 @@ const getAppearanceClasses = (value, icon = false) => {
|
|
3398
3381
|
return `yt-transparent focus:text-blue-500 focus:yt-focus active:text-blue-700 hover:text-blue-300 hover:focus:text-blue-300 disabled:hover:yt-transparent`;
|
3399
3382
|
}
|
3400
3383
|
default:
|
3401
|
-
return `
|
3384
|
+
return `wcag-grey-200 focus:bg-grey-200 focus:yt-focus active:bg-grey-300 active:text-black hover:bg-grey-100 hover:text-grey-700 hover:focus:bg-grey-100 hover:focus:text-grey-700 disabled:hover:wcag-grey-200`;
|
3402
3385
|
}
|
3403
3386
|
};
|
3404
3387
|
const createButtonWithTooltip = (props, className, ref) => {
|
@@ -4143,7 +4126,7 @@ const useListScrollTo = (internalRef, itemRefs) => {
|
|
4143
4126
|
};
|
4144
4127
|
};
|
4145
4128
|
|
4146
|
-
const Spinner
|
4129
|
+
const Spinner = /*#__PURE__*/React__default.forwardRef(function Spinner(props, ref) {
|
4147
4130
|
const {
|
4148
4131
|
delay = 500,
|
4149
4132
|
label,
|
@@ -4313,7 +4296,7 @@ const ScrollableList = /*#__PURE__*/React.forwardRef(function ScrollableList(pro
|
|
4313
4296
|
"data-taco": "scrollable-list"
|
4314
4297
|
}), loading ? /*#__PURE__*/React.createElement("li", {
|
4315
4298
|
className: "yt-list__empty"
|
4316
|
-
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Spinner
|
4299
|
+
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Spinner, {
|
4317
4300
|
delay: 0
|
4318
4301
|
})), /*#__PURE__*/React.createElement("span", null, texts.listbox.loading)) : options.length ? options.map(({
|
4319
4302
|
children,
|
@@ -5109,7 +5092,7 @@ const Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref)
|
|
5109
5092
|
key: shortcut.text
|
5110
5093
|
}, /*#__PURE__*/React.createElement("button", {
|
5111
5094
|
type: "button",
|
5112
|
-
className: "hover:
|
5095
|
+
className: "hover:wcag-grey-200 flex w-full items-start px-4 py-1 text-xs",
|
5113
5096
|
onClick: event => {
|
5114
5097
|
event.persist();
|
5115
5098
|
shortcut.onClick(event);
|
@@ -5253,8 +5236,8 @@ const Content$4 = /*#__PURE__*/React.forwardRef(function DialogContent(props, re
|
|
5253
5236
|
const {
|
5254
5237
|
texts
|
5255
5238
|
} = useLocalization();
|
5256
|
-
const className = cn('relative bg-white animate-[fade-in_150ms]', getDialogPositionClassnames(), getDialogSizeClassnames(dialog.size));
|
5257
|
-
const containerClassName = cn('bg-white p-6 rounded relative z-10
|
5239
|
+
const className = cn('relative bg-white animate-[fade-in_150ms] rounded', getDialogPositionClassnames(), getDialogSizeClassnames(dialog.size));
|
5240
|
+
const containerClassName = cn('bg-white p-6 rounded relative z-10 shadow', {
|
5258
5241
|
'rounded-b-none': !!dialog.elements.extra
|
5259
5242
|
}, props.className);
|
5260
5243
|
const handleEscapeKeyDown = event => {
|
@@ -5345,7 +5328,7 @@ const Drawer = /*#__PURE__*/React.forwardRef(function DialogDrawer(props, ref) {
|
|
5345
5328
|
Drawer.displayName = 'DialogDrawer';
|
5346
5329
|
|
5347
5330
|
const Extra = /*#__PURE__*/React.forwardRef(function DialogExtra(props, ref) {
|
5348
|
-
const className = cn('
|
5331
|
+
const className = cn('wcag-grey-100 absolute top-full left-0 -mt-px w-full rounded-t-none rounded-b p-6 text-left', props.className);
|
5349
5332
|
return /*#__PURE__*/React.createElement("div", Object.assign({}, props, {
|
5350
5333
|
className: className,
|
5351
5334
|
"data-taco": "dialog-extra",
|
@@ -6122,7 +6105,7 @@ const useItemStyling = ({
|
|
6122
6105
|
return cn('flex items-center justify-start h-8 pr-1.5 relative rounded w-full focus:outline-none group', {
|
6123
6106
|
'pl-7': menu === null || menu === void 0 ? void 0 : menu.indented,
|
6124
6107
|
'pl-1.5': !(menu !== null && menu !== void 0 && menu.indented),
|
6125
|
-
'cursor-pointer hover:
|
6108
|
+
'cursor-pointer hover:wcag-grey-200 text-black': !disabled,
|
6126
6109
|
'cursor-not-allowed hover:bg-white text-grey-300': disabled
|
6127
6110
|
}, className);
|
6128
6111
|
};
|
@@ -7153,7 +7136,7 @@ const getBadgeIcon = type => {
|
|
7153
7136
|
className: cn(css, 'yt-blue-solid')
|
7154
7137
|
});
|
7155
7138
|
case 'loading':
|
7156
|
-
return /*#__PURE__*/React__default.createElement(Spinner
|
7139
|
+
return /*#__PURE__*/React__default.createElement(Spinner, {
|
7157
7140
|
delay: 0,
|
7158
7141
|
className: cn(css, 'h-6 w-6')
|
7159
7142
|
});
|
@@ -7724,7 +7707,7 @@ const Tag$1 = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
7724
7707
|
}) : null);
|
7725
7708
|
});
|
7726
7709
|
|
7727
|
-
const createOptionClassName = () => 'group mb-px flex h-8 w-full text-sm flex-shrink-0 font-normal cursor-pointer items-center rounded bg-white px-2 leading-8 text-black aria-hidden:hidden gap-1.5 bg-white hover:
|
7710
|
+
const createOptionClassName = () => 'group mb-px flex h-8 w-full text-sm flex-shrink-0 font-normal cursor-pointer items-center rounded bg-white px-2 leading-8 text-black aria-hidden:hidden gap-1.5 bg-white hover:wcag-grey-200 aria-current:wcag-grey-200 aria-disabled:text-black/25 aria-disabled:pointer-events-none';
|
7728
7711
|
const createCollectionClassName = () => 'flex flex-col gap-px';
|
7729
7712
|
|
7730
7713
|
const Select2Context = /*#__PURE__*/React__default.createContext({});
|
@@ -8627,6 +8610,24 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
8627
8610
|
// the focus should always remain on the input, so we forward events on to the listbox
|
8628
8611
|
(_listboxRef$current = listboxRef.current) === null || _listboxRef$current === void 0 ? void 0 : _listboxRef$current.dispatchEvent(createCustomKeyboardEvent(event));
|
8629
8612
|
};
|
8613
|
+
let handleBlur;
|
8614
|
+
if (otherProps.onBlur) {
|
8615
|
+
// we might be focusing on an input or something inside the dropdown that was triggered by the select
|
8616
|
+
// so see if the element gaining focus is inside a portal and look up its controller
|
8617
|
+
// if we don't do this, things like validate on blur occur while simply opening the select
|
8618
|
+
handleBlur = event => {
|
8619
|
+
var _elementGainingFocus$;
|
8620
|
+
const elementGainingFocus = event.relatedTarget;
|
8621
|
+
if (elementGainingFocus === undefined) {
|
8622
|
+
return;
|
8623
|
+
}
|
8624
|
+
const portalId = elementGainingFocus === null || elementGainingFocus === void 0 ? void 0 : (_elementGainingFocus$ = elementGainingFocus.closest('[data-radix-popper-content-wrapper] > :first-child')) === null || _elementGainingFocus$ === void 0 ? void 0 : _elementGainingFocus$.id;
|
8625
|
+
if (!portalId || event.currentTarget.getAttribute(`aria-controls`) !== portalId) {
|
8626
|
+
var _otherProps$onBlur;
|
8627
|
+
(_otherProps$onBlur = otherProps.onBlur) === null || _otherProps$onBlur === void 0 ? void 0 : _otherProps$onBlur.call(otherProps, event);
|
8628
|
+
}
|
8629
|
+
};
|
8630
|
+
}
|
8630
8631
|
const className = cn('border-grey-300 rounded border bg-white py-1.5 shadow-md outline-none', createCollectionClassName());
|
8631
8632
|
return /*#__PURE__*/React__default.createElement(Select2Context.Provider, {
|
8632
8633
|
value: context
|
@@ -8646,6 +8647,7 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
8646
8647
|
"data-taco": "Select2"
|
8647
8648
|
}, /*#__PURE__*/React__default.createElement(Trigger$6, Object.assign({}, otherProps, {
|
8648
8649
|
"aria-haspopup": "listbox",
|
8650
|
+
onBlur: handleBlur,
|
8649
8651
|
onKeyDown: handleKeyDown,
|
8650
8652
|
ref: internalRef
|
8651
8653
|
}), allChildren)), /*#__PURE__*/React__default.createElement(PopoverPrimitive.Portal, null, /*#__PURE__*/React__default.createElement(PopoverPrimitive.Content, {
|
@@ -9732,8 +9734,8 @@ const Row = /*#__PURE__*/React__default.forwardRef(function TableRow({
|
|
9732
9734
|
minHeight: rowHeight ? `${rowHeight}px` : undefined,
|
9733
9735
|
paddingLeft: row.depth ? `${row.depth * 2}rem` : undefined
|
9734
9736
|
},
|
9735
|
-
className: cn('yt-table__row border-grey-
|
9736
|
-
'yt-table__row--active bg-grey-
|
9737
|
+
className: cn('yt-table__row border-grey-300 flex border-b min-h-[2.5rem] hover:bg-grey-100', {
|
9738
|
+
'yt-table__row--active bg-grey-200 hover:bg-grey-200': activeIndex === index,
|
9737
9739
|
'yt-table__row--clickable': !!onRowClick,
|
9738
9740
|
'yt-table__row--dragging': !!row.isDragging,
|
9739
9741
|
'yt-table__row--editing': !!row.isEditing
|
@@ -10517,7 +10519,7 @@ exports.RadioGroup = RadioGroup;
|
|
10517
10519
|
exports.SearchInput = SearchInput;
|
10518
10520
|
exports.Select = Select;
|
10519
10521
|
exports.Select2 = Select2;
|
10520
|
-
exports.Spinner = Spinner
|
10522
|
+
exports.Spinner = Spinner;
|
10521
10523
|
exports.Switch = Switch;
|
10522
10524
|
exports.TAG_COLORS = TAG_COLORS;
|
10523
10525
|
exports.Table = Table;
|