@sito/ui 0.3.2 → 0.4.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/README.md CHANGED
@@ -20,12 +20,82 @@ import "@sito/ui/theme.css";
20
20
  ## Public API
21
21
 
22
22
  ```ts
23
- import { Button, Dialog, DialogActions, IconButton, useDialog } from "@sito/ui";
23
+ import {
24
+ Button,
25
+ BUTTON_COLOR_VARIANTS,
26
+ BUTTON_SIZES,
27
+ BUTTON_VARIANTS,
28
+ ContextMenu,
29
+ ContextMenuItem,
30
+ ContextMenuSeparator,
31
+ Dialog,
32
+ DialogActions,
33
+ DIALOG_INITIAL_FOCUS,
34
+ IconButton,
35
+ ICON_BUTTON_SIZES,
36
+ Spinner,
37
+ useContextMenu,
38
+ useDialog,
39
+ } from "@sito/ui";
24
40
  ```
25
41
 
42
+ The runtime constants `BUTTON_COLOR_VARIANTS`, `BUTTON_VARIANTS`,
43
+ `BUTTON_SIZES`, `ICON_BUTTON_SIZES`, and `DIALOG_INITIAL_FOCUS` expose the
44
+ supported values for public component contracts.
45
+
26
46
  Exported types include `ButtonProps`, `ButtonSize`, `IconButtonProps`,
27
47
  `DialogProps`, `DialogActionsProps`, `DialogState`, `IconButtonSize`, and
28
- `UseDialogReturn`.
48
+ `SpinnerProps`, `UseDialogReturn`, plus the corresponding context-menu props and hook return
49
+ types.
50
+
51
+ ## Spinner
52
+
53
+ `Spinner` is the shared indeterminate-progress primitive used by `Button`
54
+ loading states and standalone feedback. Provide `label` when the spinner owns
55
+ the accessible loading announcement; omit it when surrounding content already
56
+ provides that context.
57
+
58
+ ```tsx
59
+ <Spinner label="Loading messages" />
60
+ <Spinner />
61
+ ```
62
+
63
+ ## Context Menu
64
+
65
+ `ContextMenu` owns viewport clamping, focus restoration, outside dismissal and
66
+ keyboard navigation. Consumers own the menu's actions and wording:
67
+
68
+ ```tsx
69
+ const menu = useContextMenu<string>();
70
+
71
+ <button
72
+ type="button"
73
+ onContextMenu={(event) => {
74
+ event.preventDefault();
75
+ menu.openAt(event.clientX, event.clientY, "item-id");
76
+ }}
77
+ >
78
+ Item
79
+ </button>
80
+
81
+ <ContextMenu
82
+ open={menu.open}
83
+ position={menu.position}
84
+ onClose={menu.close}
85
+ ariaLabel="Item actions"
86
+ >
87
+ <ContextMenuItem onClick={menu.close}>Open</ContextMenuItem>
88
+ <ContextMenuSeparator />
89
+ <ContextMenuItem disabled>Delete</ContextMenuItem>
90
+ </ContextMenu>;
91
+ ```
92
+
93
+ Apps with an existing overlay or hotkey scope can keep dismissal in that layer
94
+ with `closeOnEscape={false}`, `closeOnTab={false}` and
95
+ `closeOnPointerDownOutside={false}`. The component forwards its menu element ref
96
+ for adapters that need compatible positioning or containment checks. Those
97
+ adapters may also use `clampToViewport={false}` when their existing state layer
98
+ already owns clamping.
29
99
 
30
100
  ## Button Sizes
31
101
 
@@ -1,3 +1,4 @@
1
1
  import { default as Button } from './Button';
2
+ export { BUTTON_COLOR_VARIANTS, BUTTON_SIZES, BUTTON_VARIANTS } from './types';
2
3
  export type { ButtonBaseProps, ButtonColor, ButtonProps, ButtonSize, ButtonVariant, } from './types';
3
4
  export { Button };
@@ -0,0 +1,2 @@
1
+ import { ContextMenuProps } from './types';
2
+ export declare const ContextMenu: import('react').ForwardRefExoticComponent<ContextMenuProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,2 @@
1
+ import { ContextMenuItemProps } from './types';
2
+ export declare const ContextMenuItem: import('react').ForwardRefExoticComponent<ContextMenuItemProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,2 @@
1
+ import { ContextMenuSeparatorProps } from './types';
2
+ export declare const ContextMenuSeparator: ({ className, ...rest }: ContextMenuSeparatorProps) => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export declare const CONTEXT_MENU_ITEM_SELECTOR = "[role=\"menuitem\"]:not([disabled])";
2
+ export declare const CONTEXT_MENU_VIEWPORT_PADDING = 8;
@@ -0,0 +1,4 @@
1
+ export { ContextMenu } from './ContextMenu';
2
+ export { ContextMenuItem } from './ContextMenuItem';
3
+ export { ContextMenuSeparator } from './ContextMenuSeparator';
4
+ export type { ContextMenuItemProps, ContextMenuPosition, ContextMenuProps, ContextMenuSeparatorProps, } from './types';
@@ -0,0 +1,24 @@
1
+ import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
2
+ export type ContextMenuPosition = {
3
+ x: number;
4
+ y: number;
5
+ };
6
+ export type ContextMenuProps = {
7
+ open: boolean;
8
+ position: ContextMenuPosition;
9
+ onClose: () => void;
10
+ ariaLabel: string;
11
+ children?: ReactNode;
12
+ className?: string;
13
+ portalContainer?: Element | DocumentFragment | null;
14
+ viewportPadding?: number;
15
+ closeOnEscape?: boolean;
16
+ closeOnTab?: boolean;
17
+ closeOnPointerDownOutside?: boolean;
18
+ clampToViewport?: boolean;
19
+ };
20
+ export interface ContextMenuItemProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type"> {
21
+ leading?: ReactNode;
22
+ shortcut?: ReactNode;
23
+ }
24
+ export type ContextMenuSeparatorProps = HTMLAttributes<HTMLDivElement>;
@@ -1,3 +1,4 @@
1
1
  export { Dialog } from './Dialog';
2
2
  export { DialogActions } from './DialogActions';
3
+ export { DIALOG_INITIAL_FOCUS } from './types';
3
4
  export type { DialogActionButtonProps, DialogActionsProps, DialogInitialFocus, DialogProps, DialogState, DialogSubmitHandler, } from './types';
