@pallasoft/ps-core-components 2.22.1 → 2.24.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 (69) hide show
  1. package/dist/components/ps-active-filter-chip.js +1 -1
  2. package/dist/components/ps-badge.js +1 -1
  3. package/dist/components/ps-drag-grip.d.ts +1 -0
  4. package/dist/components/ps-drag-grip.js +6 -0
  5. package/dist/components/ps-drag-overlay.d.ts +7 -0
  6. package/dist/components/ps-drag-overlay.js +34 -0
  7. package/dist/components/ps-draggable-grid.js +16 -39
  8. package/dist/components/ps-empty-state.js +1 -1
  9. package/dist/components/ps-fab.js +1 -1
  10. package/dist/components/ps-form-fields-skeleton.js +1 -1
  11. package/dist/components/ps-icon-button.d.ts +3 -1
  12. package/dist/components/ps-icon-button.js +1 -1
  13. package/dist/components/ps-icon-link.d.ts +3 -1
  14. package/dist/components/ps-icon-link.js +2 -2
  15. package/dist/components/ps-pill.js +1 -1
  16. package/dist/components/ps-section-header.js +1 -1
  17. package/dist/components/ps-site-header.js +1 -1
  18. package/dist/components/ps-sortable-list.d.ts +22 -0
  19. package/dist/components/ps-sortable-list.js +79 -0
  20. package/dist/components/ps-start-preview.js +1 -1
  21. package/dist/components/ps-theme-controller.js +1 -1
  22. package/dist/components/ps-theme-toggle.js +1 -1
  23. package/dist/constants/ps-button-classes.d.ts +1 -1
  24. package/dist/constants/ps-button-classes.js +4 -4
  25. package/dist/constants/ps-drag-config.d.ts +18 -0
  26. package/dist/constants/ps-drag-config.js +30 -0
  27. package/dist/constants/ps-draggable-grid.d.ts +1 -1
  28. package/dist/constants/ps-draggable-grid.js +4 -18
  29. package/dist/constants/ps-icon-action-config.d.ts +5 -0
  30. package/dist/constants/ps-icon-action-config.js +7 -2
  31. package/dist/constants/ps-pallasoft-sign-in-classes.d.ts +5 -5
  32. package/dist/constants/ps-pallasoft-sign-in-classes.js +5 -5
  33. package/dist/constants/ps-skeleton-config.js +1 -1
  34. package/dist/esm/components/ps-active-filter-chip.js +1 -1
  35. package/dist/esm/components/ps-badge.js +1 -1
  36. package/dist/esm/components/ps-drag-grip.js +2 -0
  37. package/dist/esm/components/ps-drag-overlay.js +30 -0
  38. package/dist/esm/components/ps-draggable-grid.js +20 -43
  39. package/dist/esm/components/ps-empty-state.js +1 -1
  40. package/dist/esm/components/ps-fab.js +1 -1
  41. package/dist/esm/components/ps-form-fields-skeleton.js +1 -1
  42. package/dist/esm/components/ps-icon-button.js +1 -1
  43. package/dist/esm/components/ps-icon-link.js +2 -2
  44. package/dist/esm/components/ps-pill.js +1 -1
  45. package/dist/esm/components/ps-section-header.js +1 -1
  46. package/dist/esm/components/ps-site-header.js +1 -1
  47. package/dist/esm/components/ps-sortable-list.js +75 -0
  48. package/dist/esm/components/ps-start-preview.js +1 -1
  49. package/dist/esm/components/ps-theme-controller.js +1 -1
  50. package/dist/esm/components/ps-theme-toggle.js +1 -1
  51. package/dist/esm/constants/ps-button-classes.js +4 -4
  52. package/dist/esm/constants/ps-drag-config.js +27 -0
  53. package/dist/esm/constants/ps-draggable-grid.js +4 -18
  54. package/dist/esm/constants/ps-icon-action-config.js +7 -2
  55. package/dist/esm/constants/ps-pallasoft-sign-in-classes.js +5 -5
  56. package/dist/esm/constants/ps-skeleton-config.js +1 -1
  57. package/dist/esm/hooks/use-ps-drag-sensors.js +11 -0
  58. package/dist/esm/hooks/use-ps-reduced-motion.js +14 -0
  59. package/dist/esm/index.js +7 -0
  60. package/dist/esm/models/ps-sortable-list.js +1 -0
  61. package/dist/hooks/use-ps-drag-sensors.d.ts +2 -0
  62. package/dist/hooks/use-ps-drag-sensors.js +15 -0
  63. package/dist/hooks/use-ps-reduced-motion.d.ts +1 -0
  64. package/dist/hooks/use-ps-reduced-motion.js +18 -0
  65. package/dist/index.d.ts +7 -0
  66. package/dist/index.js +7 -0
  67. package/dist/models/ps-sortable-list.d.ts +32 -0
  68. package/dist/models/ps-sortable-list.js +2 -0
  69. package/package.json +2 -2
@@ -4,5 +4,5 @@ exports.PsActiveFilterChip = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const ps_icons_1 = require("@pallasoft/ps-icons");
6
6
  const ps_pill_1 = require("./ps-pill");
7
- const PsActiveFilterChip = ({ id, label, onRemove, removeLabel, }) => ((0, jsx_runtime_1.jsx)("button", { "aria-label": removeLabel, className: 'ps-focus-ring shrink-0 rounded-full', id: id, onClick: onRemove, type: 'button', children: (0, jsx_runtime_1.jsx)(ps_pill_1.PsPill, { className: 'pr-2', tone: 'primary', children: (0, jsx_runtime_1.jsxs)("span", { className: 'flex items-center gap-1.5', children: [label, (0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { className: 'h-3 w-3', iconKey: ps_icons_1.PsIconKey.Close })] }) }) }));
7
+ const PsActiveFilterChip = ({ id, label, onRemove, removeLabel, }) => ((0, jsx_runtime_1.jsx)("button", { "aria-label": removeLabel, className: 'ps-focus-ring shrink-0 rounded-ps-control', id: id, onClick: onRemove, type: 'button', children: (0, jsx_runtime_1.jsx)(ps_pill_1.PsPill, { className: 'pr-2', tone: 'primary', children: (0, jsx_runtime_1.jsxs)("span", { className: 'flex items-center gap-1.5', children: [label, (0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { className: 'h-3 w-3', iconKey: ps_icons_1.PsIconKey.Close })] }) }) }));
8
8
  exports.PsActiveFilterChip = PsActiveFilterChip;
@@ -12,5 +12,5 @@ const toneClassNames = {
12
12
  success: 'bg-success-soft text-emerald-700 dark:bg-emerald-400/18 dark:text-emerald-50',
13
13
  warning: 'bg-warning-soft text-amber-800 dark:bg-amber-400/18 dark:text-amber-50',
14
14
  };
15
- const PsBadge = ({ children, className, isLoading = false, tone = 'neutral', }) => isLoading ? ((0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: ps_design_system_1.PallasoftClassNameService.merge('h-7 w-20', className), shape: ps_skeleton_shape_1.PsSkeletonShape.Block })) : ((0, jsx_runtime_1.jsx)("span", { className: ps_design_system_1.PallasoftClassNameService.merge('inline-flex min-h-7 w-fit items-center justify-center whitespace-nowrap rounded-full px-3 py-0.5 text-center text-xs font-semibold capitalize', toneClassNames[tone], className), children: children }));
15
+ const PsBadge = ({ children, className, isLoading = false, tone = 'neutral', }) => isLoading ? ((0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: ps_design_system_1.PallasoftClassNameService.merge('h-7 w-20', className), shape: ps_skeleton_shape_1.PsSkeletonShape.Block })) : ((0, jsx_runtime_1.jsx)("span", { className: ps_design_system_1.PallasoftClassNameService.merge('inline-flex min-h-7 w-fit items-center justify-center whitespace-nowrap rounded-ps-control px-3 py-0.5 text-center text-xs font-semibold capitalize', toneClassNames[tone], className), children: children }));
16
16
  exports.PsBadge = PsBadge;
