@caseparts-org/caseblocks 0.0.86 → 0.0.88

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.
@@ -2,7 +2,7 @@ import { StoryObj } from '@storybook/react-vite';
2
2
  import { Tooltip } from './Tooltip';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: import('react').FC<import('./Tooltip').TooltipProps>;
5
+ component: typeof Tooltip;
6
6
  parameters: {
7
7
  layout: string;
8
8
  controls: {
@@ -16,8 +16,8 @@ declare const meta: {
16
16
  };
17
17
  tags: string[];
18
18
  args: {
19
- on: "hover";
20
- position: "top center";
19
+ on: "mouseenter focus";
20
+ placement: "top";
21
21
  mouseEnterDelay: number;
22
22
  mouseLeaveDelay: number;
23
23
  arrow: true;
@@ -28,7 +28,7 @@ declare const meta: {
28
28
  options: string[];
29
29
  description: string;
30
30
  };
31
- position: {
31
+ placement: {
32
32
  control: "select";
33
33
  options: string[];
34
34
  description: string;
@@ -41,22 +41,14 @@ declare const meta: {
41
41
  control: "number";
42
42
  description: string;
43
43
  };
44
- arrow: {
45
- control: "boolean";
46
- description: string;
47
- };
48
- open: {
49
- control: "boolean";
50
- description: string;
44
+ delay: {
45
+ control: false;
51
46
  table: {
52
47
  category: string;
53
48
  };
54
- };
55
- closeOnDocumentClick: {
56
- control: "boolean";
57
49
  description: string;
58
50
  };
59
- closeOnEscape: {
51
+ arrow: {
60
52
  control: "boolean";
61
53
  description: string;
62
54
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { Tooltip as t } from "./Tooltip.js";
3
3
  import { Button as o } from "../../atoms/Button/Button.js";
4
- const l = {
4
+ const s = {
5
5
  title: "Case Parts/Molecules/Tooltip",
6
6
  component: t,
7
7
  parameters: {
@@ -9,14 +9,14 @@ const l = {
9
9
  controls: { sort: "requiredFirst" },
10
10
  docs: {
11
11
  description: {
12
- component: "Wrapper around reactjs-popup providing consistent styling. Use `interactive` for focusable content. `on` can be a string or an array of trigger events."
12
+ component: "Wrapper around @tippyjs/react. Use mouseEnterDelay/mouseLeaveDelay or pass `delay` directly. `on` maps to Tippy trigger."
13
13
  }
14
14
  }
15
15
  },
16
16
  tags: ["autodocs"],
17
17
  args: {
18
- on: "hover",
19
- position: "top center",
18
+ on: "mouseenter focus",
19
+ placement: "top",
20
20
  mouseEnterDelay: 100,
21
21
  mouseLeaveDelay: 80,
22
22
  arrow: !0
@@ -24,52 +24,43 @@ const l = {
24
24
  argTypes: {
25
25
  on: {
26
26
  control: "select",
27
- options: ["hover", "click", "focus", "right-click"],
28
- description: "Event(s) that trigger the tooltip. Accepts a single string or an array."
27
+ options: ["mouseenter focus", "click"],
28
+ description: "Trigger events passed to Tippy `trigger`."
29
29
  },
30
- position: {
30
+ placement: {
31
31
  control: "select",
32
32
  options: [
33
- "top left",
34
- "top center",
35
- "top right",
36
- "right top",
37
- "right center",
38
- "right bottom",
39
- "bottom left",
40
- "bottom center",
41
- "bottom right",
42
- "left top",
43
- "left center",
44
- "left bottom",
45
- "center center"
33
+ "top",
34
+ "top-start",
35
+ "top-end",
36
+ "right",
37
+ "right-start",
38
+ "right-end",
39
+ "bottom",
40
+ "bottom-start",
41
+ "bottom-end",
42
+ "left",
43
+ "left-start",
44
+ "left-end"
46
45
  ],
47
- description: "Popup position passed to reactjs-popup."
46
+ description: "Popper placement used by Tippy."
48
47
  },
49
48
  mouseEnterDelay: {
50
49
  control: "number",
51
- description: "Delay (ms) before opening on hover."
50
+ description: "Show delay (ms) mapped to delay[0]."
52
51
  },
53
52
  mouseLeaveDelay: {
54
53
  control: "number",
55
- description: "Delay (ms) before closing after mouse leaves."
54
+ description: "Hide delay (ms) mapped to delay[1]."
56
55
  },
57
- arrow: {
58
- control: "boolean",
59
- description: "Show popup arrow."
60
- },
61
- open: {
62
- control: "boolean",
63
- description: "Controlled open state (overrides triggers). Leave undefined for uncontrolled.",
64
- table: { category: "Advanced" }
56
+ delay: {
57
+ control: !1,
58
+ table: { category: "Advanced" },
59
+ description: "Override both delays (number or [show, hide])."
65
60
  },
66
- closeOnDocumentClick: {
67
- control: "boolean",
68
- description: "Close when clicking outside (uncontrolled modes)."
69
- },
70
- closeOnEscape: {
61
+ arrow: {
71
62
  control: "boolean",
72
- description: "Close on Escape key."
63
+ description: "Show tooltip arrow."
73
64
  },
74
65
  contentClassName: { table: { disable: !0 } },
75
66
  tooltipClassName: { table: { disable: !0 } },
@@ -81,9 +72,9 @@ const l = {
81
72
  description: "Tooltip content."
82
73
  }
83
74
  }
84
- }, c = {
75
+ }, a = {
85
76
  args: {
86
- position: "top center",
77
+ placement: "top",
87
78
  mouseEnterDelay: 0,
88
79
  mouseLeaveDelay: 0
89
80
  },
@@ -103,13 +94,12 @@ const l = {
103
94
  {
104
95
  ...r,
105
96
  trigger: /* @__PURE__ */ e("div", { className: "tooltip-story", children: /* @__PURE__ */ e(o, { size: "md", variant: "primary", children: "Hover me" }) }),
106
- on: "hover",
107
- children: "This tooltip appears on hover (top center)."
97
+ children: "This tooltip appears on hover (top)."
108
98
  }
109
99
  )
110
100
  }
111
101
  )
112
- }, a = {
102
+ }, c = {
113
103
  render: () => /* @__PURE__ */ e(
114
104
  "div",
115
105
  {
@@ -126,13 +116,15 @@ const l = {
126
116
  {
127
117
  trigger: /* @__PURE__ */ e("div", { className: "tooltip-story", children: /* @__PURE__ */ e(o, { size: "md", variant: "secondary", children: "Click me" }) }),
128
118
  on: "click",
129
- position: "bottom center",
130
- children: "This tooltip appears on click (bottom center)."
119
+ placement: "bottom",
120
+ mouseEnterDelay: 0,
121
+ mouseLeaveDelay: 0,
122
+ children: "This tooltip appears on click (bottom)."
131
123
  }
132
124
  )
133
125
  }
134
126
  )
135
- }, p = {
127
+ }, d = {
136
128
  render: () => /* @__PURE__ */ e(
137
129
  "div",
138
130
  {
@@ -148,14 +140,13 @@ const l = {
148
140
  t,
149
141
  {
150
142
  trigger: /* @__PURE__ */ e("div", { className: "tooltip-story", children: /* @__PURE__ */ e(o, { size: "md", variant: "cta-primary", children: "Hover right" }) }),
151
- on: "hover",
152
- position: "right center",
143
+ placement: "right",
153
144
  children: "Tooltip on the right."
154
145
  }
155
146
  )
156
147
  }
157
148
  )
158
- }, d = {
149
+ }, p = {
159
150
  render: () => /* @__PURE__ */ e(
160
151
  "div",
161
152
  {
@@ -171,14 +162,13 @@ const l = {
171
162
  t,
172
163
  {
173
164
  trigger: /* @__PURE__ */ e("div", { className: "tooltip-story", children: /* @__PURE__ */ e(o, { size: "md", variant: "tertiary", children: "Hover left" }) }),
174
- on: "hover",
175
- position: "left center",
165
+ placement: "left",
176
166
  children: "Tooltip on the left."
177
167
  }
178
168
  )
179
169
  }
180
170
  )
181
- }, h = {
171
+ }, m = {
182
172
  render: () => /* @__PURE__ */ e(
183
173
  "div",
184
174
  {
@@ -195,8 +185,7 @@ const l = {
195
185
  t,
196
186
  {
197
187
  trigger: /* @__PURE__ */ e("div", { className: "tooltip-story", children: /* @__PURE__ */ e(o, { size: "md", variant: "cta-primary", children: "Hover right" }) }),
198
- on: "hover",
199
- position: "right center",
188
+ placement: "right",
200
189
  children: "Tooltip on the right."
201
190
  }
202
191
  )
@@ -204,10 +193,10 @@ const l = {
204
193
  )
205
194
  };
206
195
  export {
207
- h as AbsolutelyPositioned,
208
- a as OnClick,
209
- c as OnHover,
210
- d as PositionLeft,
211
- p as PositionRight,
212
- l as default
196
+ m as AbsolutelyPositioned,
197
+ c as OnClick,
198
+ a as OnHover,
199
+ p as PositionLeft,
200
+ d as PositionRight,
201
+ s as default
213
202
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@caseparts-org/caseblocks",
3
3
  "private": false,
4
- "version": "0.0.86",
4
+ "version": "0.0.88",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",
@@ -34,15 +34,16 @@
34
34
  "dependencies": {
35
35
  "@fontsource-variable/roboto-condensed": "^5.1.1",
36
36
  "@fontsource/roboto": "^5.1.0",
37
+ "@tippyjs/react": "^4.2.6",
37
38
  "clsx": "^2.1.1",
38
39
  "csstype": "^3.1.3",
39
40
  "reactjs-popup": "^2.0.6"
40
41
  },
41
42
  "peerDependencies": {
42
- "react": ">=18.3.1 <20.0.0",
43
- "react-dom": ">=18.3.1 <20.0.0",
44
43
  "embla-carousel-autoplay": "^8.0.0",
45
- "embla-carousel-react": "^8.0.0"
44
+ "embla-carousel-react": "^8.0.0",
45
+ "react": ">=18.3.1 <20.0.0",
46
+ "react-dom": ">=18.3.1 <20.0.0"
46
47
  },
47
48
  "devDependencies": {
48
49
  "@chromatic-com/storybook": "^4.0.1",