@seed-design/react 0.1.11 → 0.1.12
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.
|
@@ -11,8 +11,10 @@ const React = require('react');
|
|
|
11
11
|
const createSlotRecipeContext = require('../../utils/createSlotRecipeContext.cjs');
|
|
12
12
|
const createWithStateProps = require('../../utils/createWithStateProps.cjs');
|
|
13
13
|
const styled = require('../../utils/styled.cjs');
|
|
14
|
+
const reactComposeRefs = require('@radix-ui/react-compose-refs');
|
|
15
|
+
const clsx = require('clsx');
|
|
14
16
|
|
|
15
|
-
const { withRootProvider, withContext } = createSlotRecipeContext.createSlotRecipeContext(helpBubble.helpBubble);
|
|
17
|
+
const { withRootProvider, withContext, useClassNames } = createSlotRecipeContext.createSlotRecipeContext(helpBubble.helpBubble);
|
|
16
18
|
const withStateProps = createWithStateProps.createWithStateProps([reactPopover.usePopoverContext]);
|
|
17
19
|
const HelpBubbleRoot = withRootProvider(reactPopover.Popover.Root, {
|
|
18
20
|
defaultProps: {
|
|
@@ -45,11 +47,13 @@ const HelpBubbleArrowTip = React.forwardRef(
|
|
|
45
47
|
const {
|
|
46
48
|
tipRadius = 2,
|
|
47
49
|
// TODO: get value from rootage spec
|
|
50
|
+
className,
|
|
48
51
|
...otherProps
|
|
49
52
|
} = props;
|
|
50
53
|
const api = reactPopover.usePopoverContext();
|
|
51
|
-
const
|
|
52
|
-
const
|
|
54
|
+
const classNames = useClassNames();
|
|
55
|
+
const width = api.rects.arrowTip?.width || 0;
|
|
56
|
+
const height = api.rects.arrowTip?.height || 0;
|
|
53
57
|
const pathData = `M0,0
|
|
54
58
|
H${width}
|
|
55
59
|
L${width / 2 + tipRadius},${height - tipRadius}
|
|
@@ -59,10 +63,9 @@ const HelpBubbleArrowTip = React.forwardRef(
|
|
|
59
63
|
"svg",
|
|
60
64
|
{
|
|
61
65
|
"aria-hidden": "true",
|
|
62
|
-
width
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
ref,
|
|
66
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
67
|
+
ref: reactComposeRefs.composeRefs(api.refs.arrowTip, ref),
|
|
68
|
+
className: clsx(classNames.arrowTip, className),
|
|
66
69
|
...otherProps,
|
|
67
70
|
children: /* @__PURE__ */ jsxRuntime.jsx("path", { stroke: "none", d: pathData })
|
|
68
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HelpBubble.d.ts","sourceRoot":"","sources":["../../../src/components/HelpBubble/HelpBubble.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAqB,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAc,KAAK,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAI/F,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"HelpBubble.d.ts","sourceRoot":"","sources":["../../../src/components/HelpBubble/HelpBubble.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAqB,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAc,KAAK,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAI/F,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AASrE,MAAM,WAAW,mBAAoB,SAAQ,sBAAsB,EAAE,gBAAgB,CAAC,SAAS;CAAG;AAElG,eAAO,MAAM,cAAc,gEAUzB,CAAC;AAIH,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB,CAAC,WAAW;CAAG;AAE9E,eAAO,MAAM,gBAAgB,yHAA0B,CAAC;AAIxD,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB,CAAC,YAAY;CAAG;AAEhF,eAAO,MAAM,iBAAiB,6HAA2B,CAAC;AAI1D,MAAM,WAAW,yBAA0B,SAAQ,gBAAgB,CAAC,eAAe;CAAG;AAEtF,eAAO,MAAM,oBAAoB,sHAGhC,CAAC;AAIF,MAAM,WAAW,sBACf,SAAQ,cAAc,EACpB,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,EAC5B,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAE3C,eAAO,MAAM,iBAAiB,mHAG7B,CAAC;AAIF,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB,CAAC,UAAU;CAAG;AAE5E,eAAO,MAAM,eAAe,iHAG3B,CAAC;AAIF,MAAM,WAAW,uBAAwB,SAAQ,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC;IAC5E;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,kBAAkB,gIAiC9B,CAAC;AAIF,MAAM,WAAW,0BAA2B,SAAQ,gBAAgB,CAAC,gBAAgB;CAAG;AAExF,eAAO,MAAM,qBAAqB,0HAGjC,CAAC;AAIF,MAAM,WAAW,oBACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;CAAG;AAE5C,eAAO,MAAM,eAAe,kHAG3B,CAAC;AAIF,MAAM,WAAW,0BACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAE3C,eAAO,MAAM,qBAAqB,uHAGjC,CAAC"}
|
|
@@ -7,8 +7,10 @@ import { forwardRef } from 'react';
|
|
|
7
7
|
import { createSlotRecipeContext } from '../../utils/createSlotRecipeContext.js';
|
|
8
8
|
import { createWithStateProps } from '../../utils/createWithStateProps.js';
|
|
9
9
|
import { withStyleProps } from '../../utils/styled.js';
|
|
10
|
+
import { composeRefs } from '@radix-ui/react-compose-refs';
|
|
11
|
+
import clsx from 'clsx';
|
|
10
12
|
|
|
11
|
-
const { withRootProvider, withContext } = createSlotRecipeContext(helpBubble);
|
|
13
|
+
const { withRootProvider, withContext, useClassNames } = createSlotRecipeContext(helpBubble);
|
|
12
14
|
const withStateProps = createWithStateProps([usePopoverContext]);
|
|
13
15
|
const HelpBubbleRoot = withRootProvider(Popover.Root, {
|
|
14
16
|
defaultProps: {
|
|
@@ -41,11 +43,13 @@ const HelpBubbleArrowTip = forwardRef(
|
|
|
41
43
|
const {
|
|
42
44
|
tipRadius = 2,
|
|
43
45
|
// TODO: get value from rootage spec
|
|
46
|
+
className,
|
|
44
47
|
...otherProps
|
|
45
48
|
} = props;
|
|
46
49
|
const api = usePopoverContext();
|
|
47
|
-
const
|
|
48
|
-
const
|
|
50
|
+
const classNames = useClassNames();
|
|
51
|
+
const width = api.rects.arrowTip?.width || 0;
|
|
52
|
+
const height = api.rects.arrowTip?.height || 0;
|
|
49
53
|
const pathData = `M0,0
|
|
50
54
|
H${width}
|
|
51
55
|
L${width / 2 + tipRadius},${height - tipRadius}
|
|
@@ -55,10 +59,9 @@ const HelpBubbleArrowTip = forwardRef(
|
|
|
55
59
|
"svg",
|
|
56
60
|
{
|
|
57
61
|
"aria-hidden": "true",
|
|
58
|
-
width
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
ref,
|
|
62
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
63
|
+
ref: composeRefs(api.refs.arrowTip, ref),
|
|
64
|
+
className: clsx(classNames.arrowTip, className),
|
|
62
65
|
...otherProps,
|
|
63
66
|
children: /* @__PURE__ */ jsx("path", { stroke: "none", d: pathData })
|
|
64
67
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seed-design/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/daangn/seed-design.git",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@seed-design/react-avatar": "0.0.4",
|
|
44
44
|
"@seed-design/react-checkbox": "0.0.4",
|
|
45
45
|
"@seed-design/react-dialog": "0.0.5",
|
|
46
|
-
"@seed-design/react-popover": "0.0.
|
|
46
|
+
"@seed-design/react-popover": "0.0.8",
|
|
47
47
|
"@seed-design/react-portal": "0.0.2",
|
|
48
48
|
"@seed-design/react-primitive": "0.0.3",
|
|
49
49
|
"@seed-design/react-progress": "0.0.4",
|
|
@@ -58,12 +58,12 @@
|
|
|
58
58
|
"clsx": "^2.1.1"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@seed-design/css": "0.1.
|
|
61
|
+
"@seed-design/css": "0.1.12",
|
|
62
62
|
"react": ">=18.0.0",
|
|
63
63
|
"react-dom": ">=18.0.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@seed-design/css": "0.1.
|
|
66
|
+
"@seed-design/css": "0.1.12",
|
|
67
67
|
"@vitejs/plugin-react": "^4.4.1",
|
|
68
68
|
"ajv": "^8.17.1",
|
|
69
69
|
"globby": "^14.1.0",
|
|
@@ -5,8 +5,10 @@ import { forwardRef } from "react";
|
|
|
5
5
|
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
6
6
|
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
7
7
|
import { withStyleProps, type StyleProps } from "../../utils/styled";
|
|
8
|
+
import { composeRefs } from "@radix-ui/react-compose-refs";
|
|
9
|
+
import clsx from "clsx";
|
|
8
10
|
|
|
9
|
-
const { withRootProvider, withContext } = createSlotRecipeContext(helpBubble);
|
|
11
|
+
const { withRootProvider, withContext, useClassNames } = createSlotRecipeContext(helpBubble);
|
|
10
12
|
const withStateProps = createWithStateProps([usePopoverContext]);
|
|
11
13
|
|
|
12
14
|
////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -81,11 +83,16 @@ export const HelpBubbleArrowTip = forwardRef<SVGSVGElement, HelpBubbleArrowTipPr
|
|
|
81
83
|
(props, ref) => {
|
|
82
84
|
const {
|
|
83
85
|
tipRadius = 2, // TODO: get value from rootage spec
|
|
86
|
+
className,
|
|
84
87
|
...otherProps
|
|
85
88
|
} = props;
|
|
86
89
|
const api = usePopoverContext();
|
|
87
|
-
|
|
88
|
-
const
|
|
90
|
+
|
|
91
|
+
const classNames = useClassNames();
|
|
92
|
+
|
|
93
|
+
const width = api.rects.arrowTip?.width || 0;
|
|
94
|
+
const height = api.rects.arrowTip?.height || 0;
|
|
95
|
+
|
|
89
96
|
const pathData = `M0,0
|
|
90
97
|
H${width}
|
|
91
98
|
L${width / 2 + tipRadius},${height - tipRadius}
|
|
@@ -96,10 +103,9 @@ export const HelpBubbleArrowTip = forwardRef<SVGSVGElement, HelpBubbleArrowTipPr
|
|
|
96
103
|
return (
|
|
97
104
|
<svg
|
|
98
105
|
aria-hidden="true"
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
ref={ref}
|
|
106
|
+
viewBox={`0 0 ${width} ${height}`}
|
|
107
|
+
ref={composeRefs(api.refs.arrowTip, ref)}
|
|
108
|
+
className={clsx(classNames.arrowTip, className)}
|
|
103
109
|
{...otherProps}
|
|
104
110
|
>
|
|
105
111
|
<path stroke="none" d={pathData} />
|