@eightshift/ui-components 5.3.0 → 5.3.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.
@@ -89,6 +89,27 @@ const $13c3c67164f4d5be$export$4c260019440d418f = /* @__PURE__ */ forwardRef(fun
89
89
  "data-orientation": props.orientation || "horizontal"
90
90
  }, renderProps.children);
91
91
  });
92
+ /**
93
+ * @typedef {Object} ButtonProps
94
+ * @property {JSX.Element} [props.icon] - Icon to display within the button.
95
+ * @property {ButtonSize} [props.size='default'] - The size of the button.
96
+ * @property {ButtonType} [props.type='default'] - The type of the button.
97
+ * @property {boolean} [props.disabled] - If `true`, the button is disabled.
98
+ * @property {string} [props.className] - Classes to pass to the button.
99
+ * @property {string|boolean} [props.tooltip] - Tooltip text to display on hover. If set to `true` and an `aria-label` is not provided, the tooltip text will be used as the `aria-label`.
100
+ * @property {Function} [props.onPress] - Function to run when the button is pressed.
101
+ * @property {React.Ref} [props.forwardedRef] - Ref to forward to the button. Use the same as the `ref` prop.
102
+ * @property {string} [props.wrapperClassName] - Classes to pass to the tooltip wrapper.
103
+ * @property {TooltipProps} [props.tooltipProps] - Props to pass to the tooltip.
104
+ * @property {boolean} [props.pending] - If `true`, the button is in a pending state, which can be used to indicate that an action is being processed.
105
+ * @property {string} [props.pendingAriaLabel='Loading'] - ARIA label for the pending state, used for screen readers.
106
+ * @property {boolean} [props.hidden] - If `true`, the component is not rendered.
107
+ *
108
+ * @typedef {'small' | 'default' | 'large'} ButtonSize
109
+ * @typedef {'default' | 'selected' | 'selectedGhost' | 'ghost' | 'danger' | 'dangerGhost'} ButtonType
110
+ *
111
+ * @preserve
112
+ */
92
113
  /**
93
114
  * A simple button component.
94
115
  *
@@ -3,6 +3,27 @@ import { e as $07b14b47974efb58$export$5b6b19405a83ff9d, f as $de32f1b87079253c$
3
3
  import { c as clsx } from "../../lite-DVmmD_-j.js";
4
4
  import { _ as __ } from "../../default-i18n-CN_q3KUs.js";
5
5
  import { Button } from "../button/button.js";
6
+ /**
7
+ * @typedef {Object} PopoverProps
8
+ * @property {React.Ref} props.triggerRef - Ref of the trigger button. In uncontrolled mode, this element will be used to open the popover. In controlled mode, the popover will be anchored to this element.
9
+ * @property {boolean} [props.openByDefault=false] - (**Controlled mode**) If `true`, the popover is open by default.
10
+ * @property {boolean} props.isOpen - (**Uncontrolled mode**) If `true`, the popover is open.
11
+ * @property {Function} props.onOpenChange - (**Uncontrolled mode**) Function to run when the popover is opened or closed. `(isOpen: boolean) => void`.
12
+ * @property {PopoverPlacement} props.placement - The placement of the popover.
13
+ * @property {string} [props.className] - Classes to pass to the popover contents.
14
+ * @property {string} [props.wrapperClassName] - Classes to pass to the popover wrapper.
15
+ * @property {Object} props.style - Styles to pass to the popover.
16
+ * @property {number} props.offset - Offset from the trigger element, on the same axis as the placement of the popover (e.g. if `placement` is `left`, this controls the horizontal spacing from the element).
17
+ * @property {number} props.crossOffset - Offset from the trigger element, on the opposite axis as the placement of the popover (e.g. if `placement` is `left`, this controls the vertical spacing from the element).
18
+ * @property {number} props.containerPadding - Space that should be left between the popover and the edge of the container (the default container is browser window).
19
+ * @property {boolean} props.shouldFlip - If `true`, the popover should flip when there is not enough space.
20
+ * @property {Function} [props.shouldCloseOnInteractOutside=() => true] - Allows ignoring close events for certain elements. `(element: HTMLElement) => boolean`.
21
+ * @property {boolean} [props.hidden] - If `true`, the component is not rendered.
22
+ *
23
+ * @typedef {'bottom' | 'bottom left' | 'bottom right' | 'bottom start' | 'bottom end' | 'top' | 'top left' | 'top right' | 'top start' | 'top end' | 'left' | 'left top' | 'left bottom' | 'start' | 'start top' | 'start bottom' | 'right' | 'right top' | 'right bottom' | 'end' | 'end top' | 'end bottom'} PopoverPlacement
24
+ *
25
+ * @preserve
26
+ */
6
27
  /**
7
28
  * A popover component.
8
29
  *
@@ -345,6 +345,29 @@ function $4e3b923658d69c60$var$TooltipInner(props) {
345
345
  }
346
346
  }, renderProps.children));
347
347
  }
348
+ /**
349
+ * @typedef {Object} TooltipProps
350
+ * @property {string|JSX.Element} props.text - The text to display in the tooltip.
351
+ * @property {TooltipTheme} [props.theme='dark'] - The theme of the tooltip.
352
+ * @property {number} [props.offset=0] - Additional offset between the tooltip and the element on the main axis (same axis as element).
353
+ * @property {number} [props.crossOffset=0] - Additional offset between the tooltip and the element on the cross axis (opposite axis as element).
354
+ * @property {number} [props.containerPadding=12] - Space that should be left between the tooltip and the main containing element (usually browser window).
355
+ * @property {number} [props.openDelay=1500] - Duration before the tooltip is shown, in milliseconds.
356
+ * @property {number} [props.closeDelay=500] - Duration before the tooltip is hidden, in milliseconds.
357
+ * @property {boolean} [props.shouldFlip=true] - If `false`, the tooltip will not flip to the opposite side if there is not enough space.
358
+ * @property {boolean} [props.defaultOpen] - (**Uncontrolled mode**) Whether the tooltip is initially open.
359
+ * @property {boolean} [props.open] - (**Controlled mode**) Whether the tooltip is open.
360
+ * @property {Function} [props.onOpenChange] - (**Controlled mode**) Function to run when the tooltip is opened or closed.
361
+ * @property {TooltipPlacement} [props.placement] - The side of the trigger element where the tooltip will be displayed.
362
+ * @property {string} [props.className] - Classes to pass to the tooltip.
363
+ * @property {RefObject<Element>} [props.triggerRef] - Ref to anchor the tooltip to. If not provided, the tooltip will be anchored to the trigger element.
364
+ * @property {boolean} [props.arrow] - If `true`, an arrow is shown on the tooltip.
365
+ *
366
+ * @typedef {'light' | 'dark'} TooltipTheme
367
+ * @typedef {'bottom' | 'bottom left' | 'bottom right' | 'bottom start' | 'bottom end' | 'top' | 'top left' | 'top right' | 'top start' | 'top end' | 'left' | 'left top' | 'left bottom' | 'start' | 'start top' | 'start bottom' | 'right' | 'right top' | 'right bottom' | 'end' | 'end top' | 'end bottom'} TooltipPlacement
368
+ *
369
+ * @preserve
370
+ */
348
371
  /**
349
372
  * A simple tooltip component.
350
373
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eightshift/ui-components",
3
- "version": "5.3.0",
3
+ "version": "5.3.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -35,7 +35,7 @@
35
35
  "dev": "vite",
36
36
  "start": "vite",
37
37
  "build": "vite build",
38
- "lint": "npx eslint",
38
+ "lint": "bun x eslint",
39
39
  "preview": "vite preview"
40
40
  },
41
41
  "peerDependencies": {