@economic/taco 1.11.1 → 1.12.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.
Files changed (48) hide show
  1. package/dist/components/AlertDialog/AlertDialog.d.ts +29 -0
  2. package/dist/components/AlertDialog/AlertDialog.stories.d.ts +25 -0
  3. package/dist/components/AlertDialog/Context.d.ts +11 -0
  4. package/dist/components/AlertDialog/components/Content.d.ts +13 -0
  5. package/dist/components/AlertDialog/components/Footer.d.ts +7 -0
  6. package/dist/components/AlertDialog/components/Trigger.d.ts +3 -0
  7. package/dist/components/Badge/Badge.stories.d.ts +1 -1
  8. package/dist/components/Button/Button.stories.d.ts +4 -0
  9. package/dist/components/Table/util/sortTypes.d.ts +1 -1
  10. package/dist/esm/components/AlertDialog/AlertDialog.js +42 -0
  11. package/dist/esm/components/AlertDialog/AlertDialog.js.map +1 -0
  12. package/dist/esm/components/AlertDialog/Context.js +16 -0
  13. package/dist/esm/components/AlertDialog/Context.js.map +1 -0
  14. package/dist/esm/components/AlertDialog/components/Content.js +46 -0
  15. package/dist/esm/components/AlertDialog/components/Content.js.map +1 -0
  16. package/dist/esm/components/AlertDialog/components/Footer.js +26 -0
  17. package/dist/esm/components/AlertDialog/components/Footer.js.map +1 -0
  18. package/dist/esm/components/AlertDialog/components/Trigger.js +15 -0
  19. package/dist/esm/components/AlertDialog/components/Trigger.js.map +1 -0
  20. package/dist/esm/components/Card/Card.js +4 -3
  21. package/dist/esm/components/Card/Card.js.map +1 -1
  22. package/dist/esm/components/Combobox/useCombobox.js +1 -1
  23. package/dist/esm/components/Datepicker/useDatepicker.js +1 -1
  24. package/dist/esm/components/Dialog/components/Content.js +2 -2
  25. package/dist/esm/components/Hanger/Hanger.js +1 -1
  26. package/dist/esm/components/Input/Input.js +1 -1
  27. package/dist/esm/components/Listbox/ScrollableList.js +1 -1
  28. package/dist/esm/components/Listbox/useListbox.js +1 -1
  29. package/dist/esm/components/Listbox/useMultiListbox.js +1 -1
  30. package/dist/esm/components/Navigation/Navigation.js +1 -1
  31. package/dist/esm/components/Popover/Popover.js +1 -1
  32. package/dist/esm/components/SearchInput/SearchInput.js +4 -3
  33. package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
  34. package/dist/esm/components/Select/useSelect.js +1 -1
  35. package/dist/esm/components/Table/components/WindowedTable.js +1 -1
  36. package/dist/esm/components/Table/hooks/useTable.js +3 -2
  37. package/dist/esm/components/Table/hooks/useTable.js.map +1 -1
  38. package/dist/esm/components/Table/util/sortTypes.js +46 -25
  39. package/dist/esm/components/Table/util/sortTypes.js.map +1 -1
  40. package/dist/esm/index.js +4 -3
  41. package/dist/esm/index.js.map +1 -1
  42. package/dist/index.d.ts +1 -0
  43. package/dist/taco.cjs.development.js +267 -133
  44. package/dist/taco.cjs.development.js.map +1 -1
  45. package/dist/taco.cjs.production.min.js +1 -1
  46. package/dist/taco.cjs.production.min.js.map +1 -1
  47. package/package.json +4 -3
  48. package/types.json +339 -180
@@ -6,7 +6,9 @@ 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');
9
10
  var cn = _interopDefault(require('classnames'));
11
+ var interactions = require('@react-aria/interactions');
10
12
  var AccordionPrimitive = require('@radix-ui/react-accordion');
11
13
  var TooltipPrimitive = require('@radix-ui/react-tooltip');
12
14
  var ReactDayPicker = _interopDefault(require('react-day-picker'));
@@ -17,7 +19,6 @@ var PopoverPrimitive = require('@radix-ui/react-popover');
17
19
  var debounce = _interopDefault(require('lodash/debounce'));
18
20
  var dateFns = require('date-fns');
19
21
  var DialogPrimitive = require('@radix-ui/react-dialog');