@@ -28,6 +28,9 @@ type DialogBaseProps = {
28
28
  mobileFullScreen?: boolean;
29
29
  containerClassName?: string;
30
30
  className?: string;
31
+ headerClassName?: string;
32
+ titleClassName?: string;
33
+ closeButtonClassName?: string;
31
34
  closeLabel?: string;
32
35
  closeIcon?: ReactNode;
33
36
  showCloseButton?: boolean;
@@ -17,3 +17,19 @@ export declare const getFocusableElements: (element: HTMLElement) => HTMLElement
17
17
  * @returns Active HTMLElement, or null when unavailable.
18
18
  */
19
19
  export declare const getActiveElement: () => HTMLElement | null;
20
+ /**
21
+ * Registers an interactive dialog as the topmost dialog.
22
+ * @param dialogStackId Stable internal identifier for the dialog instance.
23
+ */
24
+ export declare const registerDialog: (dialogStackId: symbol) => void;
25
+ /**
26
+ * Removes a dialog from the interactive dialog stack.
27
+ * @param dialogStackId Stable internal identifier for the dialog instance.
28
+ */
29
+ export declare const unregisterDialog: (dialogStackId: symbol) => void;
30
+ /**
31
+ * Checks whether a dialog is currently the topmost interactive dialog.
32
+ * @param dialogStackId Stable internal identifier for the dialog instance.
33
+ * @returns Whether the dialog is at the top of the stack.
34
+ */
35
+ export declare const isTopmostDialog: (dialogStackId: symbol) => boolean;
@@ -1,3 +1,4 @@
1
1
  import { default as IconButton } from './IconButton';
2
+ export { ICON_BUTTON_SIZES } from './types';
2
3
  export type { IconButtonProps, IconButtonSize } from './types';
3
4
  export { IconButton };
@@ -0,0 +1,3 @@
1
+ import { SpinnerProps } from './types';
2
+ declare const Spinner: import('react').ForwardRefExoticComponent<SpinnerProps & import('react').RefAttributes<HTMLSpanElement>>;
3
+ export default Spinner;
@@ -0,0 +1,3 @@
1
+ import { default as Spinner } from './Spinner';
2
+ export type { SpinnerProps } from './types';
3
+ export { Spinner };
@@ -0,0 +1,4 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export interface SpinnerProps extends Omit<HTMLAttributes<HTMLSpanElement>, "aria-hidden" | "aria-label" | "children" | "role"> {
3
+ label?: string | undefined;
4
+ }
@@ -1,6 +1,10 @@
1
1
  export type { ButtonBaseProps, ButtonColor, ButtonProps, ButtonSize, ButtonVariant, } from './Button';
2
- export { Button } from './Button';
2
+ export { Button, BUTTON_COLOR_VARIANTS, BUTTON_SIZES, BUTTON_VARIANTS, } from './Button';
3
+ export type { ContextMenuItemProps, ContextMenuPosition, ContextMenuProps, ContextMenuSeparatorProps, } from './ContextMenu';
4
+ export { ContextMenu, ContextMenuItem, ContextMenuSeparator, } from './ContextMenu';
3
5
  export type { DialogActionButtonProps, DialogActionsProps, DialogInitialFocus, DialogProps, DialogState, DialogSubmitHandler, } from './Dialog';
4
- export { Dialog, DialogActions } from './Dialog';
6
+ export { Dialog, DialogActions, DIALOG_INITIAL_FOCUS } from './Dialog';
5
7
  export type { IconButtonProps, IconButtonSize } from './IconButton';
6
- export { IconButton } from './IconButton';
8
+ export { IconButton, ICON_BUTTON_SIZES } from './IconButton';
9
+ export type { SpinnerProps } from './Spinner';
10
+ export { Spinner } from './Spinner';
@@ -1,2 +1,4 @@
1
1
  export type { UseDialogReturn } from './useDialog';
2
2
  export { useDialog } from './useDialog';
3
+ export type { UseContextMenuReturn } from './useContextMenu';
4
+ export { useContextMenu } from './useContextMenu';
@@ -0,0 +1,2 @@
1
+ export type { UseContextMenuReturn } from './types';
2
+ export { useContextMenu } from './useContextMenu';
@@ -0,0 +1,8 @@
1
+ import { ContextMenuPosition } from '../../components/ContextMenu';
2
+ export type UseContextMenuReturn<T> = {
3
+ open: boolean;
4
+ payload: T | null;
5
+ position: ContextMenuPosition;
6
+ openAt: (x: number, y: number, payload: T) => void;
7
+ close: () => void;
8
+ };
@@ -0,0 +1,2 @@
1
+ import { UseContextMenuReturn } from './types';
2
+ export declare const useContextMenu: <T>() => UseContextMenuReturn<T>;
package/dist/main.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type { ButtonBaseProps, ButtonColor, ButtonProps, ButtonSize, ButtonVariant, DialogActionButtonProps, DialogActionsProps, DialogInitialFocus, DialogProps, DialogState, DialogSubmitHandler, IconButtonProps, IconButtonSize, } from './components';
2
- export { Button, Dialog, DialogActions, IconButton } from './components';
3
- export type { UseDialogReturn } from './hooks';
4
- export { useDialog } from './hooks';
1
+ export type { ButtonBaseProps, ButtonColor, ButtonProps, ButtonSize, ButtonVariant, ContextMenuItemProps, ContextMenuPosition, ContextMenuProps, ContextMenuSeparatorProps, DialogActionButtonProps, DialogActionsProps, DialogInitialFocus, DialogProps, DialogState, DialogSubmitHandler, IconButtonProps, IconButtonSize, SpinnerProps, } from './components';
2
+ export { Button, BUTTON_COLOR_VARIANTS, BUTTON_SIZES, BUTTON_VARIANTS, ContextMenu, ContextMenuItem, ContextMenuSeparator, Dialog, DialogActions, DIALOG_INITIAL_FOCUS, IconButton, ICON_BUTTON_SIZES, Spinner, } from './components';
3
+ export type { UseContextMenuReturn, UseDialogReturn } from './hooks';
4
+ export { useContextMenu, useDialog } from './hooks';
package/dist/styles.css CHANGED
@@ -1,5 +1,6 @@
1
1
  :root {
2
2
  --sito-ui-color-text: #101010;
3
+ --sito-ui-color-text-muted: #667085;
3
4
  --sito-ui-color-surface: #ffffff;
4
5
  --sito-ui-color-border: #d9dde4;
5
6
 
@@ -56,35 +57,75 @@
56
57
  --sito-ui-size-icon-button-icon-md: 1.25rem;
57
58
  --sito-ui-size-icon-button-icon-lg: 1.5rem;
58
59
  --sito-ui-size-icon-button-icon: var(--sito-ui-size-icon-button-icon-md);
59
- --sito-ui-size-button-spinner: 1em;
60
+ --sito-ui-size-spinner: 1em;
61
+ --sito-ui-size-button-spinner: var(--sito-ui-size-spinner);
62
+ --sito-ui-size-context-menu-min-width: 12rem;
63
+ --sito-ui-size-context-menu-max-width: 20rem;
64
+ --sito-ui-size-context-menu-item: 2rem;
65
+ --sito-ui-size-context-menu-leading: 1rem;
60
66
 
61
67
  --sito-ui-radius-pill: 1.5rem;
62
68
  --sito-ui-radius-round: 100%;
63
69
  --sito-ui-radius-dialog: 1rem;
70
+ --sito-ui-radius-context-menu: 0.5rem;
71
+ --sito-ui-radius-context-menu-item: 0.25rem;
64
72
 
65
73
  --sito-ui-border-width-thin: 1px;
66
- --sito-ui-button-spinner-border-width: 2px;
74
+ --sito-ui-spinner-border-width: 2px;
75
+ --sito-ui-button-spinner-border-width: var(--sito-ui-spinner-border-width);
67
76
 
68
77
  --sito-ui-font-weight-semibold: 600;
69
78
  --sito-ui-font-size-button: 0.875rem;
70
79
  --sito-ui-font-size-dialog-title: 1.25rem;
80
+ --sito-ui-font-size-context-menu-shortcut: 0.75rem;
71
81
  --sito-ui-line-height-button: 1.25rem;
72
82
  --sito-ui-line-height-dialog-title: 1.75rem;
73
83
 
74
84
  --sito-ui-motion-duration-normal: 300ms;
75
- --sito-ui-motion-duration-spin: 600ms;
76
- --sito-ui-motion-duration-spin-reduced: 1500ms;
85
+ --sito-ui-motion-duration-spinner: 600ms;
86
+ --sito-ui-motion-duration-spinner-reduced: 1500ms;
87
+ --sito-ui-motion-duration-spin: var(--sito-ui-motion-duration-spinner);
88
+ --sito-ui-motion-duration-spin-reduced: var(
89
+ --sito-ui-motion-duration-spinner-reduced
90
+ );
77
91
  --sito-ui-motion-easing-standard: cubic-bezier(0.4, 0, 0.2, 1);
78
92
 
79
93
  --sito-ui-shadow-dialog: 0 1rem 3rem rgb(16 24 40 / 18%);
94
+ --sito-ui-shadow-context-menu: 0 0.75rem 2rem rgb(16 24 40 / 24%);
80
95
  --sito-ui-z-index-dialog: 50;
96
+ --sito-ui-z-index-context-menu: 60;
81
97
 
82
98
  --sito-ui-button-disabled-opacity: 0.6;
99
+ --sito-ui-context-menu-disabled-opacity: 0.5;
83
100
  --sito-ui-button-active-scale: 0.97;
84
101
  --sito-ui-dialog-backdrop-background: rgb(16 24 40 / 20%);
85
102
  --sito-ui-dialog-backdrop-filter: blur(1rem);
86
103
  }
87
104
 
105
+ .sito-ui-spinner {
106
+ display: inline-block;
107
+ width: var(--sito-ui-size-spinner);
108
+ height: var(--sito-ui-size-spinner);
109
+ flex: 0 0 auto;
110
+ border: var(--sito-ui-spinner-border-width) solid currentColor;
111
+ border-right-color: transparent;
112
+ border-radius: var(--sito-ui-radius-round);
113
+ animation: sito-ui-spinner-spin var(--sito-ui-motion-duration-spinner) linear
114
+ infinite;
115
+ }
116
+
117
+ @media (prefers-reduced-motion: reduce) {
118
+ .sito-ui-spinner {
119
+ animation-duration: var(--sito-ui-motion-duration-spinner-reduced);
120
+ }
121
+ }
122
+
123
+ @keyframes sito-ui-spinner-spin {
124
+ to {
125
+ transform: rotate(360deg);
126
+ }
127
+ }
128
+
88
129
  .sito-ui-button {
89
130
  --sito-ui-button-text: var(--sito-ui-color-default-text);
90
131
  --sito-ui-button-light: var(--sito-ui-color-default-light);
@@ -236,14 +277,12 @@
236
277
  }
237
278
 
238
279
  .sito-ui-button__spinner {
239
- width: var(--sito-ui-size-button-spinner);
240
- height: var(--sito-ui-size-button-spinner);
241
- flex: 0 0 auto;
242
- border: var(--sito-ui-button-spinner-border-width) solid currentColor;
243
- border-right-color: transparent;
244
- border-radius: var(--sito-ui-radius-round);
245
- animation: sito-ui-button-spin var(--sito-ui-motion-duration-spin) linear
246
- infinite;
280
+ --sito-ui-size-spinner: var(--sito-ui-size-button-spinner);
281
+ --sito-ui-spinner-border-width: var(--sito-ui-button-spinner-border-width);
282
+ --sito-ui-motion-duration-spinner: var(--sito-ui-motion-duration-spin);
283
+ --sito-ui-motion-duration-spinner-reduced: var(
284
+ --sito-ui-motion-duration-spin-reduced
285
+ );
247
286
  }
248
287
 
249
288
  .sito-ui-button__loading-label {
@@ -261,18 +300,6 @@
261
300
  opacity: var(--sito-ui-button-disabled-opacity);
262
301
  }
263
302
 
264
- @media (prefers-reduced-motion: reduce) {
265
- .sito-ui-button__spinner {
266
- animation-duration: var(--sito-ui-motion-duration-spin-reduced);
267
- }
268
- }
269
-
270
- @keyframes sito-ui-button-spin {
271
- to {
272
- transform: rotate(360deg);
273
- }
274
- }
275
-
276
303
  .sito-ui-icon-button {
277
304
  --sito-ui-icon-button-container-size: var(--sito-ui-size-icon-button-md);
278
305
  --sito-ui-icon-button-icon-size: var(--sito-ui-size-icon-button-icon);
@@ -402,3 +429,73 @@
402
429
  }
403
430
  }
