@wallarm-org/design-system 1.21.0 → 1.22.1

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 (64) hide show
  1. package/dist/components/AppShell/story-content/_storySearchModal.js +3 -3
  2. package/dist/components/CodeSnippet/CodeSnippetCopyButton.d.ts +1 -1
  3. package/dist/components/CodeSnippet/CodeSnippetCopyButton.js +14 -7
  4. package/dist/components/CodeSnippet/InlineCodeSnippet.js +7 -25
  5. package/dist/components/Copyable/Copyable.d.ts +39 -0
  6. package/dist/components/Copyable/Copyable.js +85 -0
  7. package/dist/components/Copyable/CopyableContext.d.ts +11 -0
  8. package/dist/components/Copyable/CopyableContext.js +9 -0
  9. package/dist/components/Copyable/CopyableIcon.d.ts +9 -0
  10. package/dist/components/Copyable/CopyableIcon.js +13 -0
  11. package/dist/components/Copyable/CopyableLabel.d.ts +18 -0
  12. package/dist/components/Copyable/CopyableLabel.js +24 -0
  13. package/dist/components/Copyable/index.d.ts +4 -0
  14. package/dist/components/Copyable/index.js +4 -0
  15. package/dist/components/SearchInput/SearchInput.d.ts +18 -0
  16. package/dist/components/SearchInput/SearchInput.js +54 -0
  17. package/dist/components/SearchInput/index.d.ts +1 -0
  18. package/dist/components/SearchInput/index.js +1 -0
  19. package/dist/components/SearchModal/SearchModalInput.js +16 -3
  20. package/dist/components/SegmentedControl/classes.js +1 -1
  21. package/dist/components/Select/SelectSearchInput.js +6 -19
  22. package/dist/components/SettingsHeader/SettingsHeader.d.ts +7 -0
  23. package/dist/components/SettingsHeader/SettingsHeader.js +16 -0
  24. package/dist/components/SettingsHeader/SettingsHeaderActions.d.ts +6 -0
  25. package/dist/components/SettingsHeader/SettingsHeaderActions.js +16 -0
  26. package/dist/components/SettingsHeader/SettingsHeaderBreadcrumbs.d.ts +6 -0
  27. package/dist/components/SettingsHeader/SettingsHeaderBreadcrumbs.js +16 -0
  28. package/dist/components/SettingsHeader/SettingsHeaderDescription.d.ts +5 -0
  29. package/dist/components/SettingsHeader/SettingsHeaderDescription.js +16 -0
  30. package/dist/components/SettingsHeader/SettingsHeaderFilters.d.ts +6 -0
  31. package/dist/components/SettingsHeader/SettingsHeaderFilters.js +16 -0
  32. package/dist/components/SettingsHeader/SettingsHeaderHeading.d.ts +6 -0
  33. package/dist/components/SettingsHeader/SettingsHeaderHeading.js +16 -0
  34. package/dist/components/SettingsHeader/SettingsHeaderTitle.d.ts +5 -0
  35. package/dist/components/SettingsHeader/SettingsHeaderTitle.js +16 -0
  36. package/dist/components/SettingsHeader/index.d.ts +7 -0
  37. package/dist/components/SettingsHeader/index.js +7 -0
  38. package/dist/components/Switch/SwitchControl.js +1 -1
  39. package/dist/components/Table/EditableCell/EditableSelectCell.js +9 -1
  40. package/dist/components/Table/StickyGroupParent.js +1 -1
  41. package/dist/components/Table/TableBody/TableBodyCell.js +3 -6
  42. package/dist/components/Table/TableMasterCellActions.js +2 -1
  43. package/dist/components/Table/TableRow.js +7 -2
  44. package/dist/components/Table/classes.d.ts +5 -0
  45. package/dist/components/Table/classes.js +3 -2
  46. package/dist/components/Table/hooks/useMasterCell.d.ts +2 -1
  47. package/dist/components/Table/hooks/useMasterCell.js +2 -1
  48. package/dist/components/Table/lib/createDragHandleColumn.js +1 -1
  49. package/dist/components/Table/mocks.d.ts +1 -0
  50. package/dist/components/Table/mocks.js +33 -10
  51. package/dist/hooks/index.d.ts +0 -1
  52. package/dist/hooks/index.js +0 -1
  53. package/dist/hooks/useCopyToClipboard.d.ts +9 -10
  54. package/dist/hooks/useCopyToClipboard.js +6 -18
  55. package/dist/index.d.ts +3 -1
  56. package/dist/index.js +3 -1
  57. package/dist/metadata/components.json +12494 -9140
  58. package/package.json +1 -1
  59. package/dist/components/CopyButton/CopyButton.d.ts +0 -16
  60. package/dist/components/CopyButton/CopyButton.js +0 -63
  61. package/dist/components/CopyButton/index.d.ts +0 -1
  62. package/dist/components/CopyButton/index.js +0 -1
  63. package/dist/hooks/useCopyTooltip.d.ts +0 -12
  64. package/dist/hooks/useCopyTooltip.js +0 -63