20
- var interactions = require('@react-aria/interactions');
21
22
  var HoverCardPrimitive = require('@radix-ui/react-hover-card');
22
23
  var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
23
24
  var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
@@ -37,6 +38,187 @@ var PrimitiveSwitch = require('@radix-ui/react-switch');
37
38
  var Joyride = require('react-joyride');
38
39
  var Joyride__default = _interopDefault(Joyride);
39
40
 
41
+ /* eslint-disable @typescript-eslint/no-empty-function */
42
+ const AlertDialogContext = /*#__PURE__*/React__default.createContext({
43
+ draggable: false,
44
+ onClose: () => {},
45
+ props: {},
46
+ ref: null,
47
+ size: 'dialog'
48
+ });
49
+ const useCurrentAlertDialog = () => {
50
+ return React__default.useContext(AlertDialogContext);
51
+ };
52
+
53
+ function mergeRefs(refs) {
54
+ return value => {
55
+ refs.forEach(ref => {
56
+ if (typeof ref === 'function') {
57
+ ref(value);
58
+ } else if (ref != null) {
59
+ ref.current = value;
60
+ }
61
+ });
62
+ };
63
+ }
64
+
65
+ const Trigger = /*#__PURE__*/React.forwardRef(function AlertDialogTrigger(props, ref) {
66
+ const dialog = useCurrentAlertDialog();
67
+ return /*#__PURE__*/React.createElement(AlertDialogPrimitive.Trigger, Object.assign({}, props, {
68
+ ref: mergeRefs([dialog.ref, ref]),
69
+ asChild: true
70
+ }));
71
+ });
72
+
73
+ const Footer = /*#__PURE__*/React.forwardRef(function AlertDialogFooter(props, ref) {
74
+ const className = 'flex justify-end gap-2';
75
+ return /*#__PURE__*/React.createElement("div", Object.assign({}, props, {
76
+ className: className,
77
+ ref: ref
78
+ }), props.children);
79
+ });
80
+ const Cancel = /*#__PURE__*/React.forwardRef(function AlertDialogCancel(props, ref) {
81
+ return /*#__PURE__*/React.createElement(AlertDialogPrimitive.Cancel, Object.assign({}, props, {
82
+ ref: ref,
83
+ asChild: true
84
+ }));
85
+ });
86
+ const Action = /*#__PURE__*/React.forwardRef(function AlertDialogAction(props, ref) {
87
+ return /*#__PURE__*/React.createElement(AlertDialogPrimitive.Action, Object.assign({}, props, {
88
+ className: props.className,
89
+ ref: ref,
90
+ asChild: true
91
+ }));
92
+ });
93
+
94
+ const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(props, ref) {
95
+ const className = cn('fixed inset-0 cursor-default overflow-y-auto bg-purple-darker/[0.3] aria-hidden:hidden z-[996]', props.className);
96
+ return /*#__PURE__*/React.createElement("div", Object.assign({}, props, {
97
+ className: className,
98
+ ref: ref
99
+ }));
100
+ });
101
+
102
+ const useDraggable = ref => {
103
+ const [position, setPosition] = React__default.useState({
104
+ x: 0,
105
+ y: 0
106
+ });
107
+ const {
108
+ moveProps
109
+ } = interactions.useMove({
110
+ onMove(event) {
111
+ var _ref$current;
112
+
113
+ const rect = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getBoundingClientRect(); // Prevent dragging out of bounds
114
+
115
+ if (rect && (rect.left + event.deltaX < 0 || rect.right + event.deltaX > window.innerWidth || rect.top + event.deltaY < 0 || rect.bottom + event.deltaY > window.innerHeight)) {
116
+ return;
117
+ }
118
+
119
+ setPosition(({
120
+ x,
121
+ y
122
+ }) => {
123
+ x += event.deltaX;
124
+ y += event.deltaY;
125
+ return {
126
+ x,
127
+ y
128
+ };
129
+ });
130
+ }
131
+
132
+ });
133
+ return {
134
+ position,
135
+ handleProps: moveProps
136
+ };
137
+ };
138
+
139
+ const useProxiedRef = ref => {
140
+ const internalRef = React.useRef(null);
141
+ React.useEffect(() => {
142
+ if (ref) {
143
+ if (typeof ref === 'function') {
144
+ ref(internalRef.current);
145
+ } else {
146
+ ref.current = internalRef.current;
147
+ }
148
+ }
149
+ }, [ref]);
150
+ return internalRef;
151
+ };
152
+
153
+ const Title = /*#__PURE__*/React.forwardRef(function AlertDialogTitle(props, ref) {
154
+ const className = cn('text-center', props.className);
155
+ return /*#__PURE__*/React.createElement(AlertDialogPrimitive.Title, Object.assign({}, props, {
156
+ className: className,
157
+ ref: ref
158
+ }));
159
+ });
160
+ const Content = /*#__PURE__*/React.forwardRef(function AlertDialogContent(props, ref) {
161
+ const dialog = useCurrentAlertDialog();
162
+ const internalRef = useProxiedRef(ref);
163
+ const {
164
+ position,
165
+ handleProps: dragHandleProps
166
+ } = useDraggable(internalRef);
167
+ const className = cn('bg-white rounded relative p-6 mt-16 mx-auto origin-center rounded animate-[fade-in_150ms] z-[997] shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]', {
168
+ 'w-128 justify-center': dialog.size === 'dialog',
169
+ 'w-xs': dialog.size === 'xs',
170
+ 'w-sm': dialog.size === 'sm',
171
+ 'w-md': dialog.size === 'md',
172
+ 'w-lg': dialog.size === 'lg'
173
+ });
174
+ return /*#__PURE__*/React.createElement(AlertDialogPrimitive.Portal, null, /*#__PURE__*/React.createElement(AlertDialogPrimitive.Overlay, {
175
+ asChild: true
176
+ }, /*#__PURE__*/React.createElement(Backdrop, null, /*#__PURE__*/React.createElement(AlertDialogPrimitive.Content, Object.assign({}, props, {
177
+ ref: ref,
178
+ className: className,
179
+ style: { ...props.style,
180
+ left: dialog.draggable ? `${position.x}px` : undefined,
181
+ top: dialog.draggable ? `${position.y}px` : undefined
182
+ }
183
+ }), dialog.draggable && /*#__PURE__*/React.createElement("div", Object.assign({}, dragHandleProps, {
184
+ "aria-label": 'alert-dialog-drag',
185
+ className: "yt-dialog__drag absolute-center-x bg-grey-light top-1.5 h-3 w-24 cursor-move rounded text-center"
186
+ })), props.children))));
187
+ });
188
+
189
+ const AlertDialog = /*#__PURE__*/React.forwardRef(function AlertDialog(props, ref) {
190
+ const {
191
+ children: initialChildren,
192
+ defaultOpen,
193
+ draggable = false,
194
+ size = 'dialog',
195
+ onChange,
196
+ open,
197
+ trigger,
198
+ ...otherProps
199
+ } = props;
200
+ const context = React.useMemo(() => ({
201
+ ref,
202
+ draggable,
203
+ props: otherProps,
204
+ size,
205
+ trigger
206
+ }), [draggable, open, otherProps]);
207
+ return /*#__PURE__*/React.createElement(AlertDialogContext.Provider, {
208
+ value: context
209
+ }, /*#__PURE__*/React.createElement(AlertDialogPrimitive.Root, Object.assign({}, props, {
210
+ defaultOpen: defaultOpen,
211
+ open: open,
212
+ onOpenChange: onChange
213
+ }), trigger && /*#__PURE__*/React.createElement(Trigger, null, trigger), props.children));
214
+ });
215
+ AlertDialog.Trigger = Trigger;
216
+ AlertDialog.Content = Content;
217
+ AlertDialog.Title = Title;
218
+ AlertDialog.Cancel = Cancel;
219
+ AlertDialog.Action = Action;
220
+ AlertDialog.Footer = Footer;
221
+
40
222
  function IconAccountPreview(props, svgRef) {
41
223
  return /*#__PURE__*/React.createElement("svg", Object.assign({
42
224
  xmlns: "http://www.w3.org/2000/svg",
@@ -3239,7 +3421,7 @@ const StyledTrigger = /*#__PURE__*/React__default.forwardRef(function AccordionS
3239
3421
  name: isExpanded ? 'chevron-up' : 'chevron-down'
3240
3422
  }));
3241
3423
  });