@@ -0,0 +1 @@
1
+ export declare const PsDragGrip: () => import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsDragGrip = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const PsDragGrip = () => ((0, jsx_runtime_1.jsx)("span", { "aria-hidden": 'true', className: 'grid grid-cols-2 gap-[0.1875rem]', children: Array.from({ length: 6 }).map((_, index) => ((0, jsx_runtime_1.jsx)("span", { className: 'h-[3px] w-[3px] rounded-full bg-current' }, index))) }));
6
+ exports.PsDragGrip = PsDragGrip;
@@ -0,0 +1,7 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface PsDragOverlayProps {
3
+ children: ReactNode;
4
+ className: string;
5
+ frames: Keyframe[];
6
+ }
7
+ export declare const PsDragOverlay: ({ children, className, frames }: PsDragOverlayProps) => import("react").ReactPortal | null;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsDragOverlay = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const core_1 = require("@dnd-kit/core");
7
+ const react_dom_1 = require("react-dom");
8
+ const ps_drag_config_1 = require("../constants/ps-drag-config");
9
+ const use_ps_reduced_motion_1 = require("../hooks/use-ps-reduced-motion");
10
+ const dropAnimation = {
11
+ duration: ps_drag_config_1.PsDragConfig.dropDuration,
12
+ easing: ps_drag_config_1.PsDragConfig.dropEasing,
13
+ sideEffects: (0, core_1.defaultDropAnimationSideEffects)({
14
+ styles: { active: { opacity: ps_drag_config_1.PsDragConfig.placeholderOpacity } },
15
+ }),
16
+ };
17
+ const PsDragOverlay = ({ children, className, frames }) => {
18
+ const [isMounted, setIsMounted] = (0, react_1.useState)(false);
19
+ const isReduced = (0, use_ps_reduced_motion_1.usePsReducedMotion)();
20
+ (0, react_1.useEffect)(() => setIsMounted(true), []);
21
+ if (!isMounted)
22
+ return null;
23
+ const lift = (element) => {
24
+ if (element === null || isReduced || typeof element.animate !== 'function')
25
+ return;
26
+ element.animate(frames, {
27
+ duration: ps_drag_config_1.PsDragConfig.liftDuration,
28
+ easing: ps_drag_config_1.PsDragConfig.liftEasing,
29
+ fill: 'forwards',
30
+ });
31
+ };
32
+ return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(core_1.DragOverlay, { dropAnimation: isReduced ? null : dropAnimation, children: children === null ? null : ((0, jsx_runtime_1.jsx)("div", { className: className, ref: lift, children: children })) }), document.body);
33
+ };
34
+ exports.PsDragOverlay = PsDragOverlay;
@@ -6,26 +6,12 @@ const react_1 = require("react");
6
6
  const core_1 = require("@dnd-kit/core");
7
7
  const sortable_1 = require("@dnd-kit/sortable");
8
8
  const utilities_1 = require("@dnd-kit/utilities");
9
- const react_dom_1 = require("react-dom");
9
+ const ps_drag_config_1 = require("../constants/ps-drag-config");
10
10
  const ps_draggable_grid_1 = require("../constants/ps-draggable-grid");