@@ -0,0 +1,6 @@
1
+ import type { FC, HTMLAttributes, ReactNode, Ref } from 'react';
2
+ export interface SettingsHeaderHeadingProps extends HTMLAttributes<HTMLDivElement> {
3
+ ref?: Ref<HTMLDivElement>;
4
+ children?: ReactNode;
5
+ }
6
+ export declare const SettingsHeaderHeading: FC<SettingsHeaderHeadingProps>;
@@ -0,0 +1,16 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../utils/cn.js";
3
+ import { useTestId } from "../../utils/testId.js";
4
+ const SettingsHeaderHeading = ({ ref, children, className, ...props })=>{
5
+ const testId = useTestId('heading');
6
+ return /*#__PURE__*/ jsx("div", {
7
+ ...props,
8
+ ref: ref,
9
+ "data-testid": testId,
10
+ "data-slot": "settings-header-heading",
11
+ className: cn('flex items-center justify-between gap-16 w-full', className),
12
+ children: children
13
+ });
14
+ };
15
+ SettingsHeaderHeading.displayName = 'SettingsHeaderHeading';
16
+ export { SettingsHeaderHeading };
@@ -0,0 +1,5 @@
1
+ import type { FC, HTMLAttributes, Ref } from 'react';
2
+ export interface SettingsHeaderTitleProps extends HTMLAttributes<HTMLHeadingElement> {
3
+ ref?: Ref<HTMLHeadingElement>;
4
+ }
5
+ export declare const SettingsHeaderTitle: FC<SettingsHeaderTitleProps>;
@@ -0,0 +1,16 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../utils/cn.js";
3
+ import { useTestId } from "../../utils/testId.js";
4
+ const SettingsHeaderTitle = ({ ref, children, className, ...props })=>{
5
+ const testId = useTestId('title');
6
+ return /*#__PURE__*/ jsx("h1", {
7
+ ...props,
8
+ ref: ref,
9
+ "data-testid": testId,
10
+ "data-slot": "settings-header-title",
11
+ className: cn('font-sans-display text-xl font-medium leading-28 text-text-primary truncate', className),
12
+ children: children
13
+ });
14
+ };
15
+ SettingsHeaderTitle.displayName = 'SettingsHeaderTitle';
16
+ export { SettingsHeaderTitle };
@@ -0,0 +1,7 @@
1
+ export { SettingsHeader, type SettingsHeaderProps } from './SettingsHeader';
2
+ export { SettingsHeaderActions, type SettingsHeaderActionsProps, } from './SettingsHeaderActions';
3
+ export { SettingsHeaderBreadcrumbs, type SettingsHeaderBreadcrumbsProps, } from './SettingsHeaderBreadcrumbs';
4
+ export { SettingsHeaderDescription, type SettingsHeaderDescriptionProps, } from './SettingsHeaderDescription';
5
+ export { SettingsHeaderFilters, type SettingsHeaderFiltersProps, } from './SettingsHeaderFilters';
6
+ export { SettingsHeaderHeading, type SettingsHeaderHeadingProps, } from './SettingsHeaderHeading';
7
+ export { SettingsHeaderTitle, type SettingsHeaderTitleProps, } from './SettingsHeaderTitle';
@@ -0,0 +1,7 @@
1
+ export { SettingsHeader } from "./SettingsHeader.js";
2
+ export { SettingsHeaderActions } from "./SettingsHeaderActions.js";
3
+ export { SettingsHeaderBreadcrumbs } from "./SettingsHeaderBreadcrumbs.js";
4
+ export { SettingsHeaderDescription } from "./SettingsHeaderDescription.js";
5
+ export { SettingsHeaderFilters } from "./SettingsHeaderFilters.js";
6
+ export { SettingsHeaderHeading } from "./SettingsHeaderHeading.js";
7
+ export { SettingsHeaderTitle } from "./SettingsHeaderTitle.js";
@@ -21,7 +21,7 @@ const SwitchControl = ()=>{
21
21
  className: "absolute left-2 top-1/2 -translate-y-1/2 w-10 h-10 text-white pointer-events-none z-0"
22
22
  }),
23
23
  /*#__PURE__*/ jsx(Switch.Thumb, {
24
- className: cn('w-16 h-12', 'bg-icon-primary-alt rounded-4 shadow-sm transition-all relative z-10', 'translate-x-4', 'data-[state=checked]:translate-x-14')
24
+ className: cn('w-16 h-12', 'bg-icon-primary-alt rounded-4 shadow-sm transition-all relative z-[9]', 'translate-x-4', 'data-[state=checked]:translate-x-14')
25
25
  })
26
26
  ]
27
27
  });
@@ -22,7 +22,11 @@ const EditableSelectCell = ({ value, onCommit, items, children, placeholder = 'S
22
22
  ] : [],
23
23
  "data-testid": testId,
24
24
  positioning: {
25
- placement: 'bottom-start'
25
+ placement: 'bottom-start',
26
+ sameWidth: true,
27
+ offset: {
28
+ crossAxis: -8
29
+ }
26
30
  },
27
31
  onValueChange: (details)=>{
28
32
  const next = details.value[0];
@@ -56,6 +60,10 @@ const EditableSelectCell = ({ value, onCommit, items, children, placeholder = 'S
56
60
  })
57
61
  }),