3242
- const Trigger = /*#__PURE__*/React__default.forwardRef(function AccordionTrigger(props, ref) {
3424
+ const Trigger$1 = /*#__PURE__*/React__default.forwardRef(function AccordionTrigger(props, ref) {
3243
3425
  const {
3244
3426
  children
3245
3427
  } = props;
@@ -3255,7 +3437,7 @@ const Trigger = /*#__PURE__*/React__default.forwardRef(function AccordionTrigger
3255
3437
  asChild: true
3256
3438
  }, /*#__PURE__*/React__default.createElement(StyledTrigger, null, children))));
3257
3439
  });
3258
- const Content = /*#__PURE__*/React__default.forwardRef(function AccordionContent(props, ref) {
3440
+ const Content$1 = /*#__PURE__*/React__default.forwardRef(function AccordionContent(props, ref) {
3259
3441
  return /*#__PURE__*/React__default.createElement(AccordionPrimitive.Content, Object.assign({}, props, {
3260
3442
  ref: ref
3261
3443
  }));
@@ -3306,16 +3488,8 @@ const Accordion = props => {
3306
3488
  })));
3307
3489
  };
3308
3490
  Accordion.Item = Item;
3309
- Accordion.Trigger = Trigger;
3310
- Accordion.Content = Content;
3311
-
3312
- const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(props, ref) {
3313
- const className = cn('fixed inset-0 cursor-default overflow-y-auto bg-purple-darker/[0.3] aria-hidden:hidden z-[996]', props.className);
3314
- return /*#__PURE__*/React.createElement("div", Object.assign({}, props, {
3315
- className: className,
3316
- ref: ref
3317
- }));
3318
- });
3491
+ Accordion.Trigger = Trigger$1;
3492
+ Accordion.Content = Content$1;
3319
3493
 
