@economic/taco 1.22.8 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Alert/Alert.d.ts +12 -0
- package/dist/components/Alert/Alert.stories.d.ts +36 -0
- package/dist/components/Badge/Badge.d.ts +44 -13
- package/dist/components/BadgeIcon/BadgeIcon.d.ts +19 -0
- package/dist/components/BadgeIcon/BadgeIcon.stories.d.ts +12 -0
- package/dist/components/Button/Button.stories.d.ts +1 -1
- package/dist/components/Datepicker/Datepicker.stories.d.ts +1 -1
- package/dist/components/Select/Select.stories.d.ts +1 -1
- package/dist/components/Select/useSelect.d.ts +1 -1
- package/dist/components/Select2/Select2.d.ts +1 -2
- package/dist/components/Select2/Select2.stories.d.ts +0 -1
- package/dist/components/Select2/components/Context.d.ts +3 -1
- package/dist/components/Select2/components/Create.d.ts +1 -1
- package/dist/components/Select2/components/Edit.d.ts +2 -2
- package/dist/components/Select2/components/Option.d.ts +2 -2
- package/dist/components/Select2/utilities.d.ts +1 -1
- package/dist/components/Table2/components/row/Context.d.ts +3 -1
- package/dist/components/Tag/Tag.d.ts +3 -14
- package/dist/esm/index.css +14 -2
- package/dist/esm/packages/taco/src/components/Accordion/Accordion.js +1 -1
- package/dist/esm/packages/taco/src/components/Alert/Alert.js +49 -0
- package/dist/esm/packages/taco/src/components/Alert/Alert.js.map +1 -0
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js +1 -1
- package/dist/esm/packages/taco/src/components/Badge/Badge.js +28 -8
- package/dist/esm/packages/taco/src/components/Badge/Badge.js.map +1 -1
- package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js +30 -0
- package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Hanger/Hanger.js +1 -1
- package/dist/esm/packages/taco/src/components/Popover/Popover.js +1 -1
- package/dist/esm/packages/taco/src/components/Select/useSelect.js +2 -0
- package/dist/esm/packages/taco/src/components/Select/useSelect.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js +12 -3
- package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Create.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js +2 -3
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js +2 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/utilities.js +5 -1
- package/dist/esm/packages/taco/src/components/Select2/utilities.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/components/ColumnSettingsButton.js +7 -5
- package/dist/esm/packages/taco/src/components/Table2/components/ColumnSettingsButton.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/components/row/Context.js +5 -2
- package/dist/esm/packages/taco/src/components/Table2/components/row/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/components/row/Row.js +2 -1
- package/dist/esm/packages/taco/src/components/Table2/components/row/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js +4 -3
- package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useTable.js +2 -2
- package/dist/esm/packages/taco/src/components/Table2/hooks/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js +3 -1
- package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tag/Tag.js +3 -13
- package/dist/esm/packages/taco/src/components/Tag/Tag.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useIsFormControl.js +1 -1
- package/dist/esm/packages/taco/src/hooks/useIsFormControl.js.map +1 -1
- package/dist/esm/packages/taco/src/{components/Table2/hooks/useShouldPauseHoverState.js → hooks/useIsHoverStatePaused.js} +3 -3
- package/dist/esm/packages/taco/src/hooks/useIsHoverStatePaused.js.map +1 -0
- package/dist/esm/packages/taco/src/index.js +5 -3
- package/dist/esm/packages/taco/src/index.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js +6 -0
- package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Root.js +2 -2
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Root.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/taillwind.js +79 -20
- package/dist/esm/packages/taco/src/utils/taillwind.js.map +1 -1
- package/dist/hooks/useIsHoverStatePaused.d.ts +2 -0
- package/dist/index.css +14 -2
- package/dist/index.d.ts +2 -0
- package/dist/taco.cjs.development.js +370 -211
- 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/types.d.ts +2 -0
- package/dist/utils/taillwind.d.ts +6 -4
- package/package.json +2 -2
- package/tailwind.config.js +9 -11
- package/types.json +92 -30
- package/dist/components/Badge/Badge.stories.d.ts +0 -15
- package/dist/components/Table2/hooks/useShouldPauseHoverState.d.ts +0 -2
- package/dist/esm/packages/taco/src/components/Table2/hooks/useShouldPauseHoverState.js.map +0 -1
- package/dist/utils/colors.d.ts +0 -12
|
@@ -6,8 +6,8 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
6
6
|
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var React__default = _interopDefault(React);
|
|
9
|
-
var AlertDialogPrimitive = require('@radix-ui/react-alert-dialog');
|
|
10
9
|
var cn = _interopDefault(require('classnames'));
|
|
10
|
+
var AlertDialogPrimitive = require('@radix-ui/react-alert-dialog');
|
|
11
11
|
var AccordionPrimitive = require('@radix-ui/react-accordion');
|
|
12
12
|
var TooltipPrimitive = require('@radix-ui/react-tooltip');
|
|
13
13
|
var ReactDayPicker = _interopDefault(require('react-day-picker'));
|
|
@@ -45,131 +45,95 @@ var TabsPrimitive = require('@radix-ui/react-tabs');
|
|
|
45
45
|
var Joyride = require('react-joyride');
|
|
46
46
|
var Joyride__default = _interopDefault(Joyride);
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
const AVAILABLE_COLORS = ['green', 'yellow', 'red', 'blue', 'purple', 'brown', 'pink', 'orange', 'grey', 'transparent'];
|
|
49
|
+
const getColorByState = state => {
|
|
50
|
+
switch (state) {
|
|
51
|
+
case 'information':
|
|
52
|
+
return 'blue';
|
|
53
|
+
case 'warning':
|
|
54
|
+
return 'yellow';
|
|
55
|
+
case 'error':
|
|
56
|
+
return 'red';
|
|
57
|
+
case 'success':
|
|
58
|
+
return 'green';
|
|
59
|
+
default:
|
|
60
|
+
return 'grey';
|
|
61
|
+
}
|
|
55
62
|
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
case '
|
|
114
|
-
return '
|
|
115
|
-
case '
|
|
116
|
-
return '
|
|
117
|
-
case '
|
|
118
|
-
return '
|
|
119
|
-
case '
|
|
120
|
-
return '
|
|
121
|
-
case '
|
|
122
|
-
return '
|
|
63
|
+
const getOutlineColorShadeClasses = state => {
|
|
64
|
+
switch (state) {
|
|
65
|
+
case 'green':
|
|
66
|
+
return 'border-green-700 text-green-700';
|
|
67
|
+
case 'yellow':
|
|
68
|
+
return 'border-yellow-700 text-yellow-700';
|
|
69
|
+
case 'red':
|
|
70
|
+
return 'border-red-500 text-red-500';
|
|
71
|
+
case 'blue':
|
|
72
|
+
return 'border-blue-500 text-blue-500';
|
|
73
|
+
case 'purple':
|
|
74
|
+
return 'border-purple-700 text-purple-700';
|
|
75
|
+
case 'brown':
|
|
76
|
+
return 'border-brown-700 text-brown-700';
|
|
77
|
+
case 'pink':
|
|
78
|
+
return 'border-pink-700 text-pink-700';
|
|
79
|
+
case 'orange':
|
|
80
|
+
return 'border-orange-700 text-orange-700';
|
|
81
|
+
case 'transparent':
|
|
82
|
+
case 'grey':
|
|
83
|
+
default:
|
|
84
|
+
return 'border-grey-700 text-grey-700';
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
const getSubtleColorShadeClasses = value => {
|
|
88
|
+
switch (value) {
|
|
89
|
+
case 'green':
|
|
90
|
+
return 'wcag-green-100';
|
|
91
|
+
case 'yellow':
|
|
92
|
+
return 'wcag-yellow-100';
|
|
93
|
+
case 'red':
|
|
94
|
+
return 'wcag-red-100';
|
|
95
|
+
case 'blue':
|
|
96
|
+
return 'wcag-blue-100';
|
|
97
|
+
case 'purple':
|
|
98
|
+
return 'wcag-purple-100';
|
|
99
|
+
case 'brown':
|
|
100
|
+
return 'wcag-brown-100';
|
|
101
|
+
case 'pink':
|
|
102
|
+
return 'wcag-pink-100';
|
|
103
|
+
case 'orange':
|
|
104
|
+
return 'wcag-orange-100';
|
|
105
|
+
case 'transparent':
|
|
106
|
+
return 'wcag-transparent';
|
|
107
|
+
case 'grey':
|
|
108
|
+
default:
|
|
109
|
+
return 'wcag-grey-200';
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
const getColorShadeClasses = value => {
|
|
113
|
+
switch (value) {
|
|
114
|
+
case 'green':
|
|
115
|
+
return 'wcag-green-700';
|
|
116
|
+
case 'yellow':
|
|
117
|
+
return 'wcag-yellow-500';
|
|
118
|
+
case 'red':
|
|
119
|
+
return 'wcag-red-500';
|
|
120
|
+
case 'blue':
|
|
121
|
+
return 'wcag-blue-500';
|
|
122
|
+
case 'purple':
|
|
123
|
+
return 'wcag-purple-700';
|
|
124
|
+
case 'brown':
|
|
125
|
+
return 'wcag-brown-700';
|
|
126
|
+
case 'pink':
|
|
127
|
+
return 'wcag-pink-500';
|
|
128
|
+
case 'orange':
|
|
129
|
+
return 'wcag-orange-700';
|
|
130
|
+
case 'transparent':
|
|
131
|
+
return 'wcag-transparent';
|
|
132
|
+
case 'grey':
|
|
133
|
+
default:
|
|
134
|
+
return 'wcag-grey-700';
|
|
123
135
|
}
|
|
124
136
|
};
|
|
125
|
-
const getDialogPositionClassnames = () => 'mt-16 mx-auto';
|
|
126
|
-
const getDialogStylingClassnames = () => 'bg-white rounded animate-[fade-in_150ms] shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]';
|
|
127
|
-
|
|
128
|
-
const Title = /*#__PURE__*/React.forwardRef(function AlertDialogTitle(props, ref) {
|
|
129
|
-
const className = cn('text-center', props.className);
|
|
130
|
-
return /*#__PURE__*/React.createElement(AlertDialogPrimitive.Title, Object.assign({}, props, {
|
|
131
|
-
className: className,
|
|
132
|
-
ref: ref
|
|
133
|
-
}));
|
|
134
|
-
});
|
|
135
|
-
const Content = /*#__PURE__*/React.forwardRef(function AlertDialogContent(props, ref) {
|
|
136
|
-
const className = cn('p-6', getDialogPositionClassnames(), getDialogStylingClassnames(), getDialogSizeClassnames('dialog'));
|
|
137
|
-
return /*#__PURE__*/React.createElement(AlertDialogPrimitive.Portal, null, /*#__PURE__*/React.createElement(AlertDialogPrimitive.Overlay, {
|
|
138
|
-
asChild: true
|
|
139
|
-
}, /*#__PURE__*/React.createElement(Backdrop, null, /*#__PURE__*/React.createElement(AlertDialogPrimitive.Content, Object.assign({}, props, {
|
|
140
|
-
ref: ref,
|
|
141
|
-
className: className,
|
|
142
|
-
onEscapeKeyDown: event => event.preventDefault()
|
|
143
|
-
}), props.children))));
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
const AlertDialog = /*#__PURE__*/React.forwardRef(function AlertDialog(props, ref) {
|
|
147
|
-
const {
|
|
148
|
-
children: initialChildren,
|
|
149
|
-
defaultOpen,
|
|
150
|
-
onChange,
|
|
151
|
-
open,
|
|
152
|
-
trigger,
|
|
153
|
-
...otherProps
|
|
154
|
-
} = props;
|
|
155
|
-
const context = React.useMemo(() => ({
|
|
156
|
-
props: otherProps,
|
|
157
|
-
ref
|
|
158
|
-
}), [open, otherProps]);
|
|
159
|
-
return /*#__PURE__*/React.createElement(AlertDialogContext.Provider, {
|
|
160
|
-
value: context
|
|
161
|
-
}, /*#__PURE__*/React.createElement(AlertDialogPrimitive.Root, Object.assign({}, props, {
|
|
162
|
-
defaultOpen: defaultOpen,
|
|
163
|
-
open: open,
|
|
164
|
-
onOpenChange: onChange
|
|
165
|
-
}), trigger && /*#__PURE__*/React.createElement(Trigger, null, trigger), props.children));
|
|
166
|
-
});
|
|
167
|
-
AlertDialog.Trigger = Trigger;
|
|
168
|
-
AlertDialog.Content = Content;
|
|
169
|
-
AlertDialog.Title = Title;
|
|
170
|
-
AlertDialog.Cancel = Cancel;
|
|
171
|
-
AlertDialog.Action = Action;
|
|
172
|
-
AlertDialog.Footer = Footer;
|
|
173
137
|
|
|
174
138
|
function IconAccountPreview(props, svgRef) {
|
|
175
139
|
return /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
@@ -3249,6 +3213,196 @@ const Icon = /*#__PURE__*/React__default.forwardRef(function Icon(props, ref) {
|
|
|
3249
3213
|
})) : null;
|
|
3250
3214
|
});
|
|
3251
3215
|
|
|
3216
|
+
const BadgeIcon = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {
|
|
3217
|
+
const {
|
|
3218
|
+
color,
|
|
3219
|
+
icon,
|
|
3220
|
+
subtle,
|
|
3221
|
+
...otherProps
|
|
3222
|
+
} = props;
|
|
3223
|
+
const className = cn(`rounded-full border overflow-hidden whitespace-nowrap inline-flex items-center justify-center w-5 h-5 border-transparent [&>*]:max-h-full`, {
|
|
3224
|
+
[getSubtleColorShadeClasses(color)]: subtle,
|
|
3225
|
+
[getColorShadeClasses(color)]: !subtle
|
|
3226
|
+
}, props.className);
|
|
3227
|
+
return /*#__PURE__*/React.createElement("span", Object.assign({}, otherProps, {
|
|
3228
|
+
"aria-label": "icon",
|
|
3229
|
+
className: className,
|
|
3230
|
+
"data-taco": "badge-icon",
|
|
3231
|
+
ref: ref,
|
|
3232
|
+
role: "status",
|
|
3233
|
+
title: props['aria-label']
|
|
3234
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
|
3235
|
+
name: icon
|
|
3236
|
+
}));
|
|
3237
|
+
});
|
|
3238
|
+
|
|
3239
|
+
const getIconName = state => {
|
|
3240
|
+
switch (state) {
|
|
3241
|
+
case 'information':
|
|
3242
|
+
return 'info';
|
|
3243
|
+
case 'warning':
|
|
3244
|
+
return 'warning';
|
|
3245
|
+
case 'error':
|
|
3246
|
+
return 'close';
|
|
3247
|
+
case 'success':
|
|
3248
|
+
return 'tick';
|
|
3249
|
+
default:
|
|
3250
|
+
return 'refresh';
|
|
3251
|
+
}
|
|
3252
|
+
};
|
|
3253
|
+
const Alert = /*#__PURE__*/React__default.forwardRef(function Alert(props, ref) {
|
|
3254
|
+
const {
|
|
3255
|
+
children,
|
|
3256
|
+
title,
|
|
3257
|
+
state,
|
|
3258
|
+
onClose
|
|
3259
|
+
} = props;
|
|
3260
|
+
const className = cn(`flex w-full flex-row items-start gap-2 rounded-md border-transparent p-3 ${getSubtleColorShadeClasses(getColorByState(state))}`, props.className);
|
|
3261
|
+
return /*#__PURE__*/React__default.createElement("div", Object.assign({}, props, {
|
|
3262
|
+
ref: ref,
|
|
3263
|
+
className: className,
|
|
3264
|
+
role: "alert"
|
|
3265
|
+
}), /*#__PURE__*/React__default.createElement(BadgeIcon, {
|
|
3266
|
+
className: "flex-none",
|
|
3267
|
+
icon: getIconName(state),
|
|
3268
|
+
color: getColorByState(state)
|
|
3269
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
3270
|
+
className: "grow text-sm"
|
|
3271
|
+
}, title && /*#__PURE__*/React__default.createElement("div", {
|
|
3272
|
+
className: "font-bold"
|
|
3273
|
+
}, title), children), onClose && /*#__PURE__*/React__default.createElement(Icon, {
|
|
3274
|
+
className: "flex-none cursor-pointer",
|
|
3275
|
+
name: "close",
|
|
3276
|
+
onClick: onClose
|
|
3277
|
+
}));
|
|
3278
|
+
});
|
|
3279
|
+
|
|
3280
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
3281
|
+
const AlertDialogContext = /*#__PURE__*/React__default.createContext({
|
|
3282
|
+
props: {},
|
|
3283
|
+
ref: null
|
|
3284
|
+
});
|
|
3285
|
+
const useCurrentAlertDialog = () => {
|
|
3286
|
+
return React__default.useContext(AlertDialogContext);
|
|
3287
|
+
};
|
|
3288
|
+
|
|
3289
|
+
function mergeRefs(refs) {
|
|
3290
|
+
return value => {
|
|
3291
|
+
refs.forEach(ref => {
|
|
3292
|
+
if (typeof ref === 'function') {
|
|
3293
|
+
ref(value);
|
|
3294
|
+
} else if (ref != null) {
|
|
3295
|
+
ref.current = value;
|
|
3296
|
+
}
|
|
3297
|
+
});
|
|
3298
|
+
};
|
|
3299
|
+
}
|
|
3300
|
+
|
|
3301
|
+
const Trigger = /*#__PURE__*/React.forwardRef(function AlertDialogTrigger(props, externalRef) {
|
|
3302
|
+
const {
|
|
3303
|
+
ref: parentRef,
|
|
3304
|
+
props: parentProps
|
|
3305
|
+
} = useCurrentAlertDialog();
|
|
3306
|
+
const refCallback = mergeRefs([parentRef, externalRef]);
|
|
3307
|
+
return /*#__PURE__*/React.createElement(AlertDialogPrimitive.Trigger, Object.assign({}, parentProps, props, {
|
|
3308
|
+
ref: refCallback,
|
|
3309
|
+
asChild: true
|
|
3310
|
+
}));
|
|
3311
|
+
});
|
|
3312
|
+
|
|
3313
|
+
const Footer = /*#__PURE__*/React.forwardRef(function AlertDialogFooter(props, ref) {
|
|
3314
|
+
const className = 'flex justify-end gap-2';
|
|
3315
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({}, props, {
|
|
3316
|
+
className: className,
|
|
3317
|
+
ref: ref
|
|
3318
|
+
}), props.children);
|
|
3319
|
+
});
|
|
3320
|
+
const Cancel = /*#__PURE__*/React.forwardRef(function AlertDialogCancel(props, ref) {
|
|
3321
|
+
return /*#__PURE__*/React.createElement(AlertDialogPrimitive.Cancel, Object.assign({}, props, {
|
|
3322
|
+
ref: ref,
|
|
3323
|
+
asChild: true
|
|
3324
|
+
}));
|
|
3325
|
+
});
|
|
3326
|
+
const Action = /*#__PURE__*/React.forwardRef(function AlertDialogAction(props, ref) {
|
|
3327
|
+
return /*#__PURE__*/React.createElement(AlertDialogPrimitive.Action, Object.assign({}, props, {
|
|
3328
|
+
className: props.className,
|
|
3329
|
+
ref: ref,
|
|
3330
|
+
asChild: true
|
|
3331
|
+
}));
|
|
3332
|
+
});
|
|
3333
|
+
|
|
3334
|
+
const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(props, ref) {
|
|
3335
|
+
const className = cn('fixed inset-0 cursor-default overflow-y-auto bg-blue-900/[0.3] aria-hidden:invisible', props.className);
|
|
3336
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({}, props, {
|
|
3337
|
+
className: className,
|
|
3338
|
+
"data-taco": "backdrop",
|
|
3339
|
+
ref: ref
|
|
3340
|
+
}));
|
|
3341
|
+
});
|
|
3342
|
+
|
|
3343
|
+
const getDialogSizeClassnames = size => {
|
|
3344
|
+
switch (size) {
|
|
3345
|
+
case 'dialog':
|
|
3346
|
+
return 'w-128';
|
|
3347
|
+
case 'xs':
|
|
3348
|
+
return 'w-xs';
|
|
3349
|
+
case 'sm':
|
|
3350
|
+
return 'w-sm';
|
|
3351
|
+
case 'md':
|
|
3352
|
+
return 'w-md';
|
|
3353
|
+
case 'lg':
|
|
3354
|
+
return 'w-lg';
|
|
3355
|
+
}
|
|
3356
|
+
};
|
|
3357
|
+
const getDialogPositionClassnames = () => 'mt-16 mx-auto';
|
|
3358
|
+
const getDialogStylingClassnames = () => 'bg-white rounded animate-[fade-in_150ms] shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]';
|
|
3359
|
+
|
|
3360
|
+
const Title = /*#__PURE__*/React.forwardRef(function AlertDialogTitle(props, ref) {
|
|
3361
|
+
const className = cn('text-center', props.className);
|
|
3362
|
+
return /*#__PURE__*/React.createElement(AlertDialogPrimitive.Title, Object.assign({}, props, {
|
|
3363
|
+
className: className,
|
|
3364
|
+
ref: ref
|
|
3365
|
+
}));
|
|
3366
|
+
});
|
|
3367
|
+
const Content = /*#__PURE__*/React.forwardRef(function AlertDialogContent(props, ref) {
|
|
3368
|
+
const className = cn('p-6', getDialogPositionClassnames(), getDialogStylingClassnames(), getDialogSizeClassnames('dialog'));
|
|
3369
|
+
return /*#__PURE__*/React.createElement(AlertDialogPrimitive.Portal, null, /*#__PURE__*/React.createElement(AlertDialogPrimitive.Overlay, {
|
|
3370
|
+
asChild: true
|
|
3371
|
+
}, /*#__PURE__*/React.createElement(Backdrop, null, /*#__PURE__*/React.createElement(AlertDialogPrimitive.Content, Object.assign({}, props, {
|
|
3372
|
+
ref: ref,
|
|
3373
|
+
className: className,
|
|
3374
|
+
onEscapeKeyDown: event => event.preventDefault()
|
|
3375
|
+
}), props.children))));
|
|
3376
|
+
});
|
|
3377
|
+
|
|
3378
|
+
const AlertDialog = /*#__PURE__*/React.forwardRef(function AlertDialog(props, ref) {
|
|
3379
|
+
const {
|
|
3380
|
+
children: initialChildren,
|
|
3381
|
+
defaultOpen,
|
|
3382
|
+
onChange,
|
|
3383
|
+
open,
|
|
3384
|
+
trigger,
|
|
3385
|
+
...otherProps
|
|
3386
|
+
} = props;
|
|
3387
|
+
const context = React.useMemo(() => ({
|
|
3388
|
+
props: otherProps,
|
|
3389
|
+
ref
|
|
3390
|
+
}), [open, otherProps]);
|
|
3391
|
+
return /*#__PURE__*/React.createElement(AlertDialogContext.Provider, {
|
|
3392
|
+
value: context
|
|
3393
|
+
}, /*#__PURE__*/React.createElement(AlertDialogPrimitive.Root, Object.assign({}, props, {
|
|
3394
|
+
defaultOpen: defaultOpen,
|
|
3395
|
+
open: open,
|
|
3396
|
+
onOpenChange: onChange
|
|
3397
|
+
}), trigger && /*#__PURE__*/React.createElement(Trigger, null, trigger), props.children));
|
|
3398
|
+
});
|
|
3399
|
+
AlertDialog.Trigger = Trigger;
|
|
3400
|
+
AlertDialog.Content = Content;
|
|
3401
|
+
AlertDialog.Title = Title;
|
|
3402
|
+
AlertDialog.Cancel = Cancel;
|
|
3403
|
+
AlertDialog.Action = Action;
|
|
3404
|
+
AlertDialog.Footer = Footer;
|
|
3405
|
+
|
|
3252
3406
|
const AccordionContext = /*#__PURE__*/React__default.createContext({
|
|
3253
3407
|
as: 'h2'
|
|
3254
3408
|
});
|
|
@@ -3335,51 +3489,40 @@ const VisuallyHidden = /*#__PURE__*/React.forwardRef(function VisuallyHidden(pro
|
|
|
3335
3489
|
}));
|
|
3336
3490
|
});
|
|
3337
3491
|
|
|
3338
|
-
const getStateClasses = value => {
|
|
3339
|
-
switch (value) {
|
|
3340
|
-
case 'information':
|
|
3341
|
-
return 'yt-blue-solid';
|
|
3342
|
-
case 'warning':
|
|
3343
|
-
return 'yt-yellow-solid';
|
|
3344
|
-
case 'error':
|
|
3345
|
-
return 'yt-red-solid';
|
|
3346
|
-
case 'success':
|
|
3347
|
-
return 'yt-green-solid';
|
|
3348
|
-
default:
|
|
3349
|
-
return 'yt-grey-solid';
|
|
3350
|
-
}
|
|
3351
|
-
};
|
|
3352
|
-
const getOutlineClasses = state => {
|
|
3353
|
-
switch (state) {
|
|
3354
|
-
case 'information':
|
|
3355
|
-
case 'primary':
|
|
3356
|
-
return 'yt-blue-inverted';
|
|
3357
|
-
case 'warning':
|
|
3358
|
-
return 'yt-yellow-inverted';
|
|
3359
|
-
case 'error':
|
|
3360
|
-
case 'danger':
|
|
3361
|
-
return 'yt-red-inverted';
|
|
3362
|
-
case 'success':
|
|
3363
|
-
return 'yt-green-inverted';
|
|
3364
|
-
default:
|
|
3365
|
-
return 'yt-grey-inverted';
|
|
3366
|
-
}
|
|
3367
|
-
};
|
|
3368
|
-
|
|
3369
3492
|
const Badge = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {
|
|
3370
3493
|
const {
|
|
3371
3494
|
children,
|
|
3372
3495
|
compact = false,
|
|
3373
3496
|
outline = false,
|
|
3374
|
-
|
|
3497
|
+
status = false,
|
|
3498
|
+
subtle = false,
|
|
3499
|
+
small = false,
|
|
3500
|
+
color,
|
|
3375
3501
|
...otherProps
|
|
3376
3502
|
} = props;
|
|
3377
|
-
const
|
|
3378
|
-
|
|
3379
|
-
[`border
|
|
3503
|
+
const isTransparent = color === 'transparent';
|
|
3504
|
+
const className = cn('rounded-full border overflow-hidden whitespace-nowrap inline-flex items-center justify-center', {
|
|
3505
|
+
[`border ${getOutlineColorShadeClasses(color)}`]: outline,
|
|
3506
|
+
[`border-transparent font-normal ${getSubtleColorShadeClasses(color)}`]: subtle,
|
|
3507
|
+
[`border-transparent ${getColorShadeClasses(color)}`]: !outline && !subtle,
|
|
3508
|
+
'h-4 min-w-0 py-0 px-1 text-xs': small,
|
|
3380
3509
|
'h-2 w-2 min-w-0': compact,
|
|
3381
|
-
'
|
|
3510
|
+
'font-bold': outline || !subtle,
|
|
3511
|
+
'text-sm': !small,
|
|
3512
|
+
'h-5 py-0 px-1.5': !compact && !small,
|
|
3513
|
+
'!bg-grey-700': compact && isTransparent
|
|
3382
3514
|
}, props.className);
|
|
3515
|
+
const content = () => {
|
|
3516
|
+
if (compact) {
|
|
3517
|
+
return /*#__PURE__*/React.createElement(VisuallyHidden, null, children);
|
|
3518
|
+
}
|
|
3519
|
+
if (status) {
|
|
3520
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
3521
|
+
className: cn('mr-1 h-2 w-2 rounded-full', getColorShadeClasses(color))
|
|
3522
|
+
}), children);
|
|
3523
|
+
}
|
|
3524
|
+
return children;
|
|
3525
|
+
};
|
|
3383
3526
|
return /*#__PURE__*/React.createElement("span", Object.assign({}, otherProps, {
|
|
3384
3527
|
"aria-atomic": "true",
|
|
3385
3528
|
"aria-live": "polite",
|
|
@@ -3388,7 +3531,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(props, ref) {
|
|
|
3388
3531
|
ref: ref,
|
|
3389
3532
|
role: "status",
|
|
3390
3533
|
title: props['aria-label']
|
|
3391
|
-
}),
|
|
3534
|
+
}), content());
|
|
3392
3535
|
});
|
|
3393
3536
|
|
|
3394
3537
|
const getBannerIcon = type => {
|
|
@@ -6892,6 +7035,7 @@ const useSelect = ({
|
|
|
6892
7035
|
onClick,
|
|
6893
7036
|
onChange,
|
|
6894
7037
|
readOnly,
|
|
7038
|
+
tabIndex,
|
|
6895
7039
|
value,
|
|
6896
7040
|
...otherProps
|
|
6897
7041
|
}, ref) => {
|
|
@@ -7019,6 +7163,7 @@ const useSelect = ({
|
|
|
7019
7163
|
disabled: disabled || readOnly,
|
|
7020
7164
|
id: buttonId,
|
|
7021
7165
|
onKeyDown: !disabled && !readOnly ? handleButtonKeyDown : undefined,
|
|
7166
|
+
tabIndex,
|
|
7022
7167
|
type: 'button'
|
|
7023
7168
|
};
|
|
7024
7169
|
const listbox = {
|
|
@@ -7653,6 +7798,12 @@ const Root = /*#__PURE__*/React__default.forwardRef(function CollectionRoot(prop
|
|
|
7653
7798
|
if (event.target !== event.currentTarget) {
|
|
7654
7799
|
return;
|
|
7655
7800
|
}
|
|
7801
|
+
if (otherProps.onKeyDown) {
|
|
7802
|
+
otherProps.onKeyDown(event);
|
|
7803
|
+
}
|
|
7804
|
+
if (event.isDefaultPrevented()) {
|
|
7805
|
+
return;
|
|
7806
|
+
}
|
|
7656
7807
|
const options = getOptionsFromCollection(event.currentTarget, querySelector);
|
|
7657
7808
|
if (options) {
|
|
7658
7809
|
if (isAriaDirectionKey(event)) {
|
|
@@ -7750,9 +7901,9 @@ const Root$1 = /*#__PURE__*/React__default.forwardRef(function Listbox2(props, r
|
|
|
7750
7901
|
}, /*#__PURE__*/React__default.createElement(Root, Object.assign({}, otherProps, {
|
|
7751
7902
|
"aria-multiselectable": multiple ? true : undefined,
|
|
7752
7903
|
id: id,
|
|
7904
|
+
querySelector: customSelector ? `${DEFAULT_SELECTOR}, ${customSelector}` : DEFAULT_SELECTOR,
|
|
7753
7905
|
ref: ref,
|
|
7754
|
-
role: "listbox"
|
|
7755
|
-
querySelector: customSelector ? `${DEFAULT_SELECTOR}, ${customSelector}` : DEFAULT_SELECTOR
|
|
7906
|
+
role: "listbox"
|
|
7756
7907
|
}), children)));
|
|
7757
7908
|
});
|
|
7758
7909
|
const createListboxValueSetter = (multiple, setValue) => nextValue => {
|
|
@@ -7860,17 +8011,6 @@ const Title$3 = /*#__PURE__*/React__default.forwardRef(function Listbox2Group(pr
|
|
|
7860
8011
|
}));
|
|
7861
8012
|
});
|
|
7862
8013
|
|
|
7863
|
-
const TAG_COLORS = {
|
|
7864
|
-
green: 'wcag-green-100',
|
|
7865
|
-
yellow: 'wcag-yellow-100',
|
|
7866
|
-
red: 'wcag-red-100',
|
|
7867
|
-
blue: 'wcag-blue-100',
|
|
7868
|
-
purple: 'wcag-purple-100',
|
|
7869
|
-
orange: 'wcag-orange-100',
|
|
7870
|
-
brown: 'wcag-brown-100',
|
|
7871
|
-
pink: 'wcag-pink-100',
|
|
7872
|
-
grey: 'wcag-grey-200'
|
|
7873
|
-
};
|
|
7874
8014
|
const Tag$1 = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
7875
8015
|
const {
|
|
7876
8016
|
children,
|
|
@@ -7887,7 +8027,7 @@ const Tag$1 = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
|
7887
8027
|
'hover:bg-opacity-75': !disabled,
|
|
7888
8028
|
'cursor-pointer': !!otherProps.onClick,
|
|
7889
8029
|
'pointer-events-none': disabled || readOnly
|
|
7890
|
-
}, color
|
|
8030
|
+
}, getSubtleColorShadeClasses(color), props.className);
|
|
7891
8031
|
return /*#__PURE__*/React__default.createElement("span", Object.assign({}, otherProps, {
|
|
7892
8032
|
className: className,
|
|
7893
8033
|
ref: ref,
|
|
@@ -7907,7 +8047,9 @@ const Tag$1 = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
|
7907
8047
|
}) : null);
|
|
7908
8048
|
});
|
|
7909
8049
|
|
|
7910
|
-
const createOptionClassName = () => 'group mb-px flex 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
|
|
8050
|
+
const createOptionClassName = (shouldPauseHoverState = false) => cn('group mb-px flex 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 aria-current:wcag-grey-200 aria-disabled:text-black/25 aria-disabled:pointer-events-none', {
|
|
8051
|
+
'hover:wcag-grey-200': !shouldPauseHoverState
|
|
8052
|
+
});
|
|
7911
8053
|
const createCollectionClassName = () => 'flex flex-col gap-px';
|
|
7912
8054
|
|
|
7913
8055
|
const Select2Context = /*#__PURE__*/React__default.createContext({});
|
|
@@ -7943,7 +8085,6 @@ function _finallyRethrows(body, finalizer) {
|
|
|
7943
8085
|
return finalizer(false, result);
|
|
7944
8086
|
}
|
|
7945
8087
|
|
|
7946
|
-
const AVAILABLE_COLORS = /*#__PURE__*/Object.keys(TAG_COLORS);
|
|
7947
8088
|
const EditPopover = props => {
|
|
7948
8089
|
const {
|
|
7949
8090
|
color: initialColor,
|
|
@@ -8104,7 +8245,7 @@ const Colours = props => {
|
|
|
8104
8245
|
value: color
|
|
8105
8246
|
}, AVAILABLE_COLORS.map(availableColor => /*#__PURE__*/React__default.createElement(RadioGroupPrimitive.Item, {
|
|
8106
8247
|
"aria-label": color,
|
|
8107
|
-
className: cn('flex h-6 w-6 cursor-pointer items-center justify-center rounded',
|
|
8248
|
+
className: cn('flex h-6 w-6 cursor-pointer items-center justify-center rounded', getSubtleColorShadeClasses(availableColor)),
|
|
8108
8249
|
key: availableColor,
|
|
8109
8250
|
onFocus: () => onChangeColor(availableColor),
|
|
8110
8251
|
value: availableColor
|
|
@@ -8128,7 +8269,6 @@ const Option$1 = /*#__PURE__*/React__default.forwardRef(function Select2Option(p
|
|
|
8128
8269
|
icon,
|
|
8129
8270
|
...otherProps
|
|
8130
8271
|
} = props;
|
|
8131
|
-
const className = createOptionClassName();
|
|
8132
8272
|
const {
|
|
8133
8273
|
onDelete,
|
|
8134
8274
|
onEdit,
|
|
@@ -8136,9 +8276,11 @@ const Option$1 = /*#__PURE__*/React__default.forwardRef(function Select2Option(p
|
|
|
8136
8276
|
multiple,
|
|
8137
8277
|
ref: selectRef,
|
|
8138
8278
|
setOpen,
|
|
8279
|
+
shouldPauseHoverState,
|
|
8139
8280
|
tags,
|
|
8140
8281
|
value
|
|
8141
8282
|
} = useSelect2Context();
|
|
8283
|
+
const className = createOptionClassName(shouldPauseHoverState);
|
|
8142
8284
|
const hasValue = Array.isArray(value) ? !!value.length : value !== undefined;
|
|
8143
8285
|
const isTag = tags && !!color;
|
|
8144
8286
|
const handleClick = () => {
|
|
@@ -8507,7 +8649,7 @@ const useIsFormControl = (ref, reset) => {
|
|
|
8507
8649
|
formElement.removeEventListener('reset', reset);
|
|
8508
8650
|
}
|
|
8509
8651
|
};
|
|
8510
|
-
}, [ref]);
|
|
8652
|
+
}, [ref.current]);
|
|
8511
8653
|
return isFormControl;
|
|
8512
8654
|
};
|
|
8513
8655
|
|
|
@@ -8767,12 +8909,26 @@ const Collection = props => {
|
|
|
8767
8909
|
}, children);
|
|
8768
8910
|
};
|
|
8769
8911
|
|
|
8912
|
+
const useIsHoverStatePaused = () => {
|
|
8913
|
+
const [shouldPauseHoverState, setShouldPauseHoverState] = React__default.useState(false);
|
|
8914
|
+
// as soon as the mouse starts moving again, unpause hover state
|
|
8915
|
+
React__default.useEffect(() => {
|
|
8916
|
+
const move = () => setShouldPauseHoverState(false);
|
|
8917
|
+
if (shouldPauseHoverState) {
|
|
8918
|
+
document.addEventListener('mousemove', move);
|
|
8919
|
+
}
|
|
8920
|
+
return () => {
|
|
8921
|
+
document.removeEventListener('mousemove', move);
|
|
8922
|
+
};
|
|
8923
|
+
}, [shouldPauseHoverState]);
|
|
8924
|
+
return [shouldPauseHoverState, setShouldPauseHoverState];
|
|
8925
|
+
};
|
|
8926
|
+
|
|
8770
8927
|
const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, ref) {
|
|
8771
8928
|
const {
|
|
8772
8929
|
children: initialChildren,
|
|
8773
8930
|
defaultValue: defaultProp,
|
|
8774
8931
|
disabled = false,
|
|
8775
|
-
disableSearch = false,
|
|
8776
8932
|
emptyValue = undefined,
|
|
8777
8933
|
highlighted = false,
|
|
8778
8934
|
invalid = false,
|
|
@@ -8783,7 +8939,6 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
|
8783
8939
|
onDelete,
|
|
8784
8940
|
onEdit,
|
|
8785
8941
|
readOnly = false,
|
|
8786
|
-
tabIndex = 0,
|
|
8787
8942
|
tags = false,
|
|
8788
8943
|
value: prop,
|
|
8789
8944
|
...otherProps
|
|
@@ -8808,6 +8963,7 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
|
8808
8963
|
});
|
|
8809
8964
|
const setValue = createListboxValueSetter(multiple, _setValue);
|
|
8810
8965
|
const [validationError, setValidationError] = React__default.useState();
|
|
8966
|
+
const [shouldPauseHoverState, setShouldPauseHoverState] = useIsHoverStatePaused();
|
|
8811
8967
|
const {
|
|
8812
8968
|
flattenedChildren,
|
|
8813
8969
|
filteredChildren,
|
|
@@ -8840,6 +8996,8 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
|
8840
8996
|
setSearchQuery,
|
|
8841
8997
|
setValidationError,
|
|
8842
8998
|
setValue,
|
|
8999
|
+
shouldPauseHoverState,
|
|
9000
|
+
setShouldPauseHoverState,
|
|
8843
9001
|
tags,
|
|
8844
9002
|
validationError,
|
|
8845
9003
|
value
|
|
@@ -8872,6 +9030,11 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
|
8872
9030
|
}
|
|
8873
9031
|
};
|
|
8874
9032
|
}
|
|
9033
|
+
const handleListboxKeyDown = event => {
|
|
9034
|
+
if (isAriaDirectionKey(event)) {
|
|
9035
|
+
setShouldPauseHoverState(true);
|
|
9036
|
+
}
|
|
9037
|
+
};
|
|
8875
9038
|
const className = cn('border-grey-300 rounded border bg-white py-1.5 shadow-md outline-none', createCollectionClassName());
|
|
8876
9039
|
return /*#__PURE__*/React__default.createElement(Select2Context.Provider, {
|
|
8877
9040
|
value: context
|
|
@@ -8916,7 +9079,7 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
|
8916
9079
|
style: {
|
|
8917
9080
|
minWidth: dimensions !== null && dimensions !== void 0 && dimensions.width ? `${dimensions.width}px` : undefined
|
|
8918
9081
|
}
|
|
8919
|
-
},
|
|
9082
|
+
}, flattenedChildren.length > 0 || onCreate ? /*#__PURE__*/React__default.createElement(Search$1, {
|
|
8920
9083
|
placeholder: onCreate ? texts.select2.searchOrCreate : texts.select2.search,
|
|
8921
9084
|
ref: searchRef
|
|
8922
9085
|
}) : null, flattenedChildren.length <= 0 ? /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -8927,6 +9090,7 @@ const Select2 = /*#__PURE__*/React__default.forwardRef(function Select2(props, r
|
|
|
8927
9090
|
customSelector: ":scope > button",
|
|
8928
9091
|
disabled: disabled,
|
|
8929
9092
|
multiple: multiple,
|
|
9093
|
+
onKeyDown: handleListboxKeyDown,
|
|
8930
9094
|
readOnly: readOnly,
|
|
8931
9095
|
ref: listboxRef,
|
|
8932
9096
|
setValue: setValue,
|
|
@@ -10468,13 +10632,15 @@ const RowContext = /*#__PURE__*/React__default.createContext({
|
|
|
10468
10632
|
rowMoveReason: {},
|
|
10469
10633
|
setRowMoveReason: () => undefined
|
|
10470
10634
|
},
|
|
10635
|
+
rowIndex: undefined,
|
|
10471
10636
|
isHovered: false,
|
|
10472
10637
|
setIsHovered: () => undefined
|
|
10473
10638
|
});
|
|
10474
10639
|
const RowContextProvider = ({
|
|
10475
10640
|
isActiveRow,
|
|
10476
10641
|
children,
|
|
10477
|
-
meta
|
|
10642
|
+
meta,
|
|
10643
|
+
rowIndex
|
|
10478
10644
|
}) => {
|
|
10479
10645
|
// we use non-css hovered state to determine whether to render actions or not, for performance
|
|
10480
10646
|
const [isHovered, setIsHovered] = React__default.useState(false);
|
|
@@ -10501,10 +10667,11 @@ const RowContextProvider = ({
|
|
|
10501
10667
|
rowMoveReason,
|
|
10502
10668
|
setRowMoveReason
|
|
10503
10669
|
},
|
|
10670
|
+
rowIndex,
|
|
10504
10671
|
isHovered,
|
|
10505
10672
|
setIsHovered
|
|
10506
10673
|
};
|
|
10507
|
-
}, [isActiveRow, isHovered, rowMoveReason, validationErrors]);
|
|
10674
|
+
}, [isActiveRow, isHovered, rowMoveReason, validationErrors, rowIndex]);
|
|
10508
10675
|
return /*#__PURE__*/React__default.createElement(RowContext.Provider, {
|
|
10509
10676
|
value: context
|
|
10510
10677
|
}, children);
|
|
@@ -10762,7 +10929,8 @@ const RowActionsCell = /*#__PURE__*/React__default.memo(({
|
|
|
10762
10929
|
}) => {
|
|
10763
10930
|
const {
|
|
10764
10931
|
isActive,
|
|
10765
|
-
isHovered
|
|
10932
|
+
isHovered,
|
|
10933
|
+
rowIndex
|
|
10766
10934
|
} = useRowContext();
|
|
10767
10935
|
if (!isActive && (!isHovered || shouldPauseHoverState) || isEditing) {
|
|
10768
10936
|
return null;
|
|
@@ -10799,6 +10967,7 @@ const RowActionsCell = /*#__PURE__*/React__default.memo(({
|
|
|
10799
10967
|
icon: "more",
|
|
10800
10968
|
onClick: event => {
|
|
10801
10969
|
event.preventDefault();
|
|
10970
|
+
table.options.meta.setActiveRowIndex(rowIndex);
|
|
10802
10971
|
},
|
|
10803
10972
|
tabIndex: tabIndex,
|
|
10804
10973
|
menu: menuProps => /*#__PURE__*/React__default.createElement(Menu$1, Object.assign({}, menuProps), /*#__PURE__*/React__default.createElement(Menu$1.Content, null, visibleMoreActions.map((action, i) => /*#__PURE__*/React__default.createElement(Menu$1.Item, {
|
|
@@ -12048,16 +12217,17 @@ function useColumnDefinitions(children, options, tableRef) {
|
|
|
12048
12217
|
accessorKey: child.props.accessor,
|
|
12049
12218
|
id: child.props.accessor,
|
|
12050
12219
|
cell: props => {
|
|
12051
|
-
|
|
12220
|
+
var _value;
|
|
12221
|
+
let value = props.getValue();
|
|
12052
12222
|
if (typeof child.props.renderer === 'function') {
|
|
12053
|
-
|
|
12223
|
+
value = child.props.renderer(value, props.row.original);
|
|
12054
12224
|
}
|
|
12055
12225
|
if (typeof value === 'string' || typeof value === 'number') {
|
|
12056
12226
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
12057
12227
|
className: "truncate"
|
|
12058
12228
|
}, value);
|
|
12059
12229
|
}
|
|
12060
|
-
return value !== null &&
|
|
12230
|
+
return (_value = value) !== null && _value !== void 0 ? _value : null;
|
|
12061
12231
|
},
|
|
12062
12232
|
header: child.props.header,
|
|
12063
12233
|
meta: {
|
|
@@ -12214,21 +12384,6 @@ const useActiveRowStateListener = (table, rows, activeRowIndex) => {
|
|
|
12214
12384
|
}, [table.getState().columnFilters, rows.length]);
|
|
12215
12385
|
};
|
|
12216
12386
|
|
|
12217
|
-
const useShouldPauseHoverState = () => {
|
|
12218
|
-
const [shouldPauseHoverState, setShouldPauseHoverState] = React__default.useState(false);
|
|
12219
|
-
// as soon as the mouse starts moving again, unpause hover state
|
|
12220
|
-
React__default.useEffect(() => {
|
|
12221
|
-
const move = () => setShouldPauseHoverState(false);
|
|
12222
|
-
if (shouldPauseHoverState) {
|
|
12223
|
-
document.addEventListener('mousemove', move);
|
|
12224
|
-
}
|
|
12225
|
-
return () => {
|
|
12226
|
-
document.removeEventListener('mousemove', move);
|
|
12227
|
-
};
|
|
12228
|
-
}, [shouldPauseHoverState]);
|
|
12229
|
-
return [shouldPauseHoverState, setShouldPauseHoverState];
|
|
12230
|
-
};
|
|
12231
|
-
|
|
12232
12387
|
function useTable$1(children, props, ref) {
|
|
12233
12388
|
var _settings$columnOrder, _ref, _settings$columnPinni, _settings$columnPinni2, _settings$columnSizin, _settings$columnVisib, _settings$rowDensity;
|
|
12234
12389
|
const {
|
|
@@ -12296,7 +12451,7 @@ function useTable$1(children, props, ref) {
|
|
|
12296
12451
|
const dataColumnEndOffset = actionsForRow.length ? 1 : 0;
|
|
12297
12452
|
// custom
|
|
12298
12453
|
const activeRow = useActiveRow(defaultActiveRowIndex);
|
|
12299
|
-
const [shouldPauseHoverState, setShouldPauseHoverState] =
|
|
12454
|
+
const [shouldPauseHoverState, setShouldPauseHoverState] = useIsHoverStatePaused();
|
|
12300
12455
|
const editMode = useEditMode(onSave);
|
|
12301
12456
|
const [columnOffsets, setColumnOffsets] = React__default.useState({});
|
|
12302
12457
|
const [rowDensity, setRowDensity] = React__default.useState((_settings$rowDensity = settings === null || settings === void 0 ? void 0 : settings.rowDensity) !== null && _settings$rowDensity !== void 0 ? _settings$rowDensity : 'normal');
|
|
@@ -12837,21 +12992,23 @@ const ColumnSettingsButton = ({
|
|
|
12837
12992
|
align: "end"
|
|
12838
12993
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
12839
12994
|
className: "flex w-60 flex-col gap-2"
|
|
12840
|
-
}, /*#__PURE__*/React__default.createElement(Input, {
|
|
12995
|
+
}, table.options.enableHiding ? /*#__PURE__*/React__default.createElement(Input, {
|
|
12841
12996
|
onChange: event => setQuery(event.target.value),
|
|
12842
12997
|
placeholder: texts.table2.columnSettings.search,
|
|
12843
12998
|
value: query
|
|
12844
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
12999
|
+
}) : null, /*#__PURE__*/React__default.createElement("div", {
|
|
12845
13000
|
className: "-ml-4 -mb-2 max-h-64 w-[calc(100%_+_theme(spacing.8))] overflow-auto"
|
|
12846
|
-
}, query ?
|
|
13001
|
+
}, query ? /*#__PURE__*/React__default.createElement("div", {
|
|
13002
|
+
className: "flex min-h-[theme(spacing.8)] flex-col gap-y-px overflow-x-hidden px-2"
|
|
13003
|
+
}, columns.filter(column => {
|
|
12847
13004
|
var _column$columnDef$hea2;
|
|
12848
|
-
return (_column$columnDef$hea2 = column.columnDef.header) === null || _column$columnDef$hea2 === void 0 ? void 0 : _column$columnDef$hea2.toString().includes(query);
|
|
13005
|
+
return (_column$columnDef$hea2 = column.columnDef.header) === null || _column$columnDef$hea2 === void 0 ? void 0 : _column$columnDef$hea2.toString().toLowerCase().includes(query.toLowerCase());
|
|
12849
13006
|
}).map(column => /*#__PURE__*/React__default.createElement(OrderableColumn, {
|
|
12850
13007
|
key: column.id,
|
|
12851
13008
|
canBeReordered: false,
|
|
12852
13009
|
column: column,
|
|
12853
13010
|
isReorderingAllowed: false
|
|
12854
|
-
})) : /*#__PURE__*/React__default.createElement(SortableColumnContainer, {
|
|
13011
|
+
}))) : /*#__PURE__*/React__default.createElement(SortableColumnContainer, {
|
|
12855
13012
|
state: state,
|
|
12856
13013
|
moveColumn: pinColumn,
|
|
12857
13014
|
reorderColumn: reorderColumn,
|
|
@@ -13003,7 +13160,8 @@ const Row$1 = props => {
|
|
|
13003
13160
|
const isActiveRow = meta.activeRowIndex === props.rowIndex;
|
|
13004
13161
|
return /*#__PURE__*/React__default.createElement(RowContextProvider, {
|
|
13005
13162
|
isActiveRow: isActiveRow,
|
|
13006
|
-
meta: props.table.options.meta
|
|
13163
|
+
meta: props.table.options.meta,
|
|
13164
|
+
rowIndex: props.rowIndex
|
|
13007
13165
|
}, /*#__PURE__*/React__default.createElement(InternalRow, Object.assign({}, props)));
|
|
13008
13166
|
};
|
|
13009
13167
|
|
|
@@ -14096,9 +14254,11 @@ const useOnClickOutside = (ref, callback) => {
|
|
|
14096
14254
|
};
|
|
14097
14255
|
|
|
14098
14256
|
exports.Accordion = Accordion;
|
|
14257
|
+
exports.Alert = Alert;
|
|
14099
14258
|
exports.AlertDialog = AlertDialog;
|
|
14100
14259
|
exports.Backdrop = Backdrop;
|
|
14101
14260
|
exports.Badge = Badge;
|
|
14261
|
+
exports.BadgeIcon = BadgeIcon;
|
|
14102
14262
|
exports.Banner = Banner;
|
|
14103
14263
|
exports.Base = Base;
|
|
14104
14264
|
exports.Button = Button$1;
|
|
@@ -14134,7 +14294,6 @@ exports.Select2 = Select2;
|
|
|
14134
14294
|
exports.Shortcut = Shortcut$1;
|
|
14135
14295
|
exports.Spinner = Spinner;
|
|
14136
14296
|
exports.Switch = Switch;
|
|
14137
|
-
exports.TAG_COLORS = TAG_COLORS;
|
|
14138
14297
|
exports.Table = Table;
|
|
14139
14298
|
exports.Table2 = Table2;
|
|
14140
14299
|
exports.Tabs = Tabs;
|