11
- const liftCard = (element) => {
12
- if (element === null)
13
- return;
14
- element.animate(ps_draggable_grid_1.PsDraggableGridLiftFrames, {
15
- duration: ps_draggable_grid_1.PsDraggableGridConfig.liftDuration,
16
- easing: ps_draggable_grid_1.PsDraggableGridConfig.liftEasing,
17
- fill: 'forwards',
18
- });
19
- };
20
- const dropAnimation = {
21
- duration: ps_draggable_grid_1.PsDraggableGridConfig.dropDuration,
22
- easing: ps_draggable_grid_1.PsDraggableGridConfig.dropEasing,
23
- sideEffects: (0, core_1.defaultDropAnimationSideEffects)({
24
- styles: { active: { opacity: ps_draggable_grid_1.PsDraggableGridConfig.placeholderOpacity } },
25
- }),
26
- };
27
- const DragHandleIcon = () => ((0, jsx_runtime_1.jsx)("span", { "aria-hidden": 'true', className: 'grid grid-cols-2 gap-[0.1875rem]', children: Array.from({ length: 6 }).map((_, index) => ((0, jsx_runtime_1.jsx)("span", { className: 'h-[3px] w-[3px] rounded-full bg-current' }, index))) }));
28
- const PsDraggableGridHandle = ({ attributes, label, listeners, setActivatorNodeRef, }) => ((0, jsx_runtime_1.jsx)("button", { ...attributes, ...listeners, "aria-label": `Move ${label}`, className: ps_draggable_grid_1.PsDraggableGridClasses.handle, ref: setActivatorNodeRef, title: `Move ${label}`, type: 'button', children: (0, jsx_runtime_1.jsx)(DragHandleIcon, {}) }));
11
+ const use_ps_drag_sensors_1 = require("../hooks/use-ps-drag-sensors");
12
+ const ps_drag_grip_1 = require("./ps-drag-grip");
13
+ const ps_drag_overlay_1 = require("./ps-drag-overlay");
14
+ const PsDraggableGridHandle = ({ attributes, label, listeners, setActivatorNodeRef, }) => ((0, jsx_runtime_1.jsx)("button", { ...attributes, ...listeners, "aria-label": `Move ${label}`, className: ps_draggable_grid_1.PsDraggableGridClasses.handle, ref: setActivatorNodeRef, title: `Move ${label}`, type: 'button', children: (0, jsx_runtime_1.jsx)(ps_drag_grip_1.PsDragGrip, {}) }));
29
15
  const PsSortableGridItem = ({ className, index, item, renderItem, }) => {
30
16
  const { attributes, isDragging, listeners, setActivatorNodeRef, setNodeRef, transform, transition, } = (0, sortable_1.useSortable)({ id: item.id });
31
17
  const rendered = renderItem({
@@ -38,23 +24,14 @@ const PsSortableGridItem = ({ className, index, item, renderItem, }) => {
38
24
  if (!rendered)
39
25
  return null;
40
26
  return ((0, jsx_runtime_1.jsx)("div", { className: `${ps_draggable_grid_1.PsDraggableGridClasses.item} ${className} ${isDragging ? ps_draggable_grid_1.PsDraggableGridClasses.placeholder : ''}`, ref: setNodeRef, style: {
41
- opacity: isDragging ? ps_draggable_grid_1.PsDraggableGridConfig.placeholderOpacity : undefined,
27
+ opacity: isDragging ? ps_drag_config_1.PsDragConfig.placeholderOpacity : undefined,
42
28
  transform: utilities_1.CSS.Translate.toString(transform),
43
29
  transition,
44
30
  }, children: rendered }));
45
31
  };
46
32
  const PsDraggableGrid = ({ getItemClassName, items, onReorder, onReorderEnd, renderItem, }) => {
47
33
  const [activeId, setActiveId] = (0, react_1.useState)(null);
48
- const [isMounted, setIsMounted] = (0, react_1.useState)(false);
49
- (0, react_1.useEffect)(() => setIsMounted(true), []);
50
- const sensors = (0, core_1.useSensors)((0, core_1.useSensor)(core_1.MouseSensor, {
51
- activationConstraint: { distance: ps_draggable_grid_1.PsDraggableGridConfig.activationDistance },
52
- }), (0, core_1.useSensor)(core_1.TouchSensor, {
53
- activationConstraint: {
54
- delay: ps_draggable_grid_1.PsDraggableGridConfig.touchDelay,
55
- tolerance: ps_draggable_grid_1.PsDraggableGridConfig.touchTolerance,
56
- },
57
- }), (0, core_1.useSensor)(core_1.KeyboardSensor, { coordinateGetter: sortable_1.sortableKeyboardCoordinates }));
34
+ const sensors = (0, use_ps_drag_sensors_1.usePsDragSensors)();
58
35
  const className = (item) => getItemClassName !== undefined ? getItemClassName(item) : '';
59
36
  const activeIndex = items.findIndex((item) => item.id === activeId);
60
37
  const activeItem = activeIndex >= 0 ? items[activeIndex] : null;
@@ -71,14 +48,14 @@ const PsDraggableGrid = ({ getItemClassName, items, onReorder, onReorderEnd, ren
71
48
  if (onReorderEnd !== undefined)
72
49
  onReorderEnd(nextItems);
73
50
  };
74
- return ((0, jsx_runtime_1.jsxs)(core_1.DndContext, { collisionDetection: core_1.closestCenter, onDragCancel: () => setActiveId(null), onDragEnd: handleDragEnd, onDragStart: (event) => setActiveId(String(event.active.id)), sensors: sensors, children: [(0, jsx_runtime_1.jsx)(sortable_1.SortableContext, { items: items.map((item) => item.id), strategy: sortable_1.rectSortingStrategy, children: items.map((item, index) => ((0, jsx_runtime_1.jsx)(PsSortableGridItem, { className: className(item), index: index, item: item, renderItem: renderItem }, item.id))) }), isMounted
75
- ? (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(core_1.DragOverlay, { dropAnimation: dropAnimation, children: activeItem !== null ? ((0, jsx_runtime_1.jsx)("div", { className: ps_draggable_grid_1.PsDraggableGridClasses.lifted, ref: liftCard, children: renderItem({
76
- handle: (0, jsx_runtime_1.jsx)(PsDraggableGridHandle, { label: activeItem.label }),
77
- index: activeIndex,
78
- isDragging: true,
79
- isOverlay: true,
80
- item: activeItem,
81
- }) })) : null }), document.body)
82
- : null] }));
51
+ return ((0, jsx_runtime_1.jsxs)(core_1.DndContext, { collisionDetection: core_1.closestCenter, onDragCancel: () => setActiveId(null), onDragEnd: handleDragEnd, onDragStart: (event) => setActiveId(String(event.active.id)), sensors: sensors, children: [(0, jsx_runtime_1.jsx)(sortable_1.SortableContext, { items: items.map((item) => item.id), strategy: sortable_1.rectSortingStrategy, children: items.map((item, index) => ((0, jsx_runtime_1.jsx)(PsSortableGridItem, { className: className(item), index: index, item: item, renderItem: renderItem }, item.id))) }), (0, jsx_runtime_1.jsx)(ps_drag_overlay_1.PsDragOverlay, { className: ps_draggable_grid_1.PsDraggableGridClasses.lifted, frames: ps_draggable_grid_1.PsDraggableGridLiftFrames, children: activeItem !== null
52
+ ? renderItem({
53
+ handle: (0, jsx_runtime_1.jsx)(PsDraggableGridHandle, { label: activeItem.label }),
54
+ index: activeIndex,
55
+ isDragging: true,
56
+ isOverlay: true,
57
+ item: activeItem,
58
+ })
59
+ : null })] }));
83
60
  };
84
61
  exports.PsDraggableGrid = PsDraggableGrid;
@@ -27,6 +27,6 @@ const PsEmptyState = ({ actions = [], badge, children, className, detail, descri
27
27
  ? 'mt-1.5 text-sm leading-6 text-ink/60'
28
28
  : 'mt-3 text-sm leading-6 text-ink/60', children: description })) : null, detail ? ((0, jsx_runtime_1.jsx)("p", { className: 'mt-4 rounded-2xl border border-line bg-mist px-4 py-3 text-left text-xs leading-5 text-ink/60', children: detail })) : null, children ? (0, jsx_runtime_1.jsx)("div", { className: 'mt-5 flex justify-center', children: children }) : null, actions.length > 0 ? ((0, jsx_runtime_1.jsx)("div", { className: isInline
29
29
  ? 'mt-5 flex flex-col justify-center gap-2 sm:flex-row'
30
- : 'mt-6 flex flex-col gap-2 sm:flex-row', children: actions.map((action) => ((0, jsx_runtime_1.jsx)("a", { className: ps_design_system_1.PallasoftClassNameService.merge('ps-focus-ring ps-pressable inline-flex items-center justify-center rounded-ps-control border px-4 py-3 text-sm font-semibold', getActionClassName(action.variant)), href: action.href, rel: action.rel, target: action.target, children: action.label }, `${action.href}-${action.label}`))) })) : null] })] }) }) }));
30
+ : 'mt-6 flex flex-col gap-2 sm:flex-row', children: actions.map((action) => ((0, jsx_runtime_1.jsx)("a", { className: ps_design_system_1.PallasoftClassNameService.merge('ps-focus-ring ps-pressable ps-control ps-control-padding inline-flex items-center justify-center rounded-ps-control border border-ps-control text-sm font-semibold', getActionClassName(action.variant)), href: action.href, rel: action.rel, target: action.target, children: action.label }, `${action.href}-${action.label}`))) })) : null] })] }) }) }));
31
31
  };
32
32
  exports.PsEmptyState = PsEmptyState;
@@ -9,5 +9,5 @@ const positionClassNames = {
9
9
  'bottom-left': 'bottom-6 left-6',
10
10
  'bottom-center': 'bottom-6 left-1/2 -translate-x-1/2',
11
11
  };
12
- const PsFab = ({ className, position = 'bottom-right', ...props }) => ((0, jsx_runtime_1.jsx)(ps_button_1.PsButton, { size: 'large', variant: 'primary', className: ps_design_system_1.PallasoftClassNameService.merge('!fixed z-docked h-14 w-14 shrink-0 !px-0 shadow-lg', positionClassNames[position], className), ...props }));
12
+ const PsFab = ({ className, position = 'bottom-right', ...props }) => ((0, jsx_runtime_1.jsx)(ps_button_1.PsButton, { size: 'large', variant: 'primary', className: ps_design_system_1.PallasoftClassNameService.merge('!fixed z-docked h-14 w-14 shrink-0 !rounded-full !px-0 shadow-lg', positionClassNames[position], className), ...props }));
13
13
  exports.PsFab = PsFab;
@@ -6,5 +6,5 @@ const ps_design_system_1 = require("@pallasoft/ps-design-system");
6
6
  const ps_page_skeleton_config_1 = require("../constants/ps-page-skeleton-config");
7
7
  const ps_skeleton_shape_1 = require("../constants/ps-skeleton-shape");
8
8
  const ps_skeleton_1 = require("./ps-skeleton");