3320
3494
  const VisuallyHidden = /*#__PURE__*/React.forwardRef(function VisuallyHidden(props, ref) {
3321
3495
  return /*#__PURE__*/React.createElement("span", Object.assign({}, props, {
@@ -4192,7 +4366,7 @@ const Calendar$1 = /*#__PURE__*/React.forwardRef(function Calendar(props, ref) {
4192
4366
  })));
4193
4367
  });
4194
4368
 
4195
- const Content$1 = /*#__PURE__*/React.forwardRef(function CardContent(externalProps, ref) {
4369
+ const Content$2 = /*#__PURE__*/React.forwardRef(function CardContent(externalProps, ref) {
4196
4370
  const {
4197
4371
  noPadding,
4198
4372
  ...props
@@ -4227,7 +4401,7 @@ const Card = /*#__PURE__*/React.forwardRef(function Card(props, ref) {
4227
4401
  className: "-mt-[4px]"
4228
4402
  }) : null), children);
4229
4403
  });
4230
- Card.Content = Content$1;
4404
+ Card.Content = Content$2;
4231
4405
 
4232
4406
  const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
4233
4407
  const {
@@ -4277,20 +4451,6 @@ const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(props, ref) {
4277
4451
  return element;
4278
4452
  });
4279
4453
 
4280
- const useProxiedRef = ref => {
4281
- const internalRef = React.useRef(null);
4282
- React.useEffect(() => {
4283
- if (ref) {
4284
- if (typeof ref === 'function') {
4285
- ref(internalRef.current);
4286
- } else {
4287
- ref.current = internalRef.current;
4288
- }
4289
- }
4290
- }, [ref]);
4291
- return internalRef;
4292
- };
4293
-
4294
4454
  const getInputClasses = props => {
4295
4455
  return cn('peer bg-white text-black text-sm border font-normal not-italic no-underline rounded inline-flex leading-6 px-2 relative w-full text-ellipsis flex items-center', {
4296
4456
  'cursor-not-allowed text-black bg-grey': props.readOnly,
@@ -5391,23 +5551,11 @@ const UnstyledContent = /*#__PURE__*/React.forwardRef(function PopoverContent(pr
5391
5551
  }));
5392
5552
  });
5393
5553
 
5394
- function mergeRefs(refs) {
5395
- return value => {
5396
- refs.forEach(ref => {
5397
- if (typeof ref === 'function') {
5398
- ref(value);
5399
- } else if (ref != null) {
5400
- ref.current = value;
5401
- }
5402
- });
5403
- };
5404
- }
5405
-
5406
5554
  const PopoverContext = /*#__PURE__*/React.createContext({
5407
5555
  props: {},
5408
5556
  ref: null
5409
5557
  });
5410
- const Trigger$1 = /*#__PURE__*/React.forwardRef(function PopoverTrigger(props, ref) {
5558
+ const Trigger$2 = /*#__PURE__*/React.forwardRef(function PopoverTrigger(props, ref) {
5411
5559
  var _props$children;
5412
5560
 
5413
5561
  const context = React.useContext(PopoverContext);
@@ -5437,7 +5585,7 @@ const RenderPropWrapper = /*#__PURE__*/React.forwardRef(function RenderPropWrapp
5437
5585
  ref
5438
5586
  });
5439
5587
  });
5440
- const Content$2 = /*#__PURE__*/React.forwardRef(function PopoverContent(props, ref) {
5588
+ const Content$3 = /*#__PURE__*/React.forwardRef(function PopoverContent(props, ref) {
5441
5589
  const className = cn('bg-white focus:border-blue-light', props.className);
5442
5590
  let output;
5443
5591
 
@@ -5473,10 +5621,10 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(props, ref) {
5473
5621
  }), [otherProps]);
5474
5622
  return /*#__PURE__*/React.createElement(PopoverContext.Provider, {
5475
5623
  value: context
5476
- }, /*#__PURE__*/React.createElement(PopoverPrimitive.Root, null, trigger && /*#__PURE__*/React.createElement(Trigger$1, null, trigger), children));
5624
+ }, /*#__PURE__*/React.createElement(PopoverPrimitive.Root, null, trigger && /*#__PURE__*/React.createElement(Trigger$2, null, trigger), children));
5477
5625
  });
5478
- Popover.Trigger = Trigger$1;
5479
- Popover.Content = Content$2;
5626
+ Popover.Trigger = Trigger$2;
5627
+ Popover.Content = Content$3;
5480
5628
  Popover.Close = Close$1;
5481
5629
 
5482
5630
  const Datepicker = /*#__PURE__*/React.forwardRef(function Datepicker(props, ref) {
@@ -5561,7 +5709,7 @@ const useCurrentDialog = () => {
5561
5709
  return React.useContext(DialogContext);
5562
5710
  };
5563
5711
 
5564
- const Trigger$2 = /*#__PURE__*/React.forwardRef(function DialogTrigger(props, ref) {
5712
+ const Trigger$3 = /*#__PURE__*/React.forwardRef(function DialogTrigger(props, ref) {
5565
5713
  const dialog = useCurrentDialog();
5566
5714
  return /*#__PURE__*/React.createElement(DialogPrimitive.Trigger, Object.assign({}, dialog.props, props, {
5567
5715
  ref: mergeRefs([dialog.ref, ref]),
@@ -5569,56 +5717,19 @@ const Trigger$2 = /*#__PURE__*/React.forwardRef(function DialogTrigger(props, re
5569
5717
  }));
5570
5718
  });
5571
5719
 
5572
- const useDraggable = ref => {
5573
- const [position, setPosition] = React__default.useState({
5574
- x: 0,
5575
- y: 0
5576
- });
5577
- const {
5578
- moveProps
5579
- } = interactions.useMove({
5580
- onMove(event) {
5581
- var _ref$current;
5582
-
5583
- const rect = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getBoundingClientRect(); // Prevent dragging out of bounds
5584
-
5585
- if (rect && (rect.left + event.deltaX < 0 || rect.right + event.deltaX > window.innerWidth || rect.top + event.deltaY < 0 || rect.bottom + event.deltaY > window.innerHeight)) {
5586
- return;
5587
- }
5588
-
5589
- setPosition(({
5590
- x,
5591
- y
5592
- }) => {
5593
- x += event.deltaX;
5594
- y += event.deltaY;
5595
- return {
5596
- x,
5597
- y
5598
- };
5599
- });
5600
- }
5601
-
5602
- });
5603
- return {
5604
- position,
5605
- handleProps: moveProps
5606
- };
5607
- };
5608
-
5609
5720
  const MenuContext = /*#__PURE__*/React.createContext(undefined);
5610
5721
  const useCurrentMenu = () => {
5611
5722
  return React.useContext(MenuContext);
5612
5723
  };
5613
5724
 
5614
- const Title = /*#__PURE__*/React.forwardRef(function DialogTitle(props, ref) {
5725
+ const Title$1 = /*#__PURE__*/React.forwardRef(function DialogTitle(props, ref) {
5615
5726
  const className = cn('text-center', props.className);
5616
5727
  return /*#__PURE__*/React.createElement(DialogPrimitive.Title, Object.assign({}, props, {
5617
5728
  className: className,
5618
5729
  ref: ref
5619
5730
  }));
5620
5731
  });
5621
- const Footer = /*#__PURE__*/React.forwardRef(function DialogFooter(props, ref) {
5732
+ const Footer$1 = /*#__PURE__*/React.forwardRef(function DialogFooter(props, ref) {
5622
5733
  const className = cn('mt-8 flex justify-end', props.className);
5623
5734
  return /*#__PURE__*/React.createElement("div", Object.assign({}, props, {
5624
5735
  className: className,
@@ -5649,7 +5760,7 @@ const RenderPropWrapper$1 = /*#__PURE__*/React.forwardRef(function RenderPropWra
5649
5760
  ...renderProps
5650
5761
  });
5651
5762
  });
5652
- const Content$3 = /*#__PURE__*/React.forwardRef(function DialogContent(props, ref) {
5763
+ const Content$4 = /*#__PURE__*/React.forwardRef(function DialogContent(props, ref) {
5653
5764
  const dialog = useCurrentDialog();
5654
5765
  const internalRef = useProxiedRef(ref);
5655
5766
  const {
@@ -5837,12 +5948,12 @@ const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(props, ref) {
5837
5948
  defaultOpen: defaultOpen,
5838
5949
  open: open,
5839
5950
  onOpenChange: onChange
5840
- }, trigger && /*#__PURE__*/React.createElement(Trigger$2, null, trigger), children));
5951
+ }, trigger && /*#__PURE__*/React.createElement(Trigger$3, null, trigger), children));
5841
5952
  });
5842
- Dialog.Trigger = Trigger$2;
5843
- Dialog.Content = Content$3;
5844
- Dialog.Title = Title;
5845
- Dialog.Footer = Footer;
5953
+ Dialog.Trigger = Trigger$3;
5954
+ Dialog.Content = Content$4;
5955
+ Dialog.Title = Title$1;
5956
+ Dialog.Footer = Footer$1;
5846
5957
  Dialog.Extra = Extra;
5847
5958
  Dialog.Drawer = Drawer;
5848
5959
  Dialog.Close = Close$2;
@@ -5925,14 +6036,14 @@ const Anchor = /*#__PURE__*/React.forwardRef(function HangerAnchor(props, ref) {
5925
6036
  asChild: true
5926
6037
  }));
5927
6038
  });
5928
- const Title$1 = /*#__PURE__*/React.forwardRef(function DialogTitle(props, ref) {
6039
+ const Title$2 = /*#__PURE__*/React.forwardRef(function DialogTitle(props, ref) {
5929
6040
  const className = cn('mb-1 text-base font-bold flex w-full', props.className);
5930
6041
  return /*#__PURE__*/React.createElement("span", Object.assign({}, props, {
5931
6042
  className: className,
5932
6043
  ref: ref
5933
6044
  }));
5934
6045
  });
5935
- const Content$4 = /*#__PURE__*/React.forwardRef(function HangerContent(props, ref) {
6046
+ const Content$5 = /*#__PURE__*/React.forwardRef(function HangerContent(props, ref) {
5936
6047
  const context = React.useContext(HangerContext);
5937
6048
  const {
5938
6049
  texts
@@ -5987,8 +6098,8 @@ const Hanger = /*#__PURE__*/React.forwardRef(function Hanger(props, ref) {
5987
6098
  }, anchor && /*#__PURE__*/React.createElement(Anchor, null, anchor), children));
5988
6099
  });
5989
6100
  Hanger.Anchor = Anchor;
5990
- Hanger.Content = Content$4;
5991
- Hanger.Title = Title$1;
6101
+ Hanger.Content = Content$5;
6102
+ Hanger.Title = Title$2;
5992
6103
 
5993
6104
  const UnstyledArrow$1 = /*#__PURE__*/React.forwardRef(function HoverCardArrow(props, ref) {
5994
6105
  return /*#__PURE__*/React.createElement(HoverCardPrimitive.Arrow, {
@@ -6025,13 +6136,13 @@ const UnstyledContent$1 = /*#__PURE__*/React.forwardRef(function HoverCardConten
6025
6136
  }));
6026
6137
  });
6027
6138
 
6028
- const Trigger$3 = /*#__PURE__*/React.forwardRef(function HoverCardTrigger(props, ref) {
6139
+ const Trigger$4 = /*#__PURE__*/React.forwardRef(function HoverCardTrigger(props, ref) {
6029
6140
  return /*#__PURE__*/React.createElement(HoverCardPrimitive.Trigger, Object.assign({}, props, {
6030
6141
  asChild: true,
6031
6142
  ref: ref
6032
6143
  }));
6033
6144
  });
6034
- const Content$5 = /*#__PURE__*/React.forwardRef(function HoverCardContent(externalProps, ref) {
6145
+ const Content$6 = /*#__PURE__*/React.forwardRef(function HoverCardContent(externalProps, ref) {
6035
6146
  const {
6036
6147
  placement,
6037
6148
  ...props
@@ -6050,8 +6161,8 @@ const HoverCard = props => {
6050
6161
  openDelay: 300
6051
6162
  }));
6052
6163
  };
6053
- HoverCard.Trigger = Trigger$3;
6054
- HoverCard.Content = Content$5;
6164
+ HoverCard.Trigger = Trigger$4;
6165
+ HoverCard.Content = Content$6;
6055
6166
 
6056
6167
  const SearchInput = /*#__PURE__*/React.forwardRef(function SearchInput({
6057
6168
  onSearch,
@@ -6490,7 +6601,7 @@ const MultiListbox = /*#__PURE__*/React.forwardRef(function Listbox(props, ref)
6490
6601
  })));
6491
6602
  });
6492
6603
 
6493
- const Content$6 = /*#__PURE__*/React.forwardRef(function MenuContent(props, ref) {
6604
+ const Content$7 = /*#__PURE__*/React.forwardRef(function MenuContent(props, ref) {
6494
6605
  const internalRef = useProxiedRef(ref);
6495
6606
  const menu = useCurrentMenu();
6496
6607
  const {
@@ -6628,7 +6739,7 @@ const Link = /*#__PURE__*/React.forwardRef(function MenuLink(props, ref) {
6628
6739
  }), props.children));
6629
6740
  });
6630
6741
 
6631
- const Trigger$4 = /*#__PURE__*/React.forwardRef(function MenuTrigger(props, ref) {
6742
+ const Trigger$5 = /*#__PURE__*/React.forwardRef(function MenuTrigger(props, ref) {
6632
6743
  const menu = useCurrentMenu();
6633
6744
  const internalRef = useProxiedRef(ref);
6634
6745
  React.useEffect(() => {
@@ -6849,12 +6960,12 @@ const Menu$1 = /*#__PURE__*/React.forwardRef(function Menu(externalProps, ref) {
6849
6960
  modal: false,
6850
6961
  open: open,
6851
6962
  onOpenChange: setOpen
6852
- }), trigger && /*#__PURE__*/React.createElement(Trigger$4, {
6963
+ }), trigger && /*#__PURE__*/React.createElement(Trigger$5, {
6853
6964
  ref: ref
6854
6965
  }, trigger), children));
6855
6966
  });
6856
- Menu$1.Trigger = Trigger$4;
6857
- Menu$1.Content = Content$6;
6967
+ Menu$1.Trigger = Trigger$5;
6968
+ Menu$1.Content = Content$7;
6858
6969
  Menu$1.Item = Item$1;
6859
6970
  Menu$1.Link = Link;
6860
6971
  Menu$1.Checkbox = Checkbox$1;
@@ -7735,32 +7846,53 @@ const compareBasic = (a, b) => {
7735
7846
  return a === b ? 0 : a > b ? 1 : -1;
7736
7847
  };
7737
7848
 
7738
- const sortTypes = {
7739
- datetime: (rowA, rowB, columnId) => {
7740
- const a = getTime(rowA.values[columnId]);
7741
- const b = getTime(rowB.values[columnId]);
7742
- return compareBasic(a, b);
7743
- },
7744
- string: (rowA, rowB, columnId) => {
7745
- const a = getString(rowA.values[columnId]);
7746
- const b = getString(rowB.values[columnId]);
7747
- return compareBasic(a, b);
7748
- },
7749
- number: (rowA, rowB, columnId) => {
7750
- const a = getNumber(rowA.values[columnId]);
7751
- const b = getNumber(rowB.values[columnId]);
7752
- return compareBasic(a, b);
7753
- },
7754
- boolean: (rowA, rowB, columnId) => {
7755
- const a = !!rowA.values[columnId];
7756
- const b = !!rowB.values[columnId];
7757
- return compareBasic(a, b);
7758
- },
7759
- auto: (rowA, rowB, columnId) => {
7760
- const a = guess(rowA.values[columnId]);
7761
- const b = guess(rowB.values[columnId]);
7762
- return compareBasic(a, b);
7849
+ const stringsLocaleCompare = (a, b, locale) => {
7850
+ // In some browsers 'localCompare' may return -2 or 2 instead of -1 or 1
7851
+ const compareResult = a.localeCompare(b, locale);
7852
+ return compareResult === 0 ? 0 : compareResult > 0 ? 1 : -1;
7853
+ };
7854
+
7855
+ const compareBasicStrings = (a, b, locale) => {
7856
+ if (a && b) {
7857
+ return stringsLocaleCompare(a, b, locale);
7763
7858
  }
7859
+
7860
+ return compareBasic(a, b);
7861
+ };
7862
+
7863
+ const sortTypes = locale => {
7864
+ return {
7865
+ datetime: (rowA, rowB, columnId) => {
7866
+ const a = getTime(rowA.values[columnId]);
7867
+ const b = getTime(rowB.values[columnId]);
7868
+ return compareBasic(a, b);
7869
+ },
7870
+ string: (rowA, rowB, columnId) => {
7871
+ const a = getString(rowA.values[columnId]);
7872
+ const b = getString(rowB.values[columnId]);
7873
+ return compareBasicStrings(a, b, locale);
7874
+ },
7875
+ number: (rowA, rowB, columnId) => {
7876
+ const a = getNumber(rowA.values[columnId]);
7877
+ const b = getNumber(rowB.values[columnId]);
7878
+ return compareBasic(a, b);
7879
+ },
7880
+ boolean: (rowA, rowB, columnId) => {
7881
+ const a = !!rowA.values[columnId];
7882
+ const b = !!rowB.values[columnId];
7883
+ return compareBasic(a, b);
7884
+ },
7885
+ auto: (rowA, rowB, columnId) => {
7886
+ const a = guess(rowA.values[columnId]);
7887
+ const b = guess(rowB.values[columnId]);
7888
+
7889
+ if (typeof a === 'string' && typeof b === 'string') {
7890
+ return compareBasicStrings(a, b, locale);
7891
+ } else {
7892
+ return compareBasic(a, b);
7893
+ }
7894
+ }
7895
+ };
7764
7896
  };
7765
7897
 
7766
7898
  const pluginName = 'useRowEditing';
@@ -8555,7 +8687,8 @@ const useTable = (props, ref) => {
8555
8687
  }
8556
8688
 
8557
8689
  const {
8558
- texts
8690
+ texts,
8691
+ locale
8559
8692
  } = useLocalization();
8560
8693
  const {
8561
8694
  columns,
@@ -8592,7 +8725,7 @@ const useTable = (props, ref) => {
8592
8725
  autoResetSelectedRows: false,
8593
8726
  autoResetSortBy: false,
8594
8727
  autoResetPage: false,
8595
- sortTypes: React__default.useMemo(() => sortTypes, []),
8728
+ sortTypes: React__default.useMemo(() => sortTypes(locale), []),
8596
8729
  useControlledState: currentState => {
8597
8730
  return React__default.useMemo(() => ({ ...currentState,
8598
8731
  selectedRowIds: selectedRows || []
@@ -9554,6 +9687,7 @@ const useOnClickOutside = (ref, callback) => {
9554
9687
  };
9555
9688
 
9556
9689
  exports.Accordion = Accordion;
9690
+ exports.AlertDialog = AlertDialog;
9557
9691
  exports.Backdrop = Backdrop;
9558
9692
  exports.Badge = Badge;
9559
9693
  exports.Banner = Banner;
@@ -9590,7 +9724,7 @@ exports.Table = Table;
9590
9724
  exports.Tabs = Tabs;
9591
9725
  exports.Tag = Tag$1;
9592
9726
  exports.Textarea = Textarea;
9593
- exports.Title = Title$1;
9727
+ exports.Title = Title$2;
9594
9728
  exports.ToastProvider = ToastProvider;
9595
9729
  exports.Tooltip = Tooltip;
9596
9730
  exports.Tour = Tour;