@wellingtonhlc/shared-ui 0.24.6 → 0.24.7

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
@@ -91,6 +91,35 @@ Tambem e possivel apontar um diretorio explicitamente:
91
91
  shared-ui-check-page-actions ./src
92
92
  ```
93
93
 
94
+ ## Page Actions
95
+
96
+ `Page.Actions` e a raiz visual das acoes de tela. O pacote suporta `left`, `top`, `right` e
97
+ `bottom`, com `left` como padrao desktop e `bottom` como fallback mobile quando permitido.
98
+
99
+ Persistencia de preferencia continua sendo responsabilidade do consumidor. Use
100
+ `Page.ActionsProvider` para fornecer a preferencia global sem acoplar o pacote a
101
+ `localStorage`:
102
+
103
+ ```tsx
104
+ <Page.ActionsProvider
105
+ preferences={{
106
+ movable: true,
107
+ onPositionChange: setActionsPosition,
108
+ position: actionsPosition,
109
+ }}
110
+ >
111
+ <App />
112
+ </Page.ActionsProvider>
113
+ ```
114
+
115
+ Telas podem limitar o contrato localmente:
116
+
117
+ ```tsx
118
+ <Page.Actions allowedPositions={['top', 'bottom']} movable={false}>
119
+ <Page.ActionButton label="Salvar" />
120
+ </Page.Actions>
121
+ ```
122
+
94
123
  ## Storybook
95
124
 
96
125
  O Storybook esta na linha `10.4.6` (`storybook`, `@storybook/react-vite`, `@storybook/addon-docs` e `@storybook/addon-a11y`).
@@ -7,15 +7,29 @@ export interface PageActionsProps {
7
7
  children: ReactNode;
8
8
  className?: string;
9
9
  position?: PageActionsPosition;
10
+ defaultPosition?: PageActionsPosition;
11
+ mobilePosition?: PageActionsPosition;
12
+ allowedPositions?: PageActionsPosition[];
13
+ movable?: boolean;
14
+ onPositionChange?: (position: PageActionsPosition) => void;
10
15
  align?: PageActionsAlign;
11
16
  size?: PageActionsSize;
12
17
  helpContent?: ReactNode;
13
18
  helpLabel?: string;
14
19
  helpClassName?: string;
20
+ __fromSlot?: boolean;
15
21
  }
16
22
  export type PageActionsElement = ReactElement<PageActionsProps, typeof Actions>;
17
23
  export type PageActionsSeparatorProps = ActionSeparatorPrimitiveProps;
18
24
  export type PageActionButtonProps = ActionButtonPrimitiveProps;
25
+ export interface PageActionsPreferences {
26
+ allowedPositions?: PageActionsPosition[];
27
+ defaultPosition?: PageActionsPosition;
28
+ mobilePosition?: PageActionsPosition;
29
+ movable?: boolean;
30
+ onPositionChange?: (position: PageActionsPosition) => void;
31
+ position?: PageActionsPosition;
32
+ }
19
33
  export interface PageActionsHelpContentProps {
20
34
  children?: ReactNode;
21
35
  className?: string;
@@ -23,7 +37,7 @@ export interface PageActionsHelpContentProps {
23
37
  title?: ReactNode;
24
38
  }
25
39
  declare function ActionsHelpContent({ children, className, items, title }: PageActionsHelpContentProps): import("react").JSX.Element;
26
- declare function Actions({ align, children, className, helpClassName, helpContent, helpLabel, position, size, }: PageActionsProps): import("react").JSX.Element;
40
+ declare function Actions({ align, __fromSlot, children, className, defaultPosition, mobilePosition, allowedPositions, helpClassName, helpContent, helpLabel, movable, onPositionChange, position, size, }: PageActionsProps): import("react").JSX.Element | null;
27
41
  declare function ActionsSeparator(props: PageActionsSeparatorProps): import("react").JSX.Element;
28
42
  interface PageRootProps extends HTMLAttributes<HTMLElement> {
29
43
  children: ReactNode;
@@ -32,8 +46,9 @@ interface PageRootProps extends HTMLAttributes<HTMLElement> {
32
46
  declare function Root({ actions, children, className, ...props }: PageRootProps): import("react").JSX.Element;
33
47
  interface PageActionsProviderProps {
34
48
  children: ReactNode;
49
+ preferences?: PageActionsPreferences;
35
50
  }
36
- declare function ActionsProvider({ children }: PageActionsProviderProps): import("react").JSX.Element;
51
+ declare function ActionsProvider({ children, preferences }: PageActionsProviderProps): import("react").JSX.Element;
37
52
  interface PageActionsSlotProps {
38
53
  className?: string;
39
54
  position: PageActionsPosition;
@@ -1 +1 @@
1
- {"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../src/components/Page.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,cAAc,EACnB,KA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;CACtC;AAED,iBAAS,eAAe,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,wBAAwB,+BAK3E;AAED,UAAU,oBAAoB;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,mBAAmB,CAAC;CAC/B;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,oBAAoB,sCAoBjE;AAED,UAAU,eAAe;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,kBAAkB,CAAC,CAAC;AAChE,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,oBAAoB,CAAC,CAAC;AAExE,iBAAS,KAAK,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,+BAM/D;AAED,iBAAS,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,+BAM3E;AAED,iBAAS,MAAM,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,eAAe,+BAexE;AAED,eAAO,MAAM,IAAI;;;;;;;;;;;CAWhB,CAAC"}
@@ -1,10 +1,17 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { createContext, useContext, useLayoutEffect, useMemo, useState, } from 'react';
3
- import { CircleHelpIcon } from 'lucide-react';
2
+ import { createContext, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, } from 'react';
3
+ import { CircleHelpIcon, GripVerticalIcon } from 'lucide-react';
4
4
  import { ActionButtonPrimitive, ActionGroupPrimitive, ActionSeparatorPrimitive, } from './ActionPrimitives';
5
5
  import { Tooltip } from './Tooltip';
6
6
  import { cn } from '../utils/cn';
7
7
  const PageActionsContext = createContext(null);
8
+ const allPositions = ['left', 'top', 'right', 'bottom'];
9
+ const positionLabels = {
10
+ left: 'Esquerda',
11
+ top: 'Topo',
12
+ right: 'Direita',
13
+ bottom: 'Rodape',
14
+ };
8
15
  function ActionsHelpContent({ children, className, items, title }) {
9
16
  return (_jsxs("div", { className: cn('max-w-[22rem] space-y-2 text-xs leading-5 [overflow-wrap:anywhere]', className), children: [title && _jsx("p", { className: "font-semibold text-foreground", children: title }), children && _jsx("div", { className: "text-foreground-muted", children: children }), items?.length ? (_jsx("ul", { className: "list-disc space-y-1 pl-4 text-foreground-muted", children: items.map((item, index) => (_jsx("li", { children: item }, index))) })) : null] }));
10
17
  }
@@ -20,7 +27,126 @@ function getHelpSide(position) {
20
27
  function hasHelpContent(helpContent) {
21
28
  return helpContent !== null && helpContent !== undefined && helpContent !== false && helpContent !== '';
22
29
  }
23
- function Actions({ align = 'start', children, className, helpClassName, helpContent, helpLabel = 'Ajuda da tela', position = 'top', size = 'md', }) {
30
+ function getAllowedPositions(props, preferences) {
31
+ const allowed = props.allowedPositions ?? preferences?.allowedPositions ?? allPositions;
32
+ return allowed.filter((position, index, array) => allPositions.includes(position) && array.indexOf(position) === index);
33
+ }
34
+ function firstAllowedPosition(allowedPositions, fallback) {
35
+ return allowedPositions.includes(fallback) ? fallback : (allowedPositions[0] ?? fallback);
36
+ }
37
+ function resolvePageActionsPosition(props, preferences, isMobile) {
38
+ const allowedPositions = getAllowedPositions(props, preferences);
39
+ const explicitPosition = props.position;
40
+ const preferredPosition = preferences?.position;
41
+ const defaultPosition = props.defaultPosition ?? preferences?.defaultPosition ?? 'left';
42
+ const mobilePosition = props.mobilePosition ?? preferences?.mobilePosition ?? 'bottom';
43
+ if (explicitPosition)
44
+ return firstAllowedPosition(allowedPositions, explicitPosition);
45
+ if (isMobile)
46
+ return firstAllowedPosition(allowedPositions, mobilePosition);
47
+ if (preferredPosition)
48
+ return firstAllowedPosition(allowedPositions, preferredPosition);
49
+ return firstAllowedPosition(allowedPositions, defaultPosition);
50
+ }
51
+ function resolvePageActionsMovable(props, preferences) {
52
+ return props.movable ?? preferences?.movable ?? false;
53
+ }
54
+ function resolvePageActionsPositionChange(props, preferences) {
55
+ return props.onPositionChange ?? preferences?.onPositionChange;
56
+ }
57
+ function useIsMobile() {
58
+ const [isMobile, setIsMobile] = useState(false);
59
+ useEffect(() => {
60
+ if (typeof window === 'undefined' || typeof window.matchMedia !== 'function')
61
+ return undefined;
62
+ const media = window.matchMedia('(max-width: 767px)');
63
+ function handleChange() {
64
+ setIsMobile(media.matches);
65
+ }
66
+ handleChange();
67
+ media.addEventListener('change', handleChange);
68
+ return () => {
69
+ media.removeEventListener('change', handleChange);
70
+ };
71
+ }, []);
72
+ return isMobile;
73
+ }
74
+ function getPointerPosition(event) {
75
+ const width = window.innerWidth || 1;
76
+ const height = window.innerHeight || 1;
77
+ const x = event.clientX;
78
+ const y = event.clientY;
79
+ const leftDistance = x;
80
+ const rightDistance = width - x;
81
+ const topDistance = y;
82
+ const bottomDistance = height - y;
83
+ const minDistance = Math.min(leftDistance, rightDistance, topDistance, bottomDistance);
84
+ if (minDistance === leftDistance)
85
+ return 'left';
86
+ if (minDistance === rightDistance)
87
+ return 'right';
88
+ if (minDistance === bottomDistance)
89
+ return 'bottom';
90
+ return 'top';
91
+ }
92
+ function coerceDropPosition(position, allowedPositions) {
93
+ return allowedPositions.includes(position) ? position : firstAllowedPosition(allowedPositions, position);
94
+ }
95
+ function Actions({ align = 'start', __fromSlot = false, children, className, defaultPosition, mobilePosition, allowedPositions, helpClassName, helpContent, helpLabel = 'Ajuda da tela', movable, onPositionChange, position, size = 'md', }) {
96
+ const actionsContext = useContext(PageActionsContext);
97
+ const preferences = actionsContext?.preferences;
98
+ const setPageActions = actionsContext?.setActions;
99
+ const isMobile = useIsMobile();
100
+ const propsForResolution = {
101
+ align,
102
+ children,
103
+ className,
104
+ defaultPosition,
105
+ mobilePosition,
106
+ allowedPositions,
107
+ helpClassName,
108
+ helpContent,
109
+ helpLabel,
110
+ movable,
111
+ onPositionChange,
112
+ position,
113
+ size,
114
+ };
115
+ const effectivePosition = resolvePageActionsPosition(propsForResolution, preferences, isMobile);
116
+ const effectiveAllowedPositions = getAllowedPositions(propsForResolution, preferences);
117
+ const effectiveMovable = resolvePageActionsMovable(propsForResolution, preferences);
118
+ const effectiveOnPositionChange = resolvePageActionsPositionChange(propsForResolution, preferences);
119
+ const canMove = effectiveMovable && !!effectiveOnPositionChange && effectiveAllowedPositions.length > 1;
120
+ const [isMenuOpen, setIsMenuOpen] = useState(false);
121
+ const [dragTarget, setDragTarget] = useState(null);
122
+ const [isDragging, setIsDragging] = useState(false);
123
+ const draggedRef = useRef(false);
124
+ useLayoutEffect(() => {
125
+ if (!setPageActions || __fromSlot)
126
+ return undefined;
127
+ setPageActions(_jsx(Actions, { align: align, allowedPositions: allowedPositions, className: className, defaultPosition: defaultPosition, helpClassName: helpClassName, helpContent: helpContent, helpLabel: helpLabel, mobilePosition: mobilePosition, movable: movable, onPositionChange: onPositionChange, position: position, size: size, __fromSlot: true, children: children }));
128
+ return () => {
129
+ setPageActions(null);
130
+ };
131
+ }, [
132
+ __fromSlot,
133
+ align,
134
+ allowedPositions,
135
+ children,
136
+ className,
137
+ defaultPosition,
138
+ helpClassName,
139
+ helpContent,
140
+ helpLabel,
141
+ mobilePosition,
142
+ movable,
143
+ onPositionChange,
144
+ position,
145
+ setPageActions,
146
+ size,
147
+ ]);
148
+ if (setPageActions && !__fromSlot)
149
+ return null;
24
150
  const positionClasses = {
25
151
  top: 'w-full max-w-full self-stretch border-b border-app-border bg-background-secondary p-1',
26
152
  bottom: 'w-full border-t border-app-border bg-background-secondary p-1',
@@ -28,17 +154,71 @@ function Actions({ align = 'start', children, className, helpClassName, helpCont
28
154
  right: 'h-full min-h-0 self-stretch w-[min(10rem,24vw)] max-w-40 flex-none flex-col items-stretch border-l border-app-border bg-background-secondary p-1 [&>button]:w-full [&>button]:justify-start [&>[role=separator]]:h-px [&>[role=separator]]:min-h-0 [&>[role=separator]]:w-auto',
29
155
  };
30
156
  const alignClasses = {
31
- start: position === 'left' || position === 'right' ? 'justify-start' : 'justify-start',
32
- end: position === 'left' || position === 'right' ? 'justify-end' : 'ml-auto justify-end self-end',
157
+ start: effectivePosition === 'left' || effectivePosition === 'right' ? 'justify-start' : 'justify-start',
158
+ end: effectivePosition === 'left' || effectivePosition === 'right' ? 'justify-end' : 'ml-auto justify-end self-end',
33
159
  };
34
160
  const helpVisible = hasHelpContent(helpContent);
35
- if (helpVisible) {
36
- const isVertical = position === 'left' || position === 'right';
37
- const actions = (_jsx(ActionGroupPrimitive, { align: align, size: size, className: cn('min-w-0', isVertical ? 'w-full flex-col items-stretch' : 'min-w-0 flex-1 overflow-x-auto overflow-y-hidden', alignClasses[align]), children: children }));
38
- const helpButton = (_jsx("div", { className: cn('flex shrink-0', isVertical && 'mt-auto w-full justify-center pt-2', !isVertical && align === 'start' && 'ml-auto pl-2', !isVertical && align === 'end' && 'mr-auto pr-2'), children: _jsx(Tooltip, { className: cn('max-w-[22rem] px-3 py-2', helpClassName), content: helpContent, delayDuration: 120, openOnClick: true, side: getHelpSide(position), children: _jsx(ActionButtonPrimitive, { "aria-label": helpLabel, icon: _jsx(CircleHelpIcon, { "aria-hidden": "true" }), tooltip: helpLabel }) }) }));
39
- return (_jsxs("div", { className: cn('flex min-w-0', positionClasses[position], isVertical ? 'flex-col' : 'items-center', className), children: [align === 'end' && !isVertical ? helpButton : null, actions, align === 'start' || isVertical ? helpButton : null] }));
161
+ const isVertical = effectivePosition === 'left' || effectivePosition === 'right';
162
+ function handleMoveMenuToggle() {
163
+ if (isDragging)
164
+ return;
165
+ setIsMenuOpen((current) => !current);
40
166
  }
41
- return (_jsx(ActionGroupPrimitive, { align: align, size: size, className: cn('min-w-0', positionClasses[position], alignClasses[align], className), children: children }));
167
+ function handleMoveKeyDown(event) {
168
+ if (event.key !== 'Enter' && event.key !== ' ')
169
+ return;
170
+ event.preventDefault();
171
+ setIsMenuOpen((current) => !current);
172
+ }
173
+ function handleMovePointerDown(event) {
174
+ if (!canMove || !effectiveOnPositionChange)
175
+ return;
176
+ event.currentTarget.setPointerCapture?.(event.pointerId);
177
+ draggedRef.current = false;
178
+ setIsDragging(true);
179
+ setIsMenuOpen(false);
180
+ setDragTarget(effectivePosition);
181
+ }
182
+ function handleMovePointerMove(event) {
183
+ if (!isDragging)
184
+ return;
185
+ draggedRef.current = true;
186
+ const nextTarget = coerceDropPosition(getPointerPosition(event), effectiveAllowedPositions);
187
+ setDragTarget(nextTarget);
188
+ }
189
+ function handleMovePointerUp(event) {
190
+ if (!isDragging || !effectiveOnPositionChange)
191
+ return;
192
+ event.currentTarget.releasePointerCapture?.(event.pointerId);
193
+ const nextTarget = dragTarget ?? coerceDropPosition(getPointerPosition(event), effectiveAllowedPositions);
194
+ setIsDragging(false);
195
+ setDragTarget(null);
196
+ if (draggedRef.current && nextTarget !== effectivePosition) {
197
+ effectiveOnPositionChange(nextTarget);
198
+ }
199
+ }
200
+ function handleMovePointerCancel(event) {
201
+ if (!isDragging)
202
+ return;
203
+ event.currentTarget.releasePointerCapture?.(event.pointerId);
204
+ setIsDragging(false);
205
+ setDragTarget(null);
206
+ }
207
+ function handleSelectPosition(nextPosition) {
208
+ effectiveOnPositionChange?.(nextPosition);
209
+ setIsMenuOpen(false);
210
+ }
211
+ const helpButton = helpVisible ? (_jsx("div", { className: cn('flex shrink-0', isVertical && 'w-full justify-center'), children: _jsx(Tooltip, { className: cn('max-w-[22rem] px-3 py-2', helpClassName), content: helpContent, delayDuration: 120, openOnClick: true, side: getHelpSide(effectivePosition), children: _jsx(ActionButtonPrimitive, { "aria-label": helpLabel, icon: _jsx(CircleHelpIcon, { "aria-hidden": "true" }), tooltip: helpLabel }) }) })) : null;
212
+ const moveButton = canMove ? (_jsxs("div", { className: cn('relative flex shrink-0', isVertical && 'w-full justify-center'), children: [_jsx(ActionButtonPrimitive, { "aria-haspopup": "menu", "aria-label": "Mover barra de acoes", "aria-expanded": isMenuOpen, className: cn(isDragging ? 'cursor-grabbing' : 'cursor-grab'), icon: _jsx(GripVerticalIcon, { "aria-hidden": "true" }), tooltip: "Mover barra de acoes", onClick: handleMoveMenuToggle, onKeyDown: handleMoveKeyDown, onPointerCancel: handleMovePointerCancel, onPointerDown: handleMovePointerDown, onPointerMove: handleMovePointerMove, onPointerUp: handleMovePointerUp }), isMenuOpen ? (_jsx("div", { role: "menu", className: cn('border-app-border bg-surface text-foreground absolute z-40 min-w-36 rounded-md border p-1 text-xs shadow-lg', isVertical ? 'left-full top-0 ml-2' : 'right-0 top-full mt-2'), children: effectiveAllowedPositions.map((nextPosition) => (_jsx("button", { type: "button", role: "menuitemradio", "aria-checked": nextPosition === effectivePosition, className: cn('hover:bg-background-secondary flex w-full cursor-pointer items-center rounded px-2 py-1.5 text-left', nextPosition === effectivePosition && 'font-semibold text-brand'), onClick: () => handleSelectPosition(nextPosition), children: positionLabels[nextPosition] }, nextPosition))) })) : null] })) : null;
213
+ const actions = (_jsxs(ActionGroupPrimitive, { align: align, size: size, className: cn('min-w-0', isVertical ? 'w-full flex-col items-stretch' : 'min-w-0 overflow-x-auto overflow-y-hidden', alignClasses[align]), children: [children, helpButton, moveButton] }));
214
+ return (_jsxs("div", { className: cn('flex min-w-0', positionClasses[effectivePosition], isVertical ? 'flex-col' : 'items-center', className), children: [actions, isDragging ? _jsx(PageActionsDropZones, { activePosition: dragTarget ?? effectivePosition, allowedPositions: effectiveAllowedPositions }) : null] }));
215
+ }
216
+ function PageActionsDropZones({ activePosition, allowedPositions }) {
217
+ return (_jsx("div", { "aria-hidden": "true", className: "pointer-events-none fixed inset-0 z-50", children: allPositions.map((position) => {
218
+ if (!allowedPositions.includes(position))
219
+ return null;
220
+ return (_jsx("div", { className: cn('absolute border-2 border-dashed border-brand/50 bg-brand/10 transition-colors', position === 'left' && 'left-2 top-2 h-[calc(100%-1rem)] w-20 rounded-md', position === 'right' && 'right-2 top-2 h-[calc(100%-1rem)] w-20 rounded-md', position === 'top' && 'left-2 top-2 h-14 w-[calc(100%-1rem)] rounded-md', position === 'bottom' && 'bottom-2 left-2 h-14 w-[calc(100%-1rem)] rounded-md', activePosition === position && 'border-brand bg-brand/20 shadow-[0_0_0_4px_color-mix(in_srgb,var(--brand)_18%,transparent)]') }, position));
221
+ }) }));
42
222
  }
43
223
  function ActionsSeparator(props) {
44
224
  return _jsx(ActionSeparatorPrimitive, { ...props });
@@ -46,8 +226,10 @@ function ActionsSeparator(props) {
46
226
  const ActionButton = ActionButtonPrimitive;
47
227
  function Root({ actions, children, className, ...props }) {
48
228
  const actionsContext = useContext(PageActionsContext);
229
+ const isMobile = useIsMobile();
230
+ const preferences = actionsContext?.preferences;
49
231
  const setPageActions = actionsContext?.setActions;
50
- const position = actions?.props.position ?? 'top';
232
+ const position = actions ? resolvePageActionsPosition(actions.props, preferences, isMobile) : 'left';
51
233
  const hasHorizontalActions = position === 'left' || position === 'right';
52
234
  const topActions = position === 'top' ? actions : null;
53
235
  const bottomActions = position === 'bottom' ? actions : null;
@@ -69,15 +251,16 @@ function Root({ actions, children, className, ...props }) {
69
251
  }
70
252
  return (_jsxs("section", { className: cn('flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden', className), ...props, children: [topActions, children, bottomActions] }));
71
253
  }
72
- function ActionsProvider({ children }) {
254
+ function ActionsProvider({ children, preferences }) {
73
255
  const [actions, setActions] = useState(null);
74
- const value = useMemo(() => ({ actions, setActions }), [actions]);
256
+ const value = useMemo(() => ({ actions, preferences, setActions }), [actions, preferences]);
75
257
  return _jsx(PageActionsContext.Provider, { value: value, children: children });
76
258
  }
77
259
  function ActionsSlot({ className, position }) {
78
260
  const actionsContext = useContext(PageActionsContext);
261
+ const isMobile = useIsMobile();
79
262
  const actions = actionsContext?.actions ?? null;
80
- const actionsPosition = actions?.props.position ?? 'top';
263
+ const actionsPosition = actions ? resolvePageActionsPosition(actions.props, actionsContext?.preferences, isMobile) : null;
81
264
  if (!actions || actionsPosition !== position)
82
265
  return null;
83
266
  return (_jsx("div", { className: cn('flex min-w-0 flex-none', (position === 'top' || position === 'bottom') && 'w-full', (position === 'left' || position === 'right') && 'min-h-0 self-stretch', className), children: actions }));
package/dist/index.d.ts CHANGED
@@ -23,7 +23,7 @@ export { TextareaField, type TextareaFieldProps } from './components/TextareaFie
23
23
  export { DateField, type DateFieldProps } from './components/DateField';
24
24
  export { DecimalField, type DecimalFieldProps } from './components/DecimalField';
25
25
  export { Pagination, type PaginationProps, type PaginationSize } from './components/Pagination';
26
- export { Page, type PageActionButtonProps, type PageActionsAlign, type PageActionsElement, type PageActionsHelpContentProps, type PageActionsPosition, type PageActionsProps, type PageActionsSeparatorProps, type PageActionsSize, type PageDescriptionProps, type PageTitleProps, } from './components/Page';
26
+ export { Page, type PageActionButtonProps, type PageActionsAlign, type PageActionsElement, type PageActionsHelpContentProps, type PageActionsPreferences, type PageActionsPosition, type PageActionsProps, type PageActionsSeparatorProps, type PageActionsSize, type PageDescriptionProps, type PageTitleProps, } from './components/Page';
27
27
  export { PageMessage, type PageMessageProps, type PageMessageVariant } from './components/PageMessage';
28
28
  export { PasswordInput, type PasswordInputProps } from './components/PasswordInput';
29
29
  export { Filter, type FilterFooterProps, type FilterRootProps } from './components/Filter';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAChC,OAAO,EACL,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,GACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,wBAAwB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,oBAAo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c(var(--spacing) * 2);
869
+ }
867
870
  .top-4 {
868
871
  top: calc(var(--spacing) * 4);
869
872
  }
@@ -876,6 +879,9 @@ h2.react-datepicker__current-month {
876
879
  .top-full {
877
880
  top: 100%;
878
881
  }
882
+ .right-0 {
883
+ right: calc(var(--spacing) * 0);
884
+ }
879
885
  .right-1\.5 {
880
886
  right: calc(var(--spacing) * 1.5);
881
887
  }
@@ -894,6 +900,9 @@ h2.react-datepicker__current-month {
894
900
  .bottom-0 {
895
901
  bottom: calc(var(--spacing) * 0);
896
902
  }
903
+ .bottom-2 {
904
+ bottom: calc(var(--spacing) * 2);
905
+ }
897
906
  .bottom-full {
898
907
  bottom: 100%;
899
908
  }
@@ -918,6 +927,9 @@ h2.react-datepicker__current-month {
918
927
  .left-\[calc\(100\%\+0\.375rem\)\] {
919
928
  left: calc(100% + 0.375rem);
920
929
  }
930
+ .left-full {
931
+ left: 100%;
932
+ }
921
933
  .z-40 {
922
934
  z-index: 40;
923
935
  }
@@ -990,9 +1002,6 @@ h2.react-datepicker__current-month {
990
1002
  .mt-3 {
991
1003
  margin-top: calc(var(--spacing) * 3);
992
1004
  }
993
- .mt-auto {
994
- margin-top: auto;
995
- }
996
1005
  .mt-px {
997
1006
  margin-top: 1px;
998
1007
  }
@@ -1017,6 +1026,9 @@ h2.react-datepicker__current-month {
1017
1026
  .mb-3 {
1018
1027
  margin-bottom: calc(var(--spacing) * 3);
1019
1028
  }
1029
+ .ml-2 {
1030
+ margin-left: calc(var(--spacing) * 2);
1031
+ }
1020
1032
  .ml-auto {
1021
1033
  margin-left: auto;
1022
1034
  }
@@ -1159,6 +1171,9 @@ h2.react-datepicker__current-month {
1159
1171
  .h-\[32rem\] {
1160
1172
  height: 32rem;
1161
1173
  }
1174
+ .h-\[calc\(100\%-1rem\)\] {
1175
+ height: calc(100% - 1rem);
1176
+ }
1162
1177
  .h-fit {
1163
1178
  height: fit-content;
1164
1179
  }
@@ -1312,6 +1327,12 @@ h2.react-datepicker__current-month {
1312
1327
  .w-\[46rem\] {
1313
1328
  width: 46rem;
1314
1329
  }
1330
+ .w-\[52rem\] {
1331
+ width: 52rem;
1332
+ }
1333
+ .w-\[calc\(100\%-1rem\)\] {
1334
+ width: calc(100% - 1rem);
1335
+ }
1315
1336
  .w-\[min\(10rem\,24vw\)\] {
1316
1337
  width: min(10rem, 24vw);
1317
1338
  }
@@ -1399,6 +1420,9 @@ h2.react-datepicker__current-month {
1399
1420
  .min-w-24 {
1400
1421
  min-width: calc(var(--spacing) * 24);
1401
1422
  }
1423
+ .min-w-36 {
1424
+ min-width: calc(var(--spacing) * 36);
1425
+ }
1402
1426
  .min-w-52 {
1403
1427
  min-width: calc(var(--spacing) * 52);
1404
1428
  }
@@ -1460,6 +1484,12 @@ h2.react-datepicker__current-month {
1460
1484
  .animate-pulse {
1461
1485
  animation: var(--animate-pulse);
1462
1486
  }
1487
+ .cursor-grab {
1488
+ cursor: grab;
1489
+ }
1490
+ .cursor-grabbing {
1491
+ cursor: grabbing;
1492
+ }
1463
1493
  .cursor-not-allowed {
1464
1494
  cursor: not-allowed;
1465
1495
  }
@@ -1762,6 +1792,12 @@ h2.react-datepicker__current-month {
1762
1792
  .border-brand {
1763
1793
  border-color: var(--color-brand);
1764
1794
  }
1795
+ .border-brand\/50 {
1796
+ border-color: var(--color-brand);
1797
+ @supports (color: color-mix(in lab, red, red)) {
1798
+ border-color: color-mix(in oklab, var(--color-brand) 50%, transparent);
1799
+ }
1800
+ }
1765
1801
  .border-red-500 {
1766
1802
  border-color: var(--color-red-500);
1767
1803
  }
@@ -1879,12 +1915,24 @@ h2.react-datepicker__current-month {
1879
1915
  .bg-brand {
1880
1916
  background-color: var(--color-brand);
1881
1917
  }
1918
+ .bg-brand\/10 {
1919
+ background-color: var(--color-brand);
1920
+ @supports (color: color-mix(in lab, red, red)) {
1921
+ background-color: color-mix(in oklab, var(--color-brand) 10%, transparent);
1922
+ }
1923
+ }
1882
1924
  .bg-brand\/15 {
1883
1925
  background-color: var(--color-brand);
1884
1926
  @supports (color: color-mix(in lab, red, red)) {
1885
1927
  background-color: color-mix(in oklab, var(--color-brand) 15%, transparent);
1886
1928
  }
1887
1929
  }
1930
+ .bg-brand\/20 {
1931
+ background-color: var(--color-brand);
1932
+ @supports (color: color-mix(in lab, red, red)) {
1933
+ background-color: color-mix(in oklab, var(--color-brand) 20%, transparent);
1934
+ }
1935
+ }
1888
1936
  .bg-input-bg {
1889
1937
  background-color: var(--color-input-bg);
1890
1938
  }
@@ -2029,9 +2077,6 @@ h2.react-datepicker__current-month {
2029
2077
  .pr-1 {
2030
2078
  padding-right: calc(var(--spacing) * 1);
2031
2079
  }
2032
- .pr-2 {
2033
- padding-right: calc(var(--spacing) * 2);
2034
- }
2035
2080
  .pr-4 {
2036
2081
  padding-right: calc(var(--spacing) * 4);
2037
2082
  }
@@ -2053,9 +2098,6 @@ h2.react-datepicker__current-month {
2053
2098
  .pb-4 {
2054
2099
  padding-bottom: calc(var(--spacing) * 4);
2055
2100
  }
2056
- .pl-2 {
2057
- padding-left: calc(var(--spacing) * 2);
2058
- }
2059
2101
  .pl-4 {
2060
2102
  padding-left: calc(var(--spacing) * 4);
2061
2103
  }
@@ -2389,6 +2431,13 @@ h2.react-datepicker__current-month {
2389
2431
  }
2390
2432
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
2391
2433
  }
2434
+ .shadow-\[0_0_0_4px_color-mix\(in_srgb\,var\(--brand\)_18\%\,transparent\)\] {
2435
+ --tw-shadow: 0 0 0 4px var(--tw-shadow-color, var(--brand));
2436
+ @supports (color: color-mix(in lab, red, red)) {
2437
+ --tw-shadow: 0 0 0 4px var(--tw-shadow-color, color-mix(in srgb,var(--brand) 18%,transparent));
2438
+ }
2439
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
2440
+ }
2392
2441
  .shadow-\[0_2px_8px_-2px_color-mix\(in_srgb\,\#000_6\%\,transparent\)\] {
2393
2442
  --tw-shadow: 0 2px 8px -2px var(--tw-shadow-color, color-mix(in srgb,#000 6%,transparent));
2394
2443
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
@@ -2892,6 +2941,13 @@ h2.react-datepicker__current-month {
2892
2941
  }
2893
2942
  }
2894
2943
  }
2944
+ .hover\:bg-background-secondary {
2945
+ &:hover {
2946
+ @media (hover: hover) {
2947
+ background-color: var(--color-background-secondary);
2948
+ }
2949
+ }
2950
+ }
2895
2951
  .hover\:bg-background\/40 {
2896
2952
  &:hover {
2897
2953
  @media (hover: hover) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wellingtonhlc/shared-ui",
3
- "version": "0.24.6",
3
+ "version": "0.24.7",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",