9
- const PsFormFieldsSkeleton = ({ columnsClassName = ps_page_skeleton_config_1.PsPageSkeletonConfig.formColumnsClassName, fields = ps_page_skeleton_config_1.PsPageSkeletonConfig.formFields, }) => ((0, jsx_runtime_1.jsx)("div", { className: ps_design_system_1.PallasoftClassNameService.merge('grid gap-4', columnsClassName), children: fields.map((field) => ((0, jsx_runtime_1.jsxs)("div", { className: 'flex flex-col gap-2', children: [(0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: ps_page_skeleton_config_1.PsPageSkeletonConfig.formLabelClassName }), (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-10 w-full', shape: ps_skeleton_shape_1.PsSkeletonShape.Block })] }, field))) }));
9
+ const PsFormFieldsSkeleton = ({ columnsClassName = ps_page_skeleton_config_1.PsPageSkeletonConfig.formColumnsClassName, fields = ps_page_skeleton_config_1.PsPageSkeletonConfig.formFields, }) => ((0, jsx_runtime_1.jsx)("div", { className: ps_design_system_1.PallasoftClassNameService.merge('grid gap-4', columnsClassName), children: fields.map((field) => ((0, jsx_runtime_1.jsxs)("div", { className: 'flex flex-col gap-2', children: [(0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: ps_page_skeleton_config_1.PsPageSkeletonConfig.formLabelClassName }), (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-ps-control w-full', shape: ps_skeleton_shape_1.PsSkeletonShape.Block })] }, field))) }));
10
10
  exports.PsFormFieldsSkeleton = PsFormFieldsSkeleton;
@@ -1,7 +1,9 @@
1
1
  import type { ButtonHTMLAttributes } from 'react';
2
2
  import { type PsIconKey } from '@pallasoft/ps-icons';
3
+ import type { PsButtonProps } from './ps-button';
3
4
  export interface PsIconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
4
5
  iconKey: PsIconKey;
5
6
  label: string;
7
+ size?: PsButtonProps['size'];
6
8
  }
7
- export declare const PsIconButton: ({ className, iconKey, label, type, ...props }: PsIconButtonProps) => import("react").JSX.Element;
9
+ export declare const PsIconButton: ({ className, iconKey, label, size, type, ...props }: PsIconButtonProps) => import("react").JSX.Element;
@@ -5,5 +5,5 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const ps_design_system_1 = require("@pallasoft/ps-design-system");
6
6
  const ps_icons_1 = require("@pallasoft/ps-icons");
7
7
  const ps_icon_action_config_1 = require("../constants/ps-icon-action-config");
8
- const PsIconButton = ({ className, iconKey, label, type, ...props }) => ((0, jsx_runtime_1.jsx)("button", { ...props, "aria-label": label, className: ps_design_system_1.PallasoftClassNameService.merge(ps_icon_action_config_1.PsIconActionConfig.className, ps_icon_action_config_1.PsIconActionConfig.disabledClassName, className), title: label, type: type === 'submit' || type === 'reset' ? type : 'button', children: (0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { "aria-hidden": 'true', className: ps_icon_action_config_1.PsIconActionConfig.iconClassName, iconKey: iconKey }) }));
8
+ const PsIconButton = ({ className, iconKey, label, size = 'default', type, ...props }) => ((0, jsx_runtime_1.jsx)("button", { ...props, "aria-label": label, className: ps_design_system_1.PallasoftClassNameService.merge(ps_icon_action_config_1.PsIconActionConfig.className, ps_icon_action_config_1.PsIconActionConfig.sizeClassNames[size], ps_icon_action_config_1.PsIconActionConfig.disabledClassName, className), title: label, type: type === 'submit' || type === 'reset' ? type : 'button', children: (0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { "aria-hidden": 'true', className: ps_icon_action_config_1.PsIconActionConfig.iconClassName, iconKey: iconKey }) }));
9
9
  exports.PsIconButton = PsIconButton;
@@ -1,10 +1,12 @@
1
1
  import type { ElementType } from 'react';
2
2
  import { type PsIconKey } from '@pallasoft/ps-icons';
3
+ import type { PsButtonProps } from './ps-button';
3
4
  export interface PsIconLinkProps {
4
5
  className?: string;
5
6
  href: string;
6
7
  iconKey: PsIconKey;
7
8
  label: string;
8
9
  LinkComponent?: ElementType;
10
+ size?: PsButtonProps['size'];
9
11
  }
10
- export declare const PsIconLink: ({ className, href, iconKey, label, LinkComponent }: PsIconLinkProps) => import("react").JSX.Element;
12
+ export declare const PsIconLink: ({ className, href, iconKey, label, LinkComponent, size, }: PsIconLinkProps) => import("react").JSX.Element;
@@ -5,8 +5,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const ps_design_system_1 = require("@pallasoft/ps-design-system");
6
6
  const ps_icons_1 = require("@pallasoft/ps-icons");
7
7
  const ps_icon_action_config_1 = require("../constants/ps-icon-action-config");
8
- const PsIconLink = ({ className, href, iconKey, label, LinkComponent }) => {
9
- const linkClassName = ps_design_system_1.PallasoftClassNameService.merge(ps_icon_action_config_1.PsIconActionConfig.className, className);
8
+ const PsIconLink = ({ className, href, iconKey, label, LinkComponent, size = 'default', }) => {
9
+ const linkClassName = ps_design_system_1.PallasoftClassNameService.merge(ps_icon_action_config_1.PsIconActionConfig.className, ps_icon_action_config_1.PsIconActionConfig.sizeClassNames[size], className);
10
10
  const icon = ((0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { "aria-hidden": 'true', className: ps_icon_action_config_1.PsIconActionConfig.iconClassName, iconKey: iconKey }));
11
11
  return LinkComponent ? ((0, jsx_runtime_1.jsx)(LinkComponent, { "aria-label": label, className: linkClassName, prefetch: 'intent', title: label, to: href, children: icon })) : ((0, jsx_runtime_1.jsx)("a", { "aria-label": label, className: linkClassName, href: href, title: label, children: icon }));
12
12
  };
@@ -12,5 +12,5 @@ const toneClassNames = {
12
12
  success: 'bg-emerald-50 text-emerald-700 ring-emerald-100 dark:bg-emerald-400/18 dark:text-emerald-50 dark:ring-emerald-200/22',
13
13
  warning: 'bg-amber-50 text-amber-800 ring-amber-100 dark:bg-amber-400/18 dark:text-amber-50 dark:ring-amber-200/24',
14
14
  };
15
- const PsPill = ({ children, className, isLoading = false, tone = 'neutral', }) => isLoading ? ((0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: ps_design_system_1.PallasoftClassNameService.merge('h-8 w-24', className), shape: ps_skeleton_shape_1.PsSkeletonShape.Block })) : ((0, jsx_runtime_1.jsx)("span", { className: ps_design_system_1.PallasoftClassNameService.merge('inline-flex min-h-8 min-w-[5.5rem] max-w-full items-center justify-center rounded-full px-5 py-1 text-center text-[0.72rem] font-black capitalize tracking-[0.01em] ring-1 ring-inset', toneClassNames[tone], className), children: (0, jsx_runtime_1.jsx)("span", { className: 'min-w-0 break-words', children: children }) }));
15
+ const PsPill = ({ children, className, isLoading = false, tone = 'neutral', }) => isLoading ? ((0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: ps_design_system_1.PallasoftClassNameService.merge('h-8 w-24', className), shape: ps_skeleton_shape_1.PsSkeletonShape.Block })) : ((0, jsx_runtime_1.jsx)("span", { className: ps_design_system_1.PallasoftClassNameService.merge('inline-flex min-h-8 min-w-[5.5rem] max-w-full items-center justify-center rounded-ps-control px-5 py-1 text-center text-[0.72rem] font-black capitalize tracking-[0.01em] ring-1 ring-inset', toneClassNames[tone], className), children: (0, jsx_runtime_1.jsx)("span", { className: 'min-w-0 break-words', children: children }) }));
16
16
  exports.PsPill = PsPill;
@@ -5,5 +5,5 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const ps_skeleton_shape_1 = require("../constants/ps-skeleton-shape");
6
6
  const ps_skeleton_1 = require("./ps-skeleton");
7
7
  const ps_skeleton_group_1 = require("./ps-skeleton-group");
8
- const PsSectionHeader = ({ description, eyebrow, isLoading = false, leading, title, trailing, }) => isLoading ? ((0, jsx_runtime_1.jsxs)(ps_skeleton_group_1.PsSkeletonGroup, { className: 'flex flex-wrap items-end justify-between gap-x-4 gap-y-3', label: title, children: [(0, jsx_runtime_1.jsxs)("div", { className: 'flex min-w-0 flex-1 basis-auto flex-col gap-2', children: [eyebrow ? (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-2.5 w-24' }) : null, (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-6 w-52' }), description ? (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-3 w-72' }) : null] }), trailing ? (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-10 w-32', shape: ps_skeleton_shape_1.PsSkeletonShape.Block }) : null] })) : ((0, jsx_runtime_1.jsxs)("div", { className: 'flex flex-wrap items-end justify-between gap-x-4 gap-y-3', children: [(0, jsx_runtime_1.jsxs)("div", { className: 'flex min-w-0 flex-1 basis-auto flex-col gap-2', children: [leading, eyebrow ? ((0, jsx_runtime_1.jsx)("p", { className: 'text-[0.68rem] font-semibold uppercase tracking-[0.22em] text-ink/50', children: eyebrow })) : null, (0, jsx_runtime_1.jsx)("h1", { className: 'break-words text-xl font-extrabold text-ink sm:text-2xl', children: title }), description ? ((0, jsx_runtime_1.jsx)("p", { className: 'max-w-3xl text-sm leading-6 text-ink/60', children: description })) : null] }), trailing ? ((0, jsx_runtime_1.jsx)("div", { className: 'flex w-full shrink-0 items-center justify-end sm:ml-auto sm:w-auto', children: trailing })) : null] }));
8
+ const PsSectionHeader = ({ description, eyebrow, isLoading = false, leading, title, trailing, }) => isLoading ? ((0, jsx_runtime_1.jsxs)(ps_skeleton_group_1.PsSkeletonGroup, { className: 'flex flex-wrap items-end justify-between gap-x-4 gap-y-3', label: title, children: [(0, jsx_runtime_1.jsxs)("div", { className: 'flex min-w-0 flex-1 basis-auto flex-col gap-2', children: [eyebrow ? (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-2.5 w-24' }) : null, (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-6 w-52' }), description ? (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-3 w-72' }) : null] }), trailing ? (0, jsx_runtime_1.jsx)(ps_skeleton_1.PsSkeleton, { className: 'h-ps-control w-32', shape: ps_skeleton_shape_1.PsSkeletonShape.Block }) : null] })) : ((0, jsx_runtime_1.jsxs)("div", { className: 'flex flex-wrap items-end justify-between gap-x-4 gap-y-3', children: [(0, jsx_runtime_1.jsxs)("div", { className: 'flex min-w-0 flex-1 basis-auto flex-col gap-2', children: [leading, eyebrow ? ((0, jsx_runtime_1.jsx)("p", { className: 'text-[0.68rem] font-semibold uppercase tracking-[0.22em] text-ink/50', children: eyebrow })) : null, (0, jsx_runtime_1.jsx)("h1", { className: 'break-words text-xl font-extrabold text-ink sm:text-2xl', children: title }), description ? ((0, jsx_runtime_1.jsx)("p", { className: 'max-w-3xl text-sm leading-6 text-ink/60', children: description })) : null] }), trailing ? ((0, jsx_runtime_1.jsx)("div", { className: 'flex w-full shrink-0 items-center justify-end sm:ml-auto sm:w-auto', children: trailing })) : null] }));
9
9
  exports.PsSectionHeader = PsSectionHeader;
@@ -13,6 +13,6 @@ const PsSiteHeader = ({ centerContent, className, homeHref, label, LinkComponent
13
13
  const renderLogo = (src, darkSrc, baseClassName) => darkSrc ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("img", { alt: logoAlt !== null && logoAlt !== undefined ? logoAlt : label, className: ps_design_system_1.PallasoftClassNameService.merge(baseClassName, 'dark:hidden', logoClassName), decoding: 'async', src: src }), (0, jsx_runtime_1.jsx)("img", { alt: logoAlt !== null && logoAlt !== undefined ? logoAlt : label, className: ps_design_system_1.PallasoftClassNameService.merge(baseClassName, 'hidden dark:block', logoClassName), decoding: 'async', src: darkSrc })] })) : ((0, jsx_runtime_1.jsx)("img", { alt: logoAlt !== null && logoAlt !== undefined ? logoAlt : label, className: ps_design_system_1.PallasoftClassNameService.merge(baseClassName, logoClassName), decoding: 'async', src: src }));
14
14
  const logoContent = logoSrcMobile ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: 'hidden sm:contents', children: renderLogo(logoSrc, logoSrcDark, 'h-8 w-auto') }), (0, jsx_runtime_1.jsx)("span", { className: 'contents sm:hidden', children: renderLogo(logoSrcMobile, logoSrcMobileDark, 'h-8 w-auto') }), showLabel ? (0, jsx_runtime_1.jsx)("span", { className: 'text-base font-bold text-ink', children: label }) : null] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [renderLogo(logoSrc, logoSrcDark, 'h-8 w-auto'), showLabel ? (0, jsx_runtime_1.jsx)("span", { className: 'text-base font-bold text-ink', children: label }) : null] }));
15
15
  const logoLink = LinkComponent ? ((0, jsx_runtime_1.jsx)(LinkComponent, { "aria-label": logoLabel, className: logoLinkClassName, prefetch: 'intent', to: homeHref, children: logoContent })) : ((0, jsx_runtime_1.jsx)("a", { "aria-label": logoLabel, className: logoLinkClassName, href: homeHref, children: logoContent }));
16
- return ((0, jsx_runtime_1.jsx)("header", { ref: headerRef, className: ps_design_system_1.PallasoftClassNameService.merge('fixed inset-x-0 top-0 z-header px-6 pt-4', className), children: (0, jsx_runtime_1.jsxs)("nav", { className: ps_design_system_1.PallasoftClassNameService.merge('ps-glass mx-auto flex max-w-6xl items-center gap-3 rounded-ps-card px-5 py-3', navClassName), children: [onBack ? ((0, jsx_runtime_1.jsx)("button", { "aria-label": 'Back', className: 'ps-focus-ring flex h-9 w-9 shrink-0 items-center justify-center rounded-full text-ink md:hidden', onClick: onBack, type: 'button', children: (0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { iconKey: ps_icons_1.PsIconKey.ChevronRight, width: 20, height: 20, className: 'rotate-180' }) })) : null, (0, jsx_runtime_1.jsx)("div", { className: onBack ? 'hidden md:flex' : 'contents', children: logoLink }), (0, jsx_runtime_1.jsx)("div", { className: 'flex min-w-0 flex-1 items-center justify-center gap-3', children: centerContent }), trailing ? (0, jsx_runtime_1.jsx)("div", { className: 'flex shrink-0 items-center gap-2.5', children: trailing }) : null] }) }));
16
+ return ((0, jsx_runtime_1.jsx)("header", { ref: headerRef, className: ps_design_system_1.PallasoftClassNameService.merge('fixed inset-x-0 top-0 z-header px-6 pt-4', className), children: (0, jsx_runtime_1.jsxs)("nav", { className: ps_design_system_1.PallasoftClassNameService.merge('ps-glass mx-auto flex max-w-6xl items-center gap-3 rounded-ps-card px-5 py-3', navClassName), children: [onBack ? ((0, jsx_runtime_1.jsx)("button", { "aria-label": 'Back', className: 'ps-focus-ring ps-control-square ps-control-compact flex shrink-0 items-center justify-center rounded-ps-control text-ink md:hidden', onClick: onBack, type: 'button', children: (0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { iconKey: ps_icons_1.PsIconKey.ChevronRight, width: 20, height: 20, className: 'rotate-180' }) })) : null, (0, jsx_runtime_1.jsx)("div", { className: onBack ? 'hidden md:flex' : 'contents', children: logoLink }), (0, jsx_runtime_1.jsx)("div", { className: 'flex min-w-0 flex-1 items-center justify-center gap-3', children: centerContent }), trailing ? (0, jsx_runtime_1.jsx)("div", { className: 'flex shrink-0 items-center gap-2.5', children: trailing }) : null] }) }));
17
17
  };
18
18
  exports.PsSiteHeader = PsSiteHeader;
@@ -0,0 +1,22 @@
1
+ import { type JSX } from 'react';
2
+ import { useSortable } from '@dnd-kit/sortable';
3
+ import type { PsSortableListItem, PsSortableListProps, PsSortableListRenderOptions } from '../models/ps-sortable-list';
4
+ export interface PsSortableListHandleProps {
5
+ className?: string;
6
+ icon?: JSX.Element;
7
+ attributes?: ReturnType<typeof useSortable>['attributes'];
8
+ label: string;
9
+ listeners?: ReturnType<typeof useSortable>['listeners'];
10
+ setActivatorNodeRef?: (element: HTMLElement | null) => void;
11
+ }
12
+ export interface PsSortableListRowProps<TItem extends PsSortableListItem> {
13
+ className: string;
14
+ handleClassName?: string;
15
+ handleIcon?: JSX.Element;
16
+ getHandleLabel: (label: string) => string;
17
+ index: number;
18
+ isDisabled: boolean;
19
+ item: TItem;
20
+ renderItem: (options: PsSortableListRenderOptions<TItem>) => JSX.Element | null;
21
+ }
22
+ export declare const PsSortableList: <TItem extends PsSortableListItem>({ announcements: texts, className, getHandleLabel, getItemClassName, handleClassName, handleIcon, instructions, role, items, onMove, renderItem, }: PsSortableListProps<TItem>) => JSX.Element;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsSortableList = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const core_1 = require("@dnd-kit/core");
7
+ const sortable_1 = require("@dnd-kit/sortable");
8
+ const utilities_1 = require("@dnd-kit/utilities");
9
+ const ps_drag_config_1 = require("../constants/ps-drag-config");
10
+ const use_ps_drag_sensors_1 = require("../hooks/use-ps-drag-sensors");
11
+ const use_ps_reduced_motion_1 = require("../hooks/use-ps-reduced-motion");
12
+ const ps_drag_grip_1 = require("./ps-drag-grip");
13
+ const ps_drag_overlay_1 = require("./ps-drag-overlay");
14
+ const PsSortableListHandle = ({ attributes, className, icon, label, listeners, setActivatorNodeRef, }) => ((0, jsx_runtime_1.jsx)("button", { ...attributes, ...listeners, "aria-label": label, className: className === undefined ? ps_drag_config_1.PsDragClasses.handle : className, ref: setActivatorNodeRef, title: label, type: 'button', children: icon === undefined ? (0, jsx_runtime_1.jsx)(ps_drag_grip_1.PsDragGrip, {}) : icon }));
15
+ const PsSortableListRow = ({ className, handleClassName, handleIcon, getHandleLabel, index, isDisabled, item, renderItem, }) => {
16
+ const isReduced = (0, use_ps_reduced_motion_1.usePsReducedMotion)();
17
+ const { attributes, isDragging, listeners, setActivatorNodeRef, setNodeRef, transform, transition, } = (0, sortable_1.useSortable)({ disabled: isDisabled, id: item.id });
18
+ const rendered = renderItem({
19
+ handle: ((0, jsx_runtime_1.jsx)(PsSortableListHandle, { attributes: attributes, className: handleClassName, icon: handleIcon, label: getHandleLabel(item.label), listeners: listeners, setActivatorNodeRef: setActivatorNodeRef })),
20
+ index,
21
+ isDragging,
22
+ isOverlay: false,
23
+ item,
24
+ });
25
+ if (!rendered)
26
+ return null;
27
+ return ((0, jsx_runtime_1.jsx)("div", { className: `${ps_drag_config_1.PsDragClasses.listItem} ${className} ${isDragging ? ps_drag_config_1.PsDragClasses.placeholder : ''}`, ref: setNodeRef, style: {
28
+ opacity: isDragging ? ps_drag_config_1.PsDragConfig.placeholderOpacity : undefined,
29
+ transform: utilities_1.CSS.Translate.toString(transform),
30
+ transition: isReduced ? undefined : transition,
31
+ }, children: rendered }));
32
+ };
33
+ const PsSortableList = ({ announcements: texts, className, getHandleLabel, getItemClassName, handleClassName, handleIcon, instructions, role, items, onMove, renderItem, }) => {
34
+ const [activeId, setActiveId] = (0, react_1.useState)(null);
35
+ const sensors = (0, use_ps_drag_sensors_1.usePsDragSensors)();
36
+ const activeIndex = items.findIndex((item) => item.id === activeId);
37
+ const activeItem = activeIndex >= 0 ? items[activeIndex] : null;
38
+ const itemClassName = (item) => getItemClassName === undefined ? '' : getItemClassName(item);
39
+ const groupOf = (id) => {
40
+ const found = items.find((item) => item.id === id);
41
+ return found === undefined ? undefined : found.groupKey;
42
+ };
43
+ const labelOf = (id) => {
44
+ const found = items.find((item) => item.id === id);
45
+ return found === undefined ? id : found.label;
46
+ };
47
+ const positionOf = (id) => items.findIndex((item) => item.id === id) + 1;
48
+ const announcements = {
49
+ onDragCancel: ({ active }) => texts.cancelled(labelOf(String(active.id))),
50
+ onDragEnd: ({ active, over }) => over === null
51
+ ? texts.cancelled(labelOf(String(active.id)))
52
+ : texts.dropped(labelOf(String(active.id)), positionOf(String(over.id)), items.length),
53
+ onDragOver: ({ active, over }) => over === null
54
+ ? undefined
55
+ : texts.moved(labelOf(String(active.id)), positionOf(String(over.id)), items.length),
56
+ onDragStart: ({ active }) => texts.lifted(labelOf(String(active.id)), positionOf(String(active.id)), items.length),
57
+ };
58
+ const handleDragEnd = ({ active, over }) => {
59
+ setActiveId(null);
60
+ if (over === null || active.id === over.id)
61
+ return;
62
+ const from = items.findIndex((item) => item.id === active.id);
63
+ const to = items.findIndex((item) => item.id === over.id);
64
+ if (from < 0 || to < 0 || groupOf(String(active.id)) !== groupOf(String(over.id)))
65
+ return;
66
+ onMove(String(active.id), from, to);
67
+ };
68
+ const activeGroup = activeItem === null ? undefined : activeItem.groupKey;
69
+ return ((0, jsx_runtime_1.jsxs)(core_1.DndContext, { accessibility: { announcements, screenReaderInstructions: { draggable: instructions } }, collisionDetection: core_1.closestCenter, onDragCancel: () => setActiveId(null), onDragEnd: handleDragEnd, onDragStart: ({ active }) => setActiveId(String(active.id)), sensors: sensors, children: [(0, jsx_runtime_1.jsx)(sortable_1.SortableContext, { items: items.map((item) => item.id), strategy: sortable_1.verticalListSortingStrategy, children: (0, jsx_runtime_1.jsx)("div", { className: className, role: role, children: items.map((item, index) => ((0, jsx_runtime_1.jsx)(PsSortableListRow, { className: itemClassName(item), getHandleLabel: getHandleLabel, handleClassName: handleClassName, handleIcon: handleIcon, index: index, isDisabled: activeItem !== null && item.groupKey !== activeGroup, item: item, renderItem: renderItem }, item.id))) }) }), (0, jsx_runtime_1.jsx)(ps_drag_overlay_1.PsDragOverlay, { className: ps_drag_config_1.PsDragClasses.lifted, frames: ps_drag_config_1.PsDragListLiftFrames, children: activeItem !== null
70
+ ? renderItem({
71
+ handle: ((0, jsx_runtime_1.jsx)(PsSortableListHandle, { className: handleClassName, icon: handleIcon, label: getHandleLabel(activeItem.label) })),
72
+ index: activeIndex,
73
+ isDragging: true,
74
+ isOverlay: true,
75
+ item: activeItem,
76
+ })
77
+ : null })] }));
78
+ };
79
+ exports.PsSortableList = PsSortableList;
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PsStartPreview = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const PsStartPreview = ({ badge, children, note, title }) => ((0, jsx_runtime_1.jsxs)("div", { className: 'rounded-2xl border border-line/60 bg-surface/60 p-5', children: [(0, jsx_runtime_1.jsxs)("div", { className: 'mb-4 flex items-center justify-between', children: [(0, jsx_runtime_1.jsx)("span", { className: 'text-sm font-bold text-ink', children: title }), badge === undefined ? null : ((0, jsx_runtime_1.jsx)("span", { className: 'rounded-full border border-warning/40 px-2.5 py-1 text-xs font-semibold text-warning', children: badge }))] }), (0, jsx_runtime_1.jsx)("ul", { className: 'flex flex-col', children: children }), note === undefined ? null : ((0, jsx_runtime_1.jsx)("p", { className: 'mt-4 border-t border-line/40 pt-4 text-xs leading-5 text-ink/45', children: note }))] }));
5
+ const PsStartPreview = ({ badge, children, note, title }) => ((0, jsx_runtime_1.jsxs)("div", { className: 'rounded-2xl border border-line/60 bg-surface/60 p-5', children: [(0, jsx_runtime_1.jsxs)("div", { className: 'mb-4 flex items-center justify-between', children: [(0, jsx_runtime_1.jsx)("span", { className: 'text-sm font-bold text-ink', children: title }), badge === undefined ? null : ((0, jsx_runtime_1.jsx)("span", { className: 'rounded-ps-control border border-warning/40 px-2.5 py-1 text-xs font-semibold text-warning', children: badge }))] }), (0, jsx_runtime_1.jsx)("ul", { className: 'flex flex-col', children: children }), note === undefined ? null : ((0, jsx_runtime_1.jsx)("p", { className: 'mt-4 border-t border-line/40 pt-4 text-xs leading-5 text-ink/45', children: note }))] }));
6
6
  exports.PsStartPreview = PsStartPreview;
@@ -7,7 +7,7 @@ const ps_theme_toggle_1 = require("./ps-theme-toggle");
7
7
  const PsThemeController = () => {
8
8
  const { resolvedMode, toggle } = (0, use_ps_theme_mode_1.usePsThemeMode)();
9
9
  if (resolvedMode === null)
10
- return (0, jsx_runtime_1.jsx)("div", { className: 'h-11 w-11' });
10
+ return (0, jsx_runtime_1.jsx)("div", { className: 'ps-control-square' });
11
11
  return (0, jsx_runtime_1.jsx)(ps_theme_toggle_1.PsThemeToggle, { mode: resolvedMode, onClick: toggle });
12
12
  };
13
13
  exports.PsThemeController = PsThemeController;
@@ -6,6 +6,6 @@ const ps_design_system_1 = require("@pallasoft/ps-design-system");
6
6
  const ps_icons_1 = require("@pallasoft/ps-icons");
7
7
  const PsThemeToggle = ({ className, mode, type = 'button', ...props }) => {
8
8
  const isDarkMode = mode === ps_design_system_1.PallasoftThemeMode.Dark;
9
- return ((0, jsx_runtime_1.jsxs)("button", { "aria-label": isDarkMode ? 'Switch to light mode' : 'Switch to dark mode', className: ps_design_system_1.PallasoftClassNameService.merge('ps-focus-ring ps-glass flex h-11 items-center gap-2 rounded-2xl px-3 text-sm font-bold text-ink transition hover:border-primary/30 hover:text-primary', className), type: type, ...props, children: [(0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { className: 'h-5 w-5', iconKey: isDarkMode ? 'sun' : 'moon' }), (0, jsx_runtime_1.jsx)("span", { className: 'hidden sm:inline', children: ps_design_system_1.PallasoftThemeModeService.getNextMode(mode) === ps_design_system_1.PallasoftThemeMode.Dark ? 'Dark' : 'Light' })] }));
9
+ return ((0, jsx_runtime_1.jsxs)("button", { "aria-label": isDarkMode ? 'Switch to light mode' : 'Switch to dark mode', className: ps_design_system_1.PallasoftClassNameService.merge('ps-focus-ring ps-glass ps-control ps-control-padding flex items-center gap-2 rounded-ps-control text-sm font-semibold text-ink transition hover:border-primary/30 hover:text-primary', className), type: type, ...props, children: [(0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { className: 'size-ps-control-icon-standalone', iconKey: isDarkMode ? 'sun' : 'moon' }), (0, jsx_runtime_1.jsx)("span", { className: 'hidden sm:inline', children: ps_design_system_1.PallasoftThemeModeService.getNextMode(mode) === ps_design_system_1.PallasoftThemeMode.Dark ? 'Dark' : 'Light' })] }));
10
10
  };
11
11
  exports.PsThemeToggle = PsThemeToggle;
@@ -1,4 +1,4 @@
1
- export declare const PsButtonBaseClassName = "ps-focus-ring relative inline-flex max-w-full items-center justify-center gap-2 rounded-full border text-center font-semibold";
1
+ export declare const PsButtonBaseClassName = "ps-focus-ring relative inline-flex max-w-full items-center justify-center gap-2 rounded-ps-control border border-ps-control text-center text-sm font-semibold leading-5";
2
2
  export declare const PsButtonSizeClassNames: {
3
3
  compact: string;
4
4
  default: string;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PsLinkButtonVariantClassNames = exports.PsButtonVariantClassNames = exports.PsButtonSizeClassNames = exports.PsButtonBaseClassName = void 0;
4
- exports.PsButtonBaseClassName = 'ps-focus-ring relative inline-flex max-w-full items-center justify-center gap-2 rounded-full border text-center font-semibold';
4
+ exports.PsButtonBaseClassName = 'ps-focus-ring relative inline-flex max-w-full items-center justify-center gap-2 rounded-ps-control border border-ps-control text-center text-sm font-semibold leading-5';
5
5
  exports.PsButtonSizeClassNames = {
6
- compact: 'ps-control-compact px-3 py-2 text-sm',
7
- default: 'ps-control ps-control-padding text-sm',
8
- large: 'ps-control-large px-5 py-3 text-sm',
6
+ compact: 'ps-control-compact ps-control-padding-compact',
7
+ default: 'ps-control ps-control-padding',
8
+ large: 'ps-control-large ps-control-padding-large',
9
9
  };
10
10
  exports.PsButtonVariantClassNames = {
11
11
  danger: 'border-danger bg-danger text-white enabled:hover:opacity-90',
@@ -0,0 +1,18 @@
1
+ export declare const PsDragConfig: {
2
+ readonly activationDistance: 6;
3
+ readonly dropDuration: 220;
4
+ readonly dropEasing: "cubic-bezier(0.2, 0.8, 0.2, 1)";
5
+ readonly liftDuration: 200;
6
+ readonly liftEasing: "cubic-bezier(0.2, 0.9, 0.3, 1.2)";
7
+ readonly placeholderOpacity: "0.4";
8
+ readonly touchDelay: 180;
9
+ readonly touchTolerance: 6;
10
+ };
11
+ export declare const PsDragClasses: {
12
+ readonly handle: "ps-focus-ring inline-flex h-7 w-7 shrink-0 cursor-grab touch-none items-center justify-center rounded-ps-control text-slate-400/70 transition hover:bg-white/36 hover:text-slate-600 active:cursor-grabbing dark:text-slate-300/55 dark:hover:bg-white/8 dark:hover:text-slate-100";
13
+ readonly listItem: "min-w-0";
14
+ readonly lifted: "cursor-grabbing rounded-xl bg-surface ring-1 ring-primary/30";
15
+ readonly placeholder: "outline-dashed outline-2 outline-offset-[-2px] outline-primary/35";
16
+ };
17
+ export declare const PsDragLiftFrames: Keyframe[];
18
+ export declare const PsDragListLiftFrames: Keyframe[];
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsDragListLiftFrames = exports.PsDragLiftFrames = exports.PsDragClasses = exports.PsDragConfig = void 0;
4
+ exports.PsDragConfig = {
5
+ activationDistance: 6,
6
+ dropDuration: 220,
7
+ dropEasing: 'cubic-bezier(0.2, 0.8, 0.2, 1)',
8
+ liftDuration: 200,
9
+ liftEasing: 'cubic-bezier(0.2, 0.9, 0.3, 1.2)',
10
+ placeholderOpacity: '0.4',
11
+ touchDelay: 180,
12
+ touchTolerance: 6,
13
+ };
14
+ exports.PsDragClasses = {
15
+ handle: 'ps-focus-ring inline-flex h-7 w-7 shrink-0 cursor-grab touch-none items-center justify-center rounded-ps-control text-slate-400/70 transition hover:bg-white/36 hover:text-slate-600 active:cursor-grabbing dark:text-slate-300/55 dark:hover:bg-white/8 dark:hover:text-slate-100',
16
+ listItem: 'min-w-0',
17
+ lifted: 'cursor-grabbing rounded-xl bg-surface ring-1 ring-primary/30',
18
+ placeholder: 'outline-dashed outline-2 outline-offset-[-2px] outline-primary/35',
19
+ };
20
+ exports.PsDragLiftFrames = [
21
+ { boxShadow: '0 0 0 0 rgb(15 23 42 / 0)', transform: 'scale(1) rotate(0deg)' },
22
+ {
23
+ boxShadow: '0 28px 64px -18px rgb(15 23 42 / 0.5)',
24
+ transform: 'scale(1.035) rotate(-1.2deg)',
25
+ },
26
+ ];
27
+ exports.PsDragListLiftFrames = [
28
+ { boxShadow: '0 0 0 0 rgb(15 23 42 / 0)', transform: 'scale(1)' },
29
+ { boxShadow: '0 18px 40px -16px rgb(15 23 42 / 0.45)', transform: 'scale(1.015)' },
30
+ ];
@@ -9,7 +9,7 @@ export declare const PsDraggableGridConfig: {
9
9
  readonly touchTolerance: 6;
10
10
  };
11
11
  export declare const PsDraggableGridClasses: {
12
- readonly handle: "ps-focus-ring inline-flex h-7 w-7 shrink-0 cursor-grab touch-none items-center justify-center rounded-full text-slate-400/70 transition hover:bg-white/36 hover:text-slate-600 active:cursor-grabbing dark:text-slate-300/55 dark:hover:bg-white/8 dark:hover:text-slate-100";
12
+ readonly handle: "ps-focus-ring inline-flex h-7 w-7 shrink-0 cursor-grab touch-none items-center justify-center rounded-ps-control text-slate-400/70 transition hover:bg-white/36 hover:text-slate-600 active:cursor-grabbing dark:text-slate-300/55 dark:hover:bg-white/8 dark:hover:text-slate-100";
13
13
  readonly item: "min-w-0 rounded-[1.7rem]";
14
14
  readonly lifted: "cursor-grabbing rounded-[1.7rem] ring-1 ring-primary/30";
15
15
  readonly placeholder: "rounded-[1.7rem] outline-dashed outline-2 outline-offset-[-2px] outline-primary/35";
@@ -1,26 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PsDraggableGridLiftFrames = exports.PsDraggableGridClasses = exports.PsDraggableGridConfig = void 0;
4
- exports.PsDraggableGridConfig = {
5
- activationDistance: 6,
6
- dropDuration: 220,
7
- dropEasing: 'cubic-bezier(0.2, 0.8, 0.2, 1)',
8
- liftDuration: 200,
9
- liftEasing: 'cubic-bezier(0.2, 0.9, 0.3, 1.2)',
10
- placeholderOpacity: '0.4',
11
- touchDelay: 180,
12
- touchTolerance: 6,
13
- };
4
+ const ps_drag_config_1 = require("./ps-drag-config");
5
+ exports.PsDraggableGridConfig = ps_drag_config_1.PsDragConfig;
14
6
  exports.PsDraggableGridClasses = {
15
- handle: 'ps-focus-ring inline-flex h-7 w-7 shrink-0 cursor-grab touch-none items-center justify-center rounded-full text-slate-400/70 transition hover:bg-white/36 hover:text-slate-600 active:cursor-grabbing dark:text-slate-300/55 dark:hover:bg-white/8 dark:hover:text-slate-100',
7
+ handle: ps_drag_config_1.PsDragClasses.handle,
16
8
  item: 'min-w-0 rounded-[1.7rem]',
17
9
  lifted: 'cursor-grabbing rounded-[1.7rem] ring-1 ring-primary/30',
18
10
  placeholder: 'rounded-[1.7rem] outline-dashed outline-2 outline-offset-[-2px] outline-primary/35',
19
11
  };
20
- exports.PsDraggableGridLiftFrames = [
21
- { boxShadow: '0 0 0 0 rgb(15 23 42 / 0)', transform: 'scale(1) rotate(0deg)' },
22
- {
23
- boxShadow: '0 28px 64px -18px rgb(15 23 42 / 0.5)',
24
- transform: 'scale(1.035) rotate(-1.2deg)',
25
- },
26
- ];
12
+ exports.PsDraggableGridLiftFrames = ps_drag_config_1.PsDragLiftFrames;
@@ -2,4 +2,9 @@ export declare const PsIconActionConfig: {
2
2
  className: string;
3
3
  disabledClassName: string;
4
4
  iconClassName: string;
5
+ sizeClassNames: {
6
+ compact: string;
7
+ default: string;
8
+ large: string;
9
+ };
5
10
  };
@@ -2,7 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PsIconActionConfig = void 0;
4
4
  exports.PsIconActionConfig = {
5
- className: 'ps-focus-ring relative inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl text-ink/65 transition-colors hover:bg-ink/5 hover:text-ink',
5
+ className: 'ps-focus-ring ps-control-square relative inline-flex shrink-0 items-center justify-center rounded-ps-control text-ink/65 transition-colors hover:bg-ink/5 hover:text-ink',
6
6
  disabledClassName: 'disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent',
7
- iconClassName: 'block h-5 w-5 shrink-0',
7
+ iconClassName: 'block size-ps-control-icon-standalone shrink-0',
8
+ sizeClassNames: {
9
+ compact: 'ps-control-compact',
10
+ default: '',
11
+ large: 'ps-control-large',
12
+ },
8
13
  };
@@ -1,11 +1,11 @@
1
1
  export declare const PsPallasoftSignInClasses: {
2
- readonly base: "ps-focus-ring ps-liquid ps-liquid-control group relative inline-flex max-w-full items-center justify-center gap-3 rounded-full border border-line bg-white font-semibold text-ink shadow-sm transition duration-200 hover:-translate-y-px hover:border-primary/40 hover:shadow-md active:translate-y-0 motion-reduce:transition-none motion-reduce:hover:translate-y-0 dark:border-white/15 dark:bg-white/10 dark:text-white dark:hover:border-white/30";
2
+ readonly base: "ps-focus-ring ps-liquid ps-liquid-control group relative inline-flex max-w-full items-center justify-center gap-3 rounded-ps-control border border-line bg-white font-semibold text-ink shadow-sm transition duration-200 hover:-translate-y-px hover:border-primary/40 hover:shadow-md active:translate-y-0 motion-reduce:transition-none motion-reduce:hover:translate-y-0 dark:border-white/15 dark:bg-white/10 dark:text-white dark:hover:border-white/30";
3
3
  readonly sizes: {
4
- readonly default: "ps-control px-5 text-sm";
5
- readonly large: "ps-control-large px-6 py-3 text-base";
4
+ readonly default: "ps-control ps-control-padding text-sm";
5
+ readonly large: "ps-control-large ps-control-padding-large text-sm";
6
6
  };
7
7
  readonly markSizes: {
8
- readonly default: "h-5 w-5";
9
- readonly large: "h-6 w-6";
8
+ readonly default: "size-ps-control-icon-standalone";
9
+ readonly large: "size-ps-control-icon-standalone";
10
10
  };
11
11
  };