58
62
  /*#__PURE__*/ jsx(SelectPositioner, {
63
+ className: "min-w-full max-w-full",
64
+ style: {
65
+ width: 'calc(var(--reference-width) + 16px)'
66
+ },
59
67
  children: /*#__PURE__*/ jsx(SelectContent, {
60
68
  children: items.map((item)=>/*#__PURE__*/ jsxs(SelectOption, {
61
69
  item: item,
@@ -104,7 +104,7 @@ const StickyGroupParent = ({ tableWidth, headerHeight })=>{
104
104
  disablePinnedShadow: true
105
105
  }),
106
106
  dataCells.slice(1).map((cell)=>/*#__PURE__*/ jsx(Td, {
107
- className: cn('border-b border-border-primary-light bg-bg-surface-2 overlay', 'group-hover/row:overlay-states-primary-hover group-data-[selected]/row:overlay-states-primary-active'),
107
+ className: cn('border-b border-border-primary-light bg-bg-surface-2 overlay', 'group-hover/row:overlay-states-primary-hover group-data-[selected]/row:overlay-states-primary-active', 'group-data-[preview-active]/row:overlay-states-primary-hover group-has-[[data-state=open]]/row:overlay-states-primary-hover'),
108
108
  style: {
109
109
  width: cell.column.getSize()
110
110
  },
@@ -3,15 +3,12 @@ import { flexRender } from "@tanstack/react-table";
3
3
  import { cn } from "../../../utils/cn.js";
4
4
  import { useTestId } from "../../../utils/testId.js";
5
5
  import { Tooltip, TooltipContent, TooltipTrigger } from "../../Tooltip/index.js";
6
+ import { DROP_INDICATOR_BASE } from "../classes.js";
6
7
  import { useMasterCell } from "../hooks/index.js";
7
8
  import { TABLE_EXPAND_COLUMN_ID, getAlignClass, getExpandBorderClass, getPinningStyles, isLastPinnedLeft, useColumnDnd } from "../lib/index.js";
8
9
  import { Td } from "../primitives/index.js";
9
10
  import { useTableContext } from "../TableContext/index.js";
10
11
  import { TableMasterCellActions } from "../TableMasterCellActions.js";
11
- const DROP_INDICATOR_SHADOW = {
12
- above: 'inset 0 2px 0 0 var(--color-border-strong-warning)',
13
- below: 'inset 0 -2px 0 0 var(--color-border-strong-warning)'
14
- };
15
12
  const TableBodyCell = ({ cell, colSpan, className, disablePinnedShadow, lastRow, dragListeners, dragAttributes, dropIndicator })=>{
16
13
  const { allLeafColumns, masterColumnId } = useTableContext();
17
14
  const testId = useTestId('body-cell');
@@ -65,7 +62,7 @@ const TableBodyCell = ({ cell, colSpan, className, disablePinnedShadow, lastRow,
65
62
  };
66
63
  return /*#__PURE__*/ jsx(Td, {
67
64
  "data-testid": testId,
68
- className: cn(getAlignClass(meta), getExpandBorderClass(isExpandColumn, cell.row.depth, lastRow), isCut && 'pr-0', (isMasterTrigger || tooltipText) && 'cursor-pointer', dragListeners && 'cursor-grab active:cursor-grabbing', meta?.cellClassName, className),
65
+ className: cn(getAlignClass(meta), getExpandBorderClass(isExpandColumn, cell.row.depth, lastRow), isCut && 'pr-0', (isMasterTrigger || tooltipText) && 'cursor-pointer', dragListeners && 'cursor-grab active:cursor-grabbing', dropIndicator && DROP_INDICATOR_BASE, 'above' === dropIndicator && 'after:top-0', 'below' === dropIndicator && 'after:-bottom-px', meta?.cellClassName, className),
69
66
  pinned: 'start' === isPinned,
70
67
  lastPinnedLeft: disablePinnedShadow ? false : lastLeft,
71
68
  expanded: isExpandedToggle,
@@ -80,7 +77,7 @@ const TableBodyCell = ({ cell, colSpan, className, disablePinnedShadow, lastRow,
80
77
  overflow: 'hidden'
81
78
  },
82
79
  ...dropIndicator && {
83
- boxShadow: DROP_INDICATOR_SHADOW[dropIndicator]
80
+ overflow: 'visible'
84
81
  }
85
82
  },
86
83
  colSpan: colSpan,
@@ -1,7 +1,8 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { cn } from "../../utils/cn.js";
3
3
  const TableMasterCellActions = ({ children })=>/*#__PURE__*/ jsx("div", {
4
- className: cn('shrink-0 pl-4 pr-4 flex items-center gap-2', 'opacity-0 pointer-events-none', 'group-hover/row:opacity-100 group-hover/row:pointer-events-auto', 'group-data-[selected]/row:opacity-100 group-data-[selected]/row:pointer-events-auto', 'group-data-[preview-active]/row:opacity-100 group-data-[preview-active]/row:pointer-events-auto'),
4
+ "data-master-cell-action": "",
5
+ className: cn('shrink-0 pl-4 pr-4 flex items-center gap-2', 'opacity-0 pointer-events-none', 'group-hover/row:opacity-100 group-hover/row:pointer-events-auto', 'group-data-[selected]/row:opacity-100 group-data-[selected]/row:pointer-events-auto', 'group-data-[preview-active]/row:opacity-100 group-data-[preview-active]/row:pointer-events-auto', 'has-[[data-state=open]]:opacity-100 has-[[data-state=open]]:pointer-events-auto', '[&_[data-state=open]]:overlay [&_[data-state=open]]:overlay-states-primary-hover'),
5
6
  children: children
6
7
  });
7
8
  TableMasterCellActions.displayName = 'TableMasterCellActions';
@@ -2,6 +2,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { memo, useCallback } from "react";
3
3
  import { cn } from "../../utils/cn.js";
4
4
  import { useTestId } from "../../utils/testId.js";
5
+ import { DROP_INDICATOR_BASE } from "./classes.js";
5
6
  import { TABLE_DRAG_HANDLE_COLUMN_ID, TABLE_EXPAND_COLUMN_ID, TABLE_SELECT_COLUMN_ID, useRowDnd } from "./lib/index.js";
6
7
  import { Td, Tr } from "./primitives/index.js";
7
8
  import { TableBodyCell } from "./TableBody/TableBodyCell.js";
@@ -70,7 +71,7 @@ const TableRowInner = ({ row, ref, 'data-index': dataIndex })=>{
70
71
  lastRow: isLastRow
71
72
  }),
72
73
  dataCells.slice(1).map((cell)=>/*#__PURE__*/ jsx(Td, {
73
- className: cn('border-b border-border-primary-light bg-bg-surface-2 overlay', 'group-hover/row:overlay-states-primary-hover group-data-[selected]/row:overlay-states-primary-active', isLastRow && 'border-b-0'),
74
+ className: cn('border-b border-border-primary-light bg-bg-surface-2 overlay', 'group-hover/row:overlay-states-primary-hover group-data-[selected]/row:overlay-states-primary-active', 'group-data-[preview-active]/row:overlay-states-primary-hover group-has-[[data-state=open]]/row:overlay-states-primary-hover', isLastRow && 'border-b-0'),
74
75
  style: {
75
76
  width: cell.column.getSize()
76
77
  },
@@ -122,7 +123,11 @@ const TableRowInner = ({ row, ref, 'data-index': dataIndex })=>{
122
123
  }),
123
124
  !stretch && /*#__PURE__*/ jsx(Td, {
124
125
  pinned: false,
125
- "aria-hidden": true
126
+ "aria-hidden": true,
127
+ className: cn(dropIndicator && DROP_INDICATOR_BASE, 'above' === dropIndicator && 'after:top-0', 'below' === dropIndicator && 'after:-bottom-px'),
128
+ style: dropIndicator ? {
129
+ overflow: 'visible'
130
+ } : void 0
126
131
  })
127
132
  ]
128
133
  }),
@@ -16,5 +16,10 @@ export declare const tableContainerVariants: (props?: ({
16
16
  virtualized?: "container" | "window" | null | undefined;
17
17
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
18
18
  export declare const tableRowVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
19
+ /**
20
+ * Drop-indicator ::after pseudo-element (shared by TableBodyCell & filler Td).
21
+ * Positioned above borders so the line is uninterrupted across columns.
22
+ */
23
+ export declare const DROP_INDICATOR_BASE = "after:content-[''] after:absolute after:left-0 after:-right-px after:h-[2px] after:bg-[var(--color-border-strong-brand)] after:pointer-events-none after:z-[1]";
19
24
  /** Small icon button used in table header (sort, scroll, menu triggers) */
20
25
  export declare const tableHeaderButtonClass: string;
@@ -38,7 +38,7 @@ const tableHeadCellVariants = cva(cn(tableCellBase, 'pl-16 pr-4 py-4 text-xs fon
38
38
  dragging: false
39
39
  }
40
40
  });
41
- const tableBodyCellVariants = cva(cn(tableCellBase, 'px-16 py-8 text-sm text-text-primary', 'bg-bg-surface-2', 'align-top', 'group-hover/row:overlay-states-primary-hover', 'group-data-[selected]/row:overlay-states-primary-active', 'group-data-[selected]/row:group-hover/row:overlay-states-primary-hover', 'group-data-[preview-active]/row:overlay-states-primary-active', 'group-data-[preview-active]/row:group-hover/row:overlay-states-primary-hover', '[&:has([data-state=open][data-part=context-trigger])]:ring-2', '[&:has([data-state=open][data-part=context-trigger])]:ring-inset', '[&:has([data-state=open][data-part=context-trigger])]:ring-border-strong-brand', '[&:has([data-part=context-trigger])]:p-0', '[&_[data-part=context-trigger]]:w-full', '[&_[data-part=context-trigger]]:px-16 [&_[data-part=context-trigger]]:py-8', '[&_[data-part=context-trigger]]:text-left [&_[data-part=context-trigger]]:outline-none'), {
41
+ const tableBodyCellVariants = cva(cn(tableCellBase, 'px-16 py-8 text-sm text-text-primary', 'bg-bg-surface-2', 'align-top', 'group-hover/row:overlay-states-primary-hover', 'group-data-[selected]/row:overlay-states-primary-active', 'group-data-[selected]/row:group-hover/row:overlay-states-primary-hover', 'group-data-[preview-active]/row:overlay-states-primary-hover', 'group-has-[[data-state=open]]/row:overlay-states-primary-hover', '[&:has([data-state=open][data-part=context-trigger])]:ring-2', '[&:has([data-state=open][data-part=context-trigger])]:ring-inset', '[&:has([data-state=open][data-part=context-trigger])]:ring-border-strong-brand', '[&:has([data-part=context-trigger])]:p-0', '[&_[data-part=context-trigger]]:w-full', '[&_[data-part=context-trigger]]:px-16 [&_[data-part=context-trigger]]:py-8', '[&_[data-part=context-trigger]]:text-left [&_[data-part=context-trigger]]:outline-none'), {
42
42
  variants: {
43
43
  pinned: {
44
44
  true: 'sticky z-10',
@@ -73,5 +73,6 @@ const tableContainerVariants = cva('rounded-12 border border-border-primary-ligh
73
73
  }
74
74
  });
75
75
  const tableRowVariants = cva('transition-colors');
76
+ const DROP_INDICATOR_BASE = "after:content-[''] after:absolute after:left-0 after:-right-px after:h-[2px] after:bg-[var(--color-border-strong-brand)] after:pointer-events-none after:z-[1]";
76
77
  const tableHeaderButtonClass = cn('w-16 h-16 shrink-0 hover:text-text-primary', 'focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-focus-primary rounded-2', 'transition-colors cursor-pointer', 'inline-flex items-center justify-center bg-transparent border-0 p-0');
77
- export { tableBodyCellVariants, tableContainerVariants, tableHeadCellVariants, tableHeaderButtonClass, tableRowVariants };
78
+ export { DROP_INDICATOR_BASE, tableBodyCellVariants, tableContainerVariants, tableHeadCellVariants, tableHeaderButtonClass, tableRowVariants };
@@ -1,3 +1,4 @@
1
+ import type { MouseEvent } from 'react';
1
2
  import type { RowData } from '@tanstack/react-table';
2
3
  /**
3
4
  * Encapsulates master cell click logic for a body cell.
@@ -7,7 +8,7 @@ export declare const useMasterCell: <T extends RowData>(columnId: string, rowId:
7
8
  /** Master cell click is enabled */
8
9
  isMasterTrigger: boolean;
9
10
  /** Fire master cell click for this row */
10
- handleClick: () => void;
11
+ handleClick: (e: MouseEvent) => void;
11
12
  /** Tooltip text for master cell hover */
12
13
  tooltipText: string | undefined;
13
14
  };
@@ -4,7 +4,8 @@ const useMasterCell = (columnId, rowId)=>{
4
4
  const { masterColumnId, onMasterCellClick } = useTableContext();
5
5
  const isMasterColumn = columnId === masterColumnId;
6
6
  const hasMasterClick = isMasterColumn && !!onMasterCellClick;
7
- const handleClick = useCallback(()=>{
7
+ const handleClick = useCallback((e)=>{
8
+ if (e.target.closest('[data-master-cell-action]')) return;
8
9
  onMasterCellClick?.(rowId);
9
10
  }, [
10
11
  onMasterCellClick,
@@ -12,7 +12,7 @@ const createDragHandleColumn = ()=>({
12
12
  enablePinning: false,
13
13
  meta: {
14
14
  headerClassName: 'px-4 py-4',
15
- cellClassName: 'px-4 py-8'
15
+ cellClassName: 'px-4 py-8 align-middle text-center'
16
16
  },
17
17
  header: ()=>null,
18
18
  cell: ()=>/*#__PURE__*/ jsx(GripVertical, {
@@ -17,6 +17,7 @@ export interface SecurityEvent {
17
17
  lastSeen: string;
18
18
  endpointMethod: HttpMethodName;
19
19
  endpointPath: string;
20
+ state: boolean;
20
21
  }
21
22
  export interface SecurityHeaderEntry {
22
23
  id: string;
@@ -12,6 +12,7 @@ import { Ip, IpAddress, IpCountry, IpProvider, sourceLabels } from "../Ip/index.
12
12
  import { Link } from "../Link/index.js";
13
13
  import { OverflowTooltip, OverflowTooltipContent, OverflowTooltipTrigger } from "../OverflowTooltip/index.js";
14
14
  import { HStack, VStack } from "../Stack/index.js";
15
+ import { Switch, SwitchControl } from "../Switch/index.js";
15
16
  import { Text } from "../Text/index.js";
16
17
  import { createTableColumnHelper } from "./lib/index.js";
17
18
  const securityEvents = [
@@ -36,7 +37,8 @@ const securityEvents = [
36
37
  cweId: 'CWE-287',
37
38
  lastSeen: '5 days ago',
38
39
  endpointMethod: 'POST',
39
- endpointPath: '/api/v1/payments'
40
+ endpointPath: '/api/v1/payments',
41
+ state: true
40
42
  },
41
43
  {
42
44
  id: '2',
@@ -59,7 +61,8 @@ const securityEvents = [
59
61
  cweId: 'CWE-416',
60
62
  lastSeen: '6 days ago',
61
63
  endpointMethod: 'PUT',
62
- endpointPath: '/api/v1/users/profile'
64
+ endpointPath: '/api/v1/users/profile',
65
+ state: false
63
66
  },
64
67
  {
65
68
  id: '3',
@@ -82,7 +85,8 @@ const securityEvents = [
82
85
  cweId: 'CWE-89',
83
86
  lastSeen: '7 days ago',
84
87
  endpointMethod: 'GET',
85
- endpointPath: '/api/v1/users/:id'
88
+ endpointPath: '/api/v1/users/:id',
89
+ state: true
86
90
  },
87
91
  {
88
92
  id: '4',
@@ -105,7 +109,8 @@ const securityEvents = [
105
109
  cweId: 'CWE-22',
106
110
  lastSeen: '1 week ago',
107
111
  endpointMethod: 'GET',
108
- endpointPath: '/api/v1/errors/debug'
112
+ endpointPath: '/api/v1/errors/debug',
113
+ state: true
109
114
  },
110
115
  {
111
116
  id: '5',
@@ -128,7 +133,8 @@ const securityEvents = [
128
133
  cweId: 'CWE-200',
129
134
  lastSeen: '4 days ago',
130
135
  endpointMethod: 'POST',
131
- endpointPath: '/api/v1/auth/login'
136
+ endpointPath: '/api/v1/auth/login',
137
+ state: false
132
138
  },
133
139
  {
134
140
  id: '6',
@@ -151,7 +157,8 @@ const securityEvents = [
151
157
  cweId: 'CWE-352',
152
158
  lastSeen: '2 days ago',
153
159
  endpointMethod: 'POST',
154
- endpointPath: '/api/v1/files/upload'
160
+ endpointPath: '/api/v1/files/upload',
161
+ state: true
155
162
  },
156
163
  {
157
164
  id: '7',
@@ -174,7 +181,8 @@ const securityEvents = [
174
181
  cweId: 'CWE-125',
175
182
  lastSeen: '3 days ago',
176
183
  endpointMethod: 'GET',
177
- endpointPath: '/api/v1/images/proxy'
184
+ endpointPath: '/api/v1/images/proxy',
185
+ state: false
178
186
  },
179
187
  {
180
188
  id: '8',
@@ -197,7 +205,8 @@ const securityEvents = [
197
205
  cweId: 'CWE-134',
198
206
  lastSeen: '4 days ago',
199
207
  endpointMethod: 'GET',
200
- endpointPath: '/api/v1/auth/redirect'
208
+ endpointPath: '/api/v1/auth/redirect',
209
+ state: true
201
210
  },
202
211
  {
203
212
  id: '9',
@@ -220,7 +229,8 @@ const securityEvents = [
220
229
  cweId: 'CWE-79',
221
230
  lastSeen: '1 day ago',
222
231
  endpointMethod: 'DELETE',
223
- endpointPath: '/api/v1/users/:id'
232
+ endpointPath: '/api/v1/users/:id',
233
+ state: false
224
234
  },
225
235
  {
226
236
  id: '10',
@@ -243,7 +253,8 @@ const securityEvents = [
243
253
  cweId: 'CWE-89',
244
254
  lastSeen: '3 days ago',
245
255
  endpointMethod: 'PATCH',
246
- endpointPath: '/api/v1/content'
256
+ endpointPath: '/api/v1/content',
257
+ state: true
247
258
  }
248
259
  ];
249
260
  const securityColumnHelper = createTableColumnHelper();
@@ -274,6 +285,14 @@ const securityColumns = [
274
285
  ]
275
286
  })
276
287
  }),
288
+ securityColumnHelper.accessor('state', {
289
+ header: 'State',
290
+ size: 100,
291
+ cell: ({ getValue })=>/*#__PURE__*/ jsx(Switch, {
292
+ checked: getValue(),
293
+ children: /*#__PURE__*/ jsx(SwitchControl, {})
294
+ })
295
+ }),
277
296
  securityColumnHelper.accessor('requests', {
278
297
  header: 'Requests',
279
298
  size: 160,
@@ -671,6 +690,10 @@ const SecurityPreviewContent = ({ row })=>/*#__PURE__*/ jsxs(VStack, {
671
690
  size: "medium",
672
691
  children: row.original.status
673
692
  }),
693
+ /*#__PURE__*/ jsx(Switch, {
694
+ checked: row.original.state,
695
+ children: /*#__PURE__*/ jsx(SwitchControl, {})
696
+ }),
674
697
  /*#__PURE__*/ jsx(InlineCodeSnippet, {
675
698
  code: row.original.parameter,
676
699
  size: "sm",
@@ -1,6 +1,5 @@
1
1
  export { useArrowNav } from './useArrowNav';
2
2
  export { useControlled } from './useControlled';
3
3
  export { useCopyToClipboard } from './useCopyToClipboard';
4
- export { useCopyTooltip } from './useCopyTooltip';
5
4
  export { useIsKeyPressed } from './useIsKeyPressed';
6
5
  export { type UseOverflowItemsOptions, type UseOverflowItemsResult, useOverflowItems, } from './useOverflowItems';
@@ -1,6 +1,5 @@
1
1
  export { useArrowNav } from "./useArrowNav.js";
2
2
  export { useControlled } from "./useControlled.js";
3
3
  export { useCopyToClipboard } from "./useCopyToClipboard.js";
4
- export { useCopyTooltip } from "./useCopyTooltip.js";
5
4
  export { useIsKeyPressed } from "./useIsKeyPressed.js";
6
5
  export { useOverflowItems } from "./useOverflowItems.js";
@@ -1,23 +1,22 @@
1
1
  /**
2
2
  * Hook for copying text to clipboard with status tracking.
3
3
  *
4
+ * Uses the Clipboard API with an `execCommand` fallback for older browsers.
5
+ * The `copied` flag auto-resets after `resetDelay` ms.
6
+ *
4
7
  * @param resetDelay - Time in ms before `copied` resets to false (default: 2000)
5
- * @returns Object with `copied` state, `copy` function, `reset` function, and `isSupported` flag
8
+ * @returns `{ copied, copy }` — `copied` is `true` while the feedback window is active
6
9
  *
7
10
  * @example
8
11
  * ```tsx
9
- * const { copied, copy, reset, isSupported } = useCopyToClipboard();
12
+ * const { copied, copy } = useCopyToClipboard();
10
13
  *
11
- * {isSupported && (
12
- * <button onClick={() => copy('text to copy')}>
13
- * {copied ? 'Copied!' : 'Copy'}
14
- * </button>
15
- * )}
14
+ * <button onClick={() => copy('text to copy')}>
15
+ * {copied ? 'Copied!' : 'Copy'}
16
+ * </button>
16
17
  * ```
17
18
  */
18
19
  export declare function useCopyToClipboard(resetDelay?: number): {
19
20
  copied: boolean;
20
- copy: (text: string) => Promise<boolean>;
21
- reset: () => void;
22
- isSupported: boolean;
21
+ copy: (text: string) => void;
23
22
  };
@@ -1,31 +1,19 @@
1
1
  import { useCallback, useRef, useState } from "react";
2
- const isClipboardSupported = "u" > typeof navigator && void 0 !== navigator.clipboard && 'function' == typeof navigator.clipboard.writeText;
2
+ import { copyText } from "../utils/copyText.js";
3
3
  function useCopyToClipboard(resetDelay = 2000) {
4
4
  const [copied, setCopied] = useState(false);
5
5
  const timeoutRef = useRef(void 0);
6
- const reset = useCallback(()=>{
6
+ const copy = useCallback((text)=>{
7
+ copyText(text);
8
+ setCopied(true);
7
9
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8
- setCopied(false);
9
- }, []);
10
- const copy = useCallback(async (text)=>{
11
- if (!isClipboardSupported) return false;
12
- try {
13
- await navigator.clipboard.writeText(text);
14
- setCopied(true);
15
- if (timeoutRef.current) clearTimeout(timeoutRef.current);
16
- timeoutRef.current = setTimeout(()=>setCopied(false), resetDelay);
17
- return true;
18
- } catch {
19
- return false;
20
- }
10
+ timeoutRef.current = setTimeout(()=>setCopied(false), resetDelay);
21
11
  }, [
22
12
  resetDelay
23
13
  ]);
24
14
  return {
25
15
  copied,
26
- copy,
27
- reset,
28
- isSupported: isClipboardSupported
16
+ copy
29
17
  };
30
18
  }
31
19
  export { useCopyToClipboard };
package/dist/index.d.ts CHANGED
@@ -25,7 +25,7 @@ export { Calendar, CalendarApplyButton, type CalendarApplyButtonProps, CalendarB
25
25
  export { Card, CardContent, type CardContentProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, cardVariants, } from './components/Card';
26
26
  export { Checkbox, CheckboxDescription, type CheckboxDescriptionProps, CheckboxGroup, type CheckboxGroupProps, CheckboxIndicator, CheckboxLabel, type CheckboxLabelProps, type CheckboxProps, } from './components/Checkbox';
27
27
  export { Code, type CodeProps } from './components/Code';
28
- export { CopyButton, type CopyButtonProps } from './components/CopyButton';
28
+ export { Copyable, CopyableIcon, type CopyableIconProps, CopyableLabel, type CopyableLabelProps, type CopyableProps, useCopyable, } from './components/Copyable';
29
29
  export { Country, CountryFlag, type CountryFlagProps, CountryName, type CountryNameProps, type CountryProps, } from './components/Country';
30
30
  export { type DateFormatContextValue, DateFormatProvider, type DateFormatProviderProps, type DateOrder, useDateFormat, } from './components/DateFormatProvider';
31
31
  export { DateInput, type DateInputProps } from './components/DateInput';
@@ -68,12 +68,14 @@ export { type BreadcrumbSegment, findFirstLinkPath, type NavConfig, type NavConf
68
68
  export { ResizableHandle, type ResizableHandleProps, ResizablePanel, ResizablePanelGroup, type ResizablePanelGroupProps, type ResizablePanelProps, } from './components/Resizable';
69
69
  export { getResponseCodeCategory, RESPONSE_CODE_COLOR, ResponseCode, type ResponseCodeCategory, type ResponseCodeProps, } from './components/ResponseCode';
70
70
  export { ScrollArea, ScrollAreaContent, type ScrollAreaContentProps, ScrollAreaCorner, type ScrollAreaCornerProps, type ScrollAreaProps, ScrollAreaScrollbar, type ScrollAreaScrollbarProps, ScrollAreaViewport, type ScrollAreaViewportProps, } from './components/ScrollArea';
71
+ export { SearchInput, type SearchInputProps } from './components/SearchInput';
71
72
  export { SearchModal, SearchModalBody, type SearchModalBodyProps, SearchModalContent, type SearchModalContentProps, SearchModalEmpty, type SearchModalEmptyProps, SearchModalFooter, type SearchModalFooterProps, SearchModalGroup, SearchModalGroupLabel, type SearchModalGroupLabelProps, type SearchModalGroupProps, SearchModalInput, type SearchModalInputProps, SearchModalItem, type SearchModalItemProps, type SearchModalProps, SearchModalTrigger, type SearchModalTriggerProps, useSearchModalContext, } from './components/SearchModal';
72
73
  export { SegmentedControl, SegmentedControlButton, type SegmentedControlButtonProps, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, SegmentedControlSeparator, type SegmentedControlSeparatorProps, } from './components/SegmentedControl';
73
74
  export { SegmentedTabs, SegmentedTabsButton, SegmentedTabsContent, SegmentedTabsList, SegmentedTabsSeparator, SegmentedTabsTrigger, SegmentedTabsTriggerButton, } from './components/SegmentedTabs';
74
75
  export { createListCollection, Select, SelectButton, SelectClearTrigger, SelectContent, type SelectDataItem, SelectEmptyState, type SelectEmptyStateProps, SelectFooter, SelectGroup, SelectGroupLabel, SelectHeader, SelectInput, SelectOption, SelectOptionDescription, SelectOptionIndicator, SelectOptionText, SelectPositioner, SelectSearchInput, SelectSeparator, type UseSelectSearchOptions, type UseSelectSearchResult, useSelectSearch, } from './components/Select';
75
76
  export { Selection, SelectionAll, type SelectionAllProps, SelectionBulkBar, type SelectionBulkBarPlacement, type SelectionBulkBarProps, type SelectionContextValue, SelectionItem, type SelectionItemProps, type SelectionProps, useSelectionContext, } from './components/Selection';
76
77
  export { Separator, type SeparatorProps } from './components/Separator';
78
+ export { SettingsHeader, SettingsHeaderActions, type SettingsHeaderActionsProps, SettingsHeaderBreadcrumbs, type SettingsHeaderBreadcrumbsProps, SettingsHeaderDescription, type SettingsHeaderDescriptionProps, SettingsHeaderFilters, type SettingsHeaderFiltersProps, SettingsHeaderHeading, type SettingsHeaderHeadingProps, type SettingsHeaderProps, SettingsHeaderTitle, type SettingsHeaderTitleProps, } from './components/SettingsHeader';
77
79
  export { Skeleton, type SkeletonProps } from './components/Skeleton';
78
80
  export { Slider, SliderControl, type SliderControlProps, SliderInput, type SliderInputProps, type SliderMark, SliderMarks, type SliderMarksProps, type SliderProps, SliderThumb, type SliderThumbProps, SliderValue, type SliderValueProps, } from './components/Slider';
79
81
  export { SplashScreen, type SplashScreenProps } from './components/SplashScreen';
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ export { Calendar, CalendarApplyButton, CalendarBody, CalendarContent, CalendarD
14
14
  export { Card, CardContent, CardFooter, CardHeader, CardTitle, cardVariants } from "./components/Card/index.js";
15
15
  export { Checkbox, CheckboxDescription, CheckboxGroup, CheckboxIndicator, CheckboxLabel } from "./components/Checkbox/index.js";
16
16
  export { Code } from "./components/Code/index.js";
17
- export { CopyButton } from "./components/CopyButton/index.js";
17
+ export { Copyable, CopyableIcon, CopyableLabel, useCopyable } from "./components/Copyable/index.js";
18
18
  export { Country, CountryFlag, CountryName } from "./components/Country/index.js";
19
19
  export { DateFormatProvider, useDateFormat } from "./components/DateFormatProvider/index.js";
20
20
  export { DateInput } from "./components/DateInput/index.js";
@@ -57,12 +57,14 @@ export { RemoteShell, RemoteShellBreadcrumb, RemoteShellContent, RemoteShellPane
57
57
  export { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "./components/Resizable/index.js";
58
58
  export { RESPONSE_CODE_COLOR, ResponseCode, getResponseCodeCategory } from "./components/ResponseCode/index.js";
59
59
  export { ScrollArea, ScrollAreaContent, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaViewport } from "./components/ScrollArea/index.js";
60
+ export { SearchInput } from "./components/SearchInput/index.js";
60
61
  export { SearchModal, SearchModalBody, SearchModalContent, SearchModalEmpty, SearchModalFooter, SearchModalGroup, SearchModalGroupLabel, SearchModalInput, SearchModalItem, SearchModalTrigger, useSearchModalContext } from "./components/SearchModal/index.js";
61
62
  export { SegmentedControl, SegmentedControlButton, SegmentedControlItem, SegmentedControlSeparator } from "./components/SegmentedControl/index.js";
62
63
  export { SegmentedTabs, SegmentedTabsButton, SegmentedTabsContent, SegmentedTabsList, SegmentedTabsSeparator, SegmentedTabsTrigger, SegmentedTabsTriggerButton } from "./components/SegmentedTabs/index.js";
63
64
  export { Select, SelectButton, SelectClearTrigger, SelectContent, SelectEmptyState, SelectFooter, SelectGroup, SelectGroupLabel, SelectHeader, SelectInput, SelectOption, SelectOptionDescription, SelectOptionIndicator, SelectOptionText, SelectPositioner, SelectSearchInput, SelectSeparator, createListCollection, useSelectSearch } from "./components/Select/index.js";
64
65
  export { Selection, SelectionAll, SelectionBulkBar, SelectionItem, useSelectionContext } from "./components/Selection/index.js";
65
66
  export { Separator } from "./components/Separator/index.js";
67
+ export { SettingsHeader, SettingsHeaderActions, SettingsHeaderBreadcrumbs, SettingsHeaderDescription, SettingsHeaderFilters, SettingsHeaderHeading, SettingsHeaderTitle } from "./components/SettingsHeader/index.js";
66
68
  export { Skeleton } from "./components/Skeleton/index.js";
67
69
  export { Slider, SliderControl, SliderInput, SliderMarks, SliderThumb, SliderValue } from "./components/Slider/index.js";
68
70
  export { SplashScreen } from "./components/SplashScreen/index.js";