404
431
 
432
+ .sito-ui-context-menu {
433
+ position: fixed;
434
+ z-index: var(--sito-ui-z-index-context-menu);
435
+ display: grid;
436
+ min-width: var(--sito-ui-size-context-menu-min-width);
437
+ max-width: var(--sito-ui-size-context-menu-max-width);
438
+ max-height: calc(100vh - var(--sito-ui-space-4));
439
+ overflow: auto;
440
+ padding: var(--sito-ui-space-1);
441
+ border: var(--sito-ui-border-width-thin) solid var(--sito-ui-color-border);
442
+ border-radius: var(--sito-ui-radius-context-menu);
443
+ color: var(--sito-ui-color-text);
444
+ background: var(--sito-ui-color-surface);
445
+ box-shadow: var(--sito-ui-shadow-context-menu);
446
+ }
447
+
448
+ .sito-ui-context-menu__item {
449
+ display: grid;
450
+ grid-template-columns:
451
+ var(--sito-ui-size-context-menu-leading)
452
+ minmax(0, 1fr)
453
+ auto;
454
+ align-items: center;
455
+ gap: var(--sito-ui-space-2);
456
+ width: 100%;
457
+ min-height: var(--sito-ui-size-context-menu-item);
458
+ padding: var(--sito-ui-space-1) var(--sito-ui-space-2);
459
+ border: 0;
460
+ border-radius: var(--sito-ui-radius-context-menu-item);
461
+ color: inherit;
462
+ background: transparent;
463
+ font: inherit;
464
+ text-align: left;
465
+ cursor: default;
466
+ }
467
+
468
+ .sito-ui-context-menu__item:hover:not(:disabled),
469
+ .sito-ui-context-menu__item:focus-visible {
470
+ outline: none;
471
+ background: var(--sito-ui-color-primary-light);
472
+ }
473
+
474
+ .sito-ui-context-menu__item:disabled {
475
+ opacity: var(--sito-ui-context-menu-disabled-opacity);
476
+ }
477
+
478
+ .sito-ui-context-menu__leading {
479
+ display: grid;
480
+ place-items: center;
481
+ color: var(--sito-ui-color-text);
482
+ }
483
+
484
+ .sito-ui-context-menu__label {
485
+ overflow: hidden;
486
+ text-overflow: ellipsis;
487
+ white-space: nowrap;
488
+ }
489
+
490
+ .sito-ui-context-menu__shortcut {
491
+ color: var(--sito-ui-color-text-muted);
492
+ font-size: var(--sito-ui-font-size-context-menu-shortcut);
493
+ white-space: nowrap;
494
+ }
495
+
496
+ .sito-ui-context-menu__separator {
497
+ height: var(--sito-ui-border-width-thin);
498
+ margin: var(--sito-ui-space-1);
499
+ background: var(--sito-ui-color-border);
500
+ }
501
+
package/dist/theme.css CHANGED
@@ -1,5 +1,6 @@
1
1
  :root {
2
2
  --sito-ui-color-text: #101010;
3
+ --sito-ui-color-text-muted: #667085;
3
4
  --sito-ui-color-surface: #ffffff;
4
5
  --sito-ui-color-border: #d9dde4;
5
6
 
@@ -56,30 +57,46 @@
56
57
  --sito-ui-size-icon-button-icon-md: 1.25rem;
57
58
  --sito-ui-size-icon-button-icon-lg: 1.5rem;
58
59
  --sito-ui-size-icon-button-icon: var(--sito-ui-size-icon-button-icon-md);
59
- --sito-ui-size-button-spinner: 1em;
60
+ --sito-ui-size-spinner: 1em;
61
+ --sito-ui-size-button-spinner: var(--sito-ui-size-spinner);
62
+ --sito-ui-size-context-menu-min-width: 12rem;
63
+ --sito-ui-size-context-menu-max-width: 20rem;
64
+ --sito-ui-size-context-menu-item: 2rem;
65
+ --sito-ui-size-context-menu-leading: 1rem;
60
66
 
61
67
  --sito-ui-radius-pill: 1.5rem;
62
68
  --sito-ui-radius-round: 100%;
63
69
  --sito-ui-radius-dialog: 1rem;
70
+ --sito-ui-radius-context-menu: 0.5rem;
71
+ --sito-ui-radius-context-menu-item: 0.25rem;
64
72
 
65
73
  --sito-ui-border-width-thin: 1px;
66
- --sito-ui-button-spinner-border-width: 2px;
74
+ --sito-ui-spinner-border-width: 2px;
75
+ --sito-ui-button-spinner-border-width: var(--sito-ui-spinner-border-width);
67
76
 
68
77
  --sito-ui-font-weight-semibold: 600;
69
78
  --sito-ui-font-size-button: 0.875rem;
70
79
  --sito-ui-font-size-dialog-title: 1.25rem;
80
+ --sito-ui-font-size-context-menu-shortcut: 0.75rem;
71
81
  --sito-ui-line-height-button: 1.25rem;
72
82
  --sito-ui-line-height-dialog-title: 1.75rem;
73
83
 
74
84
  --sito-ui-motion-duration-normal: 300ms;
75
- --sito-ui-motion-duration-spin: 600ms;
76
- --sito-ui-motion-duration-spin-reduced: 1500ms;
85
+ --sito-ui-motion-duration-spinner: 600ms;
86
+ --sito-ui-motion-duration-spinner-reduced: 1500ms;
87
+ --sito-ui-motion-duration-spin: var(--sito-ui-motion-duration-spinner);
88
+ --sito-ui-motion-duration-spin-reduced: var(
89
+ --sito-ui-motion-duration-spinner-reduced
90
+ );
77
91
  --sito-ui-motion-easing-standard: cubic-bezier(0.4, 0, 0.2, 1);
78
92
 
79
93
  --sito-ui-shadow-dialog: 0 1rem 3rem rgb(16 24 40 / 18%);
94
+ --sito-ui-shadow-context-menu: 0 0.75rem 2rem rgb(16 24 40 / 24%);
80
95
  --sito-ui-z-index-dialog: 50;
96
+ --sito-ui-z-index-context-menu: 60;
81
97
 
82
98
  --sito-ui-button-disabled-opacity: 0.6;
99
+ --sito-ui-context-menu-disabled-opacity: 0.5;
83
100
  --sito-ui-button-active-scale: 0.97;
84
101
  --sito-ui-dialog-backdrop-background: rgb(16 24 40 / 20%);
85
102
  --sito-ui-dialog-backdrop-filter: blur(1rem);
package/dist/ui.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("react/jsx-runtime"),n=require("react-dom");var r=(...e)=>e.filter(Boolean).join(` `),i={DEFAULT:`default`,PRIMARY:`primary`,SECONDARY:`secondary`,ERROR:`error`,WARNING:`warning`,SUCCESS:`success`,INFO:`info`},a={TEXT:`text`,SUBMIT:`submit`,OUTLINED:`outlined`},o={SM:`sm`,MD:`md`,LG:`lg`},s=(0,e.forwardRef)(function(e,n){let{color:s=i.DEFAULT,size:c=o.MD,type:l=`button`,variant:u=a.TEXT,loading:d=!1,loadingIndicator:f,loadingLabel:p=`Loading`,disabled:m,className:h,children:g,..._}=e,v=r(`sito-ui-button`,`sito-ui-button--${u}`,`sito-ui-button--${s}`,`sito-ui-button--${c}`,d&&`sito-ui-button--loading`,h),y=f===void 0?(0,t.jsx)(`span`,{className:`sito-ui-button__spinner`,"aria-hidden":`true`,"data-sito-ui":`button-spinner`}):f;return(0,t.jsxs)(`button`,{"data-sito-ui":`button`,..._,type:l,ref:n,disabled:m||d,"aria-busy":d||_[`aria-busy`],className:v,children:[d?(0,t.jsxs)(t.Fragment,{children:[y,(0,t.jsx)(`span`,{className:`sito-ui-button__loading-label`,children:p})]}):null,g]})}),c={SM:`sm`,MD:`md`,LG:`lg`},l=e=>{if(e!==void 0)return typeof e==`number`?`${e}px`:e},u=(0,e.forwardRef)(function(e,n){let{children:i,icon:a,iconClassName:o,type:u=`button`,variant:d=`text`,color:f=`default`,loading:p=!1,size:m=c.MD,iconSize:h,className:g,style:_,...v}=e,y=i!=null&&typeof i!=`boolean`,b=l(h),x=b===void 0?_:{..._,"--sito-ui-icon-button-icon-size":b},S=r(`sito-ui-icon-button`,`sito-ui-icon-button--${m}`,y&&`sito-ui-icon-button--with-content`,g);return(0,t.jsxs)(s,{...v,ref:n,type:u,variant:d,color:f,size:m,loading:p,"data-sito-ui":`icon-button`,className:S,style:x,children:[p?null:(0,t.jsx)(`span`,{className:r(`sito-ui-icon-button__icon`,o),"aria-hidden":`true`,children:a}),i]})}),d=`input:not([type="hidden"]):not([disabled]), textarea:not([disabled]), select:not([disabled])`,f=`button[type="submit"]:not([disabled]), input[type="submit"]:not([disabled])`,p=[`a[href]`,`button:not([disabled])`,`textarea:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`),m=0,h=null,g=()=>typeof document<`u`&&!!document.body,_=()=>{g()&&(m===0&&(h=document.body.style.overflow,document.body.style.overflow=`hidden`),m+=1)},v=()=>{!g()||m===0||(--m,m===0&&(document.body.style.overflow=h??``,h=null))},y=e=>Array.from(e.querySelectorAll(p)).filter(e=>e.getAttribute(`aria-disabled`)!==`true`),b=()=>typeof document>`u`?null:document.activeElement instanceof HTMLElement?document.activeElement:null,x=typeof window>`u`?e.useEffect:e.useLayoutEffect,S=i=>{let a=(0,e.useId)(),o=(0,e.useRef)(null),s=(0,e.useRef)(null),c=(0,e.useRef)(null),l=(0,e.useRef)(void 0),{dialogId:p,title:m,ariaLabel:h,children:g,onClose:S,initialFocus:C=`none`,closeOnBackdropClick:w=!1,closeOnEscape:T=!0,lockBodyScroll:E=!0,onSubmit:D,open:O=!1,mobileFullScreen:k=!1,containerClassName:A,className:j,closeLabel:M=`Close dialog`,closeIcon:N=`x`,showCloseButton:P=!0,portalContainer:F,exitDurationMs:I=0,onExitComplete:L}=i,[R,z]=(0,e.useState)(O),[B,V]=(0,e.useState)(!1),H=m?`${p??a}-title`:void 0,U=B?`closing`:`open`,W=O&&!B;(0,e.useEffect)(()=>{l.current=L},[L]);let G=(0,e.useCallback)(()=>{c.current!==null&&(window.clearTimeout(c.current),c.current=null)},[]),K=(0,e.useCallback)(()=>{z(!1),V(!1),l.current?.(),c.current=null},[]);x(()=>{if(O){G(),z(!0),V(!1);return}if(!R)return;let e=Math.max(0,I);if(e===0){G(),K();return}V(!0),G(),c.current=window.setTimeout(K,e)},[G,I,K,O,R]),(0,e.useEffect)(()=>()=>{G()},[G]);let q=(0,e.useCallback)(e=>{if(e.key===`Escape`&&W&&T){S();return}if(e.key!==`Tab`||!W)return;let t=o.current;if(!t)return;let n=y(t);if(n.length===0){e.preventDefault(),t.focus();return}let r=n[0],i=n[n.length-1],a=b(),s=!a||!t.contains(a);if(e.shiftKey&&(s||a===r)){e.preventDefault(),i.focus();return}!e.shiftKey&&(s||a===i)&&(e.preventDefault(),r.focus())},[T,W,S]);(0,e.useEffect)(()=>{if(!(!W||typeof window>`u`))return window.addEventListener(`keydown`,q),()=>{window.removeEventListener(`keydown`,q)}},[q,W]),x(()=>{if(O)return s.current=b(),()=>{s.current?.isConnected&&s.current.focus(),s.current=null}},[O]),x(()=>{if(!O)return;let e=o.current;if(e){if(C===`first-input`){let t=e.querySelector(d);if(t){t.focus();return}}if(C===`submit`){let t=e.querySelector(f);if(t){t.focus();return}}e.focus()}},[C,O]),(0,e.useEffect)(()=>{if(!(!R||!E))return _(),()=>{v()}},[E,R]);let J=(0,e.useCallback)(e=>{W&&w&&e.target===e.currentTarget&&S()},[w,W,S]),Y=(0,e.useCallback)(e=>{e.preventDefault(),D?.(e)},[D]);if(!R||typeof document>`u`)return null;let X=D?(0,t.jsx)(`form`,{onSubmit:Y,children:g}):g,Z=typeof N==`string`?(0,t.jsx)(`span`,{"aria-hidden":`true`,children:N}):N;return(0,n.createPortal)((0,t.jsx)(`div`,{id:p?`backdrop-${p}`:void 0,"data-sito-ui":`dialog-backdrop`,"data-state":U,onClick:J,className:r(`sito-ui-dialog-backdrop`,`sito-ui-dialog-backdrop--${U}`,A),children:(0,t.jsxs)(`div`,{id:p,ref:o,role:`dialog`,"aria-modal":`true`,"aria-label":m?void 0:h,"aria-labelledby":H,tabIndex:-1,"data-sito-ui":`dialog`,"data-state":U,className:r(`sito-ui-dialog`,`sito-ui-dialog--${U}`,k&&`sito-ui-dialog--mobile-full-screen`,j),children:[(0,t.jsxs)(`div`,{className:`sito-ui-dialog__header`,children:[m?(0,t.jsx)(`h3`,{id:H,className:`sito-ui-dialog__title`,children:m}):null,P?(0,t.jsx)(u,{icon:Z,disabled:!W,"aria-disabled":!W,onClick:S,variant:`text`,color:`error`,className:`sito-ui-dialog__close`,"aria-label":M}):null]}),X]})}),F??document.body)},C=e=>{let{primaryText:n,cancelText:i,onPrimaryClick:a,onCancel:o,isLoading:c=!1,loadingIndicator:l,disabled:u=!1,primaryType:d=`submit`,containerClassName:f,primaryClassName:p,cancelClassName:m,alignEnd:h=!1,primaryName:g,primaryAriaLabel:_,cancelName:v,cancelAriaLabel:y,extraActions:b=[]}=e;return(0,t.jsxs)(`div`,{"data-sito-ui":`dialog-actions`,className:r(`sito-ui-dialog-actions`,h&&`sito-ui-dialog-actions--end`,f),children:[(0,t.jsx)(s,{type:d,color:`primary`,variant:`submit`,className:p,disabled:u,loading:c,loadingIndicator:l,onClick:a,name:g,"aria-label":_,children:n}),b.map(({id:e,...n})=>(0,t.jsx)(s,{...n},e)),(0,t.jsx)(s,{type:`button`,variant:`outlined`,className:m,disabled:u||c,onClick:o,name:v,"aria-label":y,children:i})]})},w=(t=!1)=>{let[n,r]=(0,e.useState)(t);return{open:n,setOpen:r,handleClose:()=>r(!1),handleOpen:()=>r(!0)}};exports.Button=s,exports.Dialog=S,exports.DialogActions=C,exports.IconButton=u,exports.useDialog=w;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("react/jsx-runtime"),n=require("react-dom");var r=(...e)=>e.filter(Boolean).join(` `),i=(0,e.forwardRef)(function(e,n){let{className:i,label:a,...o}=e,s=a!==void 0;return(0,t.jsx)(`span`,{"data-sito-ui":`spinner`,...o,ref:n,"aria-hidden":!s||void 0,"aria-label":a,role:s?`status`:void 0,className:r(`sito-ui-spinner`,i)})}),a={DEFAULT:`default`,PRIMARY:`primary`,SECONDARY:`secondary`,ERROR:`error`,WARNING:`warning`,SUCCESS:`success`,INFO:`info`},o={TEXT:`text`,SUBMIT:`submit`,OUTLINED:`outlined`},s={SM:`sm`,MD:`md`,LG:`lg`},c=(0,e.forwardRef)(function(e,n){let{color:c=a.DEFAULT,size:l=s.MD,type:u=`button`,variant:d=o.TEXT,loading:f=!1,loadingIndicator:p,loadingLabel:m=`Loading`,disabled:h,className:g,children:_,...v}=e,y=r(`sito-ui-button`,`sito-ui-button--${d}`,`sito-ui-button--${c}`,`sito-ui-button--${l}`,f&&`sito-ui-button--loading`,g),b=p===void 0?(0,t.jsx)(i,{className:`sito-ui-button__spinner`,"data-sito-ui":`button-spinner`}):p;return(0,t.jsxs)(`button`,{"data-sito-ui":`button`,...v,type:u,ref:n,disabled:h||f,"aria-busy":f||v[`aria-busy`],className:y,children:[f?(0,t.jsxs)(t.Fragment,{children:[b,(0,t.jsx)(`span`,{className:`sito-ui-button__loading-label`,children:m})]}):null,_]})}),l=typeof window>`u`?e.useEffect:e.useLayoutEffect,u=(0,e.forwardRef)(function({open:i,position:a,onClose:o,ariaLabel:s,children:c,className:u,portalContainer:d,viewportPadding:f=8,closeOnEscape:p=!0,closeOnTab:m=!0,closeOnPointerDownOutside:h=!0,clampToViewport:g=!0},_){let v=(0,e.useRef)(null),y=(0,e.useRef)(null),b=(0,e.useCallback)(e=>{v.current=e,typeof _==`function`?_(e):_&&(_.current=e)},[_]);return l(()=>{if(i)return y.current=document.activeElement instanceof HTMLElement?document.activeElement:null,(v.current?.querySelector(`[role="menuitem"]:not([disabled])`)??v.current)?.focus(),()=>{y.current?.isConnected&&y.current.focus(),y.current=null}},[i]),l(()=>{let e=v.current;if(!i||!e||!g)return;let t=window.innerWidth-e.offsetWidth-f,n=window.innerHeight-e.offsetHeight-f,r=Math.max(f,Math.min(a.x,t)),o=Math.max(f,Math.min(a.y,n));e.style.left=`${r}px`,e.style.top=`${o}px`},[g,i,a.x,a.y,f]),(0,e.useEffect)(()=>{if(!i||!h)return;let e=e=>{let t=e.target;(!(t instanceof Node)||!v.current?.contains(t))&&o()};return document.addEventListener(`pointerdown`,e),()=>{document.removeEventListener(`pointerdown`,e)}},[h,o,i]),!i||typeof document>`u`?null:(0,n.createPortal)((0,t.jsx)(`div`,{ref:b,role:`menu`,tabIndex:-1,"aria-label":s,"aria-orientation":`vertical`,"data-sito-ui":`context-menu`,"data-state":`open`,className:r(`sito-ui-context-menu`,u),style:{left:a.x,top:a.y},onContextMenu:e=>e.preventDefault(),onKeyDown:e=>{let t=e.key===`Escape`&&p,n=e.key===`Tab`&&m;if(t||n){e.preventDefault(),e.stopPropagation(),o();return}let r=Array.from(v.current?.querySelectorAll(`[role="menuitem"]:not([disabled])`)??[]);if(r.length===0)return;let i=document.activeElement,a=i instanceof HTMLElement?r.indexOf(i):-1,s=null;e.key===`ArrowDown`?s=(a+1+r.length)%r.length:e.key===`ArrowUp`?s=(a-1+r.length)%r.length:e.key===`Home`?s=0:e.key===`End`&&(s=r.length-1),s!==null&&(e.preventDefault(),r[s]?.focus())},children:c}),d??document.body)}),d=(0,e.forwardRef)(function({leading:e,shortcut:n,children:i,className:a,disabled:o,...s},c){return(0,t.jsxs)(`button`,{...s,ref:c,type:`button`,role:`menuitem`,tabIndex:-1,disabled:o,"data-sito-ui":`context-menu-item`,className:r(`sito-ui-context-menu__item`,a),children:[(0,t.jsx)(`span`,{className:`sito-ui-context-menu__leading`,"aria-hidden":`true`,children:e}),(0,t.jsx)(`span`,{className:`sito-ui-context-menu__label`,children:i}),n?(0,t.jsx)(`span`,{className:`sito-ui-context-menu__shortcut`,"aria-hidden":`true`,children:n}):null]})}),f=({className:e,...n})=>(0,t.jsx)(`div`,{...n,role:`separator`,"data-sito-ui":`context-menu-separator`,className:r(`sito-ui-context-menu__separator`,e)}),p={SM:`sm`,MD:`md`,LG:`lg`},m=e=>{if(e!==void 0)return typeof e==`number`?`${e}px`:e},h=(0,e.forwardRef)(function(e,n){let{children:i,icon:a,iconClassName:o,type:s=`button`,variant:l=`text`,color:u=`default`,loading:d=!1,size:f=p.MD,iconSize:h,className:g,style:_,...v}=e,y=i!=null&&typeof i!=`boolean`,b=m(h),x=b===void 0?_:{..._,"--sito-ui-icon-button-icon-size":b},S=r(`sito-ui-icon-button`,`sito-ui-icon-button--${f}`,y&&`sito-ui-icon-button--with-content`,g);return(0,t.jsxs)(c,{...v,ref:n,type:s,variant:l,color:u,size:f,loading:d,"data-sito-ui":`icon-button`,className:S,style:x,children:[d?null:(0,t.jsx)(`span`,{className:r(`sito-ui-icon-button__icon`,o),"aria-hidden":`true`,children:a}),i]})}),g=`input:not([type="hidden"]):not([disabled]), textarea:not([disabled]), select:not([disabled])`,_=`button[type="submit"]:not([disabled]), input[type="submit"]:not([disabled])`,v=[`a[href]`,`button:not([disabled])`,`textarea:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`),y=0,b=null,x=[],S=()=>typeof document<`u`&&!!document.body,C=()=>{S()&&(y===0&&(b=document.body.style.overflow,document.body.style.overflow=`hidden`),y+=1)},ee=()=>{!S()||y===0||(--y,y===0&&(document.body.style.overflow=b??``,b=null))},te=e=>Array.from(e.querySelectorAll(v)).filter(e=>e.getAttribute(`aria-disabled`)!==`true`),w=()=>typeof document>`u`?null:document.activeElement instanceof HTMLElement?document.activeElement:null,T=e=>{let t=x.indexOf(e);t>=0&&x.splice(t,1),x.push(e)},E=e=>{let t=x.indexOf(e);t>=0&&x.splice(t,1)},D=e=>x[x.length-1]===e,O=typeof window>`u`?e.useEffect:e.useLayoutEffect,k=i=>{let a=(0,e.useId)(),o=(0,e.useRef)(Symbol(`sito-ui-dialog`)),s=(0,e.useRef)(null),c=(0,e.useRef)(null),l=(0,e.useRef)(null),u=(0,e.useRef)(void 0),{dialogId:d,title:f,ariaLabel:p,children:m,onClose:v,initialFocus:y=`none`,closeOnBackdropClick:b=!1,closeOnEscape:x=!0,lockBodyScroll:S=!0,onSubmit:k,open:A=!1,mobileFullScreen:j=!1,containerClassName:M,className:N,headerClassName:P,titleClassName:F,closeButtonClassName:I,closeLabel:L=`Close dialog`,closeIcon:R=`x`,showCloseButton:z=!0,portalContainer:B,exitDurationMs:V=0,onExitComplete:H}=i,[U,W]=(0,e.useState)(A),[G,K]=(0,e.useState)(!1),q=f?`${d??a}-title`:void 0,J=G?`closing`:`open`,Y=A&&!G,X=o.current;(0,e.useEffect)(()=>{u.current=H},[H]);let Z=(0,e.useCallback)(()=>{l.current!==null&&(window.clearTimeout(l.current),l.current=null)},[]),Q=(0,e.useCallback)(()=>{W(!1),K(!1),u.current?.(),l.current=null},[]);O(()=>{if(A){Z(),W(!0),K(!1);return}if(!U)return;let e=Math.max(0,V);if(e===0){Z(),Q();return}K(!0),Z(),l.current=window.setTimeout(Q,e)},[Z,V,Q,A,U]),(0,e.useEffect)(()=>()=>{Z()},[Z]);let $=(0,e.useCallback)(e=>{if(!D(X))return;if(e.key===`Escape`&&Y&&x){v();return}if(e.key!==`Tab`||!Y)return;let t=s.current;if(!t)return;let n=te(t);if(n.length===0){e.preventDefault(),t.focus();return}let r=n[0],i=n[n.length-1],a=w(),o=!a||!t.contains(a);if(e.shiftKey&&(o||a===r)){e.preventDefault(),i.focus();return}!e.shiftKey&&(o||a===i)&&(e.preventDefault(),r.focus())},[x,X,Y,v]);(0,e.useEffect)(()=>{if(!(!Y||typeof window>`u`))return window.addEventListener(`keydown`,$),()=>{window.removeEventListener(`keydown`,$)}},[$,Y]),O(()=>{if(A)return c.current=w(),T(X),()=>{let e=D(X);E(X),e&&c.current?.isConnected&&c.current.focus(),c.current=null}},[X,A]),O(()=>{if(!A)return;let e=s.current;if(e){if(y===`first-input`){let t=e.querySelector(g);if(t){t.focus();return}}if(y===`submit`){let t=e.querySelector(_);if(t){t.focus();return}}e.focus()}},[y,A]),(0,e.useEffect)(()=>{if(!(!U||!S))return C(),()=>{ee()}},[S,U]);let ne=(0,e.useCallback)(e=>{D(X)&&Y&&b&&e.target===e.currentTarget&&v()},[b,X,Y,v]),re=(0,e.useCallback)(e=>{e.preventDefault(),k?.(e)},[k]);if(!U||typeof document>`u`)return null;let ie=k?(0,t.jsx)(`form`,{onSubmit:re,children:m}):m,ae=typeof R==`string`?(0,t.jsx)(`span`,{"aria-hidden":`true`,children:R}):R;return(0,n.createPortal)((0,t.jsx)(`div`,{id:d?`backdrop-${d}`:void 0,"data-sito-ui":`dialog-backdrop`,"data-state":J,onClick:ne,className:r(`sito-ui-dialog-backdrop`,`sito-ui-dialog-backdrop--${J}`,M),children:(0,t.jsxs)(`div`,{id:d,ref:s,role:`dialog`,"aria-modal":`true`,"aria-label":f?void 0:p,"aria-labelledby":q,tabIndex:-1,"data-sito-ui":`dialog`,"data-state":J,className:r(`sito-ui-dialog`,`sito-ui-dialog--${J}`,j&&`sito-ui-dialog--mobile-full-screen`,N),children:[(0,t.jsxs)(`div`,{className:r(`sito-ui-dialog__header`,P),children:[f?(0,t.jsx)(`h3`,{id:q,className:r(`sito-ui-dialog__title`,F),children:f}):null,z?(0,t.jsx)(h,{icon:ae,disabled:!Y,"aria-disabled":!Y,onClick:v,variant:`text`,color:`error`,className:r(`sito-ui-dialog__close`,I),"aria-label":L}):null]}),ie]})}),B??document.body)},A=e=>{let{primaryText:n,cancelText:i,onPrimaryClick:a,onCancel:o,isLoading:s=!1,loadingIndicator:l,disabled:u=!1,primaryType:d=`submit`,containerClassName:f,primaryClassName:p,cancelClassName:m,alignEnd:h=!1,primaryName:g,primaryAriaLabel:_,cancelName:v,cancelAriaLabel:y,extraActions:b=[]}=e;return(0,t.jsxs)(`div`,{"data-sito-ui":`dialog-actions`,className:r(`sito-ui-dialog-actions`,h&&`sito-ui-dialog-actions--end`,f),children:[(0,t.jsx)(c,{type:d,color:`primary`,variant:`submit`,className:p,disabled:u,loading:s,loadingIndicator:l,onClick:a,name:g,"aria-label":_,children:n}),b.map(({id:e,...n})=>(0,t.jsx)(c,{...n},e)),(0,t.jsx)(c,{type:`button`,variant:`outlined`,className:m,disabled:u||s,onClick:o,name:v,"aria-label":y,children:i})]})},j={NONE:`none`,FIRST_INPUT:`first-input`,SUBMIT:`submit`},M=(t=!1)=>{let[n,r]=(0,e.useState)(t);return{open:n,setOpen:r,handleClose:()=>r(!1),handleOpen:()=>r(!0)}},N={x:0,y:0},P=()=>{let[t,n]=(0,e.useState)(!1),[r,i]=(0,e.useState)(null),[a,o]=(0,e.useState)(N);return{open:t,payload:r,position:a,openAt:(0,e.useCallback)((e,t,r)=>{i(r),o({x:e,y:t}),n(!0)},[]),close:(0,e.useCallback)(()=>n(!1),[])}};exports.BUTTON_COLOR_VARIANTS=a,exports.BUTTON_SIZES=s,exports.BUTTON_VARIANTS=o,exports.Button=c,exports.ContextMenu=u,exports.ContextMenuItem=d,exports.ContextMenuSeparator=f,exports.DIALOG_INITIAL_FOCUS=j,exports.Dialog=k,exports.DialogActions=A,exports.ICON_BUTTON_SIZES=p,exports.IconButton=h,exports.Spinner=i,exports.useContextMenu=P,exports.useDialog=M;
package/dist/ui.js CHANGED
@@ -2,7 +2,18 @@ import { forwardRef as e, useCallback as t, useEffect as n, useId as r, useLayou
2
2
  import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
3
3
  import { createPortal as u } from "react-dom";
4
4
  //#region src/utils/classNames.ts
5
- var d = (...e) => e.filter(Boolean).join(" "), f = {
5
+ var d = (...e) => e.filter(Boolean).join(" "), f = e(function(e, t) {
6
+ let { className: n, label: r, ...i } = e, a = r !== void 0;
7
+ return /* @__PURE__ */ c("span", {
8
+ "data-sito-ui": "spinner",
9
+ ...i,
10
+ ref: t,
11
+ "aria-hidden": !a || void 0,
12
+ "aria-label": r,
13
+ role: a ? "status" : void 0,
14
+ className: d("sito-ui-spinner", n)
15
+ });
16
+ }), p = {
6
17
  DEFAULT: "default",
7
18
  PRIMARY: "primary",
8
19
  SECONDARY: "secondary",
@@ -10,46 +21,136 @@ var d = (...e) => e.filter(Boolean).join(" "), f = {
10
21
  WARNING: "warning",
11
22
  SUCCESS: "success",
12
23
  INFO: "info"
13
- }, p = {
24
+ }, m = {
14
25
  TEXT: "text",
15
26
  SUBMIT: "submit",
16
27
  OUTLINED: "outlined"
17
- }, m = {
28
+ }, h = {
18
29
  SM: "sm",
19
30
  MD: "md",
20
31
  LG: "lg"
21
- }, h = e(function(e, t) {
22
- let { color: n = f.DEFAULT, size: r = m.MD, type: i = "button", variant: a = p.TEXT, loading: o = !1, loadingIndicator: u, loadingLabel: h = "Loading", disabled: g, className: _, children: v, ...y } = e, b = d("sito-ui-button", `sito-ui-button--${a}`, `sito-ui-button--${n}`, `sito-ui-button--${r}`, o && "sito-ui-button--loading", _), x = u === void 0 ? /* @__PURE__ */ c("span", {
32
+ }, g = e(function(e, t) {
33
+ let { color: n = p.DEFAULT, size: r = h.MD, type: i = "button", variant: a = m.TEXT, loading: o = !1, loadingIndicator: u, loadingLabel: g = "Loading", disabled: _, className: v, children: y, ...b } = e, x = d("sito-ui-button", `sito-ui-button--${a}`, `sito-ui-button--${n}`, `sito-ui-button--${r}`, o && "sito-ui-button--loading", v), S = u === void 0 ? /* @__PURE__ */ c(f, {
23
34
  className: "sito-ui-button__spinner",
24
- "aria-hidden": "true",
25
35
  "data-sito-ui": "button-spinner"
26
36
  }) : u;
27
37
  return /* @__PURE__ */ l("button", {
28
38
  "data-sito-ui": "button",
29
- ...y,
39
+ ...b,
30
40
  type: i,
31
41
  ref: t,
32
- disabled: g || o,
33
- "aria-busy": o || y["aria-busy"],
34
- className: b,
35
- children: [o ? /* @__PURE__ */ l(s, { children: [x, /* @__PURE__ */ c("span", {
42
+ disabled: _ || o,
43
+ "aria-busy": o || b["aria-busy"],
44
+ className: x,
45
+ children: [o ? /* @__PURE__ */ l(s, { children: [S, /* @__PURE__ */ c("span", {
36
46
  className: "sito-ui-button__loading-label",
37
- children: h
38
- })] }) : null, v]
47
+ children: g
48
+ })] }) : null, y]
49
+ });
50
+ }), _ = typeof window > "u" ? n : i, v = e(function({ open: e, position: r, onClose: i, ariaLabel: o, children: s, className: l, portalContainer: f, viewportPadding: p = 8, closeOnEscape: m = !0, closeOnTab: h = !0, closeOnPointerDownOutside: g = !0, clampToViewport: v = !0 }, y) {
51
+ let b = a(null), x = a(null), S = t((e) => {
52
+ b.current = e, typeof y == "function" ? y(e) : y && (y.current = e);
53
+ }, [y]);
54
+ return _(() => {
55
+ if (e) return x.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, (b.current?.querySelector("[role=\"menuitem\"]:not([disabled])") ?? b.current)?.focus(), () => {
56
+ x.current?.isConnected && x.current.focus(), x.current = null;
57
+ };
58
+ }, [e]), _(() => {
59
+ let t = b.current;
60
+ if (!e || !t || !v) return;
61
+ let n = window.innerWidth - t.offsetWidth - p, i = window.innerHeight - t.offsetHeight - p, a = Math.max(p, Math.min(r.x, n)), o = Math.max(p, Math.min(r.y, i));
62
+ t.style.left = `${a}px`, t.style.top = `${o}px`;
63
+ }, [
64
+ v,
65
+ e,
66
+ r.x,
67
+ r.y,
68
+ p
69
+ ]), n(() => {
70
+ if (!e || !g) return;
71
+ let t = (e) => {
72
+ let t = e.target;
73
+ (!(t instanceof Node) || !b.current?.contains(t)) && i();
74
+ };
75
+ return document.addEventListener("pointerdown", t), () => {
76
+ document.removeEventListener("pointerdown", t);
77
+ };
78
+ }, [
79
+ g,
80
+ i,
81
+ e
82
+ ]), !e || typeof document > "u" ? null : u(/* @__PURE__ */ c("div", {
83
+ ref: S,
84
+ role: "menu",
85
+ tabIndex: -1,
86
+ "aria-label": o,
87
+ "aria-orientation": "vertical",
88
+ "data-sito-ui": "context-menu",
89
+ "data-state": "open",
90
+ className: d("sito-ui-context-menu", l),
91
+ style: {
92
+ left: r.x,
93
+ top: r.y
94
+ },
95
+ onContextMenu: (e) => e.preventDefault(),
96
+ onKeyDown: (e) => {
97
+ let t = e.key === "Escape" && m, n = e.key === "Tab" && h;
98
+ if (t || n) {
99
+ e.preventDefault(), e.stopPropagation(), i();
100
+ return;
101
+ }
102
+ let r = Array.from(b.current?.querySelectorAll("[role=\"menuitem\"]:not([disabled])") ?? []);
103
+ if (r.length === 0) return;
104
+ let a = document.activeElement, o = a instanceof HTMLElement ? r.indexOf(a) : -1, s = null;
105
+ e.key === "ArrowDown" ? s = (o + 1 + r.length) % r.length : e.key === "ArrowUp" ? s = (o - 1 + r.length) % r.length : e.key === "Home" ? s = 0 : e.key === "End" && (s = r.length - 1), s !== null && (e.preventDefault(), r[s]?.focus());
106
+ },
107
+ children: s
108
+ }), f ?? document.body);
109
+ }), y = e(function({ leading: e, shortcut: t, children: n, className: r, disabled: i, ...a }, o) {
110
+ return /* @__PURE__ */ l("button", {
111
+ ...a,
112
+ ref: o,
113
+ type: "button",
114
+ role: "menuitem",
115
+ tabIndex: -1,
116
+ disabled: i,
117
+ "data-sito-ui": "context-menu-item",
118
+ className: d("sito-ui-context-menu__item", r),
119
+ children: [
120
+ /* @__PURE__ */ c("span", {
121
+ className: "sito-ui-context-menu__leading",
122
+ "aria-hidden": "true",
123
+ children: e
124
+ }),
125
+ /* @__PURE__ */ c("span", {
126
+ className: "sito-ui-context-menu__label",
127
+ children: n
128
+ }),
129
+ t ? /* @__PURE__ */ c("span", {
130
+ className: "sito-ui-context-menu__shortcut",
131
+ "aria-hidden": "true",
132
+ children: t
133
+ }) : null
134
+ ]
39
135
  });
40
- }), g = {
136
+ }), b = ({ className: e, ...t }) => /* @__PURE__ */ c("div", {
137
+ ...t,
138
+ role: "separator",
139
+ "data-sito-ui": "context-menu-separator",
140
+ className: d("sito-ui-context-menu__separator", e)
141
+ }), x = {
41
142
  SM: "sm",
42
143
  MD: "md",
43
144
  LG: "lg"
44
- }, _ = (e) => {
145
+ }, S = (e) => {
45
146
  if (e !== void 0) return typeof e == "number" ? `${e}px` : e;
46
- }, v = e(function(e, t) {
47
- let { children: n, icon: r, iconClassName: i, type: a = "button", variant: o = "text", color: s = "default", loading: u = !1, size: f = g.MD, iconSize: p, className: m, style: v, ...y } = e, b = n != null && typeof n != "boolean", x = _(p), S = x === void 0 ? v : {
48
- ...v,
49
- "--sito-ui-icon-button-icon-size": x
50
- }, C = d("sito-ui-icon-button", `sito-ui-icon-button--${f}`, b && "sito-ui-icon-button--with-content", m);
51
- return /* @__PURE__ */ l(h, {
52
- ...y,
147
+ }, C = e(function(e, t) {
148
+ let { children: n, icon: r, iconClassName: i, type: a = "button", variant: o = "text", color: s = "default", loading: u = !1, size: f = x.MD, iconSize: p, className: m, style: h, ..._ } = e, v = n != null && typeof n != "boolean", y = S(p), b = y === void 0 ? h : {
149
+ ...h,
150
+ "--sito-ui-icon-button-icon-size": y
151
+ }, C = d("sito-ui-icon-button", `sito-ui-icon-button--${f}`, v && "sito-ui-icon-button--with-content", m);
152
+ return /* @__PURE__ */ l(g, {
153
+ ..._,
53
154
  ref: t,
54
155
  type: a,
55
156
  variant: o,
@@ -58,100 +159,109 @@ var d = (...e) => e.filter(Boolean).join(" "), f = {
58
159
  loading: u,
59
160
  "data-sito-ui": "icon-button",
60
161
  className: C,
61
- style: S,
162
+ style: b,
62
163
  children: [u ? null : /* @__PURE__ */ c("span", {
63
164
  className: d("sito-ui-icon-button__icon", i),
64
165
  "aria-hidden": "true",
65
166
  children: r
66
167
  }), n]
67
168
  });
68
- }), y = "input:not([type=\"hidden\"]):not([disabled]), textarea:not([disabled]), select:not([disabled])", b = "button[type=\"submit\"]:not([disabled]), input[type=\"submit\"]:not([disabled])", x = [
169
+ }), ee = "input:not([type=\"hidden\"]):not([disabled]), textarea:not([disabled]), select:not([disabled])", te = "button[type=\"submit\"]:not([disabled]), input[type=\"submit\"]:not([disabled])", w = [
69
170
  "a[href]",
70
171
  "button:not([disabled])",
71
172
  "textarea:not([disabled])",
72
173
  "input:not([disabled])",
73
174
  "select:not([disabled])",
74
175
  "[tabindex]:not([tabindex=\"-1\"])"
75
- ].join(","), S = 0, C = null, w = () => typeof document < "u" && !!document.body, T = () => {
76
- w() && (S === 0 && (C = document.body.style.overflow, document.body.style.overflow = "hidden"), S += 1);
77
- }, E = () => {
78
- !w() || S === 0 || (--S, S === 0 && (document.body.style.overflow = C ?? "", C = null));
79
- }, D = (e) => Array.from(e.querySelectorAll(x)).filter((e) => e.getAttribute("aria-disabled") !== "true"), O = () => typeof document > "u" ? null : document.activeElement instanceof HTMLElement ? document.activeElement : null, k = typeof window > "u" ? n : i, A = (e) => {
80
- let i = r(), s = a(null), f = a(null), p = a(null), m = a(void 0), { dialogId: h, title: g, ariaLabel: _, children: x, onClose: S, initialFocus: C = "none", closeOnBackdropClick: w = !1, closeOnEscape: A = !0, lockBodyScroll: j = !0, onSubmit: M, open: N = !1, mobileFullScreen: P = !1, containerClassName: F, className: I, closeLabel: L = "Close dialog", closeIcon: R = "x", showCloseButton: z = !0, portalContainer: B, exitDurationMs: V = 0, onExitComplete: H } = e, [U, W] = o(N), [G, K] = o(!1), q = g ? `${h ?? i}-title` : void 0, J = G ? "closing" : "open", Y = N && !G;
176
+ ].join(","), T = 0, E = null, D = [], O = () => typeof document < "u" && !!document.body, k = () => {
177
+ O() && (T === 0 && (E = document.body.style.overflow, document.body.style.overflow = "hidden"), T += 1);
178
+ }, ne = () => {
179
+ !O() || T === 0 || (--T, T === 0 && (document.body.style.overflow = E ?? "", E = null));
180
+ }, A = (e) => Array.from(e.querySelectorAll(w)).filter((e) => e.getAttribute("aria-disabled") !== "true"), j = () => typeof document > "u" ? null : document.activeElement instanceof HTMLElement ? document.activeElement : null, re = (e) => {
181
+ let t = D.indexOf(e);
182
+ t >= 0 && D.splice(t, 1), D.push(e);
183
+ }, ie = (e) => {
184
+ let t = D.indexOf(e);
185
+ t >= 0 && D.splice(t, 1);
186
+ }, M = (e) => D[D.length - 1] === e, N = typeof window > "u" ? n : i, P = (e) => {
187
+ let i = r(), s = a(Symbol("sito-ui-dialog")), f = a(null), p = a(null), m = a(null), h = a(void 0), { dialogId: g, title: _, ariaLabel: v, children: y, onClose: b, initialFocus: x = "none", closeOnBackdropClick: S = !1, closeOnEscape: w = !0, lockBodyScroll: T = !0, onSubmit: E, open: D = !1, mobileFullScreen: O = !1, containerClassName: P, className: F, headerClassName: I, titleClassName: L, closeButtonClassName: R, closeLabel: z = "Close dialog", closeIcon: B = "x", showCloseButton: ae = !0, portalContainer: oe, exitDurationMs: V = 0, onExitComplete: H } = e, [U, W] = o(D), [G, K] = o(!1), q = _ ? `${g ?? i}-title` : void 0, J = G ? "closing" : "open", Y = D && !G, X = s.current;
81
188
  n(() => {
82
- m.current = H;
189
+ h.current = H;
83
190
  }, [H]);
84
- let X = t(() => {
85
- p.current !== null && (window.clearTimeout(p.current), p.current = null);
86
- }, []), Z = t(() => {
87
- W(!1), K(!1), m.current?.(), p.current = null;
191
+ let Z = t(() => {
192
+ m.current !== null && (window.clearTimeout(m.current), m.current = null);
193
+ }, []), Q = t(() => {
194
+ W(!1), K(!1), h.current?.(), m.current = null;
88
195
  }, []);
89
- k(() => {
90
- if (N) {
91
- X(), W(!0), K(!1);
196
+ N(() => {
197
+ if (D) {
198
+ Z(), W(!0), K(!1);
92
199
  return;
93
200
  }
94
201
  if (!U) return;
95
202
  let e = Math.max(0, V);
96
203
  if (e === 0) {
97
- X(), Z();
204
+ Z(), Q();
98
205
  return;
99
206
  }
100
- K(!0), X(), p.current = window.setTimeout(Z, e);
207
+ K(!0), Z(), m.current = window.setTimeout(Q, e);
101
208
  }, [
102
- X,
103
- V,
104
209
  Z,
105
- N,
210
+ V,
211
+ Q,
212
+ D,
106
213
  U
107
214
  ]), n(() => () => {
108
- X();
109
- }, [X]);
110
- let Q = t((e) => {
111
- if (e.key === "Escape" && Y && A) {
112
- S();
215
+ Z();
216
+ }, [Z]);
217
+ let $ = t((e) => {
218
+ if (!M(X)) return;
219
+ if (e.key === "Escape" && Y && w) {
220
+ b();
113
221
  return;
114
222
  }
115
223
  if (e.key !== "Tab" || !Y) return;
116
- let t = s.current;
224
+ let t = f.current;
117
225
  if (!t) return;
118
- let n = D(t);
226
+ let n = A(t);
119
227
  if (n.length === 0) {
120
228
  e.preventDefault(), t.focus();
121
229
  return;
122
230
  }
123
- let r = n[0], i = n[n.length - 1], a = O(), o = !a || !t.contains(a);
231
+ let r = n[0], i = n[n.length - 1], a = j(), o = !a || !t.contains(a);
124
232
  if (e.shiftKey && (o || a === r)) {
125
233
  e.preventDefault(), i.focus();
126
234
  return;
127
235
  }
128
236
  !e.shiftKey && (o || a === i) && (e.preventDefault(), r.focus());
129
237
  }, [
130
- A,
238
+ w,
239
+ X,
131
240
  Y,
132
- S
241
+ b
133
242
  ]);
134
243
  n(() => {
135
- if (!(!Y || typeof window > "u")) return window.addEventListener("keydown", Q), () => {
136
- window.removeEventListener("keydown", Q);
244
+ if (!(!Y || typeof window > "u")) return window.addEventListener("keydown", $), () => {
245
+ window.removeEventListener("keydown", $);
137
246
  };
138
- }, [Q, Y]), k(() => {
139
- if (N) return f.current = O(), () => {
140
- f.current?.isConnected && f.current.focus(), f.current = null;
247
+ }, [$, Y]), N(() => {
248
+ if (D) return p.current = j(), re(X), () => {
249
+ let e = M(X);
250
+ ie(X), e && p.current?.isConnected && p.current.focus(), p.current = null;
141
251
  };
142
- }, [N]), k(() => {
143
- if (!N) return;
144
- let e = s.current;
252
+ }, [X, D]), N(() => {
253
+ if (!D) return;
254
+ let e = f.current;
145
255
  if (e) {
146
- if (C === "first-input") {
147
- let t = e.querySelector(y);
256
+ if (x === "first-input") {
257
+ let t = e.querySelector(ee);
148
258
  if (t) {
149
259
  t.focus();
150
260
  return;
151
261
  }
152
262
  }
153
- if (C === "submit") {
154
- let t = e.querySelector(b);
263
+ if (x === "submit") {
264
+ let t = e.querySelector(te);
155
265
  if (t) {
156
266
  t.focus();
157
267
  return;
@@ -159,71 +269,72 @@ var d = (...e) => e.filter(Boolean).join(" "), f = {
159
269
  }
160
270
  e.focus();
161
271
  }
162
- }, [C, N]), n(() => {
163
- if (!(!U || !j)) return T(), () => {
164
- E();
272
+ }, [x, D]), n(() => {
273
+ if (!(!U || !T)) return k(), () => {
274
+ ne();
165
275
  };
166
- }, [j, U]);
167
- let $ = t((e) => {
168
- Y && w && e.target === e.currentTarget && S();
276
+ }, [T, U]);
277
+ let se = t((e) => {
278
+ M(X) && Y && S && e.target === e.currentTarget && b();
169
279
  }, [
170
- w,
280
+ S,
281
+ X,
171
282
  Y,
172
- S
173
- ]), ee = t((e) => {
174
- e.preventDefault(), M?.(e);
175
- }, [M]);
283
+ b
284
+ ]), ce = t((e) => {
285
+ e.preventDefault(), E?.(e);
286
+ }, [E]);
176
287
  if (!U || typeof document > "u") return null;
177
- let te = M ? /* @__PURE__ */ c("form", {
178
- onSubmit: ee,
179
- children: x
180
- }) : x, ne = typeof R == "string" ? /* @__PURE__ */ c("span", {
288
+ let le = E ? /* @__PURE__ */ c("form", {
289
+ onSubmit: ce,
290
+ children: y
291
+ }) : y, ue = typeof B == "string" ? /* @__PURE__ */ c("span", {
181
292
  "aria-hidden": "true",
182
- children: R
183
- }) : R;
293
+ children: B
294
+ }) : B;
184
295
  return u(/* @__PURE__ */ c("div", {
185
- id: h ? `backdrop-${h}` : void 0,
296
+ id: g ? `backdrop-${g}` : void 0,
186
297
  "data-sito-ui": "dialog-backdrop",
187
298
  "data-state": J,
188
- onClick: $,
189
- className: d("sito-ui-dialog-backdrop", `sito-ui-dialog-backdrop--${J}`, F),
299
+ onClick: se,
300
+ className: d("sito-ui-dialog-backdrop", `sito-ui-dialog-backdrop--${J}`, P),
190
301
  children: /* @__PURE__ */ l("div", {
191
- id: h,
192
- ref: s,
302
+ id: g,
303
+ ref: f,
193
304
  role: "dialog",
194
305
  "aria-modal": "true",
195
- "aria-label": g ? void 0 : _,
306
+ "aria-label": _ ? void 0 : v,
196
307
  "aria-labelledby": q,
197
308
  tabIndex: -1,
198
309
  "data-sito-ui": "dialog",
199
310
  "data-state": J,
200
- className: d("sito-ui-dialog", `sito-ui-dialog--${J}`, P && "sito-ui-dialog--mobile-full-screen", I),
311
+ className: d("sito-ui-dialog", `sito-ui-dialog--${J}`, O && "sito-ui-dialog--mobile-full-screen", F),
201
312
  children: [/* @__PURE__ */ l("div", {
202
- className: "sito-ui-dialog__header",
203
- children: [g ? /* @__PURE__ */ c("h3", {
313
+ className: d("sito-ui-dialog__header", I),
314
+ children: [_ ? /* @__PURE__ */ c("h3", {
204
315
  id: q,
205
- className: "sito-ui-dialog__title",
206
- children: g
207
- }) : null, z ? /* @__PURE__ */ c(v, {
208
- icon: ne,
316
+ className: d("sito-ui-dialog__title", L),
317
+ children: _
318
+ }) : null, ae ? /* @__PURE__ */ c(C, {
319
+ icon: ue,
209
320
  disabled: !Y,
210
321
  "aria-disabled": !Y,
211
- onClick: S,
322
+ onClick: b,
212
323
  variant: "text",
213
324
  color: "error",
214
- className: "sito-ui-dialog__close",
215
- "aria-label": L
325
+ className: d("sito-ui-dialog__close", R),
326
+ "aria-label": z
216
327
  }) : null]
217
- }), te]
328
+ }), le]
218
329
  })
219
- }), B ?? document.body);
220
- }, j = (e) => {
221
- let { primaryText: t, cancelText: n, onPrimaryClick: r, onCancel: i, isLoading: a = !1, loadingIndicator: o, disabled: s = !1, primaryType: u = "submit", containerClassName: f, primaryClassName: p, cancelClassName: m, alignEnd: g = !1, primaryName: _, primaryAriaLabel: v, cancelName: y, cancelAriaLabel: b, extraActions: x = [] } = e;
330
+ }), oe ?? document.body);
331
+ }, F = (e) => {
332
+ let { primaryText: t, cancelText: n, onPrimaryClick: r, onCancel: i, isLoading: a = !1, loadingIndicator: o, disabled: s = !1, primaryType: u = "submit", containerClassName: f, primaryClassName: p, cancelClassName: m, alignEnd: h = !1, primaryName: _, primaryAriaLabel: v, cancelName: y, cancelAriaLabel: b, extraActions: x = [] } = e;
222
333
  return /* @__PURE__ */ l("div", {
223
334
  "data-sito-ui": "dialog-actions",
224
- className: d("sito-ui-dialog-actions", g && "sito-ui-dialog-actions--end", f),
335
+ className: d("sito-ui-dialog-actions", h && "sito-ui-dialog-actions--end", f),
225
336
  children: [
226
- /* @__PURE__ */ c(h, {
337
+ /* @__PURE__ */ c(g, {
227
338
  type: u,
228
339
  color: "primary",
229
340
  variant: "submit",
@@ -236,8 +347,8 @@ var d = (...e) => e.filter(Boolean).join(" "), f = {
236
347
  "aria-label": v,
237
348
  children: t
238
349
  }),
239
- x.map(({ id: e, ...t }) => /* @__PURE__ */ c(h, { ...t }, e)),
240
- /* @__PURE__ */ c(h, {
350
+ x.map(({ id: e, ...t }) => /* @__PURE__ */ c(g, { ...t }, e)),
351
+ /* @__PURE__ */ c(g, {
241
352
  type: "button",
242
353
  variant: "outlined",
243
354
  className: m,
@@ -249,7 +360,11 @@ var d = (...e) => e.filter(Boolean).join(" "), f = {
249
360
  })
250
361
  ]
251
362
  });
252
- }, M = (e = !1) => {
363
+ }, I = {
364
+ NONE: "none",
365
+ FIRST_INPUT: "first-input",
366
+ SUBMIT: "submit"
367
+ }, L = (e = !1) => {
253
368
  let [t, n] = o(e);
254
369
  return {
255
370
  open: t,
@@ -257,6 +372,23 @@ var d = (...e) => e.filter(Boolean).join(" "), f = {
257
372
  handleClose: () => n(!1),
258
373
  handleOpen: () => n(!0)
259
374
  };
375
+ }, R = {
376
+ x: 0,
377
+ y: 0
378
+ }, z = () => {
379
+ let [e, n] = o(!1), [r, i] = o(null), [a, s] = o(R);
380
+ return {
381
+ open: e,
382
+ payload: r,
383
+ position: a,
384
+ openAt: t((e, t, r) => {
385
+ i(r), s({
386
+ x: e,
387
+ y: t
388
+ }), n(!0);
389
+ }, []),
390
+ close: t(() => n(!1), [])
391
+ };
260
392
  };
261
393
  //#endregion
262
- export { h as Button, A as Dialog, j as DialogActions, v as IconButton, M as useDialog };
394
+ export { p as BUTTON_COLOR_VARIANTS, h as BUTTON_SIZES, m as BUTTON_VARIANTS, g as Button, v as ContextMenu, y as ContextMenuItem, b as ContextMenuSeparator, I as DIALOG_INITIAL_FOCUS, P as Dialog, F as DialogActions, x as ICON_BUTTON_SIZES, C as IconButton, f as Spinner, z as useContextMenu, L as useDialog };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sito/ui",
3
3
  "private": false,
4
- "version": "0.3.2",
4
+ "version": "0.4.0",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.34.4",
7
7
  "files": [
@@ -65,7 +65,10 @@
65
65
  "lodash": "4.18.1",
66
66
  "minimatch": "3.1.5",
67
67
  "validator": "13.15.35"
68
- }
68
+ },
69
+ "ignoredBuiltDependencies": [
70
+ "esbuild"
71
+ ]
69
72
  },
70
73
  "devDependencies": {
71
74
  "@storybook/addon-docs": "10.